Browse Source

【居民信息导入】修复:兼容cascader空间的bug

dev
wangxianzhang 3 years ago
parent
commit
ad3d556678
  1. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -1405,14 +1405,34 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
* 支部列表选项
* @return
*/
private List<OptionResultDTO> listBranchOptions() {
public List<OptionResultDTO> listBranchOptions() {
String msg = "查询支部列表失败";
List<OptionResultDTO> branchList = getResultDataOrThrowsException(partyMemberOpenFeignClient.branchlist(),
ServiceConstant.RESI_PARTYMEMBER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
//结果平铺展开
Map<String, OptionResultDTO> resultMap = new HashMap<>();
branchList.forEach(option-> option.getCurrenNodeAllChild(option,resultMap));
return branchList;
ArrayList<OptionResultDTO> optionResultDTOS = new ArrayList<>();
convertCascader2OptionResultList4Import(branchList, optionResultDTOS);
return optionResultDTOS;
}
/**
* 居民信息导入专用递归将cascader控件结果集转化为列表结果集
* @param sourceData 从哪个对象中取数据
* @param targetData 将数据存储到这个对象中
* @return
*/
private void convertCascader2OptionResultList4Import(List<OptionResultDTO> sourceData,List<OptionResultDTO> targetData) {
if (CollectionUtils.isEmpty(sourceData)) {
return;
}
for (OptionResultDTO item : sourceData) {
OptionResultDTO option = new OptionResultDTO();
option.setLabel(item.getLabel());
option.setValue(item.getValue());
targetData.add(option);
convertCascader2OptionResultList4Import(item.getChildren(), targetData);
}
}
@Override

Loading…
Cancel
Save