Merge branch 'master' into pro

This commit is contained in:
dxc
2021-04-23 08:23:20 +08:00
7 changed files with 100 additions and 30 deletions

View File

@ -161,9 +161,10 @@ public class EbpProjectCommonUtil {
public static final String FUND_ORIGN_006 = "006"; 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";
/** /**
* 审批返回 审批通过 * 审批返回 审批通过

View File

@ -26,4 +26,13 @@ public interface EbtpArchiveApi {
@ApiOperation("查询标段信息是否归档") @ApiOperation("查询标段信息是否归档")
@PostMapping("/v1/archiveRounds/getArchiveSection") @PostMapping("/v1/archiveRounds/getArchiveSection")
BaseResponse<Map<String,Boolean>> getArchiveSection(@ApiParam(value = "对象数据", required = true) @RequestBody List<String> sectionIds); BaseResponse<Map<String,Boolean>> getArchiveSection(@ApiParam(value = "对象数据", required = true) @RequestBody List<String> sectionIds);
/**
* 查询标段信息归档状态
* @param sectionIds 标段ID集合
* @return 返回结果
*/
@ApiOperation("查询标段信息归档状态")
@PostMapping("/v1/archiveRounds/getArchiveStatusBySectionIds")
BaseResponse<Map<String,Integer>> getArchiveStatusBySectionIds(@ApiParam(value = "对象数据", required = true) @RequestBody List<String> sectionIds);
} }

View File

@ -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.projectentrust.entity.ProjectEntrustVO;
import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecord; import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecord;
import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecordVO; import com.chinaunicom.mall.ebtp.project.projectrecord.entity.ProjectRecordVO;
import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSectionVO;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -110,14 +111,14 @@ public interface IProjectRecordService extends IBaseService<ProjectRecord>{
/** /**
* 获取项目是否可以修改 * 获取项目是否可以修改
* @param id 项目ID * @param id 项目ID
* @return * @return 返回结果
*/ */
boolean getProjectIsUpdate(String id); boolean getProjectIsUpdate(String id);
/** /**
* 自主采购直接初始化信息 * 自主采购直接初始化信息
* @param projectEntrustVO 自主采购信息 * @param projectEntrustVO 自主采购信息
* @return * @return 返回结果
*/ */
boolean initProjectByIndependentProcurement(ProjectEntrustVO projectEntrustVO); boolean initProjectByIndependentProcurement(ProjectEntrustVO projectEntrustVO);
@ -136,12 +137,17 @@ public interface IProjectRecordService extends IBaseService<ProjectRecord>{
*/ */
void inquiryInitialize(String id, Map<String, String> sectionMaps, LocalDateTime reviewStartTime); void inquiryInitialize(String id, Map<String, String> sectionMaps, LocalDateTime reviewStartTime);
/**
* 查询询价项目信息
* @param inquiryId 询价id
* @return 返回结果
*/
ProjectRecord getByInquiryId(String inquiryId); ProjectRecord getByInquiryId(String inquiryId);
/** /**
* 获取 * 获取
* @param id * @param id 项目ID
* @return * @return 返回结果
*/ */
BigDecimal getBudgetAmountById(String id); BigDecimal getBudgetAmountById(String id);
@ -153,10 +159,15 @@ public interface IProjectRecordService extends IBaseService<ProjectRecord>{
IPage<ProjectRecordVO> getPageByPurchase(ProjectRecordVO projectRecord); IPage<ProjectRecordVO> getPageByPurchase(ProjectRecordVO projectRecord);
/** /**
* 获取标段信息进度比 * 获取归档标段状态信息
* @param businessModule 标段环节 * @param sectionVOList 标段集合
* @param vo 项目信息
* @return 返回结果
*/ */
BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO vo); void getArchiveStatus(List<ProjectSectionVO> sectionVOList);
/**
* 获取标段信息进度比
* @param sectionVO 标段环节
* @param vo 项目信息
*/
void getLinkPercentage(ProjectSectionVO sectionVO, ProjectRecordVO vo);
} }

View File

