|
@@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.system.service.studentSelectionProject.studentSel
|
|
|
import cn.iocoder.yudao.module.system.service.supervisorSelectionSetting.supervisorSelectionSettingService;
|
|
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|
|
import com.alibaba.druid.sql.visitor.functions.If;
|
|
|
+import com.baomidou.mybatisplus.generator.IFill;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
@@ -110,22 +111,33 @@ public class studentSelectSupervisorRecordController {
|
|
|
@PreAuthorize("@ss.hasPermission('system:student-select-supervisor-record:create')")
|
|
|
public CommonResult<String> createStudentSelectSupervisorRecord(@Valid @RequestBody studentSelectSupervisorRecordSaveReqVO createReqVO) {
|
|
|
Long loginId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ AdminUserDO loginUser =adminUserService.getUser(loginId);
|
|
|
+
|
|
|
+ Integer occupiedAcademicSlots =adminUserService.countStudentListBySupervisorId(Math.toIntExact(createReqVO.getSupervisorId()),1);//占用学硕
|
|
|
+ Integer occupiedProfessionalSlots =adminUserService.countStudentListBySupervisorId(Math.toIntExact(createReqVO.getSupervisorId()),2);//占用专硕
|
|
|
+ supervisorSelectionSettingDO supervisorSelectionSetting = supervisorSelectionSettingService.getSettingBySupervisorIdAndProjectId(createReqVO.getSupervisorId(),createReqVO.getProjectId());
|
|
|
+
|
|
|
+ if (loginUser.getMasterType()==1&&supervisorSelectionSetting.getAcademicSlots().equals(occupiedAcademicSlots)){
|
|
|
+ return error(1,"学硕名额已经满了");
|
|
|
+ }
|
|
|
+ if (loginUser.getMasterType()==2&&supervisorSelectionSetting.getProfessionalSlots().equals(occupiedProfessionalSlots)){
|
|
|
+ return error(1,"专硕名额已经满了");
|
|
|
+ }
|
|
|
+
|
|
|
studentSelectSupervisorRecordDO record1 =studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(loginId,null,2);//同意
|
|
|
studentSelectSupervisorRecordDO record2 =studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(loginId,null,1);//待处理
|
|
|
- studentSelectSupervisorRecordDO record3 =studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(loginId,null,0);//编辑
|
|
|
-
|
|
|
+ studentSelectSupervisorRecordDO record3 =studentSelectSupervisorRecordService.getRecordByStudentIdAndSupervisorId(loginId,null,0);//撤回
|
|
|
|
|
|
if (record1!=null){
|
|
|
return error(1,"请求已通过了");
|
|
|
}else if (record2!=null){
|
|
|
return error(1,"还有请求在待处理中");
|
|
|
}else if (record3!=null){
|
|
|
- return error(1,"还有请求处于编辑状态");
|
|
|
+ return error(1,"还有请求在编辑中");
|
|
|
}
|
|
|
+
|
|
|
createReqVO.setStudentId(loginId);
|
|
|
createReqVO.setSelectType(1);//待处理
|
|
|
- String StudentSignature =createReqVO.getStudentSignature();
|
|
|
- System.out.println("电子签名"+StudentSignature);
|
|
|
studentSelectSupervisorRecordService.createStudentSelectSupervisorRecord(createReqVO);
|
|
|
return success("请求提交成功");
|
|
|
}
|
|
@@ -170,8 +182,10 @@ public class studentSelectSupervisorRecordController {
|
|
|
public CommonResult<PageResult<studentSelectSupervisorRecordRespVO>> getStudentSelectSupervisorRecordPage(@Valid studentSelectSupervisorRecordPageReqVO pageReqVO) {
|
|
|
LocalDateTime dateTime = LocalDateTime.now();
|
|
|
studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(dateTime.getYear()), studentSelectionProjectSaveReqVO.class);
|
|
|
- if (project.getSupervisorConfirmDeadline().isBefore(dateTime)){
|
|
|
- return error(1,"该项目已过截至日期");
|
|
|
+ Long loginId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(loginId);
|
|
|
+ if ((roleIds.contains(112L) || roleIds.contains(113L)) && project.getSupervisorConfirmDeadline().isBefore(dateTime)) {
|
|
|
+ return error(1, "该项目已过截至日期");
|
|
|
}else {
|
|
|
PageResult<studentSelectSupervisorRecordDO> pageResult = studentSelectSupervisorRecordService.getStudentSelectSupervisorRecordPage(pageReqVO);
|
|
|
return success(BeanUtils.toBean(pageResult, studentSelectSupervisorRecordRespVO.class));
|
|
@@ -326,14 +340,19 @@ public class studentSelectSupervisorRecordController {
|
|
|
return success("填写成功");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@GetMapping("/getRecordList")
|
|
|
@Operation(summary = "获取选择记录列表")
|
|
|
@PreAuthorize("@ss.hasPermission('system:student-select-supervisor-record:getRecordList')")
|
|
|
public CommonResult<List<studentSelectSupervisorRecordRespVO>> getRecordSelectSupervisorRecordList(@Valid studentSelectSupervisorRecordPageReqVO listReqVO) {
|
|
|
-// LocalDate date =LocalDate.now();
|
|
|
-// studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(date.getYear()),studentSelectionProjectSaveReqVO.class);
|
|
|
-// listReqVO.setProjectId(project.getId());
|
|
|
- return success(BeanUtils.toBean(studentSelectSupervisorRecordService.getStudentSelectSupervisorRecordList(listReqVO),studentSelectSupervisorRecordRespVO.class));
|
|
|
+ LocalDateTime dateTime = LocalDateTime.now();
|
|
|
+ studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProjectByYear(dateTime.getYear()), studentSelectionProjectSaveReqVO.class);
|
|
|
+ Long loginId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(loginId);
|
|
|
+ if ((roleIds.contains(112L) || roleIds.contains(113L)) && project.getSupervisorConfirmDeadline().isBefore(dateTime)) {
|
|
|
+ return error(1, "该项目已过截至日期");
|
|
|
+ }else
|
|
|
+ return success(BeanUtils.toBean(studentSelectSupervisorRecordService.getStudentSelectSupervisorRecordList(listReqVO),studentSelectSupervisorRecordRespVO.class));
|
|
|
}
|
|
|
|
|
|
// @GetMapping("/getStudentRecordList")
|