dzx 4 hónapja
szülő
commit
7439b14ca4

+ 14 - 6
src/main/java/com/xjrsoft/module/banding/controller/BandingTaskClassController.java

@@ -132,10 +132,11 @@ public class BandingTaskClassController {
     }
 
     @PutMapping
-    @ApiOperation(value = "修改新生分班")
+    @ApiOperation(value = "批量新增或者修改新生分班")
     @SaCheckPermission("bandingTaskClass:edit")
     public RT<Boolean> update(@Valid @RequestBody List<UpdateBandingClassDto> dtoList){
-        List<BandingTaskClass> dataList = new ArrayList<>();
+        List<BandingTaskClass> insList = new ArrayList<>();
+        List<BandingTaskClass> updList = new ArrayList<>();
         List<String> errorList = new ArrayList<>();
         for (UpdateBandingClassDto dto : dtoList) {
             if(dto.getSortCode() != null){
@@ -143,7 +144,7 @@ public class BandingTaskClassController {
                         new QueryWrapper<BandingTaskClass>().lambda()
                                 .eq(BandingTaskClass::getSortCode, dto.getSortCode())
                                 .eq(BandingTaskClass::getBandingTaskId, dto.getBandingTaskId())
-                                .ne(BandingTaskClass::getId, dto.getId())
+                                .ne(dto.getId() != null,BandingTaskClass::getId, dto.getId())
                 );
                 if(!list.isEmpty()){
                     errorList.add(dto.getName());
@@ -151,13 +152,20 @@ public class BandingTaskClassController {
             }
 
             BandingTaskClass bandingTask = BeanUtil.toBean(dto, BandingTaskClass.class);
-            bandingTask.setModifyDate(new Date());
+            if(bandingTask.getId() != null){
+                bandingTask.setModifyDate(new Date());
+                updList.add(bandingTask);
+            }else{
+                bandingTask.setCreateDate(new Date());
+                insList.add(bandingTask);
+            }
+
         }
         if(!errorList.isEmpty()){
             return RT.error(errorList.toString().replace("[", "").replace("]", "") + ",分班排序重复");
         }
-
-        boolean isSuccess = bandingTaskClassService.updateBatchById(dataList);
+        boolean saveBatch = bandingTaskClassService.saveBatch(insList);
+        boolean isSuccess = bandingTaskClassService.updateBatchById(updList);
         return RT.ok(isSuccess);
     }
 

+ 1 - 1
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -469,7 +469,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 setClassroomId(taskClass.getClassroomId());
                 setTeacherId(taskClass.getTeacherId());
                 setIsGraduate(1);
-                setIsOrderClass(taskClass.getIsOrderClass().intValue());
+                setIsOrderClass(taskClass.getIsOrderClass()==null?0:taskClass.getIsOrderClass().intValue());
                 setGradeId(bandingTask.getGradeId());
                 setDeleteMark(DeleteMark.NODELETE.getCode());
                 setEnrollType(bandingTask.getEnrollType());

+ 10 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java

@@ -118,6 +118,16 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
                 errorList.add(objectMap);
                 continue;
             }
+            if(majorSetMap.get(objectMap.get(10).toString()) == null){
+                objectMap.put(15, "第一志愿未匹配,无法导入");
+                errorList.add(objectMap);
+                continue;
+            }
+            if(majorSetMap.get(objectMap.get(11).toString()) == null){
+                objectMap.put(15, "第二志愿未匹配,无法导入");
+                errorList.add(objectMap);
+                continue;
+            }
             if(student != null && student.getStatus() == 0){
                 student.setGraduateSchool(objectMap.get(0).toString());
                 student.setName(objectMap.get(1).toString());