From 67a8703176c9f36519d98c52130b12316029bb23 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 18 七月 2023 15:20:28 +0800 Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs --- Source/UBCS-WEB/src/views/modeling/cycle.vue | 138 ++++++++ Source/UBCS-WEB/.gitignore | 1 Source/UBCS-WEB/src/components/Tree/classifyTrees.vue | 3 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/webService/config/AttributeMapConfig.java | 2 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 49 ++ Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue | 84 ++++- Source/UBCS-WEB/src/components/template/SetPersonnel.vue | 4 Source/UBCS-WEB/vue.config.js | 4 Source/UBCS-WEB/src/components/flow-cycle/components/DetailForm.vue | 1 Source/UBCS-WEB/src/api/modeling/cycle.js | 11 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java | 2 Source/UBCS-WEB/src/components/FormTemplate/index.vue | 114 ++---- Source/UBCS-WEB/src/components/Master/MasterTransfer.vue | 121 ++++++++ Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue | 111 ++++++- Source/UBCS-WEB/src/components/flow-cycle/components/DetailPanel.vue | 79 +++- Source/UBCS-WEB/src/page/index/index.vue | 5 Source/UBCS-WEB/src/views/work/process/leave/handle.vue | 3 Source/UBCS-WEB/src/main.js | 4 Source/UBCS-WEB/src/components/Master/MasterTree.vue | 4 Source/UBCS-WEB/src/components/work/BusinessWork.vue | 72 ++++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java | 12 Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue | 39 ++ Source/UBCS-WEB/src/components/Tree/attrCrud.vue | 29 + 23 files changed, 700 insertions(+), 192 deletions(-) diff --git a/Source/UBCS-WEB/.gitignore b/Source/UBCS-WEB/.gitignore index 38bac29..dac7a4b 100644 --- a/Source/UBCS-WEB/.gitignore +++ b/Source/UBCS-WEB/.gitignore @@ -5,6 +5,7 @@ /tests/e2e/videos/ /tests/e2e/screenshots/ + # local env files .env.local .env.*.local diff --git a/Source/UBCS-WEB/src/api/modeling/cycle.js b/Source/UBCS-WEB/src/api/modeling/cycle.js index 765575c..90fe8ca 100644 --- a/Source/UBCS-WEB/src/api/modeling/cycle.js +++ b/Source/UBCS-WEB/src/api/modeling/cycle.js @@ -42,10 +42,19 @@ data }) } +// 鑾峰彇鐢熷懡鍛ㄦ湡浜嬩欢 +export const getEventList = (params) => { + return request({ + url: '/api/ubcs-omd/lifeCycle/page-event', + method: 'get', + params + }) +} export default { getList, add, detail, del, - edit + edit, + getEventList } diff --git a/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue index e888918..5268994 100644 --- a/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue +++ b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue @@ -281,7 +281,7 @@ title: "鏌ョ湅璇︾粏淇℃伅", setForm: {}, }, - batchApplyCodeTableData: {}, + batchSelectTableData: {}, savedList: [], tab1Loading: false, tab2Loading: false, @@ -308,7 +308,7 @@ if (first === true) { this.codeRuleOid = data.codeRuleOid; // 绗竴娆℃墦寮�鐩存帴璧嬪�间笉鏍¢獙 - this.batchApplyCodeTableData[data.codeRuleOid] = { + this.batchSelectTableData[data.codeRuleOid] = { name: data.name, templateOid: data.oid, cloNamesList: data.cloNamesList, @@ -328,8 +328,8 @@ } } } - if (!this.batchApplyCodeTableData[data.codeRuleOid]) { - this.batchApplyCodeTableData[data.codeRuleOid] = { + if (!this.batchSelectTableData[data.codeRuleOid]) { + this.batchSelectTableData[data.codeRuleOid] = { name: data.name, templateOid: data.oid, cloNamesList: data.cloNamesList, @@ -337,6 +337,31 @@ codeRuleOid: data.codeRuleOid, }; } + } + if (this.type === 'historyImport') { + if (first === true) { + // 绗竴娆℃墦寮�鐩存帴璧嬪�间笉鏍¢獙 + this.batchSelectTableData[data.codeClassifyOid] = { + name: data.name, + templateOid: data.oid, + cloNamesList: data.cloNamesList, + codeClassifyOid: data.codeClassifyOid, + codeRuleOid: data.codeRuleOid, + }; + // 涓嶆槸绗竴娆℃墦寮�闇�瑕佷紭鍏堟牎楠� + }else if (this.localCodeClassifyOid === data.codeClassifyOid) { + console.log("閲嶅鐐瑰嚮"); + } + if (!this.batchSelectTableData[data.codeClassifyOid]) { + this.batchSelectTableData[data.codeClassifyOid] = { + name: data.name, + templateOid: data.oid, + cloNamesList: data.cloNamesList, + codeClassifyOid: data.codeClassifyOid, + tab1Selected: [] + }; + } + this.selection = this.batchSelectTableData[this.localCodeClassifyOid]['tab1Selected'] } this.localCodeClassifyOid = data.codeClassifyOid; this.cloNamesList = data.cloNamesList; @@ -352,7 +377,11 @@ (item) => !this.savedList.includes(item.oid) ); if (this.type === "batchApplyCode") { - this.batchApplyCodeTableData[data.codeRuleOid]["tab1"] = + this.batchSelectTableData[data.codeRuleOid]["tab1"] = + this.tab1Table; + } + if (this.type === "historyImport") { + this.batchSelectTableData[data.codeClassifyOid]["tab1"] = this.tab1Table; } }); @@ -366,13 +395,17 @@ this.tab2Loading = false this.tab2Table = res.data.data; if (this.tab2Table.length > 0 && this.type === "batchApplyCode") { - this.batchApplyCodeTableData[data.codeRuleOid]["codeApply"] = {}; - this.batchApplyCodeTableData[data.codeRuleOid]["tab2"] = - res.data.data; + this.batchSelectTableData[data.codeRuleOid]["codeApply"] = {}; + this.batchSelectTableData[data.codeRuleOid]["tab2"] = + this.tab2Table if (this.$refs.CodeApply) { this.$refs.CodeApply.loading = true; } this.getCodeRule(); + } + if (this.type === "historyImport") { + this.batchSelectTableData[data.codeClassifyOid]["tab2"] = + this.tab2Table } }); getFormTemplate({ @@ -384,6 +417,9 @@ }, tab1TableSelectChange(selection) { this.selectedTab1Table = selection; + if (this.batchSelectTableData[this.localCodeClassifyOid]) { + this.batchSelectTableData[this.localCodeClassifyOid]['tab1Selected'] = selection + } }, resembleRowChange(row) { if (!row || !row.oid) { @@ -425,7 +461,7 @@ return false; } } - let lookedCodeRuleOidList = Object.keys(this.batchApplyCodeTableData); + let lookedCodeRuleOidList = Object.keys(this.batchSelectTableData); let noLookCodeRuleOidList = this.leftTree.filter( (item) => !lookedCodeRuleOidList.includes(item.codeRuleOid) ); @@ -436,9 +472,9 @@ } let errorData = []; let successData = []; - for (const key in this.batchApplyCodeTableData) { - if (Object.hasOwnProperty.call(this.batchApplyCodeTableData, key)) { - const element = this.batchApplyCodeTableData[key]; + for (const key in this.batchSelectTableData) { + if (Object.hasOwnProperty.call(this.batchSelectTableData, key)) { + const element = this.batchSelectTableData[key]; if (element.tab1.length > 0) { errorData.push(element); } @@ -479,6 +515,27 @@ }, }; }); + } else if (this.type === 'historyImport') { + let lookedCodeRuleOidList = Object.keys(this.batchSelectTableData); + let noLookCodeRuleOidList = this.leftTree.filter( + (item) => !lookedCodeRuleOidList.includes(item.codeClassifyOid) + ); + let noLookName = noLookCodeRuleOidList.map((item) => item.name); + if (noLookName.length > 0) { + this.$message.warning(`鏁版嵁${noLookName}杩樻湭鏇炬煡鐪嬶紝璇峰厛鏌ョ湅锛乣); + return false; + } + params.codeImprotSaveDatVOList = this.batchSelectTableData.map(item => { + return { + Clos: item.cloNamesList, + dataList: item.tab2.concat(item.tab1Selected), + orderDTO: { + codeClassifyOid: item.codeClassifyOid, + templateOid: item.templateOid, + secDTOList: this.secDTOList, + }, + } + }) } else { params.codeImprotSaveDatVOList = [ { @@ -495,7 +552,6 @@ this.submitLoading = true submitHistoryimport(params).then((res) => { this.submitLoading = false - console.log(res); if (res.data.code === 200) { this.$message.success(res.data.msg); } @@ -503,7 +559,6 @@ }, // 閲嶆柊缂栬緫 reEdit(row) { - console.log(row, "row"); this.currentSelectedResembleRow = { templateOid: row.codetemplateoid, codeClassifyOid: row.codeclassifyid, @@ -517,7 +572,6 @@ // 鐩存帴缂栬緫鍚庝繚瀛� FormTemplateSubmit(form) { addSaveCode(form).then((res) => { - console.log(res); if (res.data.code === 200) { this.savedList.push(form.oid); this.$message.success("鏂板鎴愬姛锛�"); diff --git a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue index 26286f1..1290ecb 100644 --- a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue @@ -67,15 +67,20 @@ :type="edit" :visible.sync="DataVisible"></FormTemplateDialog> <!-- 鍙戝竷--> - <set-personnel :parameter="this.parameter" :visible.sync="visibleFlow"></set-personnel> + <set-personnel :parameter="this.parameter" :visible.sync="visibleFlow" :title="title"></set-personnel> +<!-- 鍋滅敤--> + <set-personnel :parameter="this.parameter" :visible.sync="visibleDeactivate" :title="title"></set-personnel> +<!-- 鍚敤--> + <set-personnel :parameter="this.parameter" :visible.sync="visibleEnable" :title="title"></set-personnel> +<!-- 鍥炴敹--> + <set-personnel :parameter="this.parameter" :visible.sync="visibleRecovery" :title="title"></set-personnel> <!-- 楂樼骇鏌ヨ--> <advanced-query :options="this.options" :visible.sync="findvisible" @echoContion="echoContion"></advanced-query> - - <integration-transfer :data="transferData" :props="transferProps" :visible.sync="dialogPush" - @save="handelTransferSave"></integration-transfer> +<!-- 瀵煎嚭--> + <MasterTransfer :visible.sync="dialogPush" :tableHeadData="tableHeadFindData" :codeClassifyOid="codeClassifyOid" :tableData="tableData"></MasterTransfer> +<!-- 鐩镐技椤�--> <ResembleQueryDialog :codeClassifyOid="codeClassifyOid" :codeRuleOid="this.codeRuleOid" :rowOid="rowOid" :templateOid="templateOid" :visible.sync="similarVisible"></ResembleQueryDialog> - <div class="block" style="display: flex; justify-content: flex-end"> <el-pagination :current-page="page.currentPage" :page-size="page.pageSizes" :page-sizes="page.pageSizes" :total="page.total" layout="total, sizes, prev, pager, next, jumper" @@ -166,7 +171,8 @@ parameter: { ids: [], code: "", - type: "PUBLIC", + type: '', + // this.visibleDeactivate ?'ENABLE':this.visibleEnable ? 'DISABLE' :this.visibleRecovery ? 'ROLLBACK' :'PUBLIC' template: "", vars: { codeClassifyOid: "", @@ -174,7 +180,15 @@ } }, visibleNames:[], + //鍙戝竷 visibleFlow: false, + //鍋滅敤 + visibleDeactivate:false, + //鍚敤 + visibleEnable:false, + //鍥炴敹 + visibleRecovery:false, + title:'', transferData: [], transferProps: { key: "oid", @@ -308,16 +322,6 @@ this.$refs.dataTable.doLayout() } }, - // 鍙戝竷 - setHandler() { - if (this.selectRow.length <= 0) { - this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); - } else { - this.userName = localStorage.getItem("username"); - this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; - this.visibleFlow = true; - } - }, openVis(visible) { console.log(visible) this[visible] = true @@ -334,9 +338,14 @@ // if(uniqueFlag === 'CODEEDIT') return this.openBatchImport('batchApplyCode') if (uniqueFlag === 'CODESTARTPROCESS') return this.setHandler() if (uniqueFlag === 'CODEUPREVISION') return this.DataChange() - if (uniqueFlag === 'CODERECYCLE') return this.huishouHandler() if (uniqueFlag === 'CODEEXPORT') return this.openD() if (uniqueFlag === 'CODEQUERY') return this.findHandler() + //鍋滅敤 + if (uniqueFlag === 'CODEDISABLE') return this.Deactivate() + //鍚敤 + if (uniqueFlag === 'CODEENABLE') return this.Enable() + //鍥炴敹 + if (uniqueFlag === 'CODERECYCLE') return this.Recovery() // 鐩镐技椤规煡璇� // if(uniqueFlag === 'CODEEDIT') return this.similarHandler() }); @@ -361,6 +370,74 @@ rend() { this.tableData = this.tableHeadData; }, + // 鍙戝竷 + setHandler() { + // let EditFlag1=false + // let EditFlag2=false + // if(EditFlag1){ + // this.$message.warning('鍙湁鐘舵�佹槸銆愮紪杈戜腑銆戠殑鏁版嵁鎵嶅彲浠ュ彂璧锋祦绋�') + // }else if(EditFlag2){ + // this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愮紪杈戜腑銆戞墠鍙互鍙戣捣娴佺▼') + // } + this.selectRow.forEach(item=>{ + if(this.selectRow.length === 1 && item.lcstatus !== "Editing"){ + this.$message.warning('鍙湁鐘舵�佹槸銆愮紪杈戜腑銆戠殑鏁版嵁鎵嶅彲浠ュ彂璧锋祦绋�') + }else if(item.lcstatus !== 'Editing'){ + this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愮紪杈戜腑銆戞墠鍙互鍙戣捣娴佺▼') + }else { + this.userName = localStorage.getItem("username"); + this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; + this.parameter.type='PUBLIC' + this.title='娴佺▼瀹℃壒' + this.visibleFlow = true; + } + }) + // if (this.selectRow.length <= 0) { + // this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); + // } else { + // this.userName = localStorage.getItem("username"); + // this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; + // this.parameter.type='PUBLIC' + // this.title='娴佺▼瀹℃壒' + // this.visibleFlow = true; + // } + }, + //鍋滅敤 + Deactivate(){ + if (this.selectRow.length <= 0) { + this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); + } else { + this.userName = localStorage.getItem("username"); + this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; + this.parameter.type='DISABLE' + this.title='鍋滅敤锛堝喕缁擄級缂栫爜鏁版嵁' + this.visibleDeactivate=true; + } + }, + //鍚敤 + Enable(){ + if (this.selectRow.length <= 0) { + this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); + } else { + this.userName = localStorage.getItem("username"); + this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; + this.parameter.type='ENABLE' + this.title='鍚敤锛堣В鍐伙級缂栫爜鏁版嵁' + this.visibleEnable=true; + } + }, + //鍥炴敹 + Recovery(){ + if (this.selectRow.length <= 0) { + this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); + } else { + this.userName = localStorage.getItem("username"); + this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; + this.parameter.type='ROLLBACK' + this.title='鍥炴敹缂栫爜鏁版嵁' + this.visibleRecovery=true; + } + }, handleSizeChange(val) { this.isLoading = true; setTimeout(() => { diff --git a/Source/UBCS-WEB/src/components/FormTemplate/index.vue b/Source/UBCS-WEB/src/components/FormTemplate/index.vue index 68f7141..045c798 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/index.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/index.vue @@ -328,42 +328,8 @@ this.form ); } - if (resembleQueryList.length === 0) { - let resForm = {}; - const { defaultValue, formValue } = this.getDefaultValueAndFormValues( - this.form - ); - const noData = [ - "jiliangdwname", - "materialtypeText", - "morengongysname", - "$caigouwl", - "$xiaoshouwl", - "$shifoupihaoguanli", - "lcstatus_text", - "hesuanfenleiname", - "$kucunwl", - ]; - noData.forEach((item) => { - this.$delete(formValue, item); - }); - resForm.data = formValue; - resForm = Object.assign({}, resForm, defaultValue); - resForm.secDTOList = []; - for (const key in this.codeApplyForm) { - if (Object.hasOwnProperty.call(this.codeApplyForm, key)) { - const value = this.codeApplyForm[key]; - if (value) { - resForm.secDTOList.push({ secOid: key, secValue: value }); - } - } - } - resForm.codeClassifyOid = this.codeClassifyOid; - resForm.codeRuleOid = this.codeRuleOid; - resForm.templateOid = this.templateOid; - this.$emit("submit", resForm); - } else { - this.$confirm( + if (resembleQueryList.length > 0) { + await this.$confirm( `璇ョ墿鏂欏凡鏈�${resembleQueryList.length}鏉$浉浼兼暟鎹紝鏄惁缁х画淇濆瓨锛焋, "闇�瑕佹偍纭", { @@ -371,41 +337,49 @@ cancelButtonText: "鍙栨秷", type: "warning", } - ) - .then(() => { - // 鎺掗櫎涓�浜涘瓧娈� - const noData = [ - "jiliangdwname", - "materialtypeText", - "morengongysname", - "$caigouwl", - "$xiaoshouwl", - "$shifoupihaoguanli", - "lcstatus_text", - "hesuanfenleiname", - "$kucunwl", - ]; - let resForm = {}; - const { defaultValue, formValue } = - this.getDefaultValueAndFormValues(this.form); - noData.forEach((item) => { - this.$delete(formValue, item); - }); - resForm.data = formValue; - resForm = Object.assign({}, resForm, defaultValue); - resForm.secDTOList = this.secVOList.map((item) => { - return { - secOid: item.oid, - secValue: this.codeApplyForm[item.oid], - }; - }); - resForm.codeClassifyOid = this.codeClassifyOid; - resForm.codeRuleOid = this.codeRuleOid; - resForm.templateOid = this.templateOid; - this.$emit("submit", resForm); - }) - .catch(() => {}); + ); } + // 鎺掗櫎涓�浜涘瓧娈� + const noData = [ + "jiliangdwname", + "materialtypeText", + "morengongysname", + "$caigouwl", + "$xiaoshouwl", + "$shifoupihaoguanli", + "lcstatus_text", + "hesuanfenleiname", + "$kucunwl", + ]; + let resForm = {}; + const { defaultValue, formValue } = this.getDefaultValueAndFormValues( + this.form + ); + noData.forEach((item) => { + this.$delete(formValue, item); + }); + const keys = Object.keys(formValue); + debugger + keys.forEach((item, index) => { + keys.forEach((itm, idx) => { + if ((item === ('$' + itm)) && idx !== index) { + this.$delete(formValue, keys[index]); + } + }) + }); + + resForm.data = formValue; + resForm = Object.assign({}, resForm, defaultValue); + resForm.secDTOList = this.secVOList.map((item) => { + return { + secOid: item.oid, + secValue: this.codeApplyForm[item.oid], + }; + }); + resForm.codeClassifyOid = this.codeClassifyOid; + resForm.codeRuleOid = this.codeRuleOid; + resForm.templateOid = this.templateOid; + this.$emit("submit", resForm); }, getDefaultValueAndFormValues(form) { let defaultValue = {}; diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue new file mode 100644 index 0000000..9341b92 --- /dev/null +++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue @@ -0,0 +1,121 @@ +<template> +<el-dialog :visible.sync="dialogPush" append-to-body :close-on-click-modal="false" @close="recoverPage" title="瀵煎嚭"> + <div style="margin-bottom: 10px"> + <el-button type="success" + @click="handleExcel">涓嬭浇 澶氱骇琛ㄥごexcel</el-button> + <el-radio-group v-model="radio"> + <el-radio :label="0">閫夋嫨</el-radio> + <el-radio :label="1">鍏ㄩ儴</el-radio> + <el-radio :label="2">椤电爜</el-radio> + </el-radio-group> + </div> + <div style="text-align: center"> + <el-transfer + style="text-align: left; display: inline-block;height: 400px" + filterable + :filter-method="filterMethod" + filter-placeholder="鍏抽敭璇嶆悳绱�" + v-model="value" + :titles="['鏈�夊睘鎬�', '宸查�夊睘鎬�']" + :data="data"> + </el-transfer> + </div> +</el-dialog> +</template> + +<script> +export default { +name: "MasterTransfer", + props:['visible','tableHeadData','codeClassifyOid','tableData'], + data(){ + return { + data: [], + value: [], + filterMethod(query, item) { + return item.label.indexOf(query) > -1; + }, + dialogPush:this.visible, + radio:0, + tableHeadFindData:[], + tableExportData:[], + option:{ + title: '鏂囨。鏍囬', + column: [{ + label: '澶氱骇琛ㄥご', + prop: 'header', + children: [] + }], + data: [] + } + }; + }, + watch:{ + //鐩戝惉鍒濆鍖� + visible (){ + this.dialogPush = this.visible; + }, + //琛ㄥご鏁版嵁 鐢ㄦ潵娓叉煋绌挎妗� + tableHeadData:{ + handler(newval,oldval){ + console.log(newval) + if(newval){ + //excel琛ㄥご鏁版嵁杞崲 + this.tableHeadFindData=newval.map(obj => obj.label); + this.tableHeadFindData.forEach((city, index) => { + this.data.push({ + label: city, + key: index, + }); + }); + //excel琛ㄦ牸鏁版嵁杞崲 + this.option.column[0].children=newval.map(obj => { + return { + label: obj.label, + prop: obj.prop + } + }) + } + } +}, + tableData(){ + // 灏嗗�奸噷闈㈢殑true鎴杅alse鏀瑰彉涓烘槸鎴栧惁 + this.option.data = this.tableData.map(obj => { + for (let prop in obj) { + if (obj[prop] === "true") { + obj[prop] = "鏄�"; + } else if (obj[prop] === "false") { + obj[prop] = "鍚�"; + } + } + return obj; + }); + }, + codeClassifyOid:{ + handler(newval,oldval){ + } + } + }, + computed:{ + + }, + mounted() { + }, + methods:{ + //鍏抽棴椤甸潰 + recoverPage(){ + this.$emit('update:visible', false); + }, + handleExcel(){ + this.$Export.excel({ + title: this.option.title, + columns: this.option.column, + data: this.option.data + }); + }, + } +} +</script> + +<style scoped lang="scss"> + +</style> diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue index cf5f526..2a583b3 100644 --- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue +++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue @@ -121,9 +121,7 @@ codeClassifyOid: this.nodeClickList.oid, functionId: 5, }).then(res => { - console.log('1-', res.data) - console.log('123-', res.data.buttons) - const flagsToDeleteBtn = ["CODEIMPORTHISTORY", "CODEBATCHADD", "CODESTARTPROCESS", "CODEEXPORT", "CODEQUERY"]; + const flagsToDeleteBtn = ["CODEIMPORTHISTORY", "CODEEXPORT", "CODEQUERY","batchApplyCode"]; //涓嶅悓鑺傜偣鏄剧ず涓嶅悓鎸夐挳 if (!res.data.leaf) { this.masterVrBtnList = res.data.buttons.filter(obj => flagsToDeleteBtn.includes(obj.uniqueFlag)); diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue index 7c68f93..cc66270 100644 --- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue +++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue @@ -242,7 +242,7 @@ </div> <el-table :data="ProData" style="width: 100%" - height="280" + height="750" @cell-click="handleCellClicks" @select="selectHandle" @selection-change="selectionChange" @@ -1637,15 +1637,26 @@ }, //鏋氫妇娉ㄥ叆淇濆瓨 enumAddHandle() { - if (this.enumRow.length < 1) { - this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�') - } else { - if(this.CurrentCell){ - this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.enumRow)); + let hasError = false; // 娣诲姞涓�涓彉閲� + this.tableData.forEach((item, index) => { + if (item.key === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳); + hasError = true; + return; + } else if (item.value === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`); + hasError = true; + return; + } + }); + // 淇濆瓨鎵ц閫昏緫 + if (!hasError) { + if (this.CurrentCell) { + this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); this.enumVisible = false; - }else { - this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.enumRow)); - this.tableData=[] + } else { + this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); + this.tableData=[]; this.enumVisible = false; } } diff --git a/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue b/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue index b57d4e4..ed4565f 100644 --- a/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue +++ b/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue @@ -923,7 +923,8 @@ selectHandle(selection,row){ this.crudOid=row.oid; this.crudArray=selection; - gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => { + console.log(selection,row) + gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': row.oid}).then(res => { this.ProData = res.data.data; }).catch(res => { this.$message.error(res) diff --git a/Source/UBCS-WEB/src/components/flow-cycle/components/DetailForm.vue b/Source/UBCS-WEB/src/components/flow-cycle/components/DetailForm.vue index 282b161..39b6379 100644 --- a/Source/UBCS-WEB/src/components/flow-cycle/components/DetailForm.vue +++ b/Source/UBCS-WEB/src/components/flow-cycle/components/DetailForm.vue @@ -124,7 +124,6 @@ created() { const formModel = this.root.propsAPI.getSelected()[0].getModel() - console.log(formModel, 'formModel'); this.formModel = Object.assign( { width: 80, height: 48 }, { shape: 'flow-smooth' }, diff --git a/Source/UBCS-WEB/src/components/flow-cycle/components/DetailPanel.vue b/Source/UBCS-WEB/src/components/flow-cycle/components/DetailPanel.vue index 78c2af5..6f1b324 100644 --- a/Source/UBCS-WEB/src/components/flow-cycle/components/DetailPanel.vue +++ b/Source/UBCS-WEB/src/components/flow-cycle/components/DetailPanel.vue @@ -46,33 +46,34 @@ <group-panel :status="status"> <detail-form type="group" /> </group-panel> - <node-panel :status="status"> + <!-- <edge-panel :status="status"> <div class="event"> <hr /> - <div class="btn_box"> - <el-button type="primary" size="mini">鏂板</el-button> - <el-button type="danger" size="mini">鍒犻櫎</el-button> - <el-button type="primary" size="mini">淇濆瓨</el-button> - </div> - <div class="flex" v-for="(item, index) in eventList" :key="index" :class="{active: index === currentActive}"> - <el-select size="mini" style="width: 70%" v-if="item.isEdit"> - <el-option></el-option> - </el-select> - <span v-else style="width: 70%">{{item.evenName}}</span> - <el-button size="mini" type="text" class="red">鍒犻櫎</el-button> - <el-button size="mini" type="text" @click="editChange(item)">{{item.isEdit ? '鏆傚瓨' : '缂栬緫'}}</el-button> - </div> + <h4>璺冭縼浜嬩欢</h4> + <el-select + size="mini" + style="width: 100%" + value-key="oid" + v-model="saveEventList" + multiple + > + <el-option + v-for="itm in eventList" + :key="itm.oid" + :value="itm" + :label="itm.eventShowName" + ></el-option> + </el-select> </div> - </node-panel> - - <!-- <multi-panel :status="status" /> --> - <!-- <canvas-panel :status="status" /> --> + </edge-panel> --> </template> </detail-panel> </div> </template> <script> +import API from "@/api/modeling/cycle"; + import { NodePanel, EdgePanel, @@ -94,7 +95,7 @@ DetailPanel, DetailForm, }, - props: ["rowData", "existNodes", "type"], + props: ["rowData", "existNodes", "existEdges", "type", "currentSelectedLine"], data() { return { newRowData: { @@ -117,9 +118,14 @@ { required: true, message: "璧峰鐘舵�佷笉鑳戒负绌�", trigger: "change" }, ], }, - eventList: [{evenName: '123123'}], - currentActive: 0 + eventList: [], + saveEventList: [], + edgeEventList: {}, + currentActive: 0, }; + }, + created() { + this.getEventList(); }, methods: { getNewRowDate() { @@ -133,9 +139,13 @@ }); }); }, - editChange(row) { - this.$set(row, 'isEdit', !row.isEdit) - } + getEventList() { + API.getEventList().then((res) => { + if (res.data.code === 200) { + this.eventList = res.data.data; + } + }); + }, }, watch: { rowData: { @@ -157,6 +167,25 @@ this.newRowData.startStatus = undefined; } }, + currentSelectedLine: { + deep: true, + handler(newV) { + if (newV.id) { + if (this.edgeEventList[newV.id]) { + this.saveEventList = this.edgeEventList[newV.id] + } else { + this.edgeEventList[newV.id] = [] + this.saveEventList = [] + } + } + } + }, + saveEventList: { + deep: true, + handler(newV) { + this.edgeEventList[this.currentSelectedLine.id] = newV + } + } }, }; </script> @@ -174,6 +203,6 @@ color: red; } .active { - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4) + // box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4) } </style> diff --git a/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue b/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue index 78b4dd5..4ffe6fe 100644 --- a/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue +++ b/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue @@ -14,7 +14,11 @@ </div> <!-- Main Chart --> <div class="vfe-chart-main"> - <flow :data="flowChartData" :onAfterChange="onAfterChange" /> + <flow + :data="flowChartData" + :onAfterChange="onAfterChange" + :onAfterItemSelected="onAfterItemSelected" + /> <div class="tooltip"> <template v-for="item in tooltipData"> <p>{{ item.name }}: {{ item.value }}</p> @@ -23,7 +27,14 @@ </div> <div class="vfe-chart-panel" v-if="type !== 'detail'"> <div class="vfe-chart-panel-detail"> - <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" :existNodes="existNodes" :type="type"/> + <editor-detail-panel + :rowData="rowData" + ref="EditorDetailPanel" + :existNodes="existNodes" + :existEdges="existEdges" + :currentSelectedLine="currentSelectedLine" + :type="type" + /> </div> </div> </div> @@ -83,7 +94,9 @@ }, tooltipShow: true, tooltipData: [], - existNodes: this.chartData.nodes || [] + existNodes: this.chartData.nodes || [], + existEdges: this.chartData.edges || [], + currentSelectedLine: {} }; }, @@ -114,10 +127,21 @@ this.$message.error("涓嶈兘娣诲姞宸插瓨鍦ㄧ殑鑺傜偣锛�"); } } - const { nodes } = this.$refs.flowChart.propsAPI.save() - this.existNodes = nodes || [] - console.log(this.$refs.flowChart.propsAPI.save()); + const { nodes, edges } = this.$refs.flowChart.propsAPI.save(); + this.existNodes = nodes || []; + this.existEdges = edges || []; }, + onAfterItemSelected({item}) { + if (item.target) { + const currentEdge = this.existEdges.filter(itm => itm.id === item.id)[0] || {} + console.log(currentEdge, 'currentEdgecurrentEdge'); + if (!Array.isArray(currentEdge.events)) { + currentEdge.events = [] + } + this.currentSelectedLine = currentEdge + } + }, + _downloadImage(data, filename = "flowchart.png") { const a = document.createElement("a"); a.href = data; @@ -136,6 +160,9 @@ getFlowData() { return this.$refs.flowChart.propsAPI.save(); }, + getEdgesEvents() { + return this.$refs.EditorDetailPanel.edgeEventList; + } }, }; </script> diff --git a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue index 2c7a417..cf03538 100644 --- a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue +++ b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue @@ -118,10 +118,8 @@ }, mounted() { - console.log('---',this.parameter) }, - created() { - console.log('parameter',this.parameter) + created() { }, methods: { setSaveParam() { diff --git a/Source/UBCS-WEB/src/components/work/BusinessWork.vue b/Source/UBCS-WEB/src/components/work/BusinessWork.vue index ff955e8..a324059 100644 --- a/Source/UBCS-WEB/src/components/work/BusinessWork.vue +++ b/Source/UBCS-WEB/src/components/work/BusinessWork.vue @@ -1,6 +1,6 @@ <template> <div> - <el-button @click="HandlerRend" size="small" type="primary">淇濆瓨</el-button> + <el-button @click="HandlerSave" v-if="hasEditor" size="small" type="primary" style="margin-bottom: 20px">淇濆瓨</el-button> <el-table v-loading="isLoading" :data="tableData" @@ -8,7 +8,6 @@ style="" @cell-click="handleCellClick" > - <el-table-column fixed type="selection" width="55"> </el-table-column> <el-table-column fixed label="搴忓彿" type="index" width="55"> </el-table-column> <el-table-column @@ -23,13 +22,13 @@ align="center" > <template slot-scope="{ row }"> - <el-input v-if="editingRow === row && editShow== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" + <el-input v-if="editingRow === row && editShow== item.prop && item.edit == 'text'" v-model="row[item.prop]" @blur="editingRows=null"></el-input> <el-input-number size="small" controls-position="right" v-if="editingRow === row && editShow== item.prop && item.edit == 'number'" v-model="row[item.prop]" @blur="editingRows=null" :style="{width:(item.width-10)+'px'}"></el-input-number> <el-select v-model="row[item.prop]" filterable allow-create default-first-option slot="prepend" v-if="editingRow === row && editShow== item.prop && item.edit == 'select' " @blur="editingRows=null"> <el-option - v-for="optionItem in item.data" + v-for="optionItem in item.dicData" :key="optionItem.dictValue" :label="optionItem.dictValue" :value="optionItem.dictValue"> @@ -39,7 +38,13 @@ v-if="item.edit === 'switch' || item.edit === 'truefalse'" v-model="row[item.prop]" active-value="true" inactive-value="false"> </el-switch> - <span v-else>{{ row[item.prop] }}</span> + <vciWebRefer v-if="editingRow === row && editShow== item.prop && item.edit == 'refer'" + :referConfig="item.referConfig || {}" + :value="row[item.referConfig.field] || row[item.prop]" + :text="row[item.referConfig.showField]" + @setReferValue="setReferValue" + ></vciWebRefer> + <span v-else v-html="formatter(row,item)"></span> </template> </el-table-column> </el-table> @@ -50,6 +55,7 @@ import {businese} from '@/api/work/businese' import {FlowTable} from "@/api/GetItem"; import {validatenull} from "@/util/validate"; +import {getDictionary} from "@/api/system/dict"; export default { name: "BusinessWork", props:['ids','templateId',"taskId","modelKey","codeClassifyOid"], @@ -62,12 +68,16 @@ editingRow: null, editShow: "", editAttr: "", + hasEditor:false, columnType: { text: "input", combox: "select", truefalse: "switch", number: "number", + textarea: "textarea", datetime: "datetime", + date: "date", + refer: "refer" } } }, @@ -86,8 +96,10 @@ mounted() { }, methods:{ - HandlerRend(){ + HandlerSave(){ this.editingRow = null; + //淇濆瓨 + this.$message.success(this.tableData[0].tuhao) }, //琛ㄦ牸澶存覆鏌� CrudHeaderRend() { @@ -103,6 +115,7 @@ 'modelKey': this.modelKey, 'codeClassifyOid': this.codeClassifyOid }).then((res) => { + this.hasEditor=res.data.tableDefineVO.hasEditor; this.options = res.data.tableDefineVO.seniorQueryColumns; this.List = res.data.tableDefineVO.cols[0]; this.tableHeadData=[]; @@ -112,7 +125,8 @@ prop: item.field, type: this.columnType[item.type], sortable: item.sort, - width: item.minWidth + width: item.minWidth, + edit:this.columnType[item.edit] }; if(item.field == 'id' && validatenull(item.templet)){ //浼佷笟缂栫爜鐨勯粯璁ゆ坊鍔犺秴閾炬帴,鏆傛湭瀹炵幇 @@ -125,11 +139,28 @@ return row[column.property] == 'true' || row[column.property] == '1' ? '鏄�' : '鍚�' } } + + } + if(validatenull(item.edit)) { + if (typeof item.editConfig == "string") { + columnItem.editConfig = eval("(" + item.editConfig + ")"); + } else { + columnItem.editConfig = item.editConfig + } if (item.edit == 'select') { //闇�瑕佽幏鍙栦笅鎷夋鏁版嵁 - columnItem.data=[] + columnItem.dicData = columnItem.editConfig.comboxConfig.data || this.geDictData(columnItem.editConfig.comboxConfig.comboxKey) + } + if (item.edit == 'refer') { + columnItem.referConfig = { + title: item.title, + showField: item.showField || item.field, + field: item.field, + options: columnItem.editConfig.referConfig + } } } + this.tableHeadData.push(Object.assign(item, columnItem)) }); }); @@ -144,11 +175,36 @@ this.tableData = res.data.data; }) }, + // 寮傛鑾峰彇瀛楀吀鏁版嵁 + geDictData(dictKey) { + getDictionary({code: dictKey}).then((res) => { + if (res.data && res.data.code === 200) { + return (res.data.data || []).map((itm) => { + itm.value = itm.dictValue; + itm.key = itm.dictKey; + return itm; + }); + } + }); + }, // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮 handleCellClick(row, column, cell, event) { this.editingRow = row; this.editShow = column.property; }, + formatter(row, column){ + if(column.formatter){ + return column.formatter(row,column) + }else{ + return row[column.prop] + } + }, + setReferValue(data) { + if (data.field) { + this.editingRow[data.field] = data.value || ""; + this.editingRow[data.showField] = data.text || ""; + } + } } } </script> diff --git a/Source/UBCS-WEB/src/main.js b/Source/UBCS-WEB/src/main.js index 7ad2bdd..d6b2346 100644 --- a/Source/UBCS-WEB/src/main.js +++ b/Source/UBCS-WEB/src/main.js @@ -51,10 +51,9 @@ import FlowPath from "@/components/template/FlowPath"; import Stage from "@/components/template/Stage"; import businesswork from "@/components/work/BusinessWork" - +import MasterTransfer from "@/components/Master/MasterTransfer"; // 灏嗗伐鍏峰嚱鏁版坊鍔犲埌鍏ㄥ眬 import utilFunc from './util/func' -import flowPath from "@/views/flow/flowPath"; Vue.prototype.$utilFunc = utilFunc // 娉ㄥ唽鍏ㄥ眬crud椹卞姩 window.$crudCommon = crudCommon; @@ -104,6 +103,7 @@ Vue.component('Stage',Stage) Vue.component('Divider', Divider) Vue.component('businesswork', businesswork) +Vue.component('MasterTransfer', MasterTransfer) // 鍔犺浇鐩稿叧url鍦板潃 Object.keys(urls).forEach(key => { diff --git a/Source/UBCS-WEB/src/page/index/index.vue b/Source/UBCS-WEB/src/page/index/index.vue index 27374ee..f802b58 100644 --- a/Source/UBCS-WEB/src/page/index/index.vue +++ b/Source/UBCS-WEB/src/page/index/index.vue @@ -18,10 +18,9 @@ <!-- 涓讳綋瑙嗗浘灞� --> <div style="height:100%;overflow-y:auto;overflow-x:hidden;" id="avue-view" v-show="!isSearch"> <keep-alive> - <!--<router-view class="avue-view" v-if="$route.meta.keepAlive"/>--> - <router-view class="avue-view"/> + <router-view class="avue-view" v-if="$route.meta.keepAlive"/> </keep-alive> - <!--<router-view class="avue-view" v-if="!$route.meta.keepAlive"/>--> + <router-view class="avue-view" v-if="!$route.meta.keepAlive"/> </div> </div> </div> diff --git a/Source/UBCS-WEB/src/views/modeling/cycle.vue b/Source/UBCS-WEB/src/views/modeling/cycle.vue index 5df55c7..07e770e 100644 --- a/Source/UBCS-WEB/src/views/modeling/cycle.vue +++ b/Source/UBCS-WEB/src/views/modeling/cycle.vue @@ -103,12 +103,7 @@ components: { CycleFlow }, data() { return { - form: { - // 'contionMap[id]': 'qwe' - // contionMap: [ - // {id: 'qwe'} - // ] - }, + form: {}, page: { pageSize: 10, total: 0, @@ -286,10 +281,138 @@ }); }, async submit() { + // const data = { + // startStatus: "Auditing", + // name: "22", + // id: "asas", + // nodes: [ + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "Auditing", + // x: 278.60856031183397, + // y: 84.12841612613737, + // id: "Auditing", + // change: true, + // index: 0, + // name: "Auditing", + // indexNum: 0, + // }, + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "Editing", + // x: 294.17388658989535, + // y: 299.9676071819219, + // id: "Editing", + // change: true, + // index: 1, + // name: "Editing", + // indexNum: 1, + // }, + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "drg", + // x: 278.60856031183397, + // y: 463.92237731083515, + // id: "drg", + // change: true, + // index: 3, + // name: "drg", + // indexNum: 3, + // }, + // ], + // edges: [ + // { + // source: "Auditing", + // sourceAnchor: 2, + // target: "Editing", + // targetAnchor: 0, + // id: "3083896f", + // index: 2, + // indexNum: 2, + // events: [ + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente", + // eventShowName: "TransationEventE", + // description: "", + // bizDomain: "mdm", + // oid: "5", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // ], + // }, + // { + // source: "Editing", + // sourceAnchor: 2, + // target: "drg", + // targetAnchor: 0, + // id: "b941a21d", + // index: 4, + // indexNum: 4, + // events: [ + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEventf", + // eventShowName: "TransationEventF", + // description: "", + // bizDomain: "mdm", + // oid: "6", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente", + // eventShowName: "TransationEventE", + // description: "", + // bizDomain: "mdm", + // oid: "5", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // ], + // }, + // ], + // }; + // API.add(data) + // .then((res) => { + // this.submitLoading = false; + // if (res.data.code === 200) { + // this.$message.success( + // this.type === "edit" ? "淇敼鎴愬姛锛�" : "鏂板鎴愬姛锛�" + // ); + // this.visible = false; + // this.search(); + // } + // }) + // .catch(() => { + // this.submitLoading = false; + // }); + // return; const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData(); if (!newRowData) { return; } + // const edgeEvents = this.$refs.vueFlowchartEditor.getEdgesEvents(); const flowData = await this.$refs.vueFlowchartEditor.getFlowData(); if (Array.isArray(flowData.nodes)) { flowData.nodes = flowData.nodes.map((item) => { @@ -302,6 +425,7 @@ flowData.edges = flowData.edges.map((item) => { item.name = item.label; item.indexNum = item.index; + // item.events = edgeEvents[item.id] || []; return item; }); } @@ -309,7 +433,7 @@ ...newRowData, ...flowData, }; - + debugger; this.submitLoading = true; let APIFun = API.add; if (this.type === "edit") { diff --git a/Source/UBCS-WEB/src/views/work/process/leave/handle.vue b/Source/UBCS-WEB/src/views/work/process/leave/handle.vue index 3dcbcb4..9355d1b 100644 --- a/Source/UBCS-WEB/src/views/work/process/leave/handle.vue +++ b/Source/UBCS-WEB/src/views/work/process/leave/handle.vue @@ -165,6 +165,9 @@ }, handelExecute(event) { console.log(event) + if(this.$refs.businesswork.hasEditor){ + this.$refs.businesswork.HandlerSave() + } const { toName, conditionKey, conditionValue } = event let param = { comment: this.opinionVal || '鍚屾剰', diff --git a/Source/UBCS-WEB/vue.config.js b/Source/UBCS-WEB/vue.config.js index ad43a75..0991057 100644 --- a/Source/UBCS-WEB/vue.config.js +++ b/Source/UBCS-WEB/vue.config.js @@ -26,10 +26,10 @@ proxy: { '/api': { //鏈湴鏈嶅姟鎺ュ彛鍦板潃 - target: 'http://localhost:37000', + // target: 'http://localhost:37000', // target: 'http://192.168.1.51:37000', // target: 'http://192.168.1.46:37000', - // target: 'http://dev.vci-tech.com:37000', + target: 'http://dev.vci-tech.com:37000', // target: 'http://192.168.1.51:37000/', // target: 'http://192.168.1.104:37000', // target: 'http://192.168.1.63:37000', diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java index 5cfa714..e1611d5 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java @@ -8,7 +8,6 @@ import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO; import com.vci.ubcs.code.dto.CodeOrderDTO; import com.vci.ubcs.code.entity.CodeAllCode; -import com.vci.ubcs.code.entity.CodeClassify; import com.vci.ubcs.code.enumpack.CodeDefaultLC; import com.vci.ubcs.code.enumpack.CodeLevelTypeEnum; import com.vci.ubcs.code.lifecycle.CodeAllCodeLC; @@ -33,7 +32,6 @@ import com.vci.ubcs.starter.revision.model.BaseModel; import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; import com.vci.ubcs.starter.util.LocalFileUtil; -import com.vci.ubcs.starter.util.MdmBtmTypeConstant; import com.vci.ubcs.starter.web.constant.QueryOptionConstant; import com.vci.ubcs.starter.web.enumpck.BooleanEnum; import com.vci.ubcs.starter.web.enumpck.UserSecretEnum; @@ -41,7 +39,6 @@ import com.vci.ubcs.starter.web.pagemodel.*; import com.vci.ubcs.starter.web.toolmodel.DateConverter; import com.vci.ubcs.starter.web.util.*; -import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.map.HashedMap; @@ -51,7 +48,6 @@ import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.ss.usermodel.Workbook; -import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; @@ -68,6 +64,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import static com.alibaba.druid.util.FnvHash.Constants.LIMIT; @@ -1455,8 +1452,8 @@ @Override public R batchImportData(List<CodeImprotSaveDatVO> codeImprotSaveDatVOList, String classifyAttr, boolean isImprot) { - - boolean success=true; + WriteExcelOption eo = new WriteExcelOption(); + AtomicBoolean success= new AtomicBoolean(true); codeImprotSaveDatVOList.stream().forEach(codeImprotSaveDatVO -> { List<SheetRowData> rowDataList = new ArrayList<>(); List<ClientBusinessObject>cboList=new ArrayList<>(); @@ -1573,7 +1570,7 @@ log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e); thisCbos.stream().forEach(cbo -> { String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); - errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";绯荤粺閿欒锛屽瓨鍌ㄦ暟鎹殑鏃跺�欏嚭閿欎簡"); + errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";绯荤粺閿欒锛屽瓨鍌ㄦ暟鎹殑鏃跺�欏嚭閿欎簡:"+e.getMessage()); }); } } @@ -1595,14 +1592,34 @@ try { productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList); } catch (Exception e) { - e.printStackTrace(); + log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e); + needSaveCboList.stream().forEach(cbo -> { + String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); + errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";绯荤粺閿欒锛屽瓨鍌ㄦ暟鎹殑鏃跺�欏嚭閿欎簡:"+e.getMessage()); + }); } //濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰 engineService.batchSaveSelectChar(codeClassifyTemplateVO, dataCBOList); } } + if(errorMap.size()>0) { + success.set(false); + LinkedList<WriteExcelData> excelDataList = new LinkedList<>(); + excelDataList.add(new WriteExcelData(0, 0, "閿欒淇℃伅")); + final int[] index = {1}; + errorMap.forEach((key,v)->{ + excelDataList.add(new WriteExcelData(index[0]++, 0, "绗�"+(Integer.parseInt(key)+1)+"琛屾暟鎹細"+v)); + }); + eo.addSheetDataList(codeClassifyTemplateVO.getName() + "瀵煎叆妯℃澘", excelDataList); + } }); - return R.success(isImprot?"鎵归噺鍘嗗彶瀵煎叆鎴愬姛":"鎵归噺鐢宠鎴愬姛"); + if(!success.get()){ + String excelName = LocalFileUtil.getDefaultTempFolder() + File.separator + (isImprot?"鎵归噺鍘嗗彶閿欒淇℃伅.xls":"鎵归噺鐢宠閿欒淇℃伅.xls"); + ExcelUtil.writeDataToFile(excelName,eo); + return R.fail(excelName); + }else { + return R.success(isImprot ? "鎵归噺鍘嗗彶瀵煎叆鎴愬姛" : "鎵归噺鐢宠鎴愬姛"); + } } /*** @@ -2723,6 +2740,7 @@ Integer userSecret = VciBaseUtil.getCurrentUserSecret(); cbo.setAttributeValue(SECRET_FIELD,String.valueOf((userSecret==null || userSecret ==0)? UserSecretEnum.NONE.getValue():userSecret)); } + cbo.setLcStatus(CodeDefaultLC.EDITING.getValue()); }else{ //姝ゆ椂杩樻病鏈夎浆鎹㈣矾寰� //cbo.setAttributeValue(CODE_FULL_PATH_FILED, childOidPathMap.getOrDefault(rowData.getData().getOrDefault(CODE_CLASSIFY_OID_FIELD,""),fullPath)); @@ -2779,6 +2797,7 @@ Integer userSecret = VciBaseUtil.getCurrentUserSecret(); cbo.setAttributeValue(SECRET_FIELD,String.valueOf((userSecret==null || userSecret ==0)? UserSecretEnum.NONE.getValue():userSecret)); } + cbo.setLcStatus(CodeDefaultLC.EDITING.getValue()); }else{ //姝ゆ椂杩樻病鏈夎浆鎹㈣矾寰� //cbo.setAttributeValue(CODE_FULL_PATH_FILED, childOidPathMap.getOrDefault(rowData.getData().getOrDefault(CODE_CLASSIFY_OID_FIELD,""),fullPath)); @@ -3624,13 +3643,15 @@ } } private List<ClientBusinessObject> ChangeMapTOClientBusinessObjects(List<Map<String,String>> oldDataMap){ - List<ClientBusinessObject> clientBusinessObjectList=new CopyOnWriteArrayList<>(); - oldDataMap.parallelStream().forEach(dataMap->{ + List<ClientBusinessObject> clientBusinessObjectList=new ArrayList<>(); + oldDataMap.stream().forEach(dataMap->{ ClientBusinessObject clientBusinessObject=new ClientBusinessObject(); DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject); - dataMap.forEach((key,value)->{ - clientBusinessObject.setAttributeValue(key,value); - }); + for (String key:dataMap.keySet()){ + Object value= dataMap.getOrDefault(key,""); + clientBusinessObject.setAttributeValue(key,value.toString()); + } + clientBusinessObjectList.add(clientBusinessObject); }); return clientBusinessObjectList; } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java index 95e3f5a..5b86905 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java @@ -104,6 +104,7 @@ String[] secLengths = cbo.getData().get(CODE_SEC_LENGTH_FIELD).split("#"); cbo.getData().remove(CODE_SEC_LENGTH_FIELD);//灏嗘key闄ゅ幓 cbo.getData().remove(IMPORT_ROW_INDEX);//灏嗘key闄ゅ幓 + cbo.getData().remove("codeclassifyid");//灏嗘key闄ゅ幓 List<CodeBasicSecVO> secVOList = ruleVO.getSecVOList().stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList()); Map<String/**鐮佹鐨勪富閿�**/,String/**鐮佹鐨勫��**/> serialValueMap = new HashMap<>(); Map<String, CodeBasicSecVO> secVOMap = secVOList.stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); @@ -290,6 +291,9 @@ for (int i = 0; i < dataCBOList.size(); i++) { BaseModel cbo = dataCBOList.get(i); + cbo.getData().remove(CODE_SEC_LENGTH_FIELD);//灏嗘key闄ゅ幓 + cbo.getData().remove(IMPORT_ROW_INDEX);//灏嗘key闄ゅ幓 + cbo.getData().remove("codeclassifyid");//灏嗘key闄ゅ幓 List<String> thisSecValueList = new LinkedList<>(); for (int j = 0; j < secValueList.size(); j++) { thisSecValueList.add(secValueList.get(j)); @@ -323,15 +327,17 @@ } saveSerialValue( ruleVO, lastMaxSerialValueMap, maxSerialValueMap); + allCodeDOList.stream().forEach( + allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");} + ); + + Map<String, String> statusMap = allCodeDOList.stream().collect(Collectors.toMap(s -> s.getOid(), s -> s.getLcStatus())); allCodeDOList.stream().filter(s -> StringUtils.equalsIgnoreCase("codeallcode",s.getBtmname())).forEach(s -> { s.setLcStatus(statusMap.get(s.getOid())); }); - allCodeDOList.stream().forEach( - allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");} - ); codeAllCodeService.saveBatch(allCodeDOList); // iCodeWupinService.saveBatch(dataCBOList); diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java index e941cac..1abb780 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java @@ -65,7 +65,7 @@ @Slf4j @VciWebservice(path = "/universalInterface") public class UniversalInterfaceImpl<IDockingLogeServiceing> implements UniversalInterfaceI { - @Value("${code.checkConfig:true}") + @Value("${code.universalinterface.checkSystemConfig:true}") public boolean CODE_CHECKCONFIG; @Autowired(required = false) private AttributeMapConfig attributeMapConfig; diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/webService/config/AttributeMapConfig.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/webService/config/AttributeMapConfig.java index 126250c..f3e376d 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/webService/config/AttributeMapConfig.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/webService/config/AttributeMapConfig.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.Map; -@ConfigurationProperties(prefix="attrconfig") +@ConfigurationProperties(prefix="code.universalinterface.attrconfig") @Component public class AttributeMapConfig { private Map<String,String> system_attrmap; -- Gitblit v1.9.3