Browse Source

1.6一点修改

Crazy 2 weeks ago
parent
commit
dbfc70aa5a

+ 13 - 5
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/studentSelectSupervisorRecord/StudentSelectSupervisorRecordController.java

@@ -61,7 +61,8 @@ public class StudentSelectSupervisorRecordController {
     @Resource
     private studentSelectionProjectService studentSelectionProjectService;
 
-    @Scheduled(cron = "0 00 00 * * ?") // 每天0:00检测
+//    @Scheduled(cron = "0 00 00 * * ?") // 每天0:00检测
+    @Scheduled(cron = "0 0 * * * ?") // 每1小时执行
     @Idempotent(timeout = 10)
     public void checkIsSelection() {
         LocalDateTime nowTime =LocalDateTime.now();
@@ -71,7 +72,7 @@ public class StudentSelectSupervisorRecordController {
             checkSelection();
         }
     }
-    //在项目结束的时候
+    //在项目结束的时候生成编辑记录,学院直接设置
     @GetMapping("/ceshi")
     @Operation(summary = "测试生成编辑记录")
     public void checkSelection() {
@@ -137,7 +138,7 @@ public class StudentSelectSupervisorRecordController {
 
             createReqVO.setStudentId(loginId);
             createReqVO.setSelectType(1);//待处理
-            if (!createReqVO.getStudentSignature().isEmpty()) {
+            if (createReqVO.getStudentSignature()!=null&&!createReqVO.getStudentSignature().isEmpty()) {
                 createReqVO.setStudentSignDate(dateTime.toLocalDate());//学生签名日期
             }
             studentSelectSupervisorRecordService.createStudentSelectSupervisorRecord(createReqVO);
@@ -195,8 +196,13 @@ public class StudentSelectSupervisorRecordController {
         }else if (record.getSelectType()==2){//同意了的
             //初始化记录里面的签名
             updateReqVO.setStudentSignature("");//学生签名
-            updateReqVO.setSupervisorApproveTime(LocalDateTime.now());//TODO 这个审批时间
+            updateReqVO.setStudentSignDate(null);//TODO 这个审批时间
             updateReqVO.setSupervisorSignature("");
+            updateReqVO.setStudentSignDate(null);
+            updateReqVO.setSupervisorSignDate(null);
+        }else if (record.getSelectType()==1){
+            updateReqVO.setStudentSignature("");//学生签名
+            updateReqVO.setStudentSignDate(null);
         }
         adminUserService.updateUser(saveReqVO);
         studentSelectSupervisorRecordService.updateStudentSelectSupervisorRecord(updateReqVO);
@@ -287,7 +293,9 @@ public class StudentSelectSupervisorRecordController {
                 //提交导师签名
                 updateReqVO.setSelectType(2);
                 updateReqVO.setSupervisorApproveTime(dateTime);
-                updateReqVO.setSupervisorSignDate(dateTime.toLocalDate());//导师日期
+                if (updateReqVO.getStudentSignature()!=null&&!updateReqVO.getStudentSignature().isEmpty()) {
+                    updateReqVO.setSupervisorSignDate(dateTime.toLocalDate());//导师日期
+                }
                 studentSelectSupervisorRecordService.updateStudentSelectSupervisorRecord(updateReqVO);
 
                 UserSaveReqVO saveReqVO = new UserSaveReqVO();

+ 1 - 6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/supervisorSelectionSetting/supervisorSelectionSettingServiceImpl.java

@@ -43,8 +43,6 @@ public class supervisorSelectionSettingServiceImpl implements supervisorSelectio
     private studentSelectSupervisorRecordService studentSelectSupervisorRecordService;
     @Resource
     private PermissionService permissionService;
-    @Resource
-    private studentSelectionProjectService studentSelectionProjectService;
 
     @Override
     public Integer createSupervisorSelectionSetting(supervisorSelectionSettingSaveReqVO createReqVO) {
@@ -89,9 +87,6 @@ public class supervisorSelectionSettingServiceImpl implements supervisorSelectio
         AdminUserDO loginUser = adminUserService.getUser(loginId);
         Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(loginId);
         //获取项目名称
-        LocalDateTime dateTime =LocalDateTime.now();
-        studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(dateTime.getYear()), studentSelectionProjectSaveReqVO.class);
-
         PageResult<supervisorSelectionSettingDO> result =supervisorSelectionSettingMapper.selectPage(pageReqVO,roleIds,loginUser);
 
         result.getList().forEach(re->{
@@ -101,7 +96,7 @@ public class supervisorSelectionSettingServiceImpl implements supervisorSelectio
             re.setOccupiedAcademicSlots(occupiedAcademicSlots);
             re.setOccupiedProfessionalSlots(occupiedProfessionalSlots);
             if (roleIds.contains(112L)){
-                studentSelectSupervisorRecordDO record = studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(project.getId(),loginId, Long.valueOf(supervisorId),1);//待处理的
+                studentSelectSupervisorRecordDO record = studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(pageReqVO.getProjectId(),loginId, Long.valueOf(supervisorId),1);//待处理的
                 if (record!=null){
                     re.setSelectType(1);
                 }