From ded6e8d2312e139e8ce770c7f1d5830bf2db4af6 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 19 七月 2023 11:39:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
index ecb1dc6..eb7a13d 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -400,7 +400,6 @@
     public String addSaveCode(CodeOrderDTO orderDTO) throws Exception {
         VciBaseUtil.alertNotNull(orderDTO, "缂栫爜鐢宠鐩稿叧鐨勫睘鎬у拰鐮佹鐨勫唴瀹归兘涓虹┖", orderDTO.getCodeClassifyOid(), "涓婚搴撳垎绫荤殑涓婚敭",
                 orderDTO.getTemplateOid(), "妯℃澘鐨勪富閿�", orderDTO.getCodeRuleOid(), "缂栫爜瑙勫垯鐨勪富閿�");
-		VciSystemVarConstants.getSystemVarValueMap();
         CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
         CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid());
         CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid());
@@ -918,7 +917,7 @@
 
 //						baseModels.stream().forEach(model-> {
                         try {
-                            map = VciBaseUtil.convertBean2Map(cbo);
+                            map = VciBaseUtil.convertBean2Map(cbo,null);
                         } catch (Exception e) {
                             throw new VciBaseException("绫诲瀷杞崲閿欒锛�" + e.getMessage());
                         }
@@ -3254,11 +3253,19 @@
         if (!listR.isSuccess() || listR.getData().size() == 0) {
             throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
         }
-        //灏哹ean杞负map,mybatis缁熶竴澶勭悊
+		//鑾峰彇褰撳墠涓氬姟绫诲瀷鎵�鏈夊瓧娈电敤鏉ュ仛瀵规瘮
+		R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(btmType);
+		if (!allAttributeByBtmId.isSuccess() || allAttributeByBtmId.getData().getAttributes().size() == 0) {
+			throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲瀛楁淇℃伅锛岃妫�鏌ワ紒");
+		}
+		Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> {
+			return btmTypeAttributeVO.getId();
+		}).collect(Collectors.toSet());
+		//灏哹ean杞负map,mybatis缁熶竴澶勭悊
         List<Map<String, String>> maps = new ArrayList<>();
         baseModels.stream().forEach(model -> {
             try {
-                maps.add(VciBaseUtil.convertBean2Map(model));
+                maps.add(VciBaseUtil.convertBean2Map(model,existFild));
             } catch (Exception e) {
                 throw new VciBaseException("绫诲瀷杞崲閿欒锛�" + e.toString());
             }
@@ -3409,12 +3416,20 @@
         if (!listR.isSuccess() || listR.getData().size() == 0) {
             throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
         }
+		//鑾峰彇褰撳墠涓氬姟绫诲瀷鎵�鏈夊瓧娈电敤鏉ュ仛瀵规瘮
+		R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(btmType);
+		if (!allAttributeByBtmId.isSuccess() || allAttributeByBtmId.getData().getAttributes().size() == 0) {
+			throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲瀛楁淇℃伅锛岃妫�鏌ワ紒");
+		}
+		Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> {
+			return btmTypeAttributeVO.getId();
+		}).collect(Collectors.toSet());
         //灏哹ean杞负map,mybatis缁熶竴澶勭悊
         List<Map<String, String>> maps = new ArrayList<>();
 
         baseModels.stream().forEach(model -> {
             try {
-                maps.add(VciBaseUtil.convertBean2Map(model));
+                maps.add(VciBaseUtil.convertBean2Map(model,existFild));
             } catch (Exception e) {
                 throw new VciBaseException("绫诲瀷杞崲閿欒锛�" + e.getMessage());
             }

--
Gitblit v1.9.3