From b4d0d9b1d58bc45b9b7f249fe6b3701e8db6c35f Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 26 一月 2024 16:03:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/SearchDataSyncForERPScheduling.java |    8 
 Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue                                                       |   43 +
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java   |  186 ++++++-
 Source/UBCS-WEB/src/api/GetItem.js                                                                                |    9 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/NonWebRequestAttributes.java        |   52 ++
 Source/UBCS-WEB/src/api/omd/btmType.js                                                                            |    2 
 Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue                                                           |   70 +-
 Source/UBCS-WEB/src/views/modeling/BusinessEdit.vue                                                               |  830 +++++++++++++++++++++++++++++++
 Source/UBCS-WEB/src/views/modeling/original.vue                                                                   |  225 +++++---
 Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue                                                                |   25 
 Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue                                                       |   33 
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue                                                       |    2 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/DockingManagementController.java    |   19 
 Source/UBCS-WEB/src/views/modeling/Business.vue                                                                   |   42 -
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeDuckingSyncService.java           |    2 
 Source/UBCS-WEB/src/main.js                                                                                       |    2 
 16 files changed, 1,338 insertions(+), 212 deletions(-)

diff --git a/Source/UBCS-WEB/src/api/GetItem.js b/Source/UBCS-WEB/src/api/GetItem.js
index a0cc5fa..824248b 100644
--- a/Source/UBCS-WEB/src/api/GetItem.js
+++ b/Source/UBCS-WEB/src/api/GetItem.js
@@ -136,3 +136,12 @@
     responseType: 'blob'
   })
 }
+
+//鎵嬪姩鍚屾
+export const syncSearch = (params) => {
+  return request({
+    url: 'ubcs-code/dockingManagement/searchItemDataForERP',
+    method: 'get',
+    params
+  })
+}
diff --git a/Source/UBCS-WEB/src/api/omd/btmType.js b/Source/UBCS-WEB/src/api/omd/btmType.js
index 11938d0..d0e827d 100644
--- a/Source/UBCS-WEB/src/api/omd/btmType.js
+++ b/Source/UBCS-WEB/src/api/omd/btmType.js
@@ -68,4 +68,4 @@
             ...params
         }
     })
-}
\ No newline at end of file
+}
diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
index 44bc9d7..54b5ad0 100644
--- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
+++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -164,6 +164,21 @@
                            @current-change="handleCurrentChange">
             </el-pagination>
           </div>
+          <el-dialog title="鎵嬪姩鍚屾" :visible.sync="syncDialogBox"append-to-body @close="syncClose" top="200px">
+            <p style="display: inline-block">鏈�鍚庢洿鏂版椂闂达細</p>
+            <el-date-picker
+              style="width: 300px"
+              v-model="SyncValue"
+              type="date"
+              placeholder="閫夋嫨鏃ユ湡"
+              format="yyyy 骞� MM 鏈� dd 鏃� HH 鏃� mm 鍒� ss 绉�"
+              value-format="yyyy-MM-dd HH:mm:ss">
+            </el-date-picker>
+            <div slot="footer" class="dialog-footer">
+              <el-button @click="syncClose">鍙� 娑�</el-button>
+              <el-button type="primary" @click="submitSync">纭� 瀹�</el-button>
+            </div>
+          </el-dialog>
         </div>
       </div>
       <div class="bottom">
@@ -188,7 +203,8 @@
   applyGroupCode,
   receiveEditApply,
   applySaveCode,
-  exportGroupCodeExcel
+  exportGroupCodeExcel,
+  syncSearch
 } from "@/api/GetItem";
 import {processTS, changeStatus} from "@/api/template/setPersonnel"
 import {listCodeAttributeByClassId} from "@/api/integration/integration.js";
@@ -266,6 +282,9 @@
   },
   data() {
     return {
+      //鎵嬪姩鍚屾model
+      SyncValue:'',
+      syncDialogBox:false,
       isTimeStatus: false,
       isTimeName: '',
       dateValue: "",
@@ -587,8 +606,30 @@
         if (uniqueFlag === 'excelGroupCode') return this.excelGroupCode()
         //闆嗗洟鐮佸鍏�
         if (uniqueFlag === 'importGroupCode') return this.importGroupCode("groupCode")
+        //鎵嬪姩鍚屾
+        if (uniqueFlag === 'manualSyncing') return this.manualSyncing("groupCode")
       });
     },
+    //鎵嬪姩鍚屾
+    manualSyncing(){
+      this.syncDialogBox = true;
+    },
+    //鎵嬪姩鍚屾鍏抽棴
+    syncClose(){
+      this.syncDialogBox = false;
+    },
+    //鎵嬪姩鍚屾纭畾
+    submitSync(){
+      if(this.SyncValue){
+        syncSearch({enDate:this.SyncValue}).then(res=>{
+          this.$message.success('鍚屾鎴愬姛锛�')
+          this.syncDialogBox = false;
+        })
+      }else {
+        this.$message.warning('璇烽�夋嫨鏈�鍚庢洿鏂版椂闂达紒')
+      }
+    },
+    //闆嗗洟鐮佸鍏�
     importGroupCode(type) {
       this.batchImportData.visible = true
       this.batchImportData.type = type
diff --git a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
index 5a8e927..9ee7e77 100644
--- a/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -136,7 +136,9 @@
   },
   computed: {},
   mounted() {},
-  created() {},
+  created() {
+    this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1;
+  },
   watch: {
     // 鐩戝惉鐖剁粍浠朵紶鐨勭獥鍙f樉绀洪殣钘忕殑鍊�
     visible() {
@@ -165,24 +167,26 @@
                 Object.keys(this.classifyAuthData[index]).forEach((key) => {
                   this.$set(this.classifyAuthData[index].authButton,item.code,true);
                 });
+
+                //娣诲姞 鈥滄煡鐪嬪叏閮ㄧ鐢ㄦ潯浠垛��
+                if (item.code === "classify_view") {
+                  this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
+                  console.log(this.classifyAuthData[index].authButton.allDisabled)
+                }
+
               } else {
                 Object.keys(this.classifyAuthData[index]).forEach((key) => {
                   this.$set(this.classifyAuthData[index].authButton,item.code,false);
                 });
+
+                if(item.code === "classify_view"){
+                  this.classifyAuthData[index].authButton.allDisabled = false;
+                }
               }
             }
           });
         });
-        //娣诲姞 鈥滄煡鐪嬪叏閮ㄧ鐢ㄦ潯浠垛��
-        if (this.classifyAuthData) {
-          this.classifyAuthData.forEach((classkey, classIndex) => {
-            if (classkey.authButton.classify_view) {
-              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
-            } else {
-              this.classifyAuthData[classIndex].authButton.allDisabled = false;
-            }
-          });
-        }
+
         //寮哄埗鍒锋柊琛ㄦ牸
         this.itemKey = uuidv4();
       });
@@ -238,8 +242,7 @@
         this.$message.warning("褰撳墠绉熸埛涓嶅瓨鍦ㄨ鑹蹭俊鎭紒");
         return;
       }
-      // console.log('this.roleList', this.roleList)
-      this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
+
       let item = {
         roleData: this.roleList[0].id,
         classifyItem: this.classifyData.label,
@@ -253,6 +256,7 @@
       });
       this.classifyAuthData.push(item);
       this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex);
+      this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
     },
     // 鍒犻櫎琛�
     subClassifyAuth() {
@@ -305,7 +309,7 @@
           this.$message.warning("瑙掕壊鍜屽垎绫诲凡缁忓瓨鍦紝璇烽噸鏂伴厤缃紒");
           return;
         }
-        
+
         let flag = false;
         this.classifyAuthData.forEach((item) => {
           let itemButtonList = [];
@@ -432,7 +436,6 @@
                 Vue.set(item, data, true);
               });
               this.classifyAuthData.push(item);
-              this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1
               this.roleHandlerMethods(authData.roleId, "create", index);
               // console.log('index', index)
             });
diff --git a/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue b/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
index d1672f2..937cd36 100644
--- a/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
+++ b/Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -60,8 +60,8 @@
           <el-checkbox
             v-if="item.type === 'checkbox'"
             v-model="row[item.prop]"
-            @change="checkBoxToChangeTheEvent(row[item.prop],item.code)"
-            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]">
+            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]"
+            @change="checkBoxToChangeTheEvent(row[item.prop],item.code,row,item.prop)">
           </el-checkbox>
         </template>
       </el-table-column>
@@ -96,8 +96,8 @@
       default: false,
     },
     // 褰撳墠鐐瑰嚮鐨勮妭鐐�
-    TreeNode:{
-      type:Object
+    TreeNode: {
+      type: Object
     }
   },
   data() {
@@ -128,6 +128,11 @@
         this.loadAuthPage();
       }
     },
+    classifyAuthData(newval){
+
+      this.addIndex = newval.length <= 0 ? 0 :newval.length-1;
+      console.log(this.addIndex)
+    }
   },
   computed: {},
   mounted() {
@@ -135,11 +140,21 @@
   created() {
   },
   methods: {
-    checkBoxToChangeTheEvent(check,code){
-      // console.log(check,code)
-      // if(code === "data_view" && check){
-      //
-      // }
+    checkBoxToChangeTheEvent(check, code, row, id) {
+      if (code === "data_view") {
+        row.checkTheStatus = check;
+      } else if (!row.checkTheStatus) {
+        this.$message.warning('璇峰厛鍕鹃�夋煡鐪嬫寜閽紒');
+        // 鍦ㄦ潯浠朵笉婊¤冻鏃跺皢澶氶�夋鐘舵�佽缃负false
+        row[id] = false;
+      }
+
+      if (!row.checkTheStatus) {
+        this.classifyAuthButton.forEach(key => {
+          // 鏌ョ湅涓篺alse鏃跺皢鎵�鏈夊閫夋鐘舵�佽缃负false
+          row[key.id] = false;
+        });
+      }
     },
     // 鍏抽棴瀵硅瘽妗�
     closeDialog() {
@@ -155,6 +170,7 @@
         const filteredItems = this.classifyAuthButton.filter(item =>
           !res.data.data.some(x => x.id === item.id)
         );
+
         //鍜岃〃鏍煎垪杩涜瀵规瘮
         this.classifyAuthHeader.forEach((item) => {
           const isMatched = filteredItems.some((x) => x.id === item.prop);
@@ -162,27 +178,26 @@
             if (this.classifyAuthData[index]) {
               if (isMatched) {
                 Object.keys(this.classifyAuthData[index]).forEach((key) => {
-                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
+                  this.$set(this.classifyAuthData[index].authButton, item.code, true);
+
+                  //娣诲姞 鈥滄煡鐪嬪叏閮ㄧ鐢ㄦ潯浠垛��
+                  if (item.code === "data_view") {
+                    this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
+                  }
                 });
+
               } else {
                 Object.keys(this.classifyAuthData[index]).forEach((key) => {
-                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
+                  this.$set(this.classifyAuthData[index].authButton, item.code, false);
                 });
+                if(item.code === "data_view"){
+                  this.classifyAuthData[index].authButton.allDisabled = false;
+                }
               }
             }
           });
         });
 
-        //娣诲姞鈥樻煡鐪嬧�欑鐢�
-        if (this.classifyAuthData) {
-          this.classifyAuthData.forEach((classkey, classIndex) => {
-            if (classkey.authButton.classify_view) {
-              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
-            } else {
-              this.classifyAuthData[classIndex].authButton.allDisabled = false;
-            }
-          });
-        }
         //寮哄埗鍒锋柊琛ㄦ牸
         this.itemKey = uuidv4();
       });
