【DAOP-1.0】数据需求
【功能点】联调问题处理
Showing
1 changed file
with
16 additions
and
15 deletions
| ... | @@ -121,7 +121,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -121,7 +121,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | 
| 121 | if (entity == null) { | 121 | if (entity == null) { | 
| 122 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | 122 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | 
| 123 | } | 123 | } | 
| 124 | return convertToVO(entity); | 124 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(entity.getProcessCompanyGuid())).getData(); | 
| 125 | return convertToVO(entity,map); | ||
| 125 | } | 126 | } | 
| 126 | 127 | ||
| 127 | /** | 128 | /** | 
| ... | @@ -313,7 +314,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -313,7 +314,8 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | 
| 313 | if(CollectionUtils.isEmpty(list)){ | 314 | if(CollectionUtils.isEmpty(list)){ | 
| 314 | return null; | 315 | return null; | 
| 315 | } | 316 | } | 
| 316 | return convertToVO(list.get(0)); | 317 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(list.get(0).getProcessCompanyGuid())).getData(); | 
| 318 | return convertToVO(list.get(0),map); | ||
| 317 | } | 319 | } | 
| 318 | 320 | ||
| 319 | @Override | 321 | @Override | 
| ... | @@ -539,23 +541,13 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -539,23 +541,13 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | 
| 539 | * @return void | 541 | * @return void | 
| 540 | */ | 542 | */ | 
| 541 | private void afterQuery(PageListVO<MfDemand> pageList, PageListVO<DemandRSVO> rsPageList) { | 543 | private void afterQuery(PageListVO<MfDemand> pageList, PageListVO<DemandRSVO> rsPageList) { | 
| 542 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
| 543 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
| 544 | } | ||
| 545 | // 需要特殊处理数据时使用 | 544 | // 需要特殊处理数据时使用 | 
| 546 | if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | 545 | if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | 
| 547 | List<String> guids = pageList.getRecords().stream().map(MfDemand::getProcessCompanyGuid).collect(Collectors.toList()); | 546 | List<String> guids = pageList.getRecords().stream().map(MfDemand::getProcessCompanyGuid).collect(Collectors.toList()); | 
| 548 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); | 547 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); | 
| 549 | List<DemandRSVO> results = new ArrayList<>(); | 548 | List<DemandRSVO> results = new ArrayList<>(); | 
| 550 | for (MfDemand item : pageList.getRecords()){ | 549 | for (MfDemand item : pageList.getRecords()){ | 
| 551 | DemandRSVO vo = convertToVO(item); | 550 | DemandRSVO vo = convertToVO(item,map); | 
| 552 | DemandUpdateStateVO voState = map.get(item.getProcessCompanyGuid()); | ||
| 553 | if(voState != null){ | ||
| 554 | vo.setResourceAcquisitionState(voState.getResourceAcquisitionState()); | ||
| 555 | vo.setProductProcessingState(voState.getProductProcessingState()); | ||
| 556 | vo.setProductDeliveryState(voState.getProductDeliveryState()); | ||
| 557 | vo.setProductAcceptState(voState.getProductAcceptState()); | ||
| 558 | } | ||
| 559 | results.add(vo); | 551 | results.add(vo); | 
| 560 | } | 552 | } | 
| 561 | rsPageList.setRecords(results); | 553 | rsPageList.setRecords(results); | 
| ... | @@ -579,7 +571,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -579,7 +571,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | 
| 579 | } | 571 | } | 
| 580 | List<DemandRSVO> voList = new ArrayList<>(entityList.size()); | 572 | List<DemandRSVO> voList = new ArrayList<>(entityList.size()); | 
| 581 | for (MfDemand item : entityList) { | 573 | for (MfDemand item : entityList) { | 
| 582 | DemandRSVO vo = convertToVO(item); | 574 | DemandRSVO vo = convertToVO(item,null); | 
| 583 | voList.add(vo); | 575 | voList.add(vo); | 
| 584 | } | 576 | } | 
| 585 | return voList; | 577 | return voList; | 
| ... | @@ -592,10 +584,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -592,10 +584,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | 
| 592 | * @param entity | 584 | * @param entity | 
| 593 | * @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO | 585 | * @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO | 
| 594 | */ | 586 | */ | 
| 595 | private DemandRSVO convertToVO(MfDemand entity) { | 587 | private DemandRSVO convertToVO(MfDemand entity,Map<String, DemandUpdateStateVO> map) { | 
| 596 | DemandRSVO vo = csbrBeanUtil.convert(entity, DemandRSVO.class); | 588 | DemandRSVO vo = csbrBeanUtil.convert(entity, DemandRSVO.class); | 
| 597 | //流程数据处理 | 589 | //流程数据处理 | 
| 598 | vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid())); | 590 | vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid())); | 
| 591 | if(map != null){ | ||
| 592 | DemandUpdateStateVO voState = map.get(entity.getProcessCompanyGuid()); | ||
| 593 | if(voState != null){ | ||
| 594 | vo.setResourceAcquisitionState(voState.getResourceAcquisitionState()); | ||
| 595 | vo.setProductProcessingState(voState.getProductProcessingState()); | ||
| 596 | vo.setProductDeliveryState(voState.getProductDeliveryState()); | ||
| 597 | vo.setProductAcceptState(voState.getProductAcceptState()); | ||
| 598 | } | ||
| 599 | } | ||
| 599 | return vo; | 600 | return vo; | 
| 600 | } | 601 | } | 
| 601 | 602 | ... | ... | 
- 
Please register or sign in to post a comment
