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..6e48f99 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; @@ -110,14 +111,14 @@ public interface IProjectRecordService extends IBaseService{ /** * 获取项目是否可以修改 * @param id 项目ID - * @return + * @return 返回结果 */ boolean getProjectIsUpdate(String id); /** * 自主采购直接初始化信息 * @param projectEntrustVO 自主采购信息 - * @return + * @return 返回结果 */ boolean initProjectByIndependentProcurement(ProjectEntrustVO projectEntrustVO); @@ -136,12 +137,17 @@ public interface IProjectRecordService extends IBaseService{ */ void inquiryInitialize(String id, Map sectionMaps, LocalDateTime reviewStartTime); + /** + * 查询询价项目信息 + * @param inquiryId 询价id + * @return 返回结果 + */ ProjectRecord getByInquiryId(String inquiryId); /** * 获取 - * @param id - * @return + * @param id 项目ID + * @return 返回结果 */ BigDecimal getBudgetAmountById(String id); @@ -153,10 +159,15 @@ public interface IProjectRecordService extends IBaseService{ IPage getPageByPurchase(ProjectRecordVO projectRecord); /** - * 获取标段信息进度比 - * @param businessModule 标段环节 - * @param vo 项目信息 - * @return 返回结果 + * 获取归档标段状态信息 + * @param sectionVOList 标段集合 */ - BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO vo); + void getArchiveStatus(List sectionVOList); + + /** + * 获取标段信息进度比 + * @param sectionVO 标段环节 + * @param 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..d78b532 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DictProvincesCode::getProvincesNumber,inquiryVO.getOrgOu()); + DictProvincesCode provincesCode = provincesCodeService.getOne(queryWrapper); + if(null != provincesCode){ + record.setRegionDictId(provincesCode.getProvinces()); + } + } + //采购经理 record.setOwnerContactId(projectEntrust.getPurchasingManager()); record.setOwnerContactName(projectEntrust.getPurchasingManagerName()); @@ -1028,6 +1045,7 @@ 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 +1056,12 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl 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 +1072,7 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl 1){ - businessModule = isReviewMethod ? businessModule : businessModule - 5; + public void getArchiveStatus(List sectionVOList) { + List 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()))); } - BigDecimal module = new BigDecimal(businessModule); + } - return module.divide(businessModuleTotal,2,BigDecimal.ROUND_HALF_UP); + @Override + public void getLinkPercentage(ProjectSectionVO sectionVO, ProjectRecordVO vo){ + boolean isReviewMethod = this.isReviewMethod(vo); + Integer businessModuleTotal = isReviewMethod ? 12 : 7; + if(sectionVO.getBusinessModule() > 1){ + sectionVO.setCurrentLink(isReviewMethod ? sectionVO.getBusinessModule() : sectionVO.getBusinessModule() - 5); + }else{ + sectionVO.setCurrentLink(sectionVO.getBusinessModule()); + } + sectionVO.setLinkCount(businessModuleTotal); } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java index a359def..7cd9943 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java @@ -31,6 +31,7 @@ import com.chinaunicom.mall.ebtp.project.projectreevaluation.entity.ProjectReEva import com.chinaunicom.mall.ebtp.project.projectreevaluation.service.IProjectReEvaluationService; import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSection; import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService; +import feign.FeignException; import io.seata.core.context.RootContext; import io.seata.spring.annotation.GlobalTransactional; import lombok.extern.slf4j.Slf4j; @@ -188,8 +189,8 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl baseResponse = mallResuApi.findStatusByPurpIdForEval(Long.parseLong(section.getSubprojectId())); log.info("重评校验子项目信息返回结果:{}",JsonUtils.objectToJson(baseResponse)); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); - ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_CHECK_STATUS_ERROR.customValid(!baseResponse.getData()); - }catch (Exception e){ + ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_SECTION_BUSINESS_MODULE_ERROR.customValid(!baseResponse.getData()); + }catch (FeignException e){ ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_CHECK_STATUS_ERROR.throwException(); } 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..383b3f9 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; @@ -510,6 +511,7 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl sectionList = this.list(queryWrapper); + List sectionIds = sectionList.stream().map(ProjectSection::getId).collect(Collectors.toList()); BaseResponse> response = tenderApi.getRegisterCountByPackage(sectionIds); ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(response.getMessage(),!response.isSuccess()); @@ -518,11 +520,14 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl selectEditSectionBySave(String projectId) { //获取项目是否预审 boolean isReviewMethod = recordService.isReviewMethod(recordService.getById(projectId)); @@ -563,11 +567,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; }