@@ -204,14 +219,14 @@
               if (isMatched) {
                 Object.keys(currentRow).forEach((key) => {
                   currentRow.authButton[item.code] = true;
-                  if (!currentRow.authButton.classify_view) {
+                  if (!currentRow.authButton.data_view) {
                     currentRow.authButton.allDisabled = false;
                   }
                 });
               } else {
                 Object.keys(currentRow).forEach((key) => {
                   currentRow.authButton[item.code] = false;
-                  if (!currentRow.authButton.classify_view) {
+                  if (!currentRow.authButton.data_view) {
                     currentRow.authButton.allDisabled = false;
                   }
                 });
@@ -230,11 +245,11 @@
         this.$message.warning("褰撳墠绉熸埛涓嶅瓨鍦ㄨ鑹蹭俊鎭紒");
         return;
       }
-      this.addIndex++; //鑷畾涔夌敓鎴愭坊鍔犺涓嬫爣
+
       let item = {
         roleData: this.roleList[0].id,
         classifyItem: this.classifyData.label,
-        authButton:{},
+        authButton: {},
         uuid: uuidv4(),//鐢熸垚鍞竴鐨刬d,
         index: this.addIndex,
       }
@@ -323,7 +338,7 @@
           return;
         }
         // console.log(form)
-      }else{
+      } else {
         // 涓虹┖璇佹槑鏄竻绌烘巿鏉冨垪琛�
         form.isCLear = true;
       }
@@ -404,7 +419,7 @@
                 roleData: authData.roleId,
                 classifyItem: this.classifyData.label,
                 index: index,
-                authButton:{},
+                authButton: {},
                 uuid: uuidv4(),//鐢熸垚鍞竴鐨刬d
               }
               //灏嗘寜閽缃繘鍘�
@@ -412,7 +427,6 @@
                 Vue.set(item, data, true);
               });
               this.classifyAuthData.push(item);
-              this.addIndex = this.classifyAuthData.length - 1; //娣诲姞琛屼笅鏍囩瓑浜巆lassifyAuthData鐨勯暱搴�-1
               this.roleHandlerMethods(authData.roleId, 'create', index)
             })
           }
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index b7e071a..c11e7a3 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -44,7 +44,7 @@
             </el-button>
           </div>
           <!-- 宸︿晶鏍�-->
-          <div style="height: 690px;overflow: auto">
+          <div style="height:  calc(100vh - 242px);overflow: auto">
             <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
                        :defaultExpandAll="false"
                        :option="Treeoption"
diff --git a/Source/UBCS-WEB/src/main.js b/Source/UBCS-WEB/src/main.js
index 917ff08..d476b04 100644
--- a/Source/UBCS-WEB/src/main.js
+++ b/Source/UBCS-WEB/src/main.js
@@ -49,6 +49,7 @@
 import cloneOtherBasicSecDialog from "@/components/code-dialog-page/cloneOtherBasicSecDialog"
 import advancedQuery from "@/components/advanced-query/advancedQuery"
 import businessAdd from "@/views/modeling/BusinessAdd"
+import businessEdit from "@/views/modeling/BusinessEdit"
 import VciMasterCrud from "@/components/MasterCrud/VciMasterCrud"
 import originalAdd from "@/views/modeling/originalAdd"
 import FormTemplateDialog from "@/components/FormTemplate/index"
@@ -108,6 +109,7 @@
 Vue.component('referConfigDialog',referConfigDialog)
 Vue.component('advancedQuery',advancedQuery)
 Vue.component('businessAdd',businessAdd)
+Vue.component('businessEdit',businessEdit)
 Vue.component('attrCrud',attrCrud)
 Vue.component('VciMasterCrud',VciMasterCrud)
 Vue.component('originalAdd',originalAdd)
diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index f568592..433d618 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -6,7 +6,7 @@
     <el-container>
       <el-aside style="width: 300px">
         <basic-container class="businessTreeContainer">
-          <div class="app">
+          <div class="app"style="overflow: auto;height: 84.3vh;">
             <div style="display: flex;margin-bottom: 10px;justify-content: space-around;">
               <el-button v-if="permissionList.addBtn" plain size="mini"  type="primary"
                          @click="businessAdd">
@@ -20,7 +20,7 @@
                          type="primary" @click="selectFromTable"> 浠庡凡鏈変腑鑾峰彇
               </el-button>
             </div>
-            <avue-tree :data="treeData" :option="treeOption" class="businessTree" style="height: 70.3vh"
+            <avue-tree :data="treeData" :option="treeOption" class="businessTree" style="height: 74.3vh"
                        @node-click="nodeClick">
               <template slot-scope="{ node, data }" class="el-tree-node__label">
                 <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark"
@@ -94,24 +94,6 @@
                 </template>
                 {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }}
               </el-descriptions-item>
-              <!--              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"-->
-              <!--                                    :labelStyle="descriptionOption.labelStyle">-->
-              <!--                <template slot="label">-->
-              <!--                  <i :class="icons.view"></i>-->
-              <!--                  瑙嗗浘-->
-              <!--                </template>-->
-              <!--                <el-tag v-if="obj.viewText" size="small">-->
-              <!--                  {{ obj.viewText }}-->
-              <!--                </el-tag>-->
-              <!--                <span v-else></span>-->
-              <!--              </el-descriptions-item>-->
-              <!-- <el-descriptions-item>
-            <template slot="label">
-              <i class="el-icon-arrow-down"></i>
-              瀹炵幇绫�
-            </template>
-            {{ obj.implClass }}
-          </el-descriptions-item> -->
               <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                     :labelStyle="descriptionOption.labelStyle">
                 <template slot="label">
@@ -132,7 +114,7 @@
             </avue-crud>
           </basic-container>
         </el-main>
-        <el-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" top="9vh" width="700px"
+        <el-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" top="4vh" width="600px"
                    @close="dialoghandelfalse">
           閫夋嫨棰嗗煙锛�
           <el-select v-model="domain" placeholder="璇烽�夋嫨" size="small" @change="refOnLoad">
@@ -155,6 +137,10 @@
     <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type"
                   @refreshTable="initTreeOnLoad">
     </business-add>
+    <business-edit ref="btmEdit" :btmType="addOption.btmEditType" :domainOption="domainOptions" :icons="icons" :type="type"
+                   @refreshTable="initTreeOnLoad">
+
+    </business-edit>
   </el-container>
 </template>
 <script>
