|
|
@@ -71,6 +71,7 @@ import java.util.function.BiFunction; |
|
|
|
import java.util.function.Predicate; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.hz.pm.api.projectlib.helper.ProjectManageUtil.projectQueryByProjectStatusChange; |
|
|
|
import static com.hz.pm.api.workbench.model.vo.ProjectProcessStatVO.TenderAdaptFinishStatVO; |
|
|
|
|
|
|
|
/** |
|
|
@@ -514,12 +515,7 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
public PageVo<ProjectLibListItemVO> pageProjectLib(WorkbenchProjectLibReq req) { |
|
|
|
Assert.notNull(req.getProcessNode(), "节点不能为空"); |
|
|
|
Long unitId; |
|
|
|
if (req.getUnitId() != null) { |
|
|
|
unitId = req.getUnitId(); |
|
|
|
} else { |
|
|
|
unitId = LoginUserUtil.loginUserDetail().getMhUnitId(); |
|
|
|
} |
|
|
|
Long unitId = Optional.ofNullable(req.getUnitId()).orElseGet(LoginUserUtil::getMhUnitId); |
|
|
|
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(unitId); |
|
|
|
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) |
|
|
@@ -533,7 +529,7 @@ public class WorkbenchManage { |
|
|
|
.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()) |
|
|
|
.ge(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()) |
|
|
|
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) |
|
|
|
.eq(Project::getStage, ProjectStatus.STOPPED.getCode()) |
|
|
|
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE) |
|
|
|
.orderByDesc(Project::getUpdateOn); |
|
|
|
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); |
|
|
@@ -568,44 +564,24 @@ public class WorkbenchManage { |
|
|
|
if (page.getTotal() == 0) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> { |
|
|
|
ProjectLibListItemVO item = new ProjectLibListItemVO(); |
|
|
|
item.setId(w.getId()); |
|
|
|
item.setProjectName(w.getProjectName()); |
|
|
|
// 项目申报 |
|
|
|
item.setFromType("1"); |
|
|
|
item.setProjectCode(w.getProjectCode()); |
|
|
|
item.setArea(w.getArea()); |
|
|
|
item.setAreaCode(w.getAreaCode()); |
|
|
|
item.setCreateOn(w.getCreateOn()); |
|
|
|
item.setDeclaredAmount(w.getDeclareAmount()); |
|
|
|
item.setStage(w.getStage()); |
|
|
|
item.setStatus(w.getStatus()); |
|
|
|
item.setProjectType(w.getProjectType()); |
|
|
|
item.setProjectYear(w.getProjectYear()); |
|
|
|
item.setBuildOrg(w.getBuildOrgName()); |
|
|
|
item.setBizDomain(w.getBizDomain()); |
|
|
|
item.setProcessStatus(w.getProcessStatus()); |
|
|
|
item.setInstCode(w.getInstCode()); |
|
|
|
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); |
|
|
|
item.setApprovedAmount(w.getApprovalAmount()); |
|
|
|
item.setReviewAmount(w.getReviewAmount()); |
|
|
|
item.setPrePlanProjectId(w.getPrePlanProjectId()); |
|
|
|
return item; |
|
|
|
}); |
|
|
|
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), |
|
|
|
w -> ProjectLibListItemVO.builder() |
|
|
|
.id(w.getId()) |
|
|
|
.projectName(w.getProjectName()) |
|
|
|
.projectCode(w.getProjectCode()) |
|
|
|
.projectType(w.getProjectType()) |
|
|
|
.projectYear(w.getProjectYear()) |
|
|
|
.buildOrg(w.getBuildOrgName()) |
|
|
|
.buildOrgCode(w.getBuildOrgCode()) |
|
|
|
.bizDomain(w.getBizDomain()) |
|
|
|
.approvedAmount(w.getApprovalAmount()) |
|
|
|
.reviewAmount(w.getReviewAmount()) |
|
|
|
.declaredAmount(w.getDeclareAmount()) |
|
|
|
.createOn(w.getCreateOn()) |
|
|
|
.stage(w.getStage()) |
|
|
|
.status(w.getStatus()) |
|
|
|
.build()); |
|
|
|
return PageVo.of(records, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
private static void projectQueryByProjectStatusChange |
|
|
|
(LambdaQueryWrapper<Project> query, AbstractStateChangeEvent event) { |
|
|
|
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + |
|
|
|
" and npsc.event = {0}", event); |
|
|
|
} |
|
|
|
|
|
|
|
private static void projectQueryByPurchaseStatusChange |
|
|
|
(LambdaQueryWrapper<Project> query, AbstractStateChangeEvent event) { |
|
|
|
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE + |
|
|
|
" and npsc.event ={0}", event.name()); |
|
|
|
} |
|
|
|
|
|
|
|
} |