From 25da36be2318c1247592dce7d499d0b985c80fe0 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 03 十二月 2023 23:07:03 +0800
Subject: [PATCH] 历史数据导入时,赋默认值报空指针异常bug修复

---
 Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowModelController.java   |    4 --
 Source/UBCS-WEB/src/views/code/code.vue                                                                     |   49 ++++++++++++------------
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java       |    9 ++--
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java   |    4 +-
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java |    2 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java      |    2 
 Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml                         |    6 ---
 7 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index 4b0e705..9455958 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -2779,12 +2779,11 @@
       }
       //console.log(this.form);
       //涓篺orm缁戝畾鍊�
-      this.changeSectypeFormItems(condition == "add" ? null : row);
+      this.changeSectypeFormItems(condition == "add" ? null:row);
       this.addBasicCodeSettingBox = true;
     },
     /** 鏂板鍩虹鐮佹*/
     async saveOrEditBasicCode() {
-      this.isLoadingSecCodeAddBtn = true;
       if (
         this.selectionList[0].oid == null ||
         this.selectionList[0].oid == ""
@@ -2792,26 +2791,28 @@
         this.$message.warning("缂哄け蹇呰鍙傛暟锛岃閲嶆柊閫夋嫨缂栫爜瑙勫垯鍚庡啀璇�!");
         return;
       }
+      if (!this.checkForm()) {
+        return;
+      }
+      this.isLoadingSecCodeAddBtn = true;
       this.form.pkCodeRule = this.selectionList[0].oid;
       if (this.form.oid == "" || this.form.oid == null) {
-        if (this.checkForm()) {
-          await addSave(this.form).then(
-            () => {
-              this.$message({
-                type: "success",
-                message: "鎿嶄綔鎴愬姛!",
-              });
-              console.log(this.form)
-              // 鍏抽棴瀵硅瘽妗�
-              this.addBasicCodeSettingBox = false;
-              // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
-              this.loadBasic(this.selectionList[0]);
-            },
-            (error) => {
-              window.console.log(error);
-            }
-          );
-        }
+        await addSave(this.form).then(
+          () => {
+            this.$message({
+              type: "success",
+              message: "鎿嶄綔鎴愬姛!",
+            });
+            console.log(this.form)
+            // 鍏抽棴瀵硅瘽妗�
+            this.addBasicCodeSettingBox = false;
+            // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
+            this.loadBasic(this.selectionList[0]);
+          },
+          (error) => {
+            window.console.log(error);
+          }
+        );
       } else {
         // 鍙兘鍙傜収寮曠敤鐨勪笟鍔$被鍨嬩細鍙戠敓鏀瑰彉鎵�浠ヨ繖鍎跨洿鎺ュreferConfig鐨刯son杩涜鏀瑰彉
         if (
@@ -2825,7 +2826,7 @@
           // let referValueInfo = JSON.parse(this.form.referValueInfo);
           // referValueInfo.referType = this.form.referBtmId;
         }
-        let oldBasicSec = this.selectionBasicList.at(-1);
+        let oldBasicSec = this.selectionBasicList.slice(-1)[0];
         let secType = this.form.secType;
         Vue.set(this.form, 'isClearValue', false);
         if ((oldBasicSec.secType == "codefixedsec" || oldBasicSec.secType === "codeclassifysec") && oldBasicSec.secType != secType) {
@@ -3066,7 +3067,7 @@
       if (!this.tipsMessage(this.selectionBasicList)) {
         return;
       }
-      if (this.selectionList.at(-1).lcStatus != "Editing") {
+      if (this.selectionList.slice(-1)[0].lcStatus != "Editing") {
         this.$message.warning('缂栫爜瑙勫垯鐘舵�佷笉鏄�"缂栬緫涓�"锛屼笉鍏佽鍒犻櫎鐮佹!');
         return;
       }
@@ -3212,7 +3213,7 @@
     },
     /** 鍩虹鐮佹鍒锋柊鏃舵煡璇�*/
     refreshChangeBasicSec() {
-      this.loadBasic(this.selectionList.at(-1));
+      this.loadBasic(this.selectionList.slice(-1)[0]);
     },
     /** 鎿嶄綔鍩虹鐮佹涓悳绱㈡竻绌虹瓑鎸夐挳鐨勬樉绀�/闅愯棌*/
     hideBasicTable(hideBoolean) {
@@ -3288,7 +3289,7 @@
     },
     /** 鐮佹绫诲瀷鏀瑰彉鏃讹紝澧炲姞瀵瑰簲鐨刦orm琛ㄥ崟涓殑灞炴��*/
     changeSectypeFormItems(row) {
-      console.log(row)
+      //console.log(row)
       if (
         func.isEmpty(this.enumParam.secTypeList) ||
         this.enumParam.secTypeList.length == 0
diff --git a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowModelController.java b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowModelController.java
index 2070d62..1f416c8 100644
--- a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowModelController.java
+++ b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowModelController.java
@@ -18,19 +18,15 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.vci.ubcs.flow.core.utils.TaskUtil;
 import com.vci.ubcs.flow.engine.entity.FlowModel;
 import com.vci.ubcs.flow.engine.service.FlowEngineService;
-import com.vci.ubcs.flow.engine.service.FlowTaskUserService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
-import org.springblade.core.launch.constant.FlowConstant;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tenant.annotation.NonDS;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java
index 7dec639..9b44d22 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java
@@ -132,7 +132,7 @@
             dtoList.add(codeFixedValueDTO);
         }
         String codefixedsecoid = (String) param.get("codeFixedSecOid");
-        VciBaseUtil.alertNotNull(dtoList,"鐮佸�煎璞¢泦鍚�",codefixedsecoid,"鍥哄畾鐮佹鐨勪富閿�");
+        VciBaseUtil.alertNotNull(codefixedsecoid,"鍥哄畾鐮佹鐨勪富閿�");
         if (CollectionUtils.isEmpty(dtoList)){
             return R.status(codeFixedValueService.batchDeleteBySecOid(codefixedsecoid));
         }
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
index f456e51..cfbda50 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
@@ -312,7 +312,7 @@
 			s = engineService.addSaveCode(orderDTO);
 			saveLogUtil.operateLog("缂栫爜鐢宠",false,orderDTO.toString());
 		}catch (Exception e){
-			saveLogUtil.operateLog("缂栫爜鐢宠",true,e.getMessage());
+			saveLogUtil.operateLog("缂栫爜鐢宠",true,e.toString());
 			throw e;
 		}
 		return R.success(s);
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 094677d..2ddc23a 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
@@ -465,7 +465,7 @@
 			);
 		}catch (Exception e){
 			// 鎻掑叆鏇存敼鏃ュ織璁板綍
-			saveLogUtil.operateLog(CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()),true,e.getMessage());
+			saveLogUtil.operateLog(CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()),true,e.toString());
 			throw e;
 		}
     }
