Browse Source

modify:

1. 增加适配改造进度统计接口;
tags/24082201
WendyYang 4 months ago
parent
commit
099e629f3f
4 changed files with 106 additions and 9 deletions
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/ExistsSqlConst.java
  2. +7
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java
  3. +54
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java
  4. +43
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/AdaptionProgressStatVO.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/ExistsSqlConst.java View File

@@ -23,4 +23,6 @@ public class ExistsSqlConst {

public static final String PROJECT_EXISTS_PURCHASE_STATUS_CHANGE = "select 1 from nd_purchase_status_change npsc where npsc.project_code = nd_project.project_code ";

public static final String PURCHASE_EXISTS_PURCHASE_STATUS_CHANGE = "select 1 from nd_purchase_status_change npsc where npsc.bid_id = nd_purchase.id ";

}

+ 7
- 4
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/controller/PurchaseController.java View File

@@ -7,10 +7,7 @@ import com.hz.pm.api.projectdeclared.model.dto.XcfhxApplyEditDTO;
import com.hz.pm.api.projectdeclared.model.dto.XcfhxApplySaveDTO;
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.PurchaseVO;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseAdaptionListVO;
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO;
import com.hz.pm.api.projectdeclared.model.vo.XinchuangVO;
import com.hz.pm.api.projectdeclared.model.vo.*;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.basic.model.PageVo;
@@ -82,6 +79,12 @@ public class PurchaseController {
purchaseManage.submitPurchaseRecord(req);
}

@GetMapping("/adaptionProgressStatistics")
@ApiOperation("获取采购进度统计")
public AdaptionProgressStatVO adaptionProgressStatistics() {
return purchaseManage.adaptionProgressStatistics();
}

@GetMapping("/pageAdaption")
@ApiOperation("获取适配改造列表")
public PageVo<PurchaseAdaptionListVO> pageAdaption(PurchaseAdaptionListReq req) {


+ 54
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PurchaseManage.java View File

@@ -18,6 +18,7 @@ import com.google.common.collect.Lists;
import com.hz.pm.api.common.enumeration.ProjectProcessType;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.model.constant.ExistsSqlConst;
import com.hz.pm.api.common.statemachine.event.TenderStateChangeEvent;
import com.hz.pm.api.common.statemachine.util.*;
import com.hz.pm.api.common.util.*;
import com.hz.pm.api.external.MhApiClient;
@@ -36,10 +37,7 @@ import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseScopeEnum;
import com.hz.pm.api.projectdeclared.model.enumerization.PurchaseSourceTypeEnum;
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.PurchaseAdaptionListVO;
import com.hz.pm.api.projectdeclared.model.vo.PurchaseVO;
import com.hz.pm.api.projectdeclared.model.vo.XcfhxApplyListVO;
import com.hz.pm.api.projectdeclared.model.vo.XinchuangVO;
import com.hz.pm.api.projectdeclared.model.vo.*;
import com.hz.pm.api.projectdeclared.service.*;
import com.hz.pm.api.projectlib.helper.ProjectManageUtil;
import com.hz.pm.api.projectlib.model.entity.Project;
@@ -462,11 +460,62 @@ public class PurchaseManage {
projectService.updateById(project);
}

public AdaptionProgressStatVO adaptionProgressStatistics() {
LambdaQueryWrapper<Purchase> query = Wrappers.lambdaQuery(Purchase.class)
.select(Purchase::getStatus, Purchase::getId)
.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode())
.exists(ExistsSqlConst.PURCHASE_EXISTS_PURCHASE_STATUS_CHANGE
+ " and npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO)
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT
+ "and np.stage in ({0}, {1})", ProjectStatus.STOPPED.getCode(),
ProjectStatus.CHANGE.getCode())
.orderByDesc(Purchase::getCreateOn);
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
if (!purchaseService.buildPurchaseQueryPermission(query, user)) {
return null;
}
List<Purchase> purchases = purchaseService.list(query);
Map<ITenderStatus, Long> statusCountMap = CollUtils.groupCount(purchases,
w -> {
ITenderStatus status = TenderMainStatus.getNoNull(w.getStatus());
if (TenderMainStatus.TO_BE_SUBMIT_OPERATION_PLAN.eq(status)) {
return TenderMainStatus.TO_BE_SUBMIT_OPERATION_PLAN;
} else if (TenderMainStatus.WAIT_ORG_CONFIRM.eq(status)) {
return TenderMainStatus.WAIT_ORG_CONFIRM;
} else if (TenderAdaptStatus.WITHOUT_ADAPT_INFO.eq(status)
|| TenderAdaptStatus.ADAPT_INFO_AUDIT.eq(status)
|| TenderAdaptStatus.ADAPT_INFO_FAILED.eq(status)) {
return TenderAdaptStatus.WITHOUT_ADAPT_INFO;
} else if (TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO.eq(status)
|| TenderSelfTestStatus.SELF_TEST_INFO_AUDIT.eq(status)
|| TenderSelfTestStatus.SELF_TEST_INFO_FAILED.eq(status)) {
return TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO;
} else if (TenderTestValidStatus.WITHOUT_TEST_VALID_INFO.eq(status)
|| TenderTestValidStatus.TEST_VALID_INFO_AUDIT.eq(status)
|| TenderTestValidStatus.TEST_VALID_INFO_FAILED.eq(status)) {
return TenderTestValidStatus.WITHOUT_TEST_VALID_INFO;
} else {
return status;
}
});
return AdaptionProgressStatVO.builder()
.withoutAdaptionInfo(statusCountMap.getOrDefault(TenderAdaptStatus.WITHOUT_ADAPT_INFO, 0L))
.withoutOperationCount(statusCountMap.getOrDefault(TenderMainStatus.TO_BE_SUBMIT_OPERATION_PLAN, 0L))
.withoutOrgConfirmCount(statusCountMap.getOrDefault(TenderMainStatus.WAIT_ORG_CONFIRM, 0L))
.withoutSelfTestCount(statusCountMap.getOrDefault(TenderSelfTestStatus.WITHOUT_SELF_TEST_INFO, 0L))
.withoutTestValidCount(statusCountMap.getOrDefault(TenderTestValidStatus.WITHOUT_TEST_VALID_INFO, 0L))
.totalCount(purchases.size())
.build();
}

