浏览代码

分班调整

dzx 8 月之前
父节点
当前提交
ef09389035

+ 14 - 6
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -185,13 +185,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
             }
         }
 
-
+        List<Long> studentIds = dataList.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
+        List<BaseNewStudent> list = newStudentService.list(
+                new QueryWrapper<BaseNewStudent>().lambda()
+                        .in(BaseNewStudent::getId, studentIds)
+        );
         if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
-            List<Long> studentIds = dataList.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
-            List<BaseNewStudent> list = newStudentService.list(
-                    new QueryWrapper<BaseNewStudent>().lambda()
-                            .in(BaseNewStudent::getId, studentIds)
-            );
             List<BaseNewStudent> updateList = new ArrayList<>();
             for (BaseNewStudent student : list) {
                 student.setStatus(1);
@@ -362,6 +361,15 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                 List<UserRoleRelation> userRoleRelationList = roleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
                 redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
             });
+        }else{
+            List<BaseNewStudent> updateList = new ArrayList<>();
+            for (BaseNewStudent student : list) {
+                student.setRemarks(dto.getRemarks());
+                updateList.add(student);
+            }
+            if(!updateList.isEmpty()){
+                newStudentService.updateBatchById(updateList);
+            }
         }
         return true;
     }