项目列表查询修改 重评字典修改

This commit is contained in:
dxc
2021-04-20 08:24:57 +08:00
parent 1e7a4eb332
commit 6f788ef825
6 changed files with 56 additions and 19 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;
@ -154,9 +155,9 @@ public interface IProjectRecordService extends IBaseService<ProjectRecord>{
/** /**
* 获取标段信息进度比 * 获取标段信息进度比
* @param businessModule 标段环节 * @param sectionVO 标段环节
* @param vo 项目信息 * @param vo 项目信息
* @return 返回结果 * @return 返回结果
*/ */
BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO 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;
/** /**
* 查询条件拼接 * 查询条件拼接
@ -1028,6 +1032,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 +1043,18 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
} }
} }
//拼装归档状态 是否进行归档
List<String> archiveSectionIds = sectionVOList.stream().filter(n -> n.getBusinessModule() == ProjectCommonUtil.BUSINESS_MODULE_12).map(ProjectSection::getId).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(archiveSectionIds)){
BaseResponse<Map<String,Integer>> response = archiveApi.getArchiveStatusBySectionIds(archiveSectionIds);
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())));
}
//拼装查询报名人数 当前进度
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 +1065,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 +1074,15 @@ public class ProjectRecordServiceImpl extends BaseServiceImpl<ProjectRecordMappe
} }
@Override @Override
public BigDecimal getLinkPercentage(Integer businessModule, ProjectRecordVO vo){ public void getLinkPercentage(ProjectSectionVO sectionVO, ProjectRecordVO vo){
boolean isReviewMethod = this.isReviewMethod(vo); boolean isReviewMethod = this.isReviewMethod(vo);
BigDecimal businessModuleTotal = new BigDecimal(isReviewMethod ? 12 : 7); Integer businessModuleTotal = isReviewMethod ? 12 : 7;
if(businessModule > 1){ if(sectionVO.getBusinessModule() > 1){
businessModule = isReviewMethod ? businessModule : businessModule - 5; sectionVO.setCurrentLink(isReviewMethod ? sectionVO.getBusinessModule() : sectionVO.getBusinessModule() - 5);
}else{
sectionVO.setCurrentLink(sectionVO.getBusinessModule());
} }
BigDecimal module = new BigDecimal(businessModule); sectionVO.setLinkCount(businessModuleTotal);
return module.divide(businessModuleTotal,2,BigDecimal.ROUND_HALF_UP);
} }
} }

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;
@ -520,7 +521,7 @@ public class ProjectSectionServiceImpl extends BaseServiceImpl<ProjectSectionMap
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);
} }
return resultList; return resultList;
@ -552,7 +553,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 +563,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;
} }