| | |
| | | return codeOrderSecDTOList; |
| | | } |
| | | |
| | | /*** |
| | | * 读取属性映射配置信息 |
| | | * @param systemId |
| | | * @param libray |
| | | * @param applyDatasVO |
| | | * @param codeClassifyTemplateAttrVOList |
| | | * @param dataObjectVO |
| | | * @throws Throwable |
| | | */ |
| | | public void getConfigDatas(String systemId,String libray, ApplyBZDatasVO applyDatasVO,List<CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOList,DataObjectVO dataObjectVO) throws Throwable { |
| | | |
| | | LinkedHashMap<String,LinkedHashMap<String,String>> dataKeyValueMap=new LinkedHashMap<>(); |
| | | //如果将数据转换成所需要的数据对象 |
| | | Map<String, String> attrMapConfigMap=new HashMap<>(); |
| | | Map<String, String> propMaps=new HashMap<>(); |
| | | try { |
| | | log.info("开始读取系统配置文件 start"); |
| | | Map<String, String> stringStringMap=attributeMapConfig.getSystem_attrmap(); |
| | | log.info("集成系统属性映射配置文件条目数-》"+stringStringMap.size()); |
| | | //stringStringMap.put("RLM","D:\\RLM.xml"); |
| | | if(!CollectionUtils.isEmpty(stringStringMap)) { |
| | | log.info("开始读取系统配置文件 start"); |
| | | Map<String, String> stringStringMap=attributeMapConfig.getSystem_attrmap(); |
| | | log.info("集成系统属性映射配置文件条目数-》"+stringStringMap.size()); |
| | | //stringStringMap.put("RLM","D:\\RLM.xml"); |
| | | if(!CollectionUtils.isEmpty(stringStringMap)) { |
| | | List<LibraryClsfDO> libraryClsfDOList=new ArrayList<>(); |
| | | try { |
| | | log.info("info:需要读取配置文件"); |
| | | LibraryDO libraryDO = gennerAttrMapUtil.getNewInstance().gennerAttrMapBySystem(systemId, stringStringMap); |
| | | List<LibraryClsfDO> libraryClsfDOList = libraryDO.getClsf(); |
| | | if(!CollectionUtils.isEmpty(libraryClsfDOList)) { |
| | | Map<String, List<ClsfAttrMappingDO>> libPropMaps = libraryClsfDOList.stream().collect(Collectors.toMap(LibraryClsfDO::getLibrary, LibraryClsfDO::getProp, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "从配置文件中找对应属性映射配置"); |
| | | String path=stringStringMap.get(systemId); |
| | | if (libPropMaps.containsKey(libray.toUpperCase(Locale.ROOT))) { |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息"); |
| | | List<ClsfAttrMappingDO> clsfAttrMappingDOList = libPropMaps.get(libray.toUpperCase(Locale.ROOT)); |
| | | propMaps = clsfAttrMappingDOList.stream().collect(Collectors.toMap(ClsfAttrMappingDO::getSourceKey, ClsfAttrMappingDO::getTargetKey, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息,属性映射条目数+" + clsfAttrMappingDOList.size()); |
| | | }else{ |
| | | throw new Throwable("根据系统标识【"+systemId+"】找到对应的配置文件:【"+path+"】,但未获取到对应的库【"+libray+"】属性映射信息配置"); |
| | | } |
| | | } |
| | | libraryClsfDOList = libraryDO.getClsf(); |
| | | } catch (Throwable e) { |
| | | objerrorCode = "1"; |
| | | e.printStackTrace(); |
| | | throw new Throwable("集成系统标识为:【" + systemId + "】,分类库为:【" + libray + "】的集成属性配置文件读取失败"); |
| | | } |
| | | log.info("根据参数:libray:-》"+libray+"从配置文件中找对应属性映射配置 end "); |
| | | }catch (Throwable e){ |
| | | objerrorCode="1"; |
| | | e.printStackTrace(); |
| | | throw new Throwable("集成系统标识为:【"+systemId+"】,分类库为:【"+libray+"】的集成属性配置文件读取失败"); |
| | | String path = stringStringMap.get(systemId); |
| | | if (!CollectionUtils.isEmpty(libraryClsfDOList)) { |
| | | Map<String, List<ClsfAttrMappingDO>> libPropMaps = libraryClsfDOList.stream().collect(Collectors.toMap(LibraryClsfDO::getLibrary, LibraryClsfDO::getProp, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "从配置文件中找对应属性映射配置"); |
| | | if (libPropMaps.containsKey(libray.toUpperCase(Locale.ROOT))) { |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息"); |
| | | List<ClsfAttrMappingDO> clsfAttrMappingDOList = libPropMaps.get(libray.toUpperCase(Locale.ROOT)); |
| | | propMaps = clsfAttrMappingDOList.stream().collect(Collectors.toMap(ClsfAttrMappingDO::getSourceKey, ClsfAttrMappingDO::getTargetKey, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息,属性映射条目数+" + clsfAttrMappingDOList.size()); |
| | | } else { |
| | | objerrorCode = "1"; |
| | | throw new Throwable("根据系统标识【" + systemId + "】找到对应的配置文件:【" + path + "】,但未获取到对应的库【" + libray + "】属性映射信息配置"); |
| | | } |
| | | }else{ |
| | | objerrorCode = "1"; |
| | | throw new Throwable("根据系统标识【" + systemId + "】找到对应的配置文件:【" + path + "】,但未获取到对应的库【" + libray + "】属性映射信息配置"); |
| | | } |
| | | }else{ |
| | | objerrorCode = "1"; |
| | | throw new Throwable("未获取到集成属性映射系统配置信息"); |
| | | } |
| | | log.info("根据参数:libray:-》"+libray+"从配置文件中找对应属性映射配置 end "); |
| | | LinkedList<String> rowNameList=new LinkedList<>(); |
| | | LinkedHashMap<String,Integer> filedIndexMap=new LinkedHashMap<>(); |
| | | //根据分类模板组织数据 |
| | |
| | | } |
| | | |
| | | /*** |
| | | * 根据属性映射转换编码所需字段 |
| | | * 读取属性映射配置信息 |
| | | * @param systemId |
| | | * @param libray |
| | | * @param applyDatasVO |
| | | * @param codeClassifyTemplateAttrVOList |
| | | * @param dataObjectVO |
| | | * @throws Throwable |
| | | */ |
| | | public void getConfigDatas(String systemId,String libray, ApplyDatasVO applyDatasVO,List<CodeClassifyTemplateAttrVO> codeClassifyTemplateAttrVOList,DataObjectVO dataObjectVO) throws Throwable { |
| | | |
| | |
| | | //如果将数据转换成所需要的数据对象 |
| | | Map<String, String> attrMapConfigMap=new HashMap<>(); |
| | | Map<String, String> propMaps=new HashMap<>(); |
| | | try { |
| | | log.info("开始读取系统配置文件 start"); |
| | | Map<String, String> stringStringMap=attributeMapConfig.getSystem_attrmap(); |
| | | log.info("集成系统属性映射配置文件条目数-》"+stringStringMap.size()); |
| | | //stringStringMap.put("RLM","D:\\RLM.xml"); |
| | | if(!CollectionUtils.isEmpty(stringStringMap)) { |
| | | log.info("开始读取系统配置文件 start"); |
| | | Map<String, String> stringStringMap=attributeMapConfig.getSystem_attrmap(); |
| | | log.info("集成系统属性映射配置文件条目数-》"+stringStringMap.size()); |
| | | //stringStringMap.put("RLM","D:\\RLM.xml"); |
| | | if(!CollectionUtils.isEmpty(stringStringMap)) { |
| | | List<LibraryClsfDO> libraryClsfDOList=new ArrayList<>(); |
| | | try { |
| | | log.info("info:需要读取配置文件"); |
| | | LibraryDO libraryDO = gennerAttrMapUtil.getNewInstance().gennerAttrMapBySystem(systemId, stringStringMap); |
| | | List<LibraryClsfDO> libraryClsfDOList = libraryDO.getClsf(); |
| | | if(!CollectionUtils.isEmpty(libraryClsfDOList)) { |
| | | Map<String, List<ClsfAttrMappingDO>> libPropMaps = libraryClsfDOList.stream().collect(Collectors.toMap(LibraryClsfDO::getLibrary, LibraryClsfDO::getProp, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "从配置文件中找对应属性映射配置"); |
| | | String path=stringStringMap.get(systemId); |
| | | if (libPropMaps.containsKey(libray.toUpperCase(Locale.ROOT))) { |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息"); |
| | | List<ClsfAttrMappingDO> clsfAttrMappingDOList = libPropMaps.get(libray.toUpperCase(Locale.ROOT)); |
| | | propMaps = clsfAttrMappingDOList.stream().collect(Collectors.toMap(ClsfAttrMappingDO::getSourceKey, ClsfAttrMappingDO::getTargetKey, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息,属性映射条目数+" + clsfAttrMappingDOList.size()); |
| | | }else{ |
| | | throw new Throwable("根据系统标识【"+systemId+"】找到对应的配置文件:【"+path+"】,但未获取到对应的库【"+libray+"】属性映射信息配置"); |
| | | } |
| | | } |
| | | libraryClsfDOList = libraryDO.getClsf(); |
| | | } catch (Throwable e) { |
| | | objerrorCode = "1"; |
| | | e.printStackTrace(); |
| | | throw new Throwable("集成系统标识为:【" + systemId + "】,分类库为:【" + libray + "】的集成属性配置文件读取失败"); |
| | | } |
| | | log.info("根据参数:libray:-》"+libray+"从配置文件中找对应属性映射配置 end "); |
| | | }catch (Throwable e){ |
| | | objerrorCode="1"; |
| | | e.printStackTrace(); |
| | | throw new Throwable("集成系统标识为:【"+systemId+"】,分类库为:【"+libray+"】的集成属性配置文件读取失败"); |
| | | String path = stringStringMap.get(systemId); |
| | | if (!CollectionUtils.isEmpty(libraryClsfDOList)) { |
| | | Map<String, List<ClsfAttrMappingDO>> libPropMaps = libraryClsfDOList.stream().collect(Collectors.toMap(LibraryClsfDO::getLibrary, LibraryClsfDO::getProp, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "从配置文件中找对应属性映射配置"); |
| | | if (libPropMaps.containsKey(libray.toUpperCase(Locale.ROOT))) { |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息"); |
| | | List<ClsfAttrMappingDO> clsfAttrMappingDOList = libPropMaps.get(libray.toUpperCase(Locale.ROOT)); |
| | | propMaps = clsfAttrMappingDOList.stream().collect(Collectors.toMap(ClsfAttrMappingDO::getSourceKey, ClsfAttrMappingDO::getTargetKey, (key1, key2) -> key2)); |
| | | log.info("根据参数:libray:-》" + libray + "匹配到相应的属性映射信息,属性映射条目数+" + clsfAttrMappingDOList.size()); |
| | | } else { |
| | | objerrorCode = "1"; |
| | | throw new Throwable("根据系统标识【" + systemId + "】找到对应的配置文件:【" + path + "】,但未获取到对应的库【" + libray + "】属性映射信息配置"); |
| | | } |
| | | }else{ |
| | | objerrorCode = "1"; |
| | | throw new Throwable("根据系统标识【" + systemId + "】找到对应的配置文件:【" + path + "】,但未获取到对应的库【" + libray + "】属性映射信息配置"); |
| | | } |
| | | }else{ |
| | | objerrorCode = "1"; |
| | | throw new Throwable("未获取到集成属性映射系统配置信息"); |
| | | } |
| | | log.info("根据参数:libray:-》"+libray+"从配置文件中找对应属性映射配置 end "); |
| | | LinkedList<String> rowNameList=new LinkedList<>(); |
| | | LinkedHashMap<String,Integer> filedIndexMap=new LinkedHashMap<>(); |
| | | //根据分类模板组织数据 |