|
|
@@ -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)) { |
|
|
|