| | |
| | | import com.ycl.common.constant.Constants; |
| | | import com.ycl.common.core.domain.BaseEntity; |
| | | import com.ycl.common.core.domain.entity.SysDictData; |
| | | import com.ycl.common.enums.YesOrNo; |
| | | import com.ycl.common.enums.business.FileTypeEnum; |
| | | import com.ycl.common.enums.business.ImportanceTypeEnum; |
| | | import com.ycl.common.enums.business.ProjectCategoryEnum; |
| | |
| | | query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime())); |
| | | } |
| | | // 异常项目暂时返回空 |
| | | if (ProjectCategoryEnum.EXCEPTION.getType().equals(query.getProjectPhase())) { |
| | | if (YesOrNo.YES.getCode().equals(query.getExe())) { |
| | | return Result.ok().data(new ArrayList<>()).total(0); |
| | | } |
| | | Long userId = SecurityUtils.getUserId(); |
| | |
| | | List<Long> departmentList = vo.getCompetentDepartmentList(); |
| | | projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId()))); |
| | | // 翻译项目阶段 |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectStatus(), projectVO.getProcessId() != null); |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectPhase()); |
| | | projectVO.setProjectPhase(phase); |
| | | if (StringUtils.isNotEmpty(projectVO.getProjectSubType())) { |
| | | // 翻译项目子类型 |
| | |
| | | List<ProjectVO> city = new ArrayList<>(); |
| | | List<ProjectVO> county = new ArrayList<>(); |
| | | projectVOS.forEach(item -> { |
| | | if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | reserve.add(item); |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | previous.add(item); |
| | | } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | implement.add(item); |
| | | } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | finish.add(item); |
| | | } |
| | | |
| | |
| | | ProjectExcelTemplate excel = new ProjectExcelTemplate(); |
| | | BeanUtils.copyProperties(item, excel); |
| | | //项目阶段 |
| | | excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null)); |
| | | excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase())); |
| | | excelList.add(excel); |
| | | }); |
| | | Set<Integer> indexes = OutputExcelUtils.getSelectFields(query.getFieldList(), ProjectExcelTemplate.class); |
| | |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())) { |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | |
| | | throw new RuntimeException("项目重复,项目名称、项目码已存在"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | projectId = entity.getId(); |
| | | addPlan(entity.getId()); //添加计划表 |
| | | //添加项目中标单位 |
| | | List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>(); |
| | |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | // 新增 |
| | | if (Objects.nonNull(form.getProjectInvestmentInfoForm())) { |
| | | form.getProjectInvestmentInfoForm().setProjectId(projectId); |
| | | projectInvestmentInfoServiceImpl.add(form.getProjectInvestmentInfoForm()); |
| | | } |
| | | |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm())) { |
| | | form.getProjectInvestmentFundingForm().setProjectId(projectId); |
| | | projectInvestmentFundingServiceImpl.add(form.getProjectInvestmentFundingForm()); |
| | | } |
| | | |
| | | if (Objects.nonNull(form.getProjectInvestmentPolicyComplianceForm())) { |
| | | form.getProjectInvestmentPolicyComplianceForm().setProjectId(projectId); |
| | | projectInvestmentPolicyComplianceServiceImpl.add(form.getProjectInvestmentPolicyComplianceForm()); |
| | | } |
| | | |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm())) { |
| | | form.getProjectUnitRegistrationInfoForm().setProjectId(projectId); |
| | | projectUnitRegistrationInfoServiceImpl.add(form.getProjectUnitRegistrationInfoForm()); |
| | | } |
| | | } else { |
| | | //更新 |
| | | ProjectInfo entity = baseMapper.selectById(form.getProjectInfoForm().getId()); |
| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())) { |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | // 更新 |
| | | if (Objects.nonNull(form.getProjectInvestmentInfoForm())) { |
| | | projectInvestmentInfoServiceImpl.update(form.getProjectInvestmentInfoForm()); |
| | | } |
| | | |
| | | // 更新其它项目信息表 |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm())) { |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm().getId())) { |
| | | projectInvestmentFundingServiceImpl.update(form.getProjectInvestmentFundingForm()); |
| | | } else { |
| | | form.getProjectInvestmentFundingForm().setProjectId(projectId); |
| | | projectInvestmentFundingServiceImpl.add(form.getProjectInvestmentFundingForm()); |
| | | } |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm())) { |
| | | projectInvestmentFundingServiceImpl.update(); |
| | | } |
| | | if (Objects.nonNull(form.getProjectInvestmentPolicyComplianceForm())) { |
| | | projectInvestmentPolicyComplianceServiceImpl.update(form.getProjectInvestmentPolicyComplianceForm()); |
| | | } |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm())) { |
| | | } |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm())) { |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm().getId())) { |
| | | projectUnitRegistrationInfoServiceImpl.update(form.getProjectUnitRegistrationInfoForm()); |
| | | } else { |
| | | form.getProjectUnitRegistrationInfoForm().setProjectId(projectId); |
| | | projectUnitRegistrationInfoServiceImpl.add(form.getProjectUnitRegistrationInfoForm()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return Result.ok("保存成功"); |