@@ -3113,7 +3113,7 @@
 			saveLogUtil.operateLog("鏁版嵁鏇存敼",false, StringUtil.format("{}\n淇敼涓�:\n{}",JSON.toJSONString(Collections.singletonList(oldCbo)),JSON.toJSONString(Collections.singletonList(cbo))));
 		} catch (Exception vciError) {
 			// 璁板綍鏁版嵁鏇存敼鎶ラ敊鏃剁殑鏃ュ織
-			saveLogUtil.operateLog("鏁版嵁鏇存敼",true,vciError.getMessage());
+			saveLogUtil.operateLog("鏁版嵁鏇存敼",true,vciError.toString());
 			throw new VciBaseException("鏁版嵁鏇存敼淇濆瓨鍑洪敊浜�", new String[0], vciError);
 		}
 
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
index 99278b3..cb4fdaf 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -843,7 +843,7 @@
 				}
 				// 鍗曟瀵煎叆鏁伴噺闄愬埗
 				if(sheetDataSetList.get(i).getRowData().size() > IMPORT_DATA_LIMIT){
-					throw new ServiceException("涓轰簡淇濊瘉绯荤粺鐨勭ǔ瀹氭�э紝璇蜂竴娆′笉瑕佸鍏ヨ秴杩�"+IMPORT_DATA_LIMIT+"鏉$殑鏁版嵁");
+					throw new ServiceException(StringUtil.format("涓轰簡淇濊瘉绯荤粺鐨勭ǔ瀹氭�э紝璇蜂竴娆′笉瑕佸鍏ヨ秴杩噞}鏉$殑鏁版嵁",IMPORT_DATA_LIMIT));
 				}
 				//鍘嗗彶瀵煎叆鐨勬椂鍊欎笉澶勭悊缂栫爜
 				//----閫昏緫鍐呭----
@@ -1132,7 +1132,7 @@
 			if(StringUtils.isNotBlank(excelFileName)) {
 				codeImProtRusultVO.setFilePath(excelFileName);
 				codeImProtRusultVO.setFileOid("");
-				saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true, StringUtil.format("閿欒淇℃伅锛歿}",JSON.toJSONString(shetNameMap)) );
+				saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true, StringUtil.format("閿欒淇℃伅锛歿}",JSON.toJSONString(shetNameMap)));
 			}else{
 				saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",false, StringUtil.format("瀵煎叆鍒板垎绫粄}涓紝瀵煎叆鎴愬姛鎬绘暟涓猴細{}", JSON.toJSONString(classifyFullInfo),importCount.get(0)));
 			}
@@ -1141,7 +1141,7 @@
 			}
 			return codeImProtRusultVO;
 		}catch (Exception e){
-			saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true,e.getMessage());
+			saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true,e.toString());
 			throw e;
 		}
 	}
@@ -1456,7 +1456,7 @@
 			}
 			saveLogUtil.operateLog("鎵归噺鐢宠缂栫爜",false, StringUtil.format("鎵归噺瀵煎叆鐢宠鎴愬姛鍏眥}鏉℃暟鎹紝鐢熸垚鐨勭爜鍊煎涓嬨�恵}銆�",codeList.size(),codeList));
 		}catch (Exception e){
-			saveLogUtil.operateLog("鎵归噺鐢宠缂栫爜",true,e.getMessage());
+			saveLogUtil.operateLog("鎵归噺鐢宠缂栫爜",true,e.toString());
 			throw e;
 		}
 		return uuid;
@@ -3861,6 +3861,7 @@
 						} else {
 							Map<String, String> classifyDataMap = VciBaseUtil.objectToMapString(classifyVO);
 							String value = classifyDataMap.getOrDefault(attrVO.getClassifyInvokeAttr(), "");
+							log.error("================================褰撳墠鍒嗙被娉ㄥ叆鐨剉alue鍊间负锛�==========================",value);
 							cbo.setAttributeValue(attrId, value);
 						}
 					} catch (Throwable e) {
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
index dd22b32..049f925 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -559,12 +559,6 @@
             connect by prior codeclassify0.PARENTCODECLASSIFYOID = codeclassify0.oid
     </select>
 
-    <select id="selectStartWithCurrentOid" resultMap="plCodeClassifyResultMap">
-        select * from <include refid="tableName"/>
-                          start with oid = #{oid}
-        connect by prior oid = parentcodeclassifyoid;
-    </select>
-
     <update id="batchUpdateLcStatus" parameterType="java.util.List">
         BEGIN
         <foreach collection="records" item="item" index="index" separator=";">

--
Gitblit v1.9.3