| | |
| | | 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; |
| | | import com.ycl.common.enums.business.ProjectStatusEnum; |
| | | import com.ycl.common.enums.business.*; |
| | | import com.ycl.common.exception.base.BaseException; |
| | | import com.ycl.common.utils.CopyUtils; |
| | | import com.ycl.common.utils.DateUtils; |
| | |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.time.Year; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | private final ProjectUnitRegistrationInfoServiceImpl projectUnitRegistrationInfoServiceImpl; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | private final ISysDictDataService dictDataService; |
| | | private final ProcessLogService processLogService; |
| | | |
| | | |
| | | /** |
| | |
| | | baseMapper.getPage(query, page); |
| | | List<ProjectInfoVO> records = page.getRecords(); |
| | | List<ProjectVO> list = new ArrayList<>(); |
| | | int year = Year.now().getValue(); |
| | | records.forEach(vo -> { |
| | | ProjectInfoVO.transform(vo); |
| | | ProjectVO projectVO = new ProjectVO(); |
| | |
| | | if (Objects.nonNull(dictData)) { |
| | | projectVO.setProjectSubType(dictData.getDictLabel()); |
| | | } |
| | | } |
| | | // 获取本年度的投资金额 |
| | | List<ProjectInfoYearPlan> yearPlans = new LambdaQueryChainWrapper<>(projectInfoYearPlanService.getBaseMapper()) |
| | | .eq(ProjectInfoYearPlan::getProjectInfoId, projectVO.getId()) |
| | | .eq(ProjectInfoYearPlan::getYear, year) |
| | | .list(); |
| | | if (! CollectionUtils.isEmpty(yearPlans)) { |
| | | projectVO.setYearInvestAmount(yearPlans.get(0).getYearTotalMoney()); |
| | | } |
| | | list.add(projectVO); |
| | | }); |
| | |
| | | public Map<String, Integer> countExceptionProject(IndexDTO indexDTO) { |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | map.put("processExceptionProject", 0); |
| | | // 查询发生过容缺的项目数 |
| | | List<String> projectIds = new LambdaQueryChainWrapper<>(processLogService.getBaseMapper()) |
| | | .select(ProcessLog::getProjectId) |
| | | .eq(ProcessLog::getEventType, ProcessLogEventTypeEnum.WAIT) |
| | | .list().stream().map(ProcessLog::getProjectId).distinct().collect(Collectors.toList()); |
| | | map.put("hasWaitProjectNum", projectIds.size()); |
| | | return map; |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result editProject(ProjectForm form) { |
| | | // 草稿的情况,需要判定有没有选业主单位(因为草稿不校验必填),没选则默认设置为当前人的单位 |
| | | if (ProjectConstant.DRAFT.equals(form.getProjectInfoForm().getUsedStatus())) { |
| | | if (Objects.isNull(form.getProjectInfoForm().getProjectOwnerUnit())) { |
| | | form.getProjectInfoForm().setProjectOwnerUnit(SecurityUtils.getDeptId()); |
| | | } |
| | | } |
| | | Long projectId = form.getProjectInfoForm().getId(); |
| | | if (ObjectUtil.isNotNull(form.getProjectInfoForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectInfoForm().getId())) { |
| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | //如果是储备项目(未开工项目)不需要审核(草稿除外) |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
| | | // 管理员修改的直接通过(管理员保存为草稿,那么状态还是草稿) |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | if(!checkProjectNameAndIdIsUnique(entity,null)){ |
| | |
| | | ProjectInfoForm.getEntityByForm(form.getProjectInfoForm(), entity); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | //如果是储备项目(未开工项目)不需要审核(草稿除外) |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
| | | // 管理员修改的直接通过(管理员保存为草稿,那么状态还是草稿) |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId()) && ! ProjectConstant.DRAFT.equals(entity.getUsedStatus())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | if(!checkProjectNameAndIdIsUnique(entity, entity.getId())){ |
| | |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm().getId())) { |
| | | projectUnitRegistrationInfoServiceImpl.update(form.getProjectUnitRegistrationInfoForm()); |
| | | } else { |
| | | // 先删掉之前的,再新增 |
| | | new LambdaUpdateChainWrapper<>(projectUnitRegistrationInfoServiceImpl.getBaseMapper()) |
| | | .eq(ProjectUnitRegistrationInfo::getProjectId, projectId) |
| | | .remove(); |
| | | form.getProjectUnitRegistrationInfoForm().setProjectId(projectId); |
| | | projectUnitRegistrationInfoServiceImpl.add(form.getProjectUnitRegistrationInfoForm()); |
| | | } |