From e5fe9083462ed6c692dea2da46932e50d2f8c52a Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 08 十二月 2023 12:08:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/views/modeling/LinkType.vue                                                              |    5 ++++-
 Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue                                                           |    9 ++++++---
 Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeALlCodeMapper.xml                           |    2 +-
 Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue                                                           |    5 ++++-
 Source/UBCS-WEB/src/views/modeling/Business.vue                                                              |    5 ++++-
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java |   23 +++++++++++++----------
 6 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index fb9fdec..775856c 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -144,7 +144,7 @@
         </el-dialog>
       </el-container>
     </el-container>
-    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
+    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type"
                   @refreshTable="initTreeOnLoad">
     </business-add>
   </el-container>
@@ -163,6 +163,7 @@
   name: "Business",
   data() {
     return {
+      type:"",
       //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙姸鎬�
       packageLifeBox: false,
       //鐗堟湰瑙勫垯鐘舵��
@@ -362,6 +363,7 @@
     businessAdd() {
       this.$refs.btmAdd.showSubmitDialog = true;
       this.$refs.btmAdd.btmType = {};
+      this.type = 'add';
       this.ifRefreshBtmAddRefresh();
     },
     businessEdit() {
@@ -372,6 +374,7 @@
       const json = JSON.stringify(this.obj);
       this.$refs.btmAdd.btmType = JSON.parse(json);
       this.$refs.btmAdd.showSubmitDialog = true;
+      this.type = 'edit'
       this.ifRefreshBtmAddRefresh();
     },
     ifRefreshBtmAddRefresh() {
diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index c2b4b6f..c662081 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -11,7 +11,7 @@
     <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"
              :rules="rules" @resetFields="resetForm" status-icon="true">
       <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true" prop="id">
-        <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="Object.keys(this.btmType).length !== 0 "></el-input>
+        <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="type !== 'add'"></el-input>
       </el-form-item>
       <el-form-item label="涓枃鍚嶇О" label-width="100px">
         <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
@@ -199,12 +199,15 @@
     },
     icons: {
       type: Array
+    },
+    type: {
+      type:String,
     }
   },
   watch: {
-    btmType: {
+    type: {
       handler(newval, oldval) {
-        // console.log('鐩戝惉', newval, oldval)
+        // console.log('鐩戝惉', newval)
       },
       deep: true,
       immediate: true
diff --git a/Source/UBCS-WEB/src/views/modeling/LinkType.vue b/Source/UBCS-WEB/src/views/modeling/LinkType.vue
index d28d2bc..e0f13fd 100644
--- a/Source/UBCS-WEB/src/views/modeling/LinkType.vue
+++ b/Source/UBCS-WEB/src/views/modeling/LinkType.vue
@@ -134,7 +134,7 @@
                 </el-main>
             </el-container>
         </el-container>
-        <link-type-add ref="linkAdd" :linkType="addOption.linkType" :domainOption="domainOptions" :icons="icons"
+        <link-type-add ref="linkAdd" :linkType="addOption.linkType" :domainOption="domainOptions" :icons="icons" :linkStatus="linkStatus"
             @refreshTable="initTreeOnLoad">
         </link-type-add>
 
@@ -154,6 +154,7 @@
     name: "LinkType",
     data() {
         return {
+            linkStatus:'',
             addOption: {
                 linkType: {
                     attributes:[]
@@ -252,6 +253,7 @@
         // 娣诲姞鎸夐挳鐐瑰嚮浜嬩欢
         linkTypeAdd() {
             this.$refs.linkAdd.linkType = {};
+            this.linkStatus = 'add';
             this.$refs.linkAdd.showSubmitDialog = true;
         },
         // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢
@@ -263,6 +265,7 @@
             var json = JSON.stringify(linktype);
             this.addOption.linkType = JSON.parse(json);
             this.$refs.linkAdd.linkType = this.addOption.linkType;
+            this.linkStatus = 'edit';
             this.$refs.linkAdd.showSubmitDialog = true;
         },
         // 浠庡凡鏈変腑鑾峰彇鎸夐挳鐐瑰嚮浜嬩欢
diff --git a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
index 8f1dce1..e502c19 100644
--- a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue
@@ -5,7 +5,7 @@
     <el-form ref="form" :model="linkType" :rules="rules" class="linkTypeForm" inline label-suffix=":"
              show-message="true" size="medium" status-icon="true" @resetFields="resetForm">
       <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" prop="id" required="true">
-        <el-input v-model="linkType.id" :disabled="this.linkType.hasOwnProperty('id')" :prefix-icon="icons.id" maxlength="15" show-word-limit
+        <el-input v-model="linkType.id" :disabled="linkStatus !== 'add'" :prefix-icon="icons.id" maxlength="15" show-word-limit
                   type="text"></el-input>
       </el-form-item>
       <el-form-item label="涓枃鍚嶇О" label-width="100px">
@@ -95,6 +95,9 @@
     },
     icons: {
       type: Array
+    },
+    linkStatus: {
+      type:String
     }
   },
   watch: {
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
index 32c2f3b..bd645df 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -708,28 +708,31 @@
 			QueryWrapper<CodeBasicSec> secWrapper = new QueryWrapper<>();
 			secWrapper.eq("PKCODERULE",codeAllCodeVO.getCodeRuleOid());
 			secWrapper.eq("SECTYPE","codeserialsec");
-			CodeBasicSec codeBasicSec = codeBasicSecMapper.selectOne(secWrapper);
+			List<CodeBasicSec> codeBasicSecs = codeBasicSecMapper.selectList(secWrapper);
+			if(codeBasicSecs.size() == 0 ){
+				throw new ServiceException("鏍规嵁鐮佸�糏D锛�" + codeAllCodeVO.getCodeRuleOid() + ",鐮佹绫诲瀷涓烘祦姘寸爜娈�(codeserialsec),鍦ㄥ熀纭�鐮佹涓湭鎵惧埌鐩稿叧鏁版嵁锛�");
+			}
 			QueryWrapper<CodeSerialValue> wrapper = new QueryWrapper<>();
 			wrapper.eq("codeRuleOid",codeAllCodeVO.getCodeRuleOid());
 			wrapper.eq("serialUnit",codeAllCodeVO.getSerialUnit());
-			wrapper.eq("codeSecOid",codeBasicSec.getOid());
-			CodeSerialValue codeSerialValue = codeSerialValueMapper.selectOne(wrapper);
-			if(codeSerialValue == null){
+			wrapper.eq("codeSecOid",codeBasicSecs.get(0).getOid());
+			List<CodeSerialValue> codeSerialValues = codeSerialValueMapper.selectList(wrapper);
+			if(codeSerialValues.size() == 0){
 				CodeSerialValue newSerialValue = new CodeSerialValue();
 				DefaultAttrAssimtUtil.addDefaultAttrAssimt(newSerialValue,"codeserialvalue");
 				newSerialValue.setCodeRuleOid(codeAllCodeVO.getCodeRuleOid());
-				newSerialValue.setCodeSecOid(codeBasicSec.getOid());
+				newSerialValue.setCodeSecOid(codeBasicSecs.get(0).getOid());
 				newSerialValue.setSerialUnit(codeAllCodeVO.getSerialUnit());
 				newSerialValue.setMaxSerial(codeAllCodeVO.getUnFillSerial());
 				newSerialValue.setLctid("defaultLC");
 				newSerialValue.setLcStatus("Exist");
 				codeSerialValueMapper.insert(newSerialValue);
 			}else{
-				codeSerialValue.setMaxSerial(codeAllCodeVO.getUnFillSerial());
-				codeSerialValue.setLastModifyTime(new Date());
-				codeSerialValue.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId()));
-				codeSerialValue.setTs(new Date());
-				codeSerialValueMapper.updateById(codeSerialValue);
+				codeSerialValues.get(0).setMaxSerial(codeAllCodeVO.getUnFillSerial());
+				codeSerialValues.get(0).setLastModifyTime(new Date());
+				codeSerialValues.get(0).setLastModifier(String.valueOf(AuthUtil.getUser().getUserId()));
+				codeSerialValues.get(0).setTs(new Date());
+				codeSerialValueMapper.updateById(codeSerialValues.get(0));
 			}
 		}
 		return R.success("鎿嶄綔鎴愬姛锛�");
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeALlCodeMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeALlCodeMapper.xml
index 1a108c6..bed4943 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeALlCodeMapper.xml
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeALlCodeMapper.xml
@@ -13,7 +13,7 @@
         select codeClassifyOid,
                codeRuleOid,
                serialUnit,
-               max(unFillSerial) unFillSerial
+               nvl(max(unFillSerial),0) unFillSerial
         from (select codeClassifyOid,
                      codeRuleOid,
                      serialUnit,

--
Gitblit v1.9.3