xiejun
2025-01-22 d9183aa80ae17d36b79dda48c6b1d7fa22a80ee3
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeMdmInfaceImpl.java
@@ -327,7 +327,15 @@
               String fixedField=fixedFieldMap.getOrDefault("dr","");
               dr = masterData.getOrDefault(fixedField, "").toString();
            }
            object.setCode(masterData.getOrDefault(currentClassifyConfig.get().getSourceCodeKey(),"").toString());//编码
            List<String> sourceCodeKeyList=VciBaseUtil.str2List(currentClassifyConfig.get().getSourceCodeKey());
            //object.setCode(masterData.getOrDefault(currentClassifyConfig.get().getSourceCodeKey(),"").toString());//编码
            if(!CollectionUtils.isEmpty(sourceCodeKeyList)) {
               sourceCodeKeyList.stream().forEach(codekey -> {
                  if (StringUtils.isNotBlank(masterData.getOrDefault(codekey, "").toString())) {
                     object.setCode(masterData.getOrDefault(codekey, "").toString());//编码
                  }
               });
            }
            object.setProp(proppertyVOList);
            if (dr.equals(1)) {
@@ -342,6 +350,9 @@
            codeList.add(object.getCode());
         });
         if(CollectionUtils.isEmpty(codeList)){
            throw  new Throwable("检查配置文件:【sourceCodeKey】,唯一标识字段是否正确");
         }
         String targetCodeKey=currentClassifyConfig.get().getTargetCodeKey();
         StringBuffer sb = new StringBuffer();
         sb.append(" select * from ");
@@ -358,7 +369,7 @@
         ApplyDatasVO editDatasVO = new ApplyDatasVO();
         if (!CollectionUtils.isEmpty(cboList)) {
            //根据MDM编码去判断数据是否重复.
            Map<String, ClientBusinessObject> oldpplyDataVOMap = cboList.stream().filter(data -> data != null && StringUtils.isNotBlank(data.getAttributeValue(targetCodeKey))).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue(targetCodeKey).toLowerCase(Locale.ROOT), t -> t));
            Map<String, ClientBusinessObject> oldpplyDataVOMap = cboList.stream().filter(data -> data != null && StringUtils.isNotBlank(data.getAttributeValue(targetCodeKey))).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue(targetCodeKey), t -> t));
            //数据库不存在的
            List<ApplyDataVO> applyApplyDataVOList = applyDataVOList.stream().filter(cbo -> {
               String code = cbo.getCode();
@@ -369,6 +380,8 @@
            List<ApplyDataVO> editApplyDataVOList = applyDataVOList.stream().filter(cbo -> {
               String code = cbo.getCode();
               if (oldpplyDataVOMap.containsKey(code)) {
                  ClientBusinessObject object=   oldpplyDataVOMap.get(code);
                  cbo.setCode(object.getId());
                  cbo.setOperate("update");
               }
               return oldpplyDataVOMap.containsKey(code);
@@ -483,7 +496,7 @@
                  mesg="集成系统:【"+systemCode+"】申请编码失败:" + e.getMessage();
                  mesg = e.getMessage();
                  e.printStackTrace();
                  throw new ServiceException(e.getMessage());
               //   throw new ServiceException(e.getMessage());
               } finally {
                  XMLResultDataObjectDetailDO x = new XMLResultDataObjectDetailDO();
                  x.setId(rowData.getOid());
@@ -700,6 +713,7 @@
                     String dataValue = sourceKeyValueMap.get(sourceKey);
                     if (attrMapConfigMap.containsKey(sourceKey)) {
                        String targetKey = attrMapConfigMap.get(sourceKey);
                        log.info("xxxxx属性映射值:sourceKey【"+sourceKey+"】——》+targetKey---》"+targetKey+":"+dataValue);
                        keyValueMap.put(targetKey, StringUtils.isBlank(dataValue)?"":dataValue);
                     }
                  });