【DAOP-1.0】数据需求
【功能点】联调问题处理
Showing
1 changed file
with
15 additions
and
27 deletions
... | @@ -121,8 +121,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -121,8 +121,19 @@ 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 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(entity.getProcessCompanyGuid())).getData(); | 124 | return convertToVO(entity,getStateMap(Collections.singletonList(entity.getProcessCompanyGuid()))); |
125 | return convertToVO(entity,map); | 125 | } |
126 | |||
127 | private Map<String, DemandUpdateStateVO> getStateMap(List<String> guids){ | ||
128 | if(CollectionUtils.isEmpty(guids)){ | ||
129 | return null; | ||
130 | } | ||
131 | guids = guids.stream().filter(Objects::nonNull).collect(Collectors.toList()); | ||
132 | if(CollectionUtils.isEmpty(guids)){ | ||
133 | return null; | ||
134 | } | ||
135 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); | ||
136 | return map; | ||
126 | } | 137 | } |
127 | 138 | ||
128 | /** | 139 | /** |
... | @@ -314,8 +325,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -314,8 +325,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
314 | if(CollectionUtils.isEmpty(list)){ | 325 | if(CollectionUtils.isEmpty(list)){ |
315 | return null; | 326 | return null; |
316 | } | 327 | } |
317 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(list.get(0).getProcessCompanyGuid())).getData(); | 328 | return convertToVO(list.get(0),getStateMap(Collections.singletonList(list.get(0).getProcessCompanyGuid()))); |
318 | return convertToVO(list.get(0),map); | ||
319 | } | 329 | } |
320 | 330 | ||
321 | @Override | 331 | @Override |
... | @@ -544,10 +554,9 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -544,10 +554,9 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
544 | // 需要特殊处理数据时使用 | 554 | // 需要特殊处理数据时使用 |
545 | if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | 555 | if(CollectionUtils.isNotEmpty(pageList.getRecords())){ |
546 | List<String> guids = pageList.getRecords().stream().map(MfDemand::getProcessCompanyGuid).collect(Collectors.toList()); | 556 | List<String> guids = pageList.getRecords().stream().map(MfDemand::getProcessCompanyGuid).collect(Collectors.toList()); |
547 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); | ||
548 | List<DemandRSVO> results = new ArrayList<>(); | 557 | List<DemandRSVO> results = new ArrayList<>(); |
549 | for (MfDemand item : pageList.getRecords()){ | 558 | for (MfDemand item : pageList.getRecords()){ |
550 | DemandRSVO vo = convertToVO(item,map); | 559 | DemandRSVO vo = convertToVO(item,getStateMap(guids)); |
551 | results.add(vo); | 560 | results.add(vo); |
552 | } | 561 | } |
553 | rsPageList.setRecords(results); | 562 | rsPageList.setRecords(results); |
... | @@ -555,27 +564,6 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -555,27 +564,6 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
555 | } | 564 | } |
556 | 565 | ||
557 | //region 辅助操作 | 566 | //region 辅助操作 |
558 | |||
559 | /** | ||
560 | * 数据需求实体数据转换为视图对象数据(多个) | ||
561 | * @author xcq | ||
562 | * @date 2024-12-31 18:46 | ||
563 | * @param entityList 实体数据列表 | ||
564 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.DemandRSVO> 视图对象列表 | ||
565 | */ | ||
566 | private List<DemandRSVO> convertToVO(List<MfDemand> entityList) { | ||
567 | if (CollectionUtils.isEmpty(entityList)) { | ||
568 | // W00012 = {0}:参数[{1}]不能为空! | ||
569 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
570 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
571 | } | ||
572 | List<DemandRSVO> voList = new ArrayList<>(entityList.size()); | ||
573 | for (MfDemand item : entityList) { | ||
574 | DemandRSVO vo = convertToVO(item,null); | ||
575 | voList.add(vo); | ||
576 | } | ||
577 | return voList; | ||
578 | } | ||
579 | 567 | ||
580 | /** | 568 | /** |
581 | * 数据需求实体数据转换为视图对象数据 | 569 | * 数据需求实体数据转换为视图对象数据 | ... | ... |
-
Please register or sign in to post a comment