| | |
| | | import com.gkhy.system.mapper.ProjectExpertMapper; |
| | | import com.gkhy.system.mapper.ProjectFileMapper; |
| | | import com.gkhy.system.mapper.ProjectManagementMapper; |
| | | import com.gkhy.system.service.IProjectFileService; |
| | | import com.gkhy.system.service.IProjectManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private ProjectExpertDetailMapper projectExpertDetailMapper; |
| | | |
| | | @Autowired |
| | | private IProjectFileService projectFileService; |
| | | |
| | | /** |
| | | * 查询项目管理 |
| | |
| | | throw new ServiceException("固定专家不能为空!"); |
| | | } |
| | | |
| | | if (projectManagement1.getStep() == 1 || projectManagement1.getStep() == 2){ |
| | | if ((projectManagement1.getStep() == 1 || projectManagement1.getStep() == 2) && (projectManagement.getStep() == 2 ) ){ |
| | | projectManagementSave.setStep(2L); |
| | | projectManagementSave.setState(1L); |
| | | }else if (projectManagement1.getStep() == 3){ |
| | | projectManagementSave.setStep(3L); |
| | | }else if (projectManagement1.getStep() == 2 && projectManagement.getStep() == 3){ |
| | | projectManagementSave.setStep(2L); |
| | | projectManagementSave.setState(2L); |
| | | projectManagementSave.setProjectCheckTime(new Date()); |
| | | List<ProjectExpertSaveReqDto> collect = saveData.stream() |
| | |
| | | throw new ServiceException("保存专家失败!"); |
| | | } |
| | | } |
| | | |
| | | int i = projectManagementMapper.updateProjectManagement(projectManagementSave); |
| | | if (i < 1){ |
| | | throw new ServiceException("保存专家失败!"); |
| | |
| | | if (req.getState() != 3L && req.getState() != 1 ){ |
| | | throw new ServiceException("参数异常!"); |
| | | } |
| | | if (projectManagement.getStep() != 3){ |
| | | throw new ServiceException("非审批步骤!"); |
| | | } |
| | | Long state = projectManagement.getState(); |
| | | if (req.getState() == 3 && state != 2){ |
| | | if (state != 2){ |
| | | throw new ServiceException("未生成审批单不可审批通过操作!"); |
| | | }else if (req.getState() == 1 && state != 2){ |
| | | throw new ServiceException("不可操作!"); |
| | | } |
| | | |
| | | List<ProjectFile> projectFile = req.getProjectFile(); |
| | |
| | | projectManagementUp.setState(req.getState()); |
| | | projectManagementUp.setUpdateBy(SecurityUtils.getUsername()); |
| | | if (req.getState() == 3){ |
| | | projectManagementUp.setStep(4L); |
| | | projectManagementUp.setStep(3L); |
| | | }else if (req.getState() == 1){ |
| | | projectManagementUp.setStep(2L); |
| | | } |
| | |
| | | file.setCreateBy(username); |
| | | file.setProjectId(req.getId()); |
| | | }); |
| | | int i1 = projectFileMapper.insertProjectFiles(projectFile); |
| | | if (i1 < 1){ |
| | | //int i1 = projectFileMapper.insertProjectFiles(projectFile); |
| | | Boolean b = projectFileService.saveBatchProjectFile(projectFile); |
| | | if (!b){ |
| | | throw new ServiceException("保存附件失败!"); |
| | | } |
| | | } |
| | |
| | | ProjectManagement projectManagementUp = new ProjectManagement(); |
| | | projectManagementUp.setId(req.getId()); |
| | | projectManagementUp.setState(4L); |
| | | projectManagementUp.setStep(4L); |
| | | projectManagementUp.setDesc(req.getDesc()); |
| | | projectManagementUp.setProjectEndTime(req.getProjectEndTime()); |
| | | projectManagementUp.setUpdateBy(SecurityUtils.getUsername()); |
| | |
| | | file.setCreateBy(username); |
| | | file.setProjectId(req.getId()); |
| | | }); |
| | | int i1 = projectFileMapper.insertProjectFiles(projectFile); |
| | | if (i1 < 1){ |
| | | // int i1 = projectFileMapper.insertProjectFiles(projectFile); |
| | | // if (i1 < 1){ |
| | | // throw new ServiceException("保存附件失败!"); |
| | | // } |
| | | Boolean b = projectFileService.saveBatchProjectFile(projectFile); |
| | | if (!b){ |
| | | throw new ServiceException("保存附件失败!"); |
| | | } |
| | | } |