From 6f788ef8254a36fbfaf62c2a714173545dacdc78 Mon Sep 17 00:00:00 2001 From: dxc Date: Tue, 20 Apr 2021 08:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9=20=E9=87=8D=E8=AF=84=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/common/EbpProjectCommonUtil.java | 5 +-- .../ebtp/project/feign/EbtpArchiveApi.java | 9 +++++ .../service/IProjectRecordService.java | 5 +-- .../impl/ProjectRecordServiceImpl.java | 33 ++++++++++++++----- .../entity/ProjectSectionVO.java | 9 +++++ .../impl/ProjectSectionServiceImpl.java | 14 ++++---- 6 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/common/EbpProjectCommonUtil.java b/src/main/java/com/chinaunicom/mall/ebtp/project/common/EbpProjectCommonUtil.java index e817e00..6a0719e 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/common/EbpProjectCommonUtil.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/common/EbpProjectCommonUtil.java @@ -161,9 +161,10 @@ public class EbpProjectCommonUtil { public static final String FUND_ORIGN_006 = "006"; /** - * 子业务类型(001:需求; 002:项目; 003:公告;) + * 子业务类型(001:需求; 002:项目; 003:公告; 004:协议;005:代理; 006:专家; 007:订单; 008:模板库; + * 009:招标采购中心; 010;财务及预算; 011:库存; 012:领用; 013:商品; 014:公开市场; 020:其他;) */ - public static final String SUB_BUSINESS_TYPE ="002"; + public static final String SUB_BUSINESS_TYPE ="009"; /** * 审批返回 审批通过 diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpArchiveApi.java b/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpArchiveApi.java index 9b00649..e85f965 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpArchiveApi.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/feign/EbtpArchiveApi.java @@ -26,4 +26,13 @@ public interface EbtpArchiveApi { @ApiOperation("查询标段信息是否归档") @PostMapping("/v1/archiveRounds/getArchiveSection") BaseResponse> getArchiveSection(@ApiParam(value = "对象数据", required = true) @RequestBody List sectionIds); + + /** + * 查询标段信息归档状态 + * @param sectionIds 标段ID集合 + * @return 返回结果 + */ + @ApiOperation("查询标段信息归档状态") + @PostMapping("/v1/archiveRounds/getArchiveStatusBySectionIds") + BaseResponse> getArchiveStatusBySectionIds(@ApiParam(value = "对象数据", required = true) @RequestBody List sectionIds); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/IProjectRecordService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/IProjectRecordService.java index eb74a6a..e19671a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/IProjectRecordService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/IProjectRecordService.java @@ -6,6 +6,7 @@ import com.chinaunicom.mall.ebtp.common.base.service.IBaseService; import com.chinaunicom.mall.ebtp.project.projectentrust.entity.ProjectEntrustVO; import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecord; import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecordVO; +import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSectionVO; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -154,9 +155,9 @@ public interface IProjectRecordService extends IBaseService{ /** * 获取标段信息进度比 - * @param businessModule 标段环节 + * @param sectionVO 标段环节 * @param vo 项目信息 * @return 返回结果 */ - BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO vo); + void getLinkPercentage(ProjectSectionVO sectionVO, ProjectRecordVO vo); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/impl/ProjectRecordServiceImpl.java index 17f6eb1..b647f67 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectrecord/service/impl/ProjectRecordServiceImpl.java @@ -23,6 +23,7 @@ import com.chinaunicom.mall.ebtp.project.dict.entity.DictProvincesCode; import com.chinaunicom.mall.ebtp.project.dict.service.IDictProvincesCodeService; import com.chinaunicom.mall.ebtp.project.dictchooseprocess.entity.DictChooseProcess; import com.chinaunicom.mall.ebtp.project.dictchooseprocess.service.IDictChooseProcessService; +import com.chinaunicom.mall.ebtp.project.feign.EbtpArchiveApi; import com.chinaunicom.mall.ebtp.project.feign.EbtpMallBidApi; import com.chinaunicom.mall.ebtp.project.feign.EbtpMallProcessApi; import com.chinaunicom.mall.ebtp.project.feign.EbtpTenderApi; @@ -118,6 +119,9 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl> conversionMap = sectionList.stream().collect(Collectors.groupingBy(ProjectSection::getProjectId)); List sectionVOList = new ArrayList<>(); + //拼装标段总条数 for (String key: conversionMap.keySet()) { List tempList = conversionMap.get(key); if(!CollectionUtils.isEmpty(tempList)){ @@ -1038,8 +1043,18 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl archiveSectionIds = sectionVOList.stream().filter(n -> n.getBusinessModule() == ProjectCommonUtil.BUSINESS_MODULE_12).map(ProjectSection::getId).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(archiveSectionIds)){ + BaseResponse> response = archiveApi.getArchiveStatusBySectionIds(archiveSectionIds); + CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess()); + Map resultMap = response.getData(); + sectionVOList.forEach(n -> n.setArchiveStatus(resultMap.get(n.getId()))); + } + + //拼装查询报名人数 当前进度 List sectionIds = sectionVOList.stream().map(ProjectSection::getId).collect(Collectors.toList()); - if(null != sectionList && !sectionList.isEmpty()){ + if(!CollectionUtils.isEmpty(sectionIds)){ BaseResponse> response = tenderApi.getRegisterCountByPackage(sectionIds); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess()); Map resultMap = response.getData(); @@ -1050,7 +1065,7 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl 1){ - businessModule = isReviewMethod ? businessModule : businessModule - 5; + Integer businessModuleTotal = isReviewMethod ? 12 : 7; + if(sectionVO.getBusinessModule() > 1){ + sectionVO.setCurrentLink(isReviewMethod ? sectionVO.getBusinessModule() : sectionVO.getBusinessModule() - 5); + }else{ + sectionVO.setCurrentLink(sectionVO.getBusinessModule()); } - BigDecimal module = new BigDecimal(businessModule); - - return module.divide(businessModuleTotal,2,BigDecimal.ROUND_HALF_UP); + sectionVO.setLinkCount(businessModuleTotal); } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/entity/ProjectSectionVO.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/entity/ProjectSectionVO.java index 07c29b4..de3d282 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/entity/ProjectSectionVO.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/entity/ProjectSectionVO.java @@ -95,4 +95,13 @@ public class ProjectSectionVO extends ProjectSection implements Serializable { @ApiModelProperty(value = "标段总数") private Integer sectionCount; + + @ApiModelProperty(value = "归档状态") + private Integer archiveStatus; + + @ApiModelProperty(value = "标段环节总数") + private Integer linkCount; + + @ApiModelProperty(value = "当前环节数") + private Integer currentLink; } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java index 88d5f01..aab5ecd 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectsection/service/impl/ProjectSectionServiceImpl.java @@ -38,6 +38,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.ArrayList; @@ -520,7 +521,7 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl selectEditSectionBySave(String projectId) { //获取项目是否预审 boolean isReviewMethod = recordService.isReviewMethod(recordService.getById(projectId)); @@ -563,11 +563,13 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl sectionIds = sectionVOList.stream().map(ProjectSectionVO::getId).collect(Collectors.toList()); - BaseResponse> baseResponse = rsmsApi.getToExceptionByBsId(sectionIds); - ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); + if(!CollectionUtils.isEmpty(sectionIds)){ + BaseResponse> baseResponse = rsmsApi.getToExceptionByBsId(sectionIds); + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); - Map pushResultMap = baseResponse.getData(); - sectionVOList = sectionVOList.stream().filter(n -> pushResultMap.get(n.getId())).collect(Collectors.toList()); + Map pushResultMap = baseResponse.getData(); + sectionVOList = sectionVOList.stream().filter(n -> pushResultMap.get(n.getId())).collect(Collectors.toList()); + } return sectionVOList; }