@ -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.dict.service.IDictProvincesCodeService;
import com.chinaunicom.mall.ebtp.project.dictchooseprocess.entity.DictChooseProcess; import com.chinaunicom.mall.ebtp.project.dictchooseprocess.entity.DictChooseProcess;
import com.chinaunicom.mall.ebtp.project.dictchooseprocess.service.IDictChooseProcessService; 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.EbtpMallBidApi;
import com.chinaunicom.mall.ebtp.project.feign.EbtpMallProcessApi; import com.chinaunicom.mall.ebtp.project.feign.EbtpMallProcessApi;
import com.chinaunicom.mall.ebtp.project.feign.EbtpTenderApi; import com.chinaunicom.mall.ebtp.project.feign.EbtpTenderApi;
@ -118,6 +119,9 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
@Resource @Resource
private EbtpTenderApi tenderApi; private EbtpTenderApi tenderApi;
@Resource
private EbtpArchiveApi archiveApi;
/** /**
* 查询条件拼接 * 查询条件拼接
@ -877,10 +881,23 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
record.setProjectName(projectEntrust.getProjectName()); record.setProjectName(projectEntrust.getProjectName());
//项目组织形式 //项目组织形式
record.setBidOrgDict(projectEntrust.getOrganization()); record.setBidOrgDict(projectEntrust.getOrganization());
//采购人(采购人组织机构) //采购人(采购人组织机构) 询价单位名称(例如山东省济南市分公司)
record.setTendereeOrgName(projectEntrust.getPurchaser()); record.setTendereeOrgName(projectEntrust.getPurchaser());
//所属部门 询价企业名称(中国联合网络通信有限公司)
record.setTendereeName(inquiryVO.getInquiryCompany());
//所属省分 //所属省分
record.setProvince(inquiryVO.getOrgOu()); record.setProvince(inquiryVO.getOrgOu());
//项目所在行政区域字典编号
if(StringUtils.isNotBlank(inquiryVO.getOrgOu())){
LambdaQueryWrapper<DictProvincesCode> 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.setOwnerContactId(projectEntrust.getPurchasingManager());
record.setOwnerContactName(projectEntrust.getPurchasingManagerName()); record.setOwnerContactName(projectEntrust.getPurchasingManagerName());
@ -1028,6 +1045,7 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
//分组排序 获取第一条 //分组排序 获取第一条
Map<String,List<ProjectSection>> conversionMap = sectionList.stream().collect(Collectors.groupingBy(ProjectSection::getProjectId)); Map<String,List<ProjectSection>> conversionMap = sectionList.stream().collect(Collectors.groupingBy(ProjectSection::getProjectId));
List<ProjectSectionVO> sectionVOList = new ArrayList<>(); List<ProjectSectionVO> sectionVOList = new ArrayList<>();
//拼装标段总条数
for (String key: conversionMap.keySet()) { for (String key: conversionMap.keySet()) {
List<ProjectSection> tempList = conversionMap.get(key); List<ProjectSection> tempList = conversionMap.get(key);
if(!CollectionUtils.isEmpty(tempList)){ if(!CollectionUtils.isEmpty(tempList)){
@ -1038,8 +1056,12 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
} }
} }
//拼装归档状态 是否进行归档
getArchiveStatus(sectionVOList);
//拼装查询报名人数 当前进度
List<String> sectionIds = sectionVOList.stream().map(ProjectSection::getId).collect(Collectors.toList()); List<String> sectionIds = sectionVOList.stream().map(ProjectSection::getId).collect(Collectors.toList());
if(null != sectionList && !sectionList.isEmpty()){ if(!CollectionUtils.isEmpty(sectionIds)){
BaseResponse<Map<String,Long>> response = tenderApi.getRegisterCountByPackage(sectionIds); BaseResponse<Map<String,Long>> response = tenderApi.getRegisterCountByPackage(sectionIds);
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess()); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
Map<String,Long> resultMap = response.getData(); Map<String,Long> resultMap = response.getData();
@ -1050,7 +1072,7 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
if(null != sectionVO){ if(null != sectionVO){
Long applyCount = (null != resultMap.get(sectionVO.getId()))? resultMap.get(sectionVO.getId()) : 0L; Long applyCount = (null != resultMap.get(sectionVO.getId()))? resultMap.get(sectionVO.getId()) : 0L;
sectionVO.setApplyCount(applyCount); sectionVO.setApplyCount(applyCount);
sectionVO.setLinkPercentage(getLinkPercentage(sectionVO.getBusinessModule(),vo)); getLinkPercentage(sectionVO,vo);
} }
vo.setSectionFirst(sectionVO); vo.setSectionFirst(sectionVO);
} }
@ -1059,15 +1081,26 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
} }
@Override @Override
public BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO vo){ public void getArchiveStatus(List<ProjectSectionVO> sectionVOList) {
boolean isReviewMethod = this.isReviewMethod(vo); List<String> archiveSectionIds = sectionVOList.stream().filter(n -> n.getBusinessModule() == ProjectCommonUtil.BUSINESS_MODULE_12).map(ProjectSection::getId).collect(Collectors.toList());
BigDecimal businessModuleTotal = new BigDecimal(isReviewMethod ? 12 : 7); if(!CollectionUtils.isEmpty(archiveSectionIds)){
if(businessModule > 1){ BaseResponse<Map<String,Integer>> response = archiveApi.getArchiveStatusBySectionIds(archiveSectionIds);
businessModule = isReviewMethod ? businessModule : businessModule - 5; CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(response.getMessage(),!response.isSuccess());
Map<String,Integer> 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);
} }
} }

View File

@ -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.projectreevaluation.service.IProjectReEvaluationService;
import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSection; import com.chinaunicom.mall.ebtp.project.projectsection.entity.ProjectSection;
import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService; import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService;
import feign.FeignException;
import io.seata.core.context.RootContext; import io.seata.core.context.RootContext;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -188,8 +189,8 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl<ProjectReEva
BaseResponse<Boolean> baseResponse = mallResuApi.findStatusByPurpIdForEval(Long.parseLong(section.getSubprojectId())); BaseResponse<Boolean> baseResponse = mallResuApi.findStatusByPurpIdForEval(Long.parseLong(section.getSubprojectId()));
log.info("重评校验子项目信息返回结果:{}",JsonUtils.objectToJson(baseResponse)); log.info("重评校验子项目信息返回结果:{}",JsonUtils.objectToJson(baseResponse));
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_NOT_UPDATE.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess());
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_CHECK_STATUS_ERROR.customValid(!baseResponse.getData()); ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_EXCEPTION_SECTION_BUSINESS_MODULE_ERROR.customValid(!baseResponse.getData());
}catch (Exception e){ }catch (FeignException e){
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_CHECK_STATUS_ERROR.throwException(); ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_CHECK_STATUS_ERROR.throwException();
} }

View File

@ -95,4 +95,13 @@ public class ProjectSectionVO extends ProjectSection implements Serializable {
@ApiModelProperty(value = "标段总数") @ApiModelProperty(value = "标段总数")
private Integer sectionCount; private Integer sectionCount;
@ApiModelProperty(value = "归档状态")
private Integer archiveStatus;
@ApiModelProperty(value = "标段环节总数")
private Integer linkCount;
@ApiModelProperty(value = "当前环节数")
private Integer currentLink;
} }

View File

@ -38,6 +38,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -510,6 +511,7 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
queryWrapper.eq(ProjectSection::getProjectId,projectId); queryWrapper.eq(ProjectSection::getProjectId,projectId);
queryWrapper.orderByAsc(ProjectSection::getBidSectCode); queryWrapper.orderByAsc(ProjectSection::getBidSectCode);
List<ProjectSection> sectionList = this.list(queryWrapper); List<ProjectSection> sectionList = this.list(queryWrapper);
List<String> sectionIds = sectionList.stream().map(ProjectSection::getId).collect(Collectors.toList()); List<String> sectionIds = sectionList.stream().map(ProjectSection::getId).collect(Collectors.toList());
BaseResponse<Map<String,Long>> response = tenderApi.getRegisterCountByPackage(sectionIds); BaseResponse<Map<String,Long>> response = tenderApi.getRegisterCountByPackage(sectionIds);
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(response.getMessage(),!response.isSuccess()); ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(response.getMessage(),!response.isSuccess());
@ -518,11 +520,14 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValid(null == record); ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValid(null == record);
for (ProjectSection section:sectionList) { for (ProjectSection section:sectionList) {
ProjectSectionVO vo = BeanUtil.toBean(section,ProjectSectionVO.class); ProjectSectionVO vo = BeanUtil.toBean(section,ProjectSectionVO.class);
Long applyCount = (null == resultMap.get(vo.getId()))? resultMap.get(vo.getId()) : 0L; Long applyCount = (null != resultMap.get(vo.getId()))? resultMap.get(vo.getId()) : 0L;
vo.setApplyCount(applyCount); vo.setApplyCount(applyCount);
vo.setLinkPercentage(recordService.getLinkPercentage(vo.getBusinessModule(),BeanUtil.toBean(record, ProjectRecordVO.class))); recordService.getLinkPercentage(vo,BeanUtil.toBean(record, ProjectRecordVO.class));
resultList.add(vo); resultList.add(vo);
} }
//拼装归档状态 是否进行归档
recordService.getArchiveStatus(resultList);
return resultList; return resultList;
} }
@ -552,7 +557,6 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
return projectSectionMapper.getSectionFlowList(projectId); return projectSectionMapper.getSectionFlowList(projectId);
} }
private List<ProjectSectionVO> selectEditSectionBySave(String projectId) { private List<ProjectSectionVO> selectEditSectionBySave(String projectId) {
//获取项目是否预审 //获取项目是否预审
boolean isReviewMethod = recordService.isReviewMethod(recordService.getById(projectId)); boolean isReviewMethod = recordService.isReviewMethod(recordService.getById(projectId));
@ -563,11 +567,13 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
//查询接口过滤已推送数据的标段信息 //查询接口过滤已推送数据的标段信息
List<String> sectionIds = sectionVOList.stream().map(ProjectSectionVO::getId).collect(Collectors.toList()); List<String> sectionIds = sectionVOList.stream().map(ProjectSectionVO::getId).collect(Collectors.toList());
BaseResponse<Map<String,Boolean>> baseResponse = rsmsApi.getToExceptionByBsId(sectionIds); if(!CollectionUtils.isEmpty(sectionIds)){
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess()); BaseResponse<Map<String,Boolean>> baseResponse = rsmsApi.getToExceptionByBsId(sectionIds);
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_SECTION_NOT_FIND.customValidName(baseResponse.getMessage(),!baseResponse.isSuccess());
Map<String,Boolean> pushResultMap = baseResponse.getData(); Map<String,Boolean> pushResultMap = baseResponse.getData();
sectionVOList = sectionVOList.stream().filter(n -> pushResultMap.get(n.getId())).collect(Collectors.toList()); sectionVOList = sectionVOList.stream().filter(n -> pushResultMap.get(n.getId())).collect(Collectors.toList());
}
return sectionVOList; return sectionVOList;
} }