Просмотр исходного кода

feat:

1. 项目总览、招标采购修改;
dev
WendyYang 6 дней назад
Родитель
Сommit
756610dd80
3 измененных файлов: 20 добавлений и 31 удалений
  1. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectManageTodoCountManage.java
  3. +16
    -27
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java Просмотреть файл

@@ -177,7 +177,7 @@ public class PurchaseManage {
w -> CollUtil.anyMatch(w, x -> PURCHASING_STATUS.contains(x.getStatus()))));
// 已采购
stat.setPurchaseFinishedCount(CollUtil.count(projectPurchaseMap.values(),
w -> !w.isEmpty() && CollUtil.anyMatch(w, x -> !PURCHASING_STATUS.contains(x.getStatus()))));
w -> !w.isEmpty() && CollUtil.allMatch(w, x -> !PURCHASING_STATUS.contains(x.getStatus()))));

stat.setTotalCount(projects.size());
return stat;
@@ -214,8 +214,8 @@ public class PurchaseManage {
String inSql = BizUtils.inSqlJoin(CollUtils.convert(PURCHASING_STATUS, String::valueOf));
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE + " and np.status in " + inSql);
} else if (TenderMainStatus.PURCHASE_FINISHED.eq(req.getTabStatus())) {
query.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE +
" and npsc.event = {0} ", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO);
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE +
" and npsc.event = {0} ", ProjectStateChangeEvent.SUBMIT_PURCHASE_CONTRACT_RECORD);
} else if (ProjectStatus.TO_BE_PURCHASED.eq(req.getTabStatus())) {
query.eq(Project::getStatus, ProjectStatus.TO_BE_PURCHASED.getCode());
} else {


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectManageTodoCountManage.java Просмотреть файл

@@ -89,7 +89,7 @@ public class ProjectManageTodoCountManage {
// 招标采购
projReqOrg.setBuildOrgCode(req.getBuildOrgCode());
PurchaseProgressVO purchase = purchaseManage.purchaseProgress(projReqOrg);
ret.setProjectPurchase(sum(purchase, PurchaseProgressVO::getOnPurchaseCount));
ret.setProjectPurchase(sum(purchase, PurchaseProgressVO::getOnPurchaseCount, PurchaseProgressVO::getToBePurchaseCount));
// 适配改造
PurchaseAdaptionListReq adaptionReq = new PurchaseAdaptionListReq();
adaptionReq.setBuildOrgCode(buildOrgCode);


+ 16
- 27
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java Просмотреть файл

@@ -332,13 +332,10 @@ public class WorkbenchManage {


public List<String> getProjectCodes(Map<String, List<ProjectStatusChange>> projectStatusChanges,
List<String> projectCodes,
ProjectStateChangeEvent event) {
return projectStatusChanges.entrySet().stream()
.filter(w -> projectCodes.contains(w.getKey()))
.filter(w -> CollUtil.anyMatch(w.getValue(), w1 -> event.eq(w1.getEvent())))
.map(Map.Entry::getKey)
.filter(projectCodes::contains)
.collect(Collectors.toList());
}

@@ -348,7 +345,7 @@ public class WorkbenchManage {
return CollUtil.count(projectStatusChanges.entrySet(), w -> {
List<ProjectStatusChange> changes = w.getValue();
return CollUtil.anyMatch(changes, w1 -> startEvent.eq(w1.getEvent()))
&& CollUtil.anyMatch(changes, w1 -> !finishEvent.eq(w1.getEvent()));
&& CollUtil.allMatch(changes, w1 -> !finishEvent.eq(w1.getEvent()));
});
}

@@ -422,8 +419,7 @@ public class WorkbenchManage {
}
break;
case PROJECT_REVIEW: {
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, allProjectCodes,
ProjectStateChangeEvent.PROJECT_REVIEW_PASS);
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.PROJECT_REVIEW_PASS);
currStat.setProjectCount(projectCodes.size());
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes);
currStat.setSourceCount(systemReplaceCount.getKey());
@@ -454,8 +450,7 @@ public class WorkbenchManage {
}
break;
case PROJECT_APPROVAL: {
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, allProjectCodes,
ProjectStateChangeEvent.DECLARED_RECORD_PASS);
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.DECLARED_RECORD_PASS);
currStat.setProjectCount(projectCodes.size());
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes);
currStat.setSourceCount(systemReplaceCount.getKey());
@@ -466,27 +461,21 @@ public class WorkbenchManage {
}
break;
case PROJECT_PURCHASE: {
Wrapper<Purchase> purchaseQuery = Wrappers.lambdaQuery(Purchase.class)
.select(Purchase::getId, Purchase::getProjectId, Purchase::getBidType,
Purchase::getStatus, Purchase::getSupplier)
.in(Purchase::getProjectId, allProjectIds);
List<Purchase> purchases = purchaseService.list(purchaseQuery);
projectPurchaseCountMap.putAll(CollUtils.group(purchases, Purchase::getProjectId));
List<Long> projectIds = projectPurchaseCountMap.entrySet().stream()
.filter(w -> CollUtil.allMatch(w.getValue(),
p -> StrUtil.isNotBlank(p.getSupplier())))
.map(Map.Entry::getKey)
.collect(Collectors.toList());
currStat.setProjectCount(projectIds.size());
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectIds(projectIds);
currStat.setSourceCount(systemReplaceCount.getKey());
currStat.setTargetCount(systemReplaceCount.getValue());
List<String> projectCodes = CollUtils.convert(projectIds, ProjectIdCodeCacheUtil::get);
currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes));
if (!projectIds.isEmpty()) {
List<String> projectCodes = getProjectCodes(projectStatusChangeMap, ProjectStateChangeEvent.SUBMIT_PURCHASE_CONTRACT_RECORD);
currStat.setProjectCount(projectCodes.size());
if (!projectCodes.isEmpty()) {
Wrapper<Purchase> purchaseQuery = Wrappers.lambdaQuery(Purchase.class)
.select(Purchase::getId, Purchase::getProjectId, Purchase::getBidType, Purchase::getStatus)
.in(Purchase::getProjectId, allProjectIds);
List<Purchase> purchases = purchaseService.list(purchaseQuery);
projectPurchaseCountMap.putAll(CollUtils.group(purchases, Purchase::getProjectId));
Pair<Integer, Integer> systemReplaceCount = countReplaceSystemByProjectCodes(projectCodes);
currStat.setSourceCount(systemReplaceCount.getKey());
currStat.setTargetCount(systemReplaceCount.getValue());
currStat.setStoppedCount(stoppedProjectCount(projectStatusChangeMap, projectCodes));
Wrapper<PurchaseStatusChange> pQuery = Wrappers.lambdaQuery(PurchaseStatusChange.class)
.select(PurchaseStatusChange::getEvent, PurchaseStatusChange::getProjectId)
.in(PurchaseStatusChange::getProjectId, projectIds)
.in(PurchaseStatusChange::getBidId, CollUtils.fieldList(purchases, Purchase::getId))
.in(PurchaseStatusChange::getEvent,
ADAPT_INFO_PASSED,
SELF_TEST_PASSED,


Загрузка…
Отмена
Сохранить