@@ -193,6 +179,7 @@
       },
       addOption: {
         btmType: {},
+        btmEditType:{}
       },
       loadOption: {
         height: 'auto',
@@ -262,6 +249,7 @@
           tabs: true,
           addBtn: false,
           menu: false,
+          refreshBtn:false,
           highlightCurrentRow: true,
           column: [
             {
@@ -301,6 +289,7 @@
       if (data.oid) {
         getDetail(data.oid).then(res => {
           this.obj = res.data.data;
+          this.addOption.btmEditType = res.data.data;
         })
       } else {
         this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
@@ -379,9 +368,9 @@
         this.$message.warning("璇烽�夋嫨涓�鏉″彾瀛愯妭鐐圭殑涓氬姟绫诲瀷");
         return;
       }
-      const json = JSON.stringify(this.obj);
-      this.$refs.btmAdd.btmType = JSON.parse(json);
-      this.$refs.btmAdd.showSubmitDialog = true;
+      // const json = JSON.stringify(this.obj);
+      // this.$refs.btmAdd.btmType = JSON.parse(json);
+      this.$refs.btmEdit.showSubmitDialog = true;
       this.type = 'edit'
       this.ifRefreshBtmAddRefresh();
     },
@@ -403,10 +392,7 @@
 }
 
 
-.app {
-  overflow-y: auto;
-  height: 84.3vh;
-}
+
 
 //
 //.app::-webkit-scrollbar {
diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index c662081..4009cbb 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -2,6 +2,7 @@
   <el-dialog
     title="涓氬姟绫诲瀷"
     :visible.sync="showSubmitDialog"
+    v-loading="loading"
     append-to-body
     @close="closeSubmitDialog"
     width="70%"
@@ -11,7 +12,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="type !== 'add'"></el-input>
+        <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="false"></el-input>
       </el-form-item>
       <el-form-item label="涓枃鍚嶇О" label-width="100px">
         <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
@@ -202,20 +203,18 @@
     },
     type: {
       type:String,
+    },
+    btmEditType:{
+      type:Object,
+      default: {}
     }
   },
   watch: {
-    type: {
-      handler(newval, oldval) {
-        // console.log('鐩戝惉', newval)
-      },
-      deep: true,
-      immediate: true
-    }
   },
   data() {
     return {
       form: {},
+      loading:false,
       showSubmitDialog: false,
       option: {
         height: "330px",
@@ -485,11 +484,11 @@
     // 鍏抽棴缁勪欢寮圭獥
     closeSubmitDialog() {
       this.showSubmitDialog = false;
-      this.btmType.attributes = [];
-      this.btmType = {};
-      this.attrRef.selectData = [];
-      this.attrRef.queryNotIn = null;
-      this.resetForm();
+      // this.btmType.attributes = [];
+      // this.btmType = {};
+      // this.attrRef.selectData = [];
+      // this.attrRef.queryNotIn = null;
+      // this.resetForm();
     },
     // 鍏抽棴灞炴�ф睜鏌ヨ寮圭獥
     closeAttrDialog() {
diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessEdit.vue b/Source/UBCS-WEB/src/views/modeling/BusinessEdit.vue
new file mode 100644
index 0000000..d60c8cb
--- /dev/null
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessEdit.vue
@@ -0,0 +1,830 @@
+<template>
+  <el-dialog
+    title="涓氬姟绫诲瀷"
+    :visible.sync="showSubmitDialog"
+    v-loading="loading"
+    append-to-body
+    @close="closeSubmitDialog"
+    width="70%"
+    top="6vh"
+    style="height: 115vh;"
+  >
+    <el-form ref="form" :model="btmEditType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"
+             :rules="rules" @resetFields="resetForm" status-icon="true">
+      <el-form-item label="鑻辨枃鍚嶇О" label-width="100px"  prop="id">
+        <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="true"></el-input>
+      </el-form-item>
+      <el-form-item label="涓枃鍚嶇О" label-width="100px">
+        <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
+      </el-form-item>
+      <!-- <el-form-item label="鏁版嵁搴撹〃鍚�" label-width="100px">
+        <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input>
+      </el-form-item> -->
+      <el-form-item label="鎵�灞為鍩�" label-width="100px" prop="domain" class="domainSelect">
+        <el-select  placeholder="璇烽�夋嫨棰嗗煙" v-model="btmType.bizDomain" :prefix-icon="icons.domain">
+          <el-option v-for="item in domainOption"
+                     :label="item.label" :value="item.value" :key="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鐗堟湰瑙勫垯" label-width="100px">
+        <el-input v-model="btmType.revisionRuleName"
+                  :prefix-icon="icons.revisionRule"
+                  class="revisionRule"
+                  @focus="openRevision"
+                  clearable
+                  @clear="clearRevision"
+                  :suffix-icon="icons.referType"
+                  placeholder="璇烽�夋嫨锛岀暀绌哄垯涓嶈繘琛岀鐞�">
+        </el-input>
+      </el-form-item>
+      <el-form-item label="鐢熷懡鍛ㄦ湡" label-width="100px">
+        <el-input v-model="btmType.lifeCycleName"
+                  :prefix-icon="icons.lifeCycle"
+                  class="lifeCycle"
+                  @focus="openLifeCycle"
+                  clearable
+                  @clear="clearLifeCycle"
+                  :suffix-icon="icons.referType"
+                  placeholder="璇烽�夋嫨锛岀暀绌哄垯涓嶈繘琛岀鐞�">
+        </el-input>
+      </el-form-item>
+      <!--      <div>-->
+      <!--        <el-form-item label="寮�鍚鍥�" label-width="100px" class="viewFlag">-->
+      <!--          <el-switch v-model="btmType.viewFlag" active-color="#13ce66" @change="viewChange"></el-switch>-->
+      <!--        </el-form-item>-->
+      <!--        <el-form-item label="瑙嗗浘璇彞" label-width="100px" class="viewInput">-->
+      <!--          <el-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </div>-->
+      <el-form-item label="鎻忚堪" label-width="100px" class="description">
+        <el-input v-model="btmType.description"
+                  :prefix-icon="icons.desc"
+                  class="descClass"
+                  id="descId"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <avue-crud :option="option"
+               :data="btmType.attributes"
+               :page.sync="page"
+               ref="attrTable">
+      <template slot-scope="scope" slot="menuLeft">
+        <el-button type="danger"
+                   icon="el-icon-plus"
+                   size="small"
+                   @click="rowAdd()">灞炴�ч�夋嫨
+        </el-button>
+      </template>
+      <template slot="attrDataTypeText" slot-scope="{row}">
+        <el-tag>{{ row.attrDataTypeText }}</el-tag>
+      </template>
+      <template slot="menu" slot-scope="{row,index}">
+        <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row,index)">缂栬緫
+        </el-button>
+        <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit"
+                   @click="removeFormAttrTable(row,index)">绉婚櫎
+        </el-button>
+        <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @click="cellEditSave(row,index)">
+          淇濆瓨
+        </el-button>
+      </template>
+    </avue-crud>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitBtmType">纭畾</el-button>
+      <el-button @click="cancleSubmitBtmType">鍙栨秷</el-button>
+    </div>
+
+    <!-- 灞炴�ф睜鐨勯�夋嫨 -->
+    <el-dialog title="灞炴�ф睜"
+               :visible="attrRef.visible"
+               append-to-body
+               @close="closeAttrDialog"
+               width="80%"
+    >
+      <avue-crud class="attrRef"
+                 :option="attrRef.option"
+                 :data="attrRef.data"
+                 :page.sync="attrRef.page"
+                 ref="attrRef"
+                 @on-load="attrRefOnLoad"
+                 @search-change="attrRefSearch"
+                 @selection-change="selectionChange"
+                 v-loading="attrRef.loading">
+        <template slot="typeValue" slot-scope="scope">
+          <el-tag>{{ scope.row.typeValue }}</el-tag>
+        </template>
+      </avue-crud>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="confirmSelectAttr">纭畾</el-button>
+        <el-button @click="cancleSelectAttr">鍙栨秷</el-button>
+      </div>
+    </el-dialog>
+    <!-- 鐗堟湰瑙勫垯鐨勫弬鐓� -->
+    <el-dialog title="璇烽�夋嫨鐗堟湰瑙勫垯"
+               :visible.sync="revisionRef.visible"
+               append-to-body
+               width="80%">
+
+      <avue-crud class="revisionRef"
+                 :option="revisionRef.option"
+                 :data="revisionRef.data"
+                 :page.sync="revisionRef.page"
+                 ref="revisionRef"
+                 @row-click="revisionClick"
+                 v-loading="revisionRef.loading"
+                 @search-change="searchRevisionRule"
+                 @search-reset="clearSearchRevisionRule">
+        <template slot="radio"
+                  slot-scope="{row}">
+          <el-radio v-model="revisionRef.selectRow"
+                    :label="row.$index">&nbsp;
+          </el-radio>
+        </template>
+      </avue-crud>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="confirmRevision">纭畾</el-button>
+        <el-button @click="cancelRevision">鍙栨秷</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 鐢熷懡鍛ㄦ湡鐨勫弬鐓� -->
+    <el-dialog title="璇烽�夋嫨鐢熷懡鍛ㄦ湡"
+               :visible.sync="lifeCycleRef.visible"
+               append-to-body
+               width="80%">
+
+      <avue-crud class="lifeCycleRef"
+                 :option="lifeCycleRef.option"
+                 :data="lifeCycleRef.data"
+                 :page.sync="lifeCycleRef.page"
+                 ref="lifeCycleRef"
+                 @row-click="lifeCycleClick"
+                 v-loading="lifeCycleRef.loading"
+                 @search-change="searchLifeCycle"
+                 @search-reset="clearSearchLifeCycle">
+        <template slot="radio"
+                  slot-scope="{row}">
+          <el-radio v-model="lifeCycleRef.selectRow"
+                    :label="row.$index">&nbsp;
+          </el-radio>
+        </template>
+      </avue-crud>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="confirmLifeCycle">纭畾</el-button>
+        <el-button @click="cancelLifeCycle">鍙栨秷</el-button>
+      </div>
+    </el-dialog>
+  </el-dialog>
+
+
+</template>
+
+
+<script>
+
+import {add, update} from '@/api/omd/btmType';
+import {queryPage} from '@/api/omd/OmdAttribute';
+import {getPage} from '@/api/omd/revisionRule';
+import {getList} from '@/api/modeling/cycle';
+
+export default {
+  name: 'BusinessEdit',
+  props: {
+    btmType: {
+      type: Object,
+      default:{}
+    },
+    domainOption: {
+      type: Array
+    },
+    icons: {
+      type: Array
+    },
+    type: {
+      type:String,
+    },
+    btmEditType:{
+      type:Object,
+      default: {}
+    }
+  },
+  watch: {
+  },
+  data() {
+    return {
+      form: {},
+      loading:false,
+      showSubmitDialog: false,
+      option: {
+        height: "330px",
+        selection: false,
+        headerAlign: 'center',
+        border: true,
+        index: true,
+        rowKey: 'id',
+        tabs: true,
+        menu: true,
+        editBtn: false,
+        delBtn: false,
+        columnBtn: false,
+        menuWidth: 150,
+        refreshBtn:false,
+        addBtn: false,
+        highlightCurrentRow: true,
+        column: [
+          {
+            label: '鑻辨枃鍚嶇О',
+            prop: 'id',
+            align: 'center',
+            disabled:true
+          }, {
+            label: '涓枃鍚嶇О',
+            prop: 'name',
+            align: 'center',
+            cell: true
+          },{
+            label: "绫诲瀷",
+            prop: "attrDataTypeText",
+            align: 'center',
+            slot: true
+          },
+          {
+            label: "榛樿鍊�",
+            prop: "defaultValue",
+            align: 'center',
+            cell: true
+          },
+          {
+            label: "璇存槑",
+            prop: "description",
+            align: 'center',
+            cell: true
+          }
+        ]
+      },
+      attrRef: {
+        visible: false,
+        page: {
+          currentPage: 1,
+          pageSize: 10,
+        },
+        loading: false,
+        key: null,
+        option: {
+          height: 360,
+          addBtn: false,
+          refreshBtn: false,
+          columnBtn: false,
+          selection: true,
+          menu: false,
+          border: true,
+          reserveSelection: true,
+          searchMenuSpan: 8,
+          highlightCurrentRow: true,
+          rowKey: 'id',
+          column: [
+            {
+              label: '鑻辨枃鍚嶇О',
+              prop: 'id',
+              align: 'left',
+              search: true,
+              disabled:true,
+              width: 230
+            }, {
+              label: '涓枃鍚嶇О',
+              prop: 'name',
+              align: 'center',
+            },
+            {
+              label: "绫诲瀷",
+              prop: "typeValue",
+              align: 'center',
+              slot: true,
+            },
+            {
+              label: "榛樿鍊�",
+              prop: "defaultValue",
+              align: 'center'
+            },
+            {
+              label: '鍏佽涓虹┖',
+              prop: 'nullable',
+              type: 'switch',
+              display: false,
+              hide: true,
+              labelWidth: 132,
+              dicData: [{
+                label: '鍚�',
+                value: 1
+              }, {
+                label: '鏄�',
+                value: 0
+              }]
+            },
+            {
+              label: "璇存槑",
+              prop: "description",
+              cell: true,
+              align: 'center'
+            }
+          ]
+        },
+        data: [],
+        queryNotIn: ''
+      },
+      revisionRef: {
+        visible: false,
+        page: {
+          currentPage: 1,
+          pageSize: 10
+        },
+        loading: false,
+        selectRow: '',
+        searchKey: null,
+        option: {
+          height: 360,
+          addBtn: false,
+          refreshBtn: false,
+          columnBtn: false,
+          menu: false,
+          border: true,
+          reserveSelection: true,
+          searchMenuSpan: 8,
+          searchShowBtn: false,
+          highlightCurrentRow: true,
+          column: [{
+            label: '閫夋嫨',
+            prop: 'radio',
+            width: 60,
+            hide: false
+          },
+            {
+              label: '鑻辨枃鍚嶇О',
+              prop: 'id',
+              disabled:true,
+              search: true
+            },
+            {
+              label: "涓枃鍚嶇О",
+              prop: "name",
+              search: true,
+            },
+            {
+              label: "璺宠穬瀛楃",
+              prop: "skipCode"
+            },
+            {
+              label: "鍒濆鍊�",
+              prop: "startCode"
+            },
+            {
+              label: "姝ラ暱",
+              prop: "serialStep"
+            },
+            {
+              label: "鍓嶇紑",
+              prop: "prefixCode"
+            },
+            {
+              label: "鍚庣紑",
+              prop: "suffixCode"
+            },
+            {
+              label: "鎻忚堪",
+              prop: "description",
+              type: "textarea"
+            }
+          ]
+        },
+      },
+      lifeCycleRef: {
+        visible: false,
+        page: {
+          currentPage: 1,
+          pageSize: 10
+        },
+        loading: false,
+        selectRow: '',
+        searchKey: null,
+        option: {
+          height: 360,
+          addBtn: false,
+          refreshBtn: false,
+          columnBtn: false,
+          menu: false,
+          border: true,
+          reserveSelection: true,
+          searchMenuSpan: 8,
+          searchShowBtn: false,
+          highlightCurrentRow: true,
+          column: [{
+            label: '閫夋嫨',
+            prop: 'radio',
+            width: 60,
+            hide: false
+          },
+            {
+              label: '鑻辨枃鍚嶇О',
+              prop: 'id',
+              disabled:true,
+              search: true
+            },
+            {
+              label: "涓枃鍚嶇О",
+              prop: "name",
+              search: true,
+            },
+            {
+              label: "璺宠穬瀛楃",
+              prop: "skipCode"
+            },
+            {
+              label: "鍒濆鍊�",
+              prop: "startCode"
+            },
+            {
+              label: "姝ラ暱",
+              prop: "serialStep"
+            },
+            {
+              label: "鍓嶇紑",
+              prop: "prefixCode"
+            },
+            {
+              label: "鍚庣紑",
+              prop: "suffixCode"
+            },
+            {
+              label: "鎻忚堪",
+              prop: "description",
+              type: "textarea"
+            }
+          ]
+        },
+      },
+      rules: {
+        id: [
+          {required: true, message: '璇疯緭鍏ヤ笟鍔$被鍨嬬紪鍙�', trigger: 'blur'},
+          {pattern: /^[A-Za-z]+$/, message: '涓氬姟绫诲瀷缂栧彿鍙兘涓鸿嫳鏂�', trigger: 'blur'},
+          {min: 2, max: 20, message: '闀垮害鍦�2鍒�20涓瓧绗�', trigger: 'blur'}
+        ],
+        name: [
+          {required: true, message: '璇疯緭鍏ヤ笟鍔$被鍨嬩腑鏂囧悕绉�', trigger: 'blur'}
+        ],
+        domain: [
+          {required: true, message: '璇烽�夋嫨鎵�灞為鍩�', trigger: 'blur'}
+        ]
+      },
+    }
+  },
+  created() {
+
+  },
+  methods: {
+    // 鍏抽棴缁勪欢寮圭獥
+    closeSubmitDialog() {
+      this.showSubmitDialog = false;
+      // this.btmType.attributes = [];
+      // this.btmType = {};
+      // this.attrRef.selectData = [];
+      // this.attrRef.queryNotIn = null;
+      // this.resetForm();
+    },
+    // 鍏抽棴灞炴�ф睜鏌ヨ寮圭獥
+    closeAttrDialog() {
+      this.attrRef.visible = false;
+    },
+    // 灞炴�ч�夋嫨娣诲姞
+    async rowAdd() {
+      await this.attrRefOnLoad();
+      this.attrRef.visible = true;
+    },
+    // 灞炴�ф睜鍔犺浇
+    attrRefOnLoad() {
+      if (this.attrRef.queryNotIn != '' && this.btmType.attributes !== undefined && this.btmType.attributes.length > 0) {
+        this.attrRef.queryNotIn = '';
+        this.btmType.attributes.forEach(item => {
+          this.attrRef.queryNotIn += (item.id + ",")
+        })
+      }
+      this.attrRef.loading = true;
+      queryPage(this.attrRef.key, this.attrRef.queryNotIn, this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => {
+        const data = res.data.data;
+        this.attrRef.page.total = data.total;
+        this.attrRef.data = data.records;
+      });
+      setTimeout(() => {
+        this.attrRef.loading = false;
+      }, 600)
+      this.$nextTick(() => {
+        this.$refs.attrRef.refreshTable();
+      });
+    },
+    // 灞炴�ф睜妫�绱�
+    attrRefSearch(form, done) {
+      this.attrRef.key = form.id;
+      this.attrRefOnLoad();
+      done();
+      this.attrRef.key = null;
+    },
+    // 浠庡睘鎬ф睜涓Щ闄�
+    removeFormAttrTable(row, index) {
+      this.btmType.attributes.splice(index, 1);
+      this.attrRef.queryNotIn = "";
+      this.btmType.attributes.forEach(item => {
+        this.attrRef.queryNotIn += (item.id + ",")
+      })
+    },
+    // 灞炴�ф睜鍕鹃�変簨浠�
+    selectionChange(list) {
+      this.attrRef.selectData = list;
+    },
+    // 纭灞炴�ф睜鍕鹃��
+    confirmSelectAttr() {
+      if (!this.btmType.attributes) {
+        this.btmType.attributes = [];
+      }
+      // console.log(this.attrRef.selectData);
+      this.attrRef.selectData.forEach(item => {
+        this.btmType.attributes.push({
+          id: item.id,
+          name: item.name,
+          attrDataType: item.typeKey,
+          attrDataTypeText: item.typeValue,
+          defaultValue: item.defaultValue,
+          description: item.description,
+          attributeLength: item.maxLength,
+          referBtmTypeId: item.referTypeCode,
+          referBtmTypeName: item.referToName,
+          enumId: item.dictCode,
+        });
+        this.attrRef.queryNotIn += (item.id + ",")
+      });
+      this.attrRef.data = [];
+      this.closeAttrDialog();
+    },
+    // 鍙栨秷灞炴�ф睜鍕鹃��
+    cancleSelectAttr() {
+      this.attrRef.selectData = [];
+      this.closeAttrDialog();
+    },
+    // 娣诲姞涓氬姟绫诲瀷
+    submitBtmType() {
+      // console.log(this.btmType);
+      if (!this.btmType.attributes){
+        this.$message.warning("杩樻病鏈変负涓氬姟绫诲瀷閫夋嫨灞炴��");
+        return;
+      }else{
+        let nullFlag = false;
+        this.btmType.attributes.forEach(item => {
+          if (!item.name){
+            this.$message.warning("绗�" + (item.$index+1) + "琛岀殑涓枃鍚嶇О涓嶈兘涓虹┖");
+            nullFlag = true;
+            return;
+          }
+        })
+        if (nullFlag){
+          return;
+        }
+
+      }
+      add(this.btmType, true).then(res => {
+        // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂�
+        this.$message.success('淇濆瓨鎴愬姛');
+        this.cancleSubmitBtmType();
+        this.$emit('refreshTable');
+      })
+    },
+    // 鍙栨秷娣诲姞涓氬姟绫诲瀷
+    cancleSubmitBtmType() {
+      this.btmType = {};
+      this.btmType.attributes = [];
+      this.showSubmitDialog = false;
+    },
+    // 鍒锋柊灞炴�у垪琛�
+    refreshAttrTable() {
+      this.$nextTick(() => {
+        this.$refs.attrTable.refreshTable();
+      })
+    },
+    //
+    viewChange() {
+
+    },
+    // 鍒楄〃缂栬緫
+    cellEditClick(cell) {
+      // console.log(cell);
+      cell.$cellEdit = true;
+    },
+    // 鍒楄〃缂栬緫淇濆瓨
+    cellEditSave(row,index) {
+      this.btmType.attributes[index].name = row.name
+      this.btmType.attributes[index].defaultValue = row.defaultValue;
+      this.btmType.attributes[index].description = row.description;
+      row.$cellEdit = false;
+      // console.log(this.btmType.attributes);
+      this.$refs.attrTable.refreshTable();
+    },
+    // 鎵撳紑鐗堟湰瑙勫垯鍙傜収
+    openRevision() {
+      this.revisionRef.visible = true;
+      this.revisionRuleOnLoad();
+    },
+    // 鐗堟湰鍙傜収鍒楄〃鐨勯粯璁ゆ煡璇㈡柟娉�
+    revisionRuleOnLoad(){
+      this.revisionRef.loading = true;
+      getPage().then(res => {
+        this.revisionRef.data = res.data.data.records;
+      });
+      setTimeout(() => {
+        this.revisionRef.loading = false;
+      }, 600)
+      this.$nextTick(() => {
+        this.$refs.revisionRef.refreshTable();
+      });
+    },
+    // 鎵撳紑鐗堟湰瑙勫垯鍙傜収
+    openLifeCycle() {
+      this.lifeCycleRef.visible = true;
+      this.lifeCycleOnLoad();
+    },
+    // 鐢熷懡鍛ㄦ湡鍒楄〃鐨勯粯璁ゆ煡璇㈡柟娉�
+    lifeCycleOnLoad(){
+      this.lifeCycleRef.loading = true;
+      getList().then(res => {
+        this.lifeCycleRef.data = res.data.data.records;
+      });
+      setTimeout(() => {
+        this.lifeCycleRef.loading = false;
+      }, 600)
+      this.$nextTick(() => {
+        this.$refs.lifeCycleRef.refreshTable();
+      });
+    },
+    // 鍏抽棴鐗堟湰瑙勫垯鍙傜収寮圭獥
+    closeRevisionDialog() {
+      this.revisionRef.visible = false;
+    },
+    // 鍏抽棴鐢熷懡鍛ㄦ湡鍙傜収寮圭獥
+    closeLifeCycleDialog() {
+      this.lifeCycleRef.visible = false;
+    },
+    // 纭閫変腑鐗堟湰瑙勫垯
+    confirmRevision() {
+      this.btmType.revisionFlag = true;
+      this.btmType.revisionRuleId = this.revisionRef.selectData.id;
+      this.btmType.revisionRuleName = this.revisionRef.selectData.name;
+      this.btmType.inputRevisionFlag = false;
+      this.cancelRevision();
+    },
+    // 纭閫変腑鐢熷懡鍛ㄦ湡
+    confirmLifeCycle() {
+      this.btmType.lifeCycleFlag = true;
+      this.btmType.lifeCycleId = this.lifeCycleRef.selectData.id;
+      this.btmType.lifeCycleName = this.lifeCycleRef.selectData.name;
+      this.cancelLifeCycle();
+    },
+    // 鍙栨秷閫変腑鐗堟湰瑙勫垯
+    cancelRevision() {
+      this.revisionRef.selectRow = '';
+      this.revisionRef.selectData = {};
+      this.closeRevisionDialog();
+    },
+    // 鍙栨秷閫変腑鐢熷懡鍛ㄦ湡
+    cancelLifeCycle() {
+      this.lifeCycleRef.selectRow = '';
+      this.lifeCycleRef.selectData = {};
+      this.closeLifeCycleDialog();
+    },
+    // 鐗堟湰瑙勫垯鍗曢��
+    revisionClick(row) {
+      this.revisionRef.selectRow = row.$index;
+      this.revisionRef.selectData = {
+        id: row.id,
+        name: row.name,
+      };
+    },
+    // 鐢熷懡鍛ㄦ湡鍗曢��
+    lifeCycleClick(row) {
+      this.lifeCycleRef.selectRow = row.$index;
+      this.lifeCycleRef.selectData = {
+        id: row.id,
+        name: row.name,
+      };
+    },
+    // 鍙栨秷鐗堟湰瑙勫垯
+    clearRevision() {
+      this.$delete(this.btmType, 'revisionFlag');
+      this.$delete(this.btmType, 'revisionRuleId');
+      this.$delete(this.btmType, 'revisionRuleName');
+      this.$delete(this.btmType, 'inputRevisionFlag');
+    },
+    // 鍙栨秷鐢熷懡鍛ㄦ湡
+    clearLifeCycle() {
+      this.$delete(this.btmType, 'lifeCycleFlag');
+      this.$delete(this.btmType, 'lifeCycleId');
+      this.$delete(this.btmType, 'lifeCycleName');
+    },
+    // 琛ㄥ崟閲嶇疆
+    resetForm() {
+      this.btmType = {};
+      this.$refs.form.resetFields();
+    },
+    /**
+     * 鎼滅储鐗堟湰瑙勫垯
+     * @param params 鎼滅储妗嗚緭鍏ュ��  {id: '',name: ''} 鐩存帴鑾峰彇灏辫
+     * @param done 鎵ц瀹屾垚鍚庣殑鍥炶皟
+     */
+    searchRevisionRule(params,done){
+      let condition = {};
+      if (params.id){
+        condition['id_like'] = params.id;
+      }
+      if (params.name){
+        condition['name_like'] = params.name;
+      }
+      this.revisionRef.loading = true;
+      getPage(this.revisionRef.page.currentPage,this.revisionRef.page.pageSize,condition).then(res => {
+        this.revisionRef.data = res.data.data.records;
+      });
+      setTimeout(() => {
+        done();
+        this.revisionRef.loading = false;
+      }, 600);
+      this.$nextTick(() => {
+        this.$refs.revisionRef.refreshTable();
+      });
+    },
+    /**
+     * 鎼滅储鐢熷懡鍛ㄦ湡
+     * @param params 鎼滅储妗嗚緭鍏ュ��
+     * @param done 鎵ц瀹屾垚鍚庣殑鍥炶皟
+     */
+    searchLifeCycle(params,done){
+      let condition = {};
+      if (params.id){
+        condition['id_like'] = params.id;
+      }
+      if (params.name){
+        condition['name_like'] = params.name;
+      }
+      this.lifeCycleRef.loading = true;
+      getList(this.lifeCycleRef.page.currentPage,this.lifeCycleRef.page.pageSize,condition).then(res => {
+        this.lifeCycleRef.data = res.data.data.records;
+      });
+      setTimeout(() => {
+        done();
+        this.lifeCycleRef.loading = false;
+      }, 600);
+      this.$nextTick(() => {
+        this.$refs.lifeCycleRef.refreshTable();
+      });
+    },
+    // 鍙栨秷鐗堟湰瑙勫垯鎼滅储
+    clearSearchRevisionRule(item){
+      this.revisionRuleOnLoad();
+    },
+    // 鍙栨秷鐢熷懡鍛ㄦ湡鎼滅储
+    clearSearchLifeCycle(item){
+      this.lifeCycleOnLoad();
+      console.log(item);
+    }
+  }
+}
+</script>
+
+<style>
+/* 灞炴�ф睜鍙傜収鍒楄〃 */
+.attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
+}
+
+.revisionRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
+}
+
+.lifeCycleRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+  display: none !important;
+}
+
+.btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner {
+  width: 260px;
+}
+
+.domainSelect > .el-form-item__content > .el-select > .el-input > .el-input__inner {
+  width: 260px;
+}
+
+.viewFlag {
+  width: 360px;
+}
+
+.viewInput > .el-form-item__content > .el-input > .el-input__inner {
+  width: 630px;
+}
+
+.descClass > .el-input__inner {
+  width: 1000px;
+}
+</style>
diff --git a/Source/UBCS-WEB/src/views/modeling/original.vue b/Source/UBCS-WEB/src/views/modeling/original.vue
index 5b1b1f8..d555c5f 100644
--- a/Source/UBCS-WEB/src/views/modeling/original.vue
+++ b/Source/UBCS-WEB/src/views/modeling/original.vue
@@ -1,25 +1,43 @@
-  <template>
+<template>
   <el-container>
     <el-main>
       <basic-container>