private PageVo<PurchaseAdaptionListVO> queryData(PurchaseAdaptionListReq req) {
LambdaQueryWrapper<Purchase> query = Wrappers.lambdaQuery(Purchase.class)
.eq(Purchase::getBidType, BidTypeEnum.BUILD_APP.getCode())
.exists(ExistsSqlConst.PURCHASE_EXISTS_PURCHASE_STATUS_CHANGE
+ " npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO)
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT
+ "and np.stage = {0}", ProjectStatus.STOPPED.getCode())
+ "and np.stage in ({0}, {1})", ProjectStatus.STOPPED.getCode(),
ProjectStatus.CHANGE.getCode())
.orderByDesc(Purchase::getCreateOn);
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
if (!purchaseService.buildPurchaseQueryPermission(query, user)) {


+ 43
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/AdaptionProgressStatVO.java View File

@@ -0,0 +1,43 @@
package com.hz.pm.api.projectdeclared.model.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

/**
* <p>
* AdaptionProgressStatVO
* </p>
*
* @author WendyYang
* @since 16:46 2024/8/20
*/
@Data
@Builder
public class AdaptionProgressStatVO {

@Tolerate
public AdaptionProgressStatVO() {
// 默认构造方法
}

@ApiModelProperty("总数")
private Integer totalCount;

@ApiModelProperty("待填写实施计划")
private Long withoutOperationCount;

@ApiModelProperty("待上传开工文件")
private Long withoutAdaptionInfo;

@ApiModelProperty("待上传自测材料")
private Long withoutSelfTestCount;

@ApiModelProperty("待上传测试验证材料")
private Long withoutTestValidCount;

@ApiModelProperty("待单位确认")
private Long withoutOrgConfirmCount;

}

Loading…
Cancel
Save