Browse Source

bug修复

dzx 4 months ago
parent
commit
7740ffae5d

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

@@ -148,6 +148,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         );
         //2、查询所有班级信息
         List<BandingTaskClass> classList = taskClassMapper.getListOrderByAsc(bandingTask.getId());
+        if(!classList.isEmpty()){
+            //清除数据
+            List<Long> classIds = classList.stream().map(BandingTaskClass::getId).collect(Collectors.toList());
+            classStudentService.remove(
+                    new QueryWrapper<BandingTaskClassStudent>().lambda()
+                            .in(BandingTaskClassStudent::getBandingTaskClassId, classIds)
+            );
+        }
+
 
         //3、查询所用到的规则
         List<BandingRule> ruleList = ruleMapper.selectJoinList(BandingRule.class,
@@ -415,7 +424,6 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         //形成学生数据
         createStudentData(dto.getId(), classStudents, updateList);
 
-
         BandingTask bandingTask = this.getById(dto.getId());
         bandingTask.setStatus(1);
         bandingTask.setModifyDate(new Date());