-        <avue-crud v-model="form" ref="crud" :option="option" :data="data" @on-load="onLoad" :page.sync="page" :permission="permissionList"
-          @refresh-change="refreshChange" @row-click="rowClick" style="height: calc(100vh - 148px)">
+        <avue-crud ref="crud" v-model="form" :data="data" :option="option" :page.sync="page"
+                   :permission="permissionList"
+                   style="height: calc(100vh - 148px)"
+                   @on-load="onLoad" @refresh-change="refreshChange" @row-click="rowClick">
           <template slot="radio" slot-scope="{row}">
             <el-radio v-model="selectRow" :label="row.$index">&nbsp;
             </el-radio>
           </template>
           <template slot="menu" slot-scope="{row,index}">
-            <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave(row,index)" v-if="permissionList.editBtn">缂栬緫</el-button>
-            <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave(row,index)" v-if="permissionList.delBtn">鍒犻櫎</el-button>
+            <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text"
+                       @click="updateSave(row,index)">缂栬緫
+            </el-button>
+            <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text"
+                       @click="deleteSave(row,index)">鍒犻櫎
+            </el-button>
           </template>
-            <template slot="menuLeft">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave" v-if="permissionList.addBtn">鏂�&nbsp;&nbsp;澧�
-            </el-button>
-            <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen" v-if="permissionList.apply">鏌ョ湅浣跨敤鑼冨洿
-            </el-button>
-            <el-input placeholder="鎸夊睘鎬х紪鍙锋煡璇�" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch"
-              size="small" @change="doSearch" type="text"></el-input>
-            <el-button size="small" plain type="primary" icon="el-icon-search" @click="doSearch">&nbsp;鎼滅储</el-button>
+          <template slot="menuLeft">
+            <div>
+              <el-button v-if="permissionList.addBtn" icon="el-icon-plus" size="small" type="primary" @click="addSave">鏂�&nbsp;&nbsp;澧�
+              </el-button>
+              <el-button v-if="permissionList.apply" icon="el-icon-zoom-in" plain size="small" type="primary"
+                         @click="applyRangeOpen">鏌ョ湅浣跨敤鑼冨洿
+              </el-button>
+              <span style="width: 200px;display: inline-block">
+                <el-select slot="prepend" v-model="oriValue" placeholder="璇烽�夋嫨" size="small">
+                <el-option v-for="item in oriData" :key="item.prop" :label="item.label" :value="item.prop"
+                ></el-option>
+              </el-select>
+            </span>
+              <span>
+                 <el-input v-model="searchId" class="attrSearch" clearable placeholder="璇疯緭鍏ュ唴瀹�"
+                           prefix-icon="el-icon-search"
+                           size="small" type="text" @change="doSearch"></el-input>
+              <el-button icon="el-icon-search" plain size="small" type="primary" @click="doSearch">&nbsp;鎼滅储</el-button>
+              </span>
+            </div>
           </template>
           <template slot="typeValue" slot-scope="{row}">
             <el-tag>{{ row.typeValue }}</el-tag>
