c5b9143d by 肖初晴

【DAOP-1.0】数据需求

【功能点】联调问题处理
1 parent 2818aed6
......@@ -121,7 +121,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
if (entity == null) {
throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME)));
}
return convertToVO(entity);
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(entity.getProcessCompanyGuid())).getData();
return convertToVO(entity,map);
}
/**
......@@ -313,7 +314,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
if(CollectionUtils.isEmpty(list)){
return null;
}
return convertToVO(list.get(0));
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(list.get(0).getProcessCompanyGuid())).getData();
return convertToVO(list.get(0),map);
}
@Override
......@@ -539,23 +541,13 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
* @return void
*/
private void afterQuery(PageListVO<MfDemand> pageList, PageListVO<DemandRSVO> rsPageList) {
if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
rsPageList.setRecords(convertToVO(pageList.getRecords()));
}
// 需要特殊处理数据时使用
if(CollectionUtils.isNotEmpty(pageList.getRecords())){
List<String> guids = pageList.getRecords().stream().map(MfDemand::getProcessCompanyGuid).collect(Collectors.toList());
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData();
List<DemandRSVO> results = new ArrayList<>();
for (MfDemand item : pageList.getRecords()){
DemandRSVO vo = convertToVO(item);
DemandUpdateStateVO voState = map.get(item.getProcessCompanyGuid());
if(voState != null){
vo.setResourceAcquisitionState(voState.getResourceAcquisitionState());
vo.setProductProcessingState(voState.getProductProcessingState());
vo.setProductDeliveryState(voState.getProductDeliveryState());
vo.setProductAcceptState(voState.getProductAcceptState());
}
DemandRSVO vo = convertToVO(item,map);
results.add(vo);
}
rsPageList.setRecords(results);
......@@ -579,7 +571,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
}
List<DemandRSVO> voList = new ArrayList<>(entityList.size());
for (MfDemand item : entityList) {
DemandRSVO vo = convertToVO(item);
DemandRSVO vo = convertToVO(item,null);
voList.add(vo);
}
return voList;
......@@ -592,10 +584,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
* @param entity
* @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO
*/
private DemandRSVO convertToVO(MfDemand entity) {
private DemandRSVO convertToVO(MfDemand entity,Map<String, DemandUpdateStateVO> map) {
DemandRSVO vo = csbrBeanUtil.convert(entity, DemandRSVO.class);
//流程数据处理
vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid()));
if(map != null){
DemandUpdateStateVO voState = map.get(entity.getProcessCompanyGuid());
if(voState != null){
vo.setResourceAcquisitionState(voState.getResourceAcquisitionState());
vo.setProductProcessingState(voState.getProductProcessingState());
vo.setProductDeliveryState(voState.getProductDeliveryState());
vo.setProductAcceptState(voState.getProductAcceptState());
}
}
return vo;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!