dbc107bc by 肖初晴

【DAOP-1.0】数据需求

【功能点】联调问题处理
1 parent c5b9143d
......@@ -121,8 +121,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
if (entity == null) {
throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME)));
}
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(entity.getProcessCompanyGuid())).getData();
return convertToVO(entity,map);
return convertToVO(entity,getStateMap(Collections.singletonList(entity.getProcessCompanyGuid())));
}
private Map<String, DemandUpdateStateVO> getStateMap(List<String> guids){
if(CollectionUtils.isEmpty(guids)){
return null;
}
guids = guids.stream().filter(Objects::nonNull).collect(Collectors.toList());
if(CollectionUtils.isEmpty(guids)){
return null;
}
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData();
return map;
}
/**
......@@ -314,8 +325,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
if(CollectionUtils.isEmpty(list)){
return null;
}
Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(Collections.singletonList(list.get(0).getProcessCompanyGuid())).getData();
return convertToVO(list.get(0),map);
return convertToVO(list.get(0),getStateMap(Collections.singletonList(list.get(0).getProcessCompanyGuid())));
}
@Override
......@@ -544,10 +554,9 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
// 需要特殊处理数据时使用
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,map);
DemandRSVO vo = convertToVO(item,getStateMap(guids));
results.add(vo);
}
rsPageList.setRecords(results);
......@@ -555,27 +564,6 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
}
//region 辅助操作
/**
* 数据需求实体数据转换为视图对象数据(多个)
* @author xcq
* @date 2024-12-31 18:46
* @param entityList 实体数据列表
* @return java.util.List<com.csbr.qingcloud.portal.domain.vo.DemandRSVO> 视图对象列表
*/
private List<DemandRSVO> convertToVO(List<MfDemand> entityList) {
if (CollectionUtils.isEmpty(entityList)) {
// W00012 = {0}:参数[{1}]不能为空!
throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012",
"实体数据转换为视图对象实体数据", "实体数据"));
}
List<DemandRSVO> voList = new ArrayList<>(entityList.size());
for (MfDemand item : entityList) {
DemandRSVO vo = convertToVO(item,null);
voList.add(vo);
}
return voList;
}
/**
* 数据需求实体数据转换为视图对象数据
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!