From d64ebcc0b18bda5290725a956256f86c8036fbfb Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 24 二月 2025 22:39:17 +0800
Subject: [PATCH] 下面阶段查询修改
---
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | 64 +++++++++++++-------------------
1 files changed, 26 insertions(+), 38 deletions(-)
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
index ac53878..677b8b7 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -17,6 +17,7 @@
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;
@@ -325,7 +326,7 @@
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();
@@ -356,7 +357,7 @@
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())) {
// 缈昏瘧椤圭洰瀛愮被鍨�
@@ -455,13 +456,13 @@
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);
}
@@ -586,7 +587,7 @@
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);
@@ -817,7 +818,7 @@
entity.setCreateBy(userId);
entity.setUpdateBy(userId);
//濡傛灉鏄偍澶囬」鐩�(鏈紑宸ラ」鐩�)涓嶉渶瑕佸鏍�
- if (ProjectConstant.COMMIT.equals(entity.getUsedStatus()) && ProjectStatusEnum.PENDDING.getType().equals(entity.getProjectStatus())) {
+ if ("0".equals(entity.getProjectPhase())) {
entity.setUsedStatus(ProjectConstant.PASS);
}
// 绠$悊鍛樹慨鏀圭殑鐩存帴閫氳繃
@@ -828,6 +829,7 @@
throw new RuntimeException("椤圭洰閲嶅锛岄」鐩悕绉般�侀」鐩爜宸插瓨鍦�");
}
baseMapper.insert(entity);
+ projectId = entity.getId();
addPlan(entity.getId()); //娣诲姞璁″垝琛�
//娣诲姞椤圭洰涓爣鍗曚綅
List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>();
@@ -850,26 +852,6 @@
}
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 {
//鏇存柊
@@ -926,19 +908,25 @@
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("淇濆瓨鎴愬姛");
--
Gitblit v1.8.0