| | |
| | | return projectManagementMapper.selectProjectData(projectManagement); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void projectBackEvaluation(Long id) { |
| | | if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | throw new ServiceException("非管理员无权操作!"); |
| | | } |
| | | ProjectManagement projectManagement = projectManagementMapper.selectProjectManagementById(id); |
| | | if (null == projectManagement){ |
| | | throw new ServiceException("项目不存在"); |
| | | } |
| | | if (projectManagement.getState() != 4) { |
| | | throw new ServiceException("项目未完成,无权操作!"); |
| | | } |
| | | if (projectManagement.getEvaluationState() != 1){ |
| | | throw new ServiceException("未完成评审不可退回!"); |
| | | } |
| | | LambdaUpdateWrapper<ProjectManagement> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(ProjectManagement::getId, id) |
| | | .set(ProjectManagement::getEvaluationState, 0).set(ProjectManagement::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(ProjectManagement::getUpdateTime, new Date()); |
| | | int update = projectManagementMapper.update(null, updateWrapper); |
| | | if (update > 0){ |
| | | LambdaUpdateWrapper<OutProjectExpert> updateWrapper1 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper1.eq(OutProjectExpert::getProjectId, id) |
| | | .set(OutProjectExpert::getEvaluationState, 0).set(OutProjectExpert::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(OutProjectExpert::getUpdateTime, new Date()); |
| | | outProjectExpertMapper.update(null, updateWrapper1); |
| | | LambdaUpdateWrapper<ProjectExpert> updateWrapper2 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper2.eq(ProjectExpert::getProjectId, id).set(ProjectExpert::getEvaluationState, 0) |
| | | .set(ProjectExpert::getUpdateBy, SecurityUtils.getUsername()) |
| | | .set(ProjectExpert::getUpdateTime, new Date()); |
| | | projectExpertMapper.update(null, updateWrapper2); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | private List<ProjectExpertDetail> dealData(List<ProjectExpertScoreSaveReq.Score> data, Long projectExpertId) { |
| | | List<ProjectExpertDetail> dealData = new ArrayList<>(); |
| | | data.forEach(dto -> { |