@@ -30,68 +48,68 @@
             <avue-crud v-model="applyRange.model" :option="applyRange.option" :data="applyRange.data" class="applyRangeTable"
             ></avue-crud>
         </el-dialog> -->
-        <Versionpackage :rangeData="applyRangeData" ref="applyRange"></Versionpackage>
+        <Versionpackage ref="applyRange" :rangeData="applyRangeData"></Versionpackage>
       </basic-container>
     </el-main>
     <el-aside>
       <basic-container class="itemForm">
-      <div style="height: 44vh">
-        <el-descriptions class="margin-top" :column="1" size="medium" border title="灞炴�ч」" >
-          <el-descriptions-item>
-            <template slot="label">
-              灞炴�х紪鍙�
-            </template>
-            {{ itemForm.itemData.id }}
-          </el-descriptions-item>
-          <el-descriptions-item>
-            <template slot="label">
-              灞炴�у悕绉�
-            </template>
-            {{ itemForm.itemData.name }}
-          </el-descriptions-item>
-          <el-descriptions-item>
-            <template slot="label">
-              灞炴�х被鍨�
-            </template>
-            {{ itemForm.itemData.typeValue }}
-          </el-descriptions-item>
-          <!--          <el-descriptions-item>
-                      <template slot="label">
-                        鏍囩
-                      </template>
-                      {{ itemForm.itemData.hashtag }}
-                    </el-descriptions-item>-->
-          <el-descriptions-item>
-            <template slot="label">
-              榛樿鍊�
-            </template>
-            {{ itemForm.itemData.defaultValue }}
-          </el-descriptions-item>
-          <el-descriptions-item>
-            <template slot="label">
-              鍏佽涓虹┖
-            </template>
-            {{ 'true' == itemForm.itemData.nullable ? '鏄�' : '鍚�'}}
-          </el-descriptions-item>
-          <el-descriptions-item>
-            <template slot="label">
-              闀垮害
-            </template>
-            {{ itemForm.itemData.maxLength }}
-          </el-descriptions-item>
-          <el-descriptions-item>
-            <template slot="label">
-              鎻忚堪
-            </template>
-            {{ itemForm.itemData.description }}
-          </el-descriptions-item>
-        </el-descriptions>
-      </div>
+        <div style="height: 44vh">
+          <el-descriptions :column="1" border class="margin-top" size="medium" title="灞炴�ч」">
+            <el-descriptions-item>
+              <template slot="label">
+                灞炴�х紪鍙�
+              </template>
+              {{ itemForm.itemData.id }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label">
+                灞炴�у悕绉�
+              </template>
+              {{ itemForm.itemData.name }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label">
+                灞炴�х被鍨�
+              </template>
+              {{ itemForm.itemData.typeValue }}
+            </el-descriptions-item>
+            <!--          <el-descriptions-item>
+                        <template slot="label">
+                          鏍囩
+                        </template>
+                        {{ itemForm.itemData.hashtag }}
+                      </el-descriptions-item>-->
+            <el-descriptions-item>
+              <template slot="label">
+                榛樿鍊�
+              </template>
+              {{ itemForm.itemData.defaultValue }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label">
+                鍏佽涓虹┖
+              </template>
+              {{ 'true' == itemForm.itemData.nullable ? '鏄�' : '鍚�' }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label">
+                闀垮害
+              </template>
+              {{ itemForm.itemData.maxLength }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label">
+                鎻忚堪
+              </template>
+              {{ itemForm.itemData.description }}
+            </el-descriptions-item>
+          </el-descriptions>
+        </div>
         <div style="height: 40vh">
-          <el-descriptions class="margin-top" :column="1" size="medium" border title="灞炴�ч厤缃�"></el-descriptions>
-          <el-tabs v-model="itemForm.activeName" @tab-click="handleClick" stretch="true" style="height:235px">
+          <el-descriptions :column="1" border class="margin-top" size="medium" title="灞炴�ч厤缃�"></el-descriptions>
+          <el-tabs v-model="itemForm.activeName" stretch="true" style="height:235px" @tab-click="handleClick">
             <el-tab-pane label="鍙傜収" name="referTab">
-              <el-descriptions class="margin-top" :column="1" size="medium" border>
+              <el-descriptions :column="1" border class="margin-top" size="medium">
                 <el-descriptions-item>
                   <template slot="label">
                     浣跨敤鍙傜収
@@ -113,7 +131,7 @@
               </el-descriptions>
             </el-tab-pane>
             <el-tab-pane label="鏋氫妇" name="enumTab">
-              <el-descriptions class="margin-top" :column="1" :size="small" border>
+              <el-descriptions :column="1" :size="small" border class="margin-top">
                 <el-descriptions-item>
                   <template slot="label">
                     浣跨敤鏋氫妇
@@ -132,7 +150,7 @@
         </div>
       </basic-container>
     </el-aside>
-    <originalAdd ref="originalAdd" @refreshTable="refreshChange" :attribute="editAttribute"></originalAdd>
+    <originalAdd ref="originalAdd" :attribute="editAttribute" @refreshTable="refreshChange"></originalAdd>
   </el-container>
 </template>
 
@@ -151,6 +169,22 @@
   name: "original",
   data() {
     return {
+      oriData: [
+        {
+          label: "灞炴�х紪鍙�",
+          prop: "id",
+          align: "left",
+          display: false,
+          width: 200,
+          required: true
+        }, {
+          label: "灞炴�у悕绉�",
+          prop: "name",
+          align: "left",
+          display: false
+        }
+      ],
+      oriValue: "id",
       page: {
         pageSize: 10,
         currentPage: 1,
@@ -165,8 +199,8 @@
       editAttribute: {},
       applyRangeData: [],
       option: {
-        height:'auto',
-        calcHeight:20,
+        height: 'auto',
+        calcHeight: 20,
         headerAlign: "center",
         border: true,
         index: true,
@@ -179,7 +213,7 @@
         addBtn: false,
         editBtn: false,
         delBtn: false,
-        columnBtn:false,
+        columnBtn: false,
         column: [{
           label: "閫夋嫨",
           prop: "radio",
@@ -256,21 +290,21 @@
       itemForm: {
         itemData: {},
         activeName: "referTab",
-        enumInitFlag:false,
+        enumInitFlag: false,
         referInitFlag: false,
         form: {}
       },
       searchId: '',
     };
   },
-  computed:{
+  computed: {
     ...mapGetters(["permission"]),
-    permissionList(){
-      return{
-        addBtn:this.vaildData(this.permission.modeling_original.original_add,false),
-        apply:this.vaildData(this.permission.modeling_original.original_applyopen,false),
-        delBtn:this.vaildData(this.permission.modeling_original.original_delete,false),
-        editBtn:this.vaildData(this.permission.modeling_original.original_edit,false),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.modeling_original.original_add, false),
+        apply: this.vaildData(this.permission.modeling_original.original_applyopen, false),
+        delBtn: this.vaildData(this.permission.modeling_original.original_delete, false),
+        editBtn: this.vaildData(this.permission.modeling_original.original_edit, false),
       }
     },
   },
@@ -286,7 +320,7 @@
       newAttr.nullable = true;
       this.$refs.originalAdd.attribute = newAttr;
     },
-    updateSave(row,index) {
+    updateSave(row, index) {
       this.selectRow = index;
       var json = JSON.stringify(row);
       this.editAttribute = JSON.parse(json);
@@ -299,7 +333,7 @@
       this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag;
       // this.refreshChange()
     },
-    deleteSave(row,index) {
+    deleteSave(row, index) {
       this.$confirm("鍒犻櫎鍏冩暟鎹皢鏃犳硶琚仮澶�, 鏄惁缁х画?", "鎻愮ず", {
         iconClass: 'el-icon-question',
         confirmButtonText: "纭畾",
@@ -330,12 +364,12 @@
       this.attribute = row;
       this.checkUsingReferDict(row);
     },
-    checkUsingReferDict(row){
-      if (row.referToId !== null && row.referToId !== ""){
+    checkUsingReferDict(row) {
+      if (row.referToId !== null && row.referToId !== "") {
         this.itemForm.activeName = 'referTab';
         this.itemForm.referInitFlag = true;
         this.itemForm.enumInitFlag = false;
-      }else if (row.usingDict === 'true'){
+      } else if (row.usingDict === 'true') {
         this.itemForm.activeName = 'enumTab';
         this.itemForm.referInitFlag = false;
         this.itemForm.enumInitFlag = true;
@@ -344,7 +378,7 @@
           this.itemForm.itemData.dictValue = this.editAttribute.dictValue;
           this.$refs.originalAdd.dictEnums = res.data.data;
         })
-      }else {
+      } else {
         this.itemForm.activeName = 'referTab';
         this.itemForm.referInitFlag = true;
         this.itemForm.enumInitFlag = false;
@@ -369,22 +403,25 @@
 
       });
     },
-    doSearch(){
-      var params = {"id_like":this.searchId};
-      this.onLoad(this.page,params);
+    doSearch() {
+
+      var params = {[this.oriValue + "_like"]: this.searchId};
+      this.onLoad(this.page, params);
     }
   },
-  components: { Versionpackage }
+  components: {Versionpackage}
 }
 </script>
 
 <style lang="scss">
-.applyRangeTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu {
+.applyRangeTable > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
   display: none !important;
 }
+
 .attrSearch {
-  width:201px;
+  width: 201px;
 }
+
 .attrSearch > .el-input__inner {
   width: 200px;
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/NonWebRequestAttributes.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/NonWebRequestAttributes.java
new file mode 100644
index 0000000..21e6542
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/NonWebRequestAttributes.java
@@ -0,0 +1,52 @@
+package com.vci.ubcs.code.Scheduling;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+
+/**
+ * @author Vigi
+ */
+@Slf4j
+public class NonWebRequestAttributes implements RequestAttributes {
+
+	@Override
+	public Object getAttribute(String name, int scope) {
+		return null;
+	}
+
+	@Override
+	public void setAttribute(String name, Object value, int scope) {
+		// to do nothing
+	}
+
+	@Override
+	public void removeAttribute(String name, int scope) {
+		// to do nothing
+	}
+
+	@Override
+	public String[] getAttributeNames(int scope) {
+		return new String[0];
+	}
+
+	@Override
+	public void registerDestructionCallback(String name, Runnable callback, int scope) {
+		// to do nothing
+	}
+
+	@Override
+	public Object resolveReference(String key) {
+		return null;
+	}
+
+	@Override
+	public String getSessionId() {
+		return null;
+	}
+
+	@Override
+	public Object getSessionMutex() {
+		return null;
+	}
+}
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/SearchDataSyncForERPScheduling.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/SearchDataSyncForERPScheduling.java
index 937d52a..574b42c 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/SearchDataSyncForERPScheduling.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/SearchDataSyncForERPScheduling.java
@@ -3,13 +3,16 @@
 import com.vci.ubcs.code.service.ICodeDuckingSyncService;
 import com.vci.ubcs.code.service.UniversalInterfaceI;
 import com.vci.ubcs.starter.web.enumpck.BooleanEnum;
+import io.swagger.annotations.Scope;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
@@ -28,8 +31,7 @@
 	@Value("${erp.item.isStart:false}")
 	public boolean ERP_ITEM_ISSTARE;
 
-	@Value("${erp.item.btmName:XHDH}")
-	public String ERP_ITEM_BTMNAME;
+
 	/**
 	 * 鏄惁鍒濆鍖栧畬鎴愪簡
 	 */
@@ -50,7 +52,7 @@
 		if(ERP_ITEM_ISSTARE && BooleanEnum.TRUE.getValue().equalsIgnoreCase(FINISH_INIT)) {
 			SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.");
 			String time = formatter.format(new Date());
-			codeDuckingSyncServiceI.saveItemDataSyncScheduing(ERP_ITEM_BTMNAME);
+			codeDuckingSyncServiceI.saveItemDataSyncScheduing("");
 			String outInfo = "============ 鎵ц浜嗕粠ERP椤圭洰浠e彿/鍨嬪彿浠e彿鏁版嵁 end;";
 			log.info(outInfo+time);
 		}
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/DockingManagementController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/DockingManagementController.java
index 49df39d..121128e 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/DockingManagementController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/DockingManagementController.java
@@ -17,10 +17,12 @@
 import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import javafx.scene.control.TableRow;
 import lombok.AllArgsConstructor;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -56,6 +58,9 @@
 	 * 鍚屾闆嗘垚鏈嶅姟
 	 */
 	private final 	ICodeDuckingSyncService codeDuckingSyncService;
+
+	/*@Value("${erp.item.btmName:XHDH}")
+	private String ERP_ITEM_BTMNAME;*/
 
 	/**绯荤粺闆嗘垚鐨勭郴缁熶俊鎭垪琛�
 	 * @param queryObject 鍩虹鏌ヨ瀵硅薄锛屽寘鍚煡璇㈡潯浠讹紝鍒嗛〉锛屾帓搴忕瓑
@@ -314,4 +319,18 @@
 	public  R sendData(String oid){
 		return codeDuckingSyncService.sendData(oid);
 	}
+
+	/***
+	 * 椤圭洰鍨嬪彿浠e彿鏌ヨ鍚屾
+	 * @return
+	 */
+	@PostMapping("/searchItemDataForERP")
+	public R searchItemDataForERP(String endDate){
+			try {
+				codeDuckingSyncService.saveItemDataSyncScheduing(endDate);
+				return R.success("鍚屾鎴愬姛");
+			}catch (Throwable e){
+			 return	R.fail("鍚屾澶辫触");
+			}
+	}
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeDuckingSyncService.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeDuckingSyncService.java
index 4b7bb10..2f93cac 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeDuckingSyncService.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeDuckingSyncService.java
@@ -49,6 +49,6 @@
 	 */
 	R sendData(String oids);
 
-	void saveItemDataSyncScheduing(String btmName);
+	void saveItemDataSyncScheduing(String endDate);
 }
 
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java
index be0ed51..b3d3f2b 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java
@@ -7,6 +7,7 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.vci.ubcs.code.Scheduling.NonWebRequestAttributes;
 import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO;
 import com.vci.ubcs.code.constant.MdmDuckingConstant;
 import com.vci.ubcs.code.dto.CodeOrderDTO;
@@ -42,6 +43,7 @@
 import com.vci.ubcs.code.webService.config.AttributeMapConfig;
 import com.vci.ubcs.omd.feign.IBtmTypeClient;
 import com.vci.ubcs.omd.vo.BtmTypeVO;
+import com.vci.ubcs.starter.exception.VciBaseException;
 import com.vci.ubcs.starter.revision.model.BaseModel;
 import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
 import com.vci.ubcs.starter.util.HttpUtils;
@@ -54,6 +56,7 @@
 import com.vci.ubcs.starter.web.util.WebUtil;
 import com.vci.ubcs.system.user.entity.User;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.map.CaseInsensitiveMap;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.redis.cache.BladeRedis;
 import org.springblade.core.secure.BladeUser;
@@ -62,12 +65,16 @@
 import org.springblade.core.tool.utils.Func;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.support.DefaultTransactionStatus;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.annotation.Resource;
 import javax.jws.WebMethod;
@@ -102,7 +109,13 @@
 
 	@Value("${erp.item.systemId:ERP}")
 	public String systemId;
+	@Value("${erp.item.secName:鍥哄畾鐮佹}")
+	public String secName;
+	@Value("${erp.item.secValue:A}")
+	public String secValue;
 
+	@Value("${erp.item.btmName:XHDH}")
+	public String btmName;
 	/**
 	 * 涓氬姟绫诲瀷鐨勬湇鍔�
 	 */
@@ -122,8 +135,7 @@
 	private MdmIOService mdmIOService;
 	@Resource
 	private IPasswordFreeLoginService passwordFreeLoginService;
-	@Resource
-	private WebServiceContext webServiceContext;
+
 	@Resource
 	private IDockingLogeService dockingLogeService;
 	@Resource
@@ -152,7 +164,6 @@
 	private MdmSearchItemCodeProvider mdmSearchItemCodeProvider;
 	@Autowired
 	HttpServletRequest request;
-
 	@Override
 	public void DockingDataSyncScheduing() {
 
@@ -214,30 +225,82 @@
 		});
 		return  R.success("鎵嬪姩鎺ㄩ�佸畬鎴�,璇锋牳瀵规槸鍚︽帹閫佹垚鍔�");
 	}
+	private SearchItemDataVO initData(String status,String itemCode,String mmCode){
+		SearchItemDataVO searchItemDataVO=new SearchItemDataVO();
+		searchItemDataVO.setLastchangedon(new Date());
+		searchItemDataVO.setLastchangedby("19831133");
+		searchItemDataVO.setCreatby("19831133");
+		searchItemDataVO.setCreatedon(new Date());
+		searchItemDataVO.setIsenabled(status);
+		searchItemDataVO.setMaterialcode("XMDH0001");
+		searchItemDataVO.setStatus("1");
+		searchItemDataVO.setProjectcode("3333");
+		searchItemDataVO.setProjectitem(itemCode);
+		searchItemDataVO.setMmodelcode(mmCode);
 
+		return searchItemDataVO;
+	}
+
+	public HttpServletRequest  getRequest(){
+		HttpServletRequest request =null;
+		RequestAttributes requestAttributes = null;
+		try{
+			requestAttributes = RequestContextHolder.currentRequestAttributes();
+		}catch (IllegalStateException e){
+			//requestAttributes = new NonWebRequestAttributes();
+			//RequestContextHolder.setRequestAttributes(requestAttributes, true);
+			request = new MockHttpServletRequest();
+			RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request),true);
+		}finally {
+			if (requestAttributes instanceof  ServletRequestAttributes) {
+				ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.currentRequestAttributes();
+				request = servletRequestAttributes.getRequest();
+			}
+		}
+		return request;
+	}
 	/***
 	 * 鍚屾鍨嬪彿浠e彿
 	 */
 	@Override
-	public void saveItemDataSyncScheduing(String btmName) {
+	public void saveItemDataSyncScheduing(String endDate) {
+		String paramString="";
+		String backString="鎴愬姛";
+		String msg="鎴愬姛";
+		boolean success=true;
 		SearchItemParam searchItemParam=new SearchItemParam();
 		searchItemParam.setSystag("VCI"); //璋冪敤绯荤粺鏍囪瘑
-		Calendar calendar= Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY,0);
-		calendar.set(Calendar.MINUTE,0);
-		calendar.set(Calendar.SECOND,0);
-		log.info("鏌ヨ鏃堕棿------->"+calendar.getTime());
 		SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		String lastchangedon= dft.format(calendar.getTime());
+		String lastchangedon="";
+		if(StringUtils.isBlank(endDate)) {
+			Calendar calendar = Calendar.getInstance();
+			calendar.set(Calendar.HOUR_OF_DAY, 0);
+			calendar.set(Calendar.MINUTE, 0);
+			calendar.set(Calendar.SECOND, 0);
+			log.info("鏌ヨ鏃堕棿------->"+calendar.getTime());
+			lastchangedon= dft.format(calendar.getTime());
+		}else{
+			lastchangedon=endDate;
+		}
 		searchItemParam.setLastchangedon(lastchangedon);
 		searchItemParam.setStatus("1");//
 		Map<String,String>searchDataMap=  VciBaseUtil.objectToMapString(searchItemParam);
 		SearchItemVO searchItemVO= mdmSearchItemCodeProvider.getppModelByElem(searchDataMap);
+		/*SearchItemVO searchItemVO=new SearchItemVO();
+		List<SearchItemDataVO> data=new ArrayList<>();
+		SearchItemDataVO searchItemDataVO1=initData("1","","pro-00001");
+		SearchItemDataVO searchItemDataVO2=initData("0","item-00001","");
+		data.add(searchItemDataVO1);
+		data.add(searchItemDataVO2);
+		searchItemVO.setData(data);
+		searchItemVO.setCode("200");
+		searchItemVO.setMsg("");*/
 		if(searchItemVO!=null) {
+			paramString = JSONObject.toJSON(searchItemVO).toString();
 			try {
 				//鍏嶅瘑鐧诲綍鐢宠token锛宺equest涓坊鍔犵敤鎴蜂俊鎭�
 				try {
-					passwordFreeLoginService.pwdFreeLoginByBoolean(systemId.toLowerCase(Locale.ROOT), request);
+					passwordFreeLoginService.pwdFreeLoginByBoolean(systemId.toLowerCase(Locale.ROOT),getRequest());
 				}catch (Throwable e){
 					throw new Throwable("鐢ㄦ埛閴存潈澶辫触.");
 				}
@@ -257,6 +320,8 @@
 				List<SearchItemDataVO> dataList = searchItemVO.getData();
 				Map<String, SearchItemDataVO> dataVOMap = new HashMap<>();
 				List<String> itemCodeList = new ArrayList<>();
+				ApplyDatasVO allDatasVO = new ApplyDatasVO();
+				List<ApplyDataVO> allObjectList=new ArrayList<>();
 				if (!CollectionUtils.isEmpty(dataList)) {
 					dataList.stream().forEach(searchItemDataVO -> {
 						String itemCode = StringUtils.isNotBlank(searchItemDataVO.getProjectitem()) ? searchItemDataVO.getProjectitem() : searchItemDataVO.getMmodelcode();//椤圭洰浠e彿
@@ -264,7 +329,7 @@
 						itemCodeList.add(itemCode);
 					});
 					String tableName = "";
-					R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(btmName);
+					R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(codeClassify.getBtmTypeId());
 					if (!r.isSuccess()) {
 						throw new Throwable(r.getMsg());
 					}
@@ -273,7 +338,7 @@
 						throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷瀵硅薄锛�");
 					}
 					tableName = btmTypeVO.getTableName();
-					if (com.alibaba.nacos.common.utils.StringUtils.isBlank(tableName)) {
+					if (StringUtils.isBlank(tableName)) {
 						throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷鐩稿叧鑱旂殑琛�");
 					}
 					StringBuffer sb = new StringBuffer();
@@ -282,19 +347,21 @@
 					sb.append(" where 1=1");
 					sb.append(" and lastr=1 and lastv=1");
 					sb.append(" and codeclsfid = '" + codeClassify.getOid() + "' ");
-					sb.append( VciBaseUtil.toInSql(attrKey,VciBaseUtil.array2String(itemCodeList.toArray(new String[]{}))));
+					sb.append(" and "+ VciBaseUtil.toInSql(attrKey,itemCodeList.toArray(new String[]{})));
 					List<Map<String, String>> newDataList = commonsMapper.queryByOnlySqlForMap(sb.toString());
 					//List<BaseModel> baseModelList=new ArrayList<>();
 					Map<String,BaseModel> baseModelMap=new HashMap<>();
 					newDataList.stream().forEach(dataMap->{
 						BaseModel baseModel=new BaseModel();
-						DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,baseModel,false,user);
+						Map<String,String> newDateMap=new CaseInsensitiveMap<>(dataMap);
+						DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(newDateMap,baseModel,true,user);
 						DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel,user);
 						//baseModelList.add(baseModel);
-						String attrKeyValue=dataMap.getOrDefault(attrKey,"");
+
+						String attrKeyValue=newDateMap.getOrDefault(attrKey,"");
 						baseModelMap.put(attrKeyValue,baseModel);
 					});
-					ApplyDatasVO editDatasVO = new ApplyDatasVO();
+
 					List<ApplyDataVO> addObjectList=new ArrayList<>();
 					List<ApplyDataVO> editObjectList=new ArrayList<>();
 					dataVOMap.forEach((key,value)->{
@@ -305,6 +372,10 @@
 							changeObjectToMap(value,"",user,"create",addObjectList);
 						}
 					});
+					allObjectList.addAll(addObjectList);
+					allObjectList.addAll(editObjectList);
+					allDatasVO.setObject(allObjectList);
+					LinkedList<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new LinkedList<>();
 					if(!CollectionUtils.isEmpty(addObjectList)){
 						//瑙勫垯鐨勪富閿渶瑕佸幓鑾峰彇
 						CodeClassifyFullInfoBO classifyFullInfo = codeClassifyService.getClassifyFullInfo(codeClassify.getOid());
@@ -323,32 +394,91 @@
 						this.getConfigDatas(systemId, btmName, applyDatasVO, attrVOS, dataObjectVO);
 						CodeOrderDTO orderDTO = new CodeOrderDTO();
 						orderDTO.setCodeClassifyOid(codeClassify.getOid());//鍒嗙被涓婚敭
-
+						//鐮佹璁剧疆
+						List<SectionVO> section=new ArrayList<>();
+						SectionVO sectionVO=new SectionVO();
+						sectionVO.setValue(secValue);
+						sectionVO.setName(secName);
+						section.add(sectionVO);
 						log.info("end锛氳鍒欒幏鍙栧畬姣�");
-						List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(null, ruleVO,classifyFullInfo);
+						List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(section, ruleVO,classifyFullInfo);
 						log.info("end锛氱爜娈佃幏鍙栧畬姣�");
-
 						orderDTO.setSecDTOList(codeOrderSecDTOList);//鍒嗙被鐮佹
 						mdmIOService.batchSyncApplyCode(orderDTO, dataObjectVO, resultDataObjectDetailDOs,false);
+						allResultDataObjectDetailDOS.addAll(resultDataObjectDetailDOs);
 					}
-
+					//鏇存柊鏁版嵁锛堟洿鏂扮姸鎬侊級
 					if(!CollectionUtils.isEmpty(editObjectList)){
 						DataObjectVO dataObjectVO = new DataObjectVO();
 						ApplyDatasVO applyDatasVO = new ApplyDatasVO();
+						applyDatasVO.setObject(editObjectList);
 						LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>();
 						CodeClassifyVO codeClassifyVO=new CodeClassifyVO();
 						BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassify, codeClassifyVO);
 						this.getConfigDatas(systemId, btmName, applyDatasVO, attrVOS, dataObjectVO);
 						mdmIOService.batchSyncEditDatas(codeClassifyVO,dataObjectVO, resultDataObjectDetailDOs,false);
-
+						allResultDataObjectDetailDOS.addAll(resultDataObjectDetailDOs);
 					}
+					Object paramObject = JSONObject.toJSON(allDatasVO);
+					paramString=Func.isEmpty(paramObject)?"":paramObject.toString();
+					Object backObject = JSONObject.toJSON(allResultDataObjectDetailDOS);
+					backString=Func.isEmpty(backObject)?"":backObject.toString();
 				}
 			}
 			catch (Throwable e){
+				e.printStackTrace();;
 				log.error("鏌ヨ澶辫触--->"+e);
+				success=false;
+				backString="鏌ヨ澶辫触--->"+e;
+				msg="鏌ヨ澶辫触--->"+e;
+				throw new VciBaseException(e.getMessage());
+			}finally {
+				try {
+					//璁板綍鏃ュ織
+					this.saveLogs(systemId, systemId, paramString, backString, success, msg, "queryData");
+				}catch (Throwable e){
+					e.printStackTrace();
+					log.error(e.getMessage());
+					throw new VciBaseException(e.getMessage());
+				}
 			}
 		}
 	}
+
+	/***
+	 * 璁板綍鏃ュ織淇℃伅
+	 * @param systemId
+	 * @param parmaData
+	 * @param result
+	 * @return
+	 */
+	private  void saveLogs(String systemId,String systemName,String parmaData, String result,boolean isSucess,String msg,String operation){
+		//璁板綍鏃ュ織淇℃伅
+		DockingLog dockingLoge=new DockingLog();
+		//String oid=redisService.getUUIDEveryDay();
+		dockingLoge.setSystemCode(StringUtils.isBlank(systemId)?"-":systemId);//璁剧疆绯荤粺鏍囪瘑
+		dockingLoge.setSystemName(StringUtils.isBlank(systemName)?"-":systemName);
+		dockingLoge.setMsg(msg);//鏃ュ織娑堟伅
+		dockingLoge.setClassifyId("-");//鍒嗙被缂栧彿
+		dockingLoge.setClassifyName("-");//鍒嗙被鍚嶇О
+		dockingLoge.setClassifyOid("-");//鍒嗙被涓婚敭
+		dockingLoge.setUniqueCode("-");//鍞竴鏍囪瘑
+		dockingLoge.setSystemOid("-");//绯荤粺鏍囪瘑
+//        dockingLogeDO.setName(operation);
+		//dockingLogeDO.setOid(oid);//鏃ュ織涓婚敭
+		dockingLoge.setParamString(parmaData);//鍙傛暟淇℃伅
+		dockingLoge.setReturnString(result);//杩斿洖淇℃伅
+		dockingLoge.setType(operation);//鏃ュ織鎿嶄綔绫诲瀷
+		dockingLoge.setCreateTime(new Date());
+		if(isSucess) {
+			dockingLoge.setInterfaceStatus("true");//鎺ュ彛闆嗘垚鐘舵��
+		}else{
+			dockingLoge.setInterfaceStatus("false");//鎺ュ彛闆嗘垚鐘舵��
+		}
+		dockingLogeService.save(dockingLoge);
+		log.info("闆嗘垚鎺ㄩ�佹暟鎹垚鍔�,systemId:"+systemId+",systemname:"+systemName+",operation:"+operation+",param:"+parmaData);
+	}
+
 	/***
 	 * 鏍规嵁浼犲叆鐨勫弬鏁颁俊鎭牎楠岀爜娈佃鍒�
 	 */
@@ -540,13 +670,15 @@
 	 //String status= searchItemDataVO.getStatus();//鏁版嵁鐘舵�� 瀛楃鍨嬶紝鏋氫妇鍊硷紱鍒跺崟锛�0锛涘鎵逛腑锛�1锛涢�氳繃锛�2锛涢┏鍥烇細3锛�
 
 	 String mmodelCode=searchItemDataVO.getMmodelcode();//鍒堕�犲瀷鍙蜂唬鍙�
-	 initProperty("mmodelCode","","mmodelCode",propList);
+	 initProperty("mmodelcode","",mmodelCode,propList);
 	 String projectCode= searchItemDataVO.getProjectcode();//椤圭洰缂栫爜
-	 initProperty("projectcode","","projectCode",propList);
+	 initProperty("projectcode","",projectCode,propList);
 	 String projectItem=searchItemDataVO.getProjectitem();//椤圭洰浠e彿
-	 initProperty("projectitem","","projectItem",propList);
+	 initProperty("projectitem","",projectItem,propList);
 	 String materialCode=searchItemDataVO.getMaterialcode();//浜у搧缂栫爜
-	 initProperty("materialcode","","materialCode",propList);
+	 initProperty("materialcode","",materialCode,propList);
+	 //缁勫悎灞炴�х殑澶勭悊
+	 initProperty(attrKey,"",StringUtils.isNotBlank(projectItem)?projectItem:mmodelCode,propList);
 	 String creatBy=searchItemDataVO.getCreatby();//鍒涘缓鑰�
 	 Date cretaeDon= searchItemDataVO.getCreatedon();//鍒涘缓鏃ユ湡 鏃ユ湡鍨嬶紝濡傦細2023-09-08 19:24:11
 	 String lastchangeBy=searchItemDataVO.getLastchangedby();//鏇存敼鑰�
@@ -554,7 +686,7 @@
 	 String isenabled=  searchItemDataVO.getIsenabled();//瀛楃鍨嬶紝鏋氫妇鍊硷紱鍋滅敤锛�0锛涘惎鐢細1锛�
 	 applyDataVO.setOperate(operation);
 	 applyDataVO.setCode(code);
-	 if(isenabled.equals(0)){
+	 if(isenabled.equals("0")){
 		 applyDataVO.setStatus(CodeDefaultLC.DISABLE.getValue());
 	 }else{
 		 applyDataVO.setStatus(CodeDefaultLC.RELEASED.getValue());

--
Gitblit v1.9.3