فهرست منبع

修复手动分班时报到产生重复数据问题

dzx 7 ماه پیش
والد
کامیت
69dc4d848e

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

@@ -21,11 +21,9 @@ import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
-import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
-import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
 import com.xjrsoft.module.organization.entity.User;
@@ -39,7 +37,6 @@ import com.xjrsoft.module.student.entity.BaseStudentFamily;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
-import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
 import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
@@ -71,21 +68,18 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
     private final BandingTaskClassMapper taskClassMapper;
-    private final BandingTaskMapper bandingTaskMapper;
     private final IStudentReportPlanService reportPlanService;
     private final IBaseSemesterService semesterService;
     private final IBaseNewStudentService newStudentService;
     private final StudentReportRecordMapper reportRecordMapper;
 
     private final IBaseClassService classService;
-    private final BaseClassMajorSetMapper classMajorSetMapper;
     private final CommonPropertiesConfig propertiesConfig;
     private final IUserService userService;
     private final IUserRoleRelationService roleRelationService;
     private final IBaseStudentSchoolRollService schoolRollService;
     private final IBaseStudentService studentService;
     private final IBaseStudentFamilyService familyService;
-    private final BaseMajorSetMapper majorSetMapper;
     private final RedisUtil redisUtil;
 
     @Override
@@ -159,6 +153,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
 
             for (StudentReportPlan plan : planList) {
                 for (Long newStudentId : dto.getNewStudentIds()) {
+                    reportRecordMapper.deleteRecordByUserIdAndPlanId(newStudentId, plan.getId());
                     StudentReportRecord record = new StudentReportRecord();
                     record.setCreateDate(new Date());
                     record.setCreateUserId(StpUtil.getLoginIdAsLong());

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java

@@ -12,6 +12,7 @@ import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -41,4 +42,7 @@ public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRe
 
     List<StudentReportRecordPlanPageVo> getTryReadingList(@Param("dto") StudentTryReadingReportPageDto dto);
 
+    @Update("update student_report_record set delete_mark = 1 where user_id = #{userId} and student_report_plan_id = #{planId}")
+    Boolean deleteRecordByUserIdAndPlanId(@Param("userId") Long userId, @Param("planId") Long planId);
+
 }