Jelajahi Sumber

开学报到调整

dzx 9 bulan lalu
induk
melakukan
ee47105e30

+ 4 - 1
src/main/java/com/xjrsoft/module/job/StudentReportPlanTask.java

@@ -5,6 +5,7 @@ import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
+import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
 import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import lombok.extern.slf4j.Slf4j;
@@ -40,7 +41,9 @@ public class StudentReportPlanTask {
         List<StudentReportPlan> list = planService.getWillBeginData();
 
         for (StudentReportPlan studentReportPlan : list) {
-            planService.release(planService.getByIdDeep(studentReportPlan.getId()));
+            List<StudentReportPlanClassRelation> classRelationList = planService.getStudentReportPlanClassRelationList(studentReportPlan.getId());
+            studentReportPlan.setStudentReportPlanClassRelationList(classRelationList);
+            planService.release(studentReportPlan);
         }
 
         //查询已发布已结束的,自动结束

+ 3 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentReportPlanService.java

@@ -5,6 +5,7 @@ import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.student.dto.StudentReportPlanPageDto;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
+import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
 import com.xjrsoft.module.student.vo.StudentReportPlanPageVo;
 
 import java.util.List;
@@ -51,4 +52,6 @@ public interface IStudentReportPlanService extends MPJBaseService<StudentReportP
 
 
     List<StudentReportPlan> getWillBeginData();
+
+    List<StudentReportPlanClassRelation> getStudentReportPlanClassRelationList(Long id);
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java

@@ -228,4 +228,12 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
     public List<StudentReportPlan> getWillBeginData() {
         return baseMapper.getWillBeginData();
     }
+
+    @Override
+    public List<StudentReportPlanClassRelation> getStudentReportPlanClassRelationList(Long id) {
+        return relationMapper.selectList(
+                new QueryWrapper<StudentReportPlanClassRelation>().lambda()
+                        .eq(StudentReportPlanClassRelation::getStudentReportPlanId, id)
+        );
+    }
 }

+ 3 - 3
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -19,6 +19,7 @@ import com.xjrsoft.module.student.entity.BaseStudent;
 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.StudentReportPlanMapper;
 import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
 import com.xjrsoft.module.student.service.IBaseStudentService;
@@ -34,7 +35,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDate;
-import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.List;
 
@@ -52,7 +52,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     private final IUserService userService;
     private final IBaseStudentSchoolRollService rollService;
     private final IStudentChangeRecordService changeRecordService;
-    private final IStudentReportPlanService planService;
+    private final StudentReportPlanMapper planMapper;
     @Override
     public StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto) {
         return this.baseMapper.getClassStatistics(dto);
@@ -162,7 +162,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     public Boolean updateStduyStatus(StudentReportSignDto dto) {
         LocalDate now = LocalDate.now();
         StudentReportRecord record = this.getById(dto.getId());
-        StudentReportPlan reportPlan = planService.getById(record.getStudentReportPlanId());
+        StudentReportPlan reportPlan = planMapper.selectById(record.getStudentReportPlanId());
         if(!(now.isAfter(reportPlan.getUpdateStartTime()) && now.isBefore(reportPlan.getUpdateEndTime())) || !now.equals(reportPlan.getUpdateStartTime()) || !now.equals(reportPlan.getUpdateEndTime())){
             throw new MyException("不在修改时间内,无法修改");
         }