diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java index 11bf04e..4745084 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java @@ -39,6 +39,7 @@ import com.hz.pm.api.projectdeclared.model.req.*; import com.hz.pm.api.projectdeclared.model.req.SubmitPurchaseNoticeReq.PurchaseNoticeTenderDTO; import com.hz.pm.api.projectdeclared.model.vo.*; import com.hz.pm.api.projectdeclared.service.*; +import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; import com.hz.pm.api.projectlib.helper.ProjectManageUtil; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectInst; @@ -49,6 +50,7 @@ import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; import com.hz.pm.api.projectlib.model.vo.TenderListInfoVO; import com.hz.pm.api.projectlib.service.IProjectInstService; import com.hz.pm.api.projectlib.service.IProjectService; +import com.hz.pm.api.projectlib.service.IPurchaseStatusChangeService; import com.hz.pm.api.sys.manage.ProcessModelManage; import com.hz.pm.api.user.helper.MhUnitCache; import com.hz.pm.api.user.security.model.UserFullInfoDTO; @@ -120,6 +122,7 @@ public class PurchaseManage { private final EnvironmentUtil environmentUtil; private final IXinchuangService xinchuangService; private final MhXchxFileHelper mhXchxFileHelper; + private final IPurchaseStatusChangeService purchaseStatusChangeService; /** * 待采购的-项目列表 @@ -577,10 +580,24 @@ public class PurchaseManage { List projects = projectService.list(projectQuery); Map projectMap = CollUtils.listToMap(projects, Project::getId); Map contractMap = contractService.listByProjectIds(projectIds); + List finishOrgConfirmBidIds = new ArrayList<>(); + if (req.getStatus() == null) { + List bidIds = CollUtils.fieldList(records, Purchase::getId); + Wrapper pscQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class) + .select(PurchaseStatusChange::getBidId) + .eq(PurchaseStatusChange::getEvent, TenderStateChangeEvent.SUBMIT_PURCHASE_ORG_CONFIRM) + .in(PurchaseStatusChange::getBidId, bidIds); + List changes = purchaseStatusChangeService.list(pscQuery); + changes.forEach(c -> finishOrgConfirmBidIds.add(c.getBidId())); + } List data = records.stream().map(w -> { PurchaseAdaptionListVO adaption = new PurchaseAdaptionListVO(); adaption.setBidId(w.getId()); - adaption.setStatus(w.getStatus()); + if (finishOrgConfirmBidIds.contains(w.getId())) { + adaption.setStatus(TenderMainStatus.ORG_CONFIRM_PASSED.getCode()); + } else { + adaption.setStatus(w.getStatus()); + } adaption.setBizName(w.getBidName()); adaption.setProjectId(w.getProjectId()); Project project = projectMap.get(w.getProjectId()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderMainStatus.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderMainStatus.java index c23849c..ccb33cc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderMainStatus.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/enumeration/status/TenderMainStatus.java @@ -28,6 +28,7 @@ public enum TenderMainStatus implements ITenderStatus { TO_BE_SUBMIT_OPERATION_PLAN(ProjectStatus.ON_ADAPTING, 103, "待填写实施计划"), // 衔接状态 WAIT_ORG_CONFIRM(ProjectStatus.ON_ADAPTING, 104, "待单位确认"), + ORG_CONFIRM_PASSED(ProjectStatus.ON_ADAPTING, 105, "单位已确认"), TO_BE_SUBMIT_FIRST_INSPECTED_INFO(ProjectStatus.TO_BE_FIRST_INSPECTED, 201, "待上传初验材料"), TO_BE_SUBMIT_FINALLY_INSPECTED_APPLY(ProjectStatus.ON_PILOT_RUNNING, 401, "待终验申报"), ON_FINALLY_INSPECTED_APPLY(ProjectStatus.ON_FINALLY_INSPECTED, 501, "终验申报中"),