From ca6ec80da1bffc13e67b2ce5e34ff67f485cc74f Mon Sep 17 00:00:00 2001 From: lihang <lihang@vci-tech.com> Date: 星期二, 16 五月 2023 17:51:56 +0800 Subject: [PATCH] 业务类型新增按钮联调修正。 业务类型弹出表单细节修正。 --- Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java | 15 + Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java | 2 Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/NewAppConstantEnum.java | 59 +++++++ Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeVO.java | 9 + Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java | 3 Source/UBCS-WEB/src/api/omd/btmType.js | 16 ++ Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeAttributeWrapper.java | 7 Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java | 2 Source/UBCS-WEB/src/views/modeling/original.vue | 3 Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java | 34 ++++ Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 156 +++++++++++++----- Source/UBCS-WEB/src/api/omd/OmdAttribute.js | 13 + Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/AttributeWrapper.java | 5 Source/UBCS-WEB/src/views/modeling/Business.vue | 75 +++----- Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeWrapper.java | 5 Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java | 25 +- 16 files changed, 314 insertions(+), 115 deletions(-) diff --git a/Source/UBCS-WEB/src/api/omd/OmdAttribute.js b/Source/UBCS-WEB/src/api/omd/OmdAttribute.js index 783f658..690ad99 100644 --- a/Source/UBCS-WEB/src/api/omd/OmdAttribute.js +++ b/Source/UBCS-WEB/src/api/omd/OmdAttribute.js @@ -50,3 +50,16 @@ }) } +export const queryPage = (key,notInStr,current,size) => { + return request({ + url: '/api/ubcs-omd/attribute/query-page', + method: 'get', + params: { + key, + notInStr, + current, + size + } + }) +} + diff --git a/Source/UBCS-WEB/src/api/omd/btmType.js b/Source/UBCS-WEB/src/api/omd/btmType.js index 1d9218e..86d043c 100644 --- a/Source/UBCS-WEB/src/api/omd/btmType.js +++ b/Source/UBCS-WEB/src/api/omd/btmType.js @@ -40,4 +40,20 @@ oid: oid } }) +} + +export const add = (btmType,auto) => { + return request({ + url: '/api/ubcs-omd/btm-type/submit/' + auto, + method: 'post', + data: btmType + }) +} + +export const update = (btmType) => { + return request({ + url: '/api/ubcs-omd/btm-type/submit/' + auto, + method: 'post', + data: btmType + }) } \ No newline at end of file diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index 87d1d21..3b59829 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -50,7 +50,9 @@ <i :class="icons.domain"></i> 鎵�灞為鍩� </template> - {{ obj.domain }} + <el-tag size="small"> + {{ obj.domainText }} + </el-tag> </el-descriptions-item> <!-- <el-descriptions-item> <template slot="label"> @@ -85,7 +87,9 @@ <i :class="icons.view"></i> 瑙嗗浘 </template> - {{ obj.viewFlag }} + <el-tag size="small"> + {{ obj.viewText }} + </el-tag> </el-descriptions-item> <!-- <el-descriptions-item> <template slot="label"> @@ -106,17 +110,25 @@ <!-- 灞炴�у垪琛�--> <basic-container> <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p> - <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"></avue-crud> + <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"> + <template slot="attrDataType" slot-scope="{row}" > + <el-tag>{{row.attrDataType}}</el-tag> + </template> + </avue-crud> </basic-container> </el-main> <el-dialog :visible="ref.visible" title="浠庢暟鎹簱涓坊鍔�" width="700px" append-to-body @close="dialoghandelfalse"> 閫夋嫨棰嗗煙锛� <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad"> - <el-option v-for="item in domainOptions" :key="item" :label="item" :value="item"> + <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange"> </avue-crud> + <div slot="footer" class="dialog-footer"> + <el-button @click="dialoghandeltrue">纭畾</el-button> + <el-button @click="dialoghandelfalse">鍙栨秷</el-button> + </div> </el-dialog> </el-container> </el-container> @@ -169,18 +181,19 @@ columnBtn:false, column: [ { - label: '灞炴�ц嫳鏂囧悕绉�', + label: '鑻辨枃鍚嶇О', prop: 'id', align: 'center' }, { - label: '灞炴�т腑鏂囧悕绉�', + label: '涓枃鍚嶇О', prop: 'name', align: 'center' }, { - label: "灞炴�х被鍨�", + label: "绫诲瀷", prop: "attrDataType", - align: 'center' + align: 'center', + slot: true }, { label: "榛樿鍊�", @@ -248,38 +261,6 @@ this.initDomainOption(); }, methods: { - //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗗彇娑堢偣鍑讳簨浠� - dialoghandelfalse() { - this.packageLifeBox = false - }, - //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙‘瀹氱偣鍑讳簨浠� - dialoghandeltrue() { - this.packageLifeBox = false - }, - //閫夋嫨鐢熷懡鍛ㄦ湡瀵硅瘽妗� - handelLife() { - this.packageLifeBox = true - }, - //鐗堟湰瑙勫垯鎵嬪姩杈撳叆鍜岄�夋嫨妗嗙殑鐘舵�佸彇鍙� - handelRules() { - this.rulesFalg = !this.rulesFalg - }, - //鐗堟湰瑙勫垯涓変釜鎸夐挳鐨勬樉绀洪殣钘� - radioChange(val) { - if (val.value == 0) { - this.basicOption.group[1].column[1].display = false; - this.basicOption.group[1].column[2].display = false; - this.basicOption.group[1].column[3].display = false; - } else if (val.value == 1) { - this.basicOption.group[1].column[1].display = true; - this.basicOption.group[1].column[2].display = true; - this.basicOption.group[1].column[3].display = false; - } else if (val.value == 2) { - this.basicOption.group[1].column[1].display = true; - this.basicOption.group[1].column[2].display = true; - this.basicOption.group[1].column[3].display = true; - } - }, nodeClick(data) { if(data.oid){ getDetail(data.oid).then(res => { @@ -297,7 +278,6 @@ }, initTreeOnLoad() { initTree().then(res => { - console.log('123'); this.treeData = res.data.data; }); }, @@ -308,7 +288,6 @@ }, selectionChange(list) { this.selectionList = list; - console.log(this.selectionList); }, dialoghandelfalse() { this.ref.visible = false; @@ -324,13 +303,15 @@ }, businessAdd(){ this.$refs.btmAdd.showSubmitDialog = true; - this.$refs.btmAdd.refreshAttrTable(); - console.log('娣诲姞'); + this.ifRefreshBtmAddRefresh(); }, businessEdit(){ - this.addOption.btmType = this.obj; - this.$refs.addOption.showSubmitDialog = true; - console.log('缂栬緫'); + this.$refs.btmAdd.btmType = this.obj; + this.$refs.btmAdd.showSubmitDialog = true; + this.ifRefreshBtmAddRefresh(); + }, + ifRefreshBtmAddRefresh(){ + this.$refs.btmAdd.refreshAttrTable(); } }, } diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue index c56390b..946768b 100644 --- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue +++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue @@ -6,42 +6,54 @@ @close="closeSubmitDialog" width="74%" > - <el-form ref="form" :model="btmType" show-message="true" inline> - <el-form-item label="鑻辨枃鍚嶇О:" label-width="100px"> + <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"> + + <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true"> <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input> </el-form-item> - <el-form-item label="涓枃鍚嶇О:" label-width="100px"> + <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-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"> + <el-form-item label="鎵�灞為鍩�" label-width="100px"> <el-select v-model="btmType.domain" :prefix-icon="icons.domain"> <el-option v-for="item in domainOption" - :label="item"></el-option> + :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.revisionRuleId" :prefix-icon="icons.revisionRule"> + <el-form-item label="鐗堟湰瑙勫垯" label-width="100px"> + <el-input v-model="btmType.revisionRuleId" :prefix-icon="icons.revisionRule" class="revisionRule"> <i slot="suffix" class="el-input__icon el-icon-search"></i> </el-input> </el-form-item> - <el-form-item label="鐢熷懡鍛ㄦ湡:" label-width="100px"> + <el-form-item label="鐢熷懡鍛ㄦ湡" label-width="100px"> <el-input v-model="btmType.lifeCycleId" :prefix-icon="icons.lifeCycle"> <i slot="suffix" class="el-input__icon el-icon-search"></i> </el-input> </el-form-item> - <el-form-item label="瑙嗗浘:" label-width="100px"> - <el-input v-model="btmType.view" :prefix-icon="icons.view"></el-input> + <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"> + <el-form-item label="瑙嗗浘璇彞" label-width="100px"> + <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" ></el-input> </el-form-item> </el-form> - <avue-crud :option="option" :data="btmType.attributes" :page.sync="page" ref="attrTable"> + <avue-crud :option="option" + :data="btmType.attributes" + :page.sync="page" + ref="attrTable" + @cell-mouse-enter="cellEditClick" + @cell-mouse-leave="cellEditSave"> <template slot-scope="scope" slot="menuLeft"> <el-button type="danger" icon="el-icon-plus" @@ -50,8 +62,10 @@ </template> </avue-crud> - <el-button @click="submitBtmType">纭畾</el-button> + <div slot="footer" class="dialog-footer"> + <el-button @click="submitBtmType">纭畾</el-button> <el-button @click="cancleSubmitBtmType">鍙栨秷</el-button> + </div> <el-dialog title="灞炴�ф睜" @@ -66,13 +80,16 @@ :page.sync="attrRef.page" ref="attrRef" @on-load="attrRefOnLoad" + @search-change="attrRefSearch" @selection-change="selectionChange"> <template slot="name" slot-scope="scope" > <el-tag>{{scope}}</el-tag> </template> </avue-crud> - <el-button @click="confirmSelectAttr">纭畾</el-button> - <el-button @click="cancleSelectAttr">鍙栨秷</el-button> + <div slot="footer" class="dialog-footer"> + <el-button @click="confirmSelectAttr">纭畾</el-button> + <el-button @click="cancleSelectAttr">鍙栨秷</el-button> + </div> </el-dialog> </el-dialog> </template> @@ -80,8 +97,8 @@ <script> -import { } from '@/api/omd/btmType'; -import { getPage } from '@/api/omd/OmdAttribute'; +import { add,update } from '@/api/omd/btmType'; +import { queryPage } from '@/api/omd/OmdAttribute'; export default { name: 'BusinessAdd', props: { @@ -117,17 +134,18 @@ highlightCurrentRow: true, column: [ { - label: '灞炴�ц嫳鏂囧悕绉�', + label: '鑻辨枃鍚嶇О', prop: 'id', align: 'left' }, { - label: '灞炴�т腑鏂囧悕绉�', + label: '涓枃鍚嶇О', prop: 'name', - align: 'center' + align: 'center', + cell: true }, { - label: "灞炴�х被鍨�", - prop: "typeValue", + label: "绫诲瀷", + prop: "attrDataType", align: 'center', slot: true }, @@ -135,13 +153,15 @@ label: "榛樿鍊�", prop: "defaultValue", cell: 'true', - align: 'center' + align: 'center', + cell: true }, { label: "璇存槑", prop: "description", cell: 'true', - align: 'center' + align: 'center', + cell:true } ] }, @@ -150,8 +170,8 @@ page: { currentPage:1, pageSize:10, - key:'' }, + key: null, option:{ height: 360, addBtn: false, @@ -160,19 +180,22 @@ selection: true, menu: false, border: true, + reserveSelection: true, + searchMenuSpan:8, column: [ { - label: '灞炴�ц嫳鏂囧悕绉�', + label: '鑻辨枃鍚嶇О', prop: 'key', align: 'left', + search: true, width: 230 }, { - label: '灞炴�т腑鏂囧悕绉�', + label: '涓枃鍚嶇О', prop: 'label', - align: 'center' + align: 'center', }, { - label: "灞炴�х被鍨�", + label: "绫诲瀷", prop: "typeValue", align: 'center' }, @@ -199,12 +222,13 @@ { label: "璇存槑", prop: "description", + cell:true, align: 'center' } ] }, data: [], - queryNotIn: [] + queryNotIn: null } } }, @@ -214,42 +238,52 @@ methods: { closeSubmitDialog(){ this.showSubmitDialog = false; + this.btmType.attributes = []; this.btmType = {}; + this.attrRef.selectData = []; + this.attrRef.queryNotIn = null; }, closeAttrDialog(){ this.attrRef.visible = false; }, rowAdd(){ this.attrRef.visible = true; - this.$refs.attrRef.refreshTable(); this.attrRefOnLoad(); - }, attrRefOnLoad(){ - var str = ''; - this.attrRef.queryNotIn.forEach(item => { - str = str + item + ',' - }); - getPage(this.attrRef.page.currentPage, this.attrRef.page.pageSize,{'condition["key_like"]':this.attrRef.page.key}).then(res => { + 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; - }) + }); + this.$nextTick(() => { + this.$refs.attrRef.refreshTable(); + }); + }, + attrRefSearch(form,done){ + this.attrRef.key = form.key; + this.attrRefOnLoad(); + done(); + this.attrRef.key = null; }, selectionChange(list){ this.attrRef.selectData = list; }, confirmSelectAttr(){ this.btmType.attributes = []; + this.attrRef.queryNotIn = ""; this.attrRef.selectData.forEach(item => { this.btmType.attributes.push({ id: item.key, name: item.label, typeValue: item.typeValue, + typeKey: item.typeValue, + attrDataType : item.typeValue, defaultValue: item.defaultValue, - description: item.description + description: item.description, + attributeLength: item.maxLength }); - this.attrRef.queryNotIn.push(item.key); + this.attrRef.queryNotIn += (item.key + ",") }); this.closeAttrDialog(); }, @@ -258,17 +292,35 @@ this.closeAttrDialog(); }, submitBtmType(){ - // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂� console.log(this.btmType); - this.$emit('refreshTable'); + add(this.btmType,true).then(res => { + // 娣诲姞瀹屾垚锛屽洖璋冪埗缁勪欢鐨勫埛鏂� + this.$message.success('淇濆瓨鎴愬姛'); + this.cancleSubmitBtmType(); + this.$emit('refreshTable'); + }) }, cancleSubmitBtmType(){ this.btmType = {}; this.btmType.attributes = []; - console.log(this.btmType); + this.showSubmitDialog = false; }, refreshAttrTable(){ - this.$refs.attrTable.refreshTable(); + this.$nextTick( () => { + this.$refs.attrTable.refreshTable(); + }) + }, + viewChange(){ + + }, + cellEditClick(cell){ + cell.$cellEdit = true; + }, + cellEditSave(row){ + this.btmType.attributes[row.$index].name = row.name + this.btmType.attributes[row.$index].defaultValue = row.defaultValue; + this.btmType.attributes[row.$index].description = row.description; + row.$cellEdit = false; } } } @@ -277,6 +329,18 @@ <style> /* 灞炴�ф睜鍙傜収鍒楄〃 */ .attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ - display: none !important; + display: none !important; +} + +.btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner { + width: 200px; +} + +.viewFlag { + width: 305px; +} + +.descClass > .el-input__inner { + width: 57vw } </style> \ No newline at end of file diff --git a/Source/UBCS-WEB/src/views/modeling/original.vue b/Source/UBCS-WEB/src/views/modeling/original.vue index 910206a..72a86fc 100644 --- a/Source/UBCS-WEB/src/views/modeling/original.vue +++ b/Source/UBCS-WEB/src/views/modeling/original.vue @@ -152,7 +152,8 @@ label: '灞炴�х紪鍙�', prop: 'key', align: 'left', - display: false + display: false, + width: 200 }, { label: '灞炴�у悕绉�', prop: 'label', diff --git a/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java b/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java index e0d2770..40ea05a 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java +++ b/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java @@ -21,6 +21,8 @@ private String name; + private String id; + private String oid; private List<BtmTypeTreeVO> childList; diff --git a/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeVO.java b/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeVO.java index 74bee2c..58a2003 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeVO.java +++ b/Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeVO.java @@ -132,6 +132,10 @@ */ private boolean viewFlag; + /** + * 瑙嗗浘鏄剧ず瀛楁 + */ + private String viewText; /** * 瑙嗗浘鍒涘缓鐨剆ql璇彞 */ @@ -177,6 +181,11 @@ */ private String domain; + /** + * 棰嗗煙鏄剧ず瀛楁 + */ + private String domainText; + /** * 鍖呭惈灞炴�� */ diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/NewAppConstantEnum.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/NewAppConstantEnum.java new file mode 100644 index 0000000..6f024d0 --- /dev/null +++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/NewAppConstantEnum.java @@ -0,0 +1,59 @@ +package com.vci.ubcs.starter.web.enumpck; + +import org.springblade.core.launch.constant.AppConstant; + +public enum NewAppConstantEnum { + + /** + * 缂栫爜瑙勫垯锛屾湇鍔″惎鍔ㄥ悕 + */ + APPLICATION_NAME_CODE(AppConstant.APPLICATION_NAME_CODE,"缂栫爜瑙勫垯鏈嶅姟"), + ; + + /** + * 鏋氫妇鐨刵ame + */ + private String name; + + /** + * 鏋氫妇鏄剧ず鏂囨湰 + */ + private String text; + + NewAppConstantEnum(String name, String text) { + this.name = name; + this.text = text; + } + + public String getName() { + return name; + } + + public String getText() { + return text; + } + + public void setName(String name) { + this.name = name; + } + + public void setText(String text) { + this.text = text; + } + + + public static String getTextByName(String name) { + NewAppConstantEnum[] var1 = values(); + int var2 = var1.length; + + for(int var3 = 0; var3 < var2; ++var3) { + NewAppConstantEnum eu = var1[var3]; + if (eu.name.equals(name)) { + return eu.text; + } + } + + return null; + } + +} diff --git a/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java index 6bd64b9..91bb8c2 100644 --- a/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java @@ -532,7 +532,7 @@ if (!CollectionUtils.isEmpty(linkTypeVOList)) { modifyAttributeInfoList.addAll(checkLinkType(linkTypeVOList)); } - if (CollectionUtils.isEmpty(modifyAttributeInfoList)) { + if (!CollectionUtils.isEmpty(modifyAttributeInfoList)) { reflexDifferent(modifyAttributeInfoList, btmTypeVOList, linkTypeVOList); } return modifyAttributeInfoList; diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java index 16a5701..84a5c7b 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java @@ -1,6 +1,9 @@ package com.vci.ubcs.omd.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.vci.ubcs.omd.constant.OmdCacheConstant; @@ -18,10 +21,14 @@ import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -80,7 +87,7 @@ }) @ApiOperationSupport(order = 2) @ApiOperation(value = "鏌ヨ鍒楄〃", notes = "浼犲叆鏌ヨ") - public R<IPage<AttributeVO>> parentList(@ApiIgnore @RequestParam Map<String, Object> condition, Query query) { + public R<IPage<AttributeVO>> pageList(@ApiIgnore @RequestParam Map<String, Object> condition, Query query) { IPage<AttributeVO> pageVO = new Page<>(); IPage<Attribute> page = attributeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition, Attribute.class).lambda().orderByAsc(Attribute::getKey)); BeanUtil.copy(page,pageVO); @@ -88,6 +95,31 @@ return R.data(pageVO); } + @GetMapping("/query-page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "key",value = "灞炴�у悕妯$硦",paramType = "query",dataType = "string"), + @ApiImplicitParam(name = "notIn",value = "灞炴�у悕鎺掗櫎",paramType = "query",dataType = "string") + }) + @ApiOperationSupport(order = 6) + @ApiOperation(value = "鏌ヨ鍒楄〃",notes = "浼犲叆鏌ョ殑鍊煎拰涓嶆煡鐨勫��") + public R<IPage<AttributeVO>> queryPageList(String key,String notInStr,Query query){ + LambdaQueryWrapper<Attribute> wrapper = Wrappers.<Attribute>query().lambda(); + if (StringUtil.isNotBlank(notInStr)){ + List<String> notInList = Func.toStrList(",", notInStr); + if (!CollectionUtils.isEmpty(notInList)){ + wrapper = wrapper.notIn(Attribute::getKey,notInList); + } + } + if (StringUtil.isNotBlank(key)){ + wrapper = wrapper.like(Attribute::getKey,key); + } + IPage<Attribute> page = attributeService.page(Condition.getPage(query),wrapper.orderByAsc(Attribute::getKey)); + IPage<AttributeVO> pageVO = new Page<>(); + BeanUtil.copy(page,pageVO); + pageVO.setRecords(AttributeWrapper.build().listEntityVO(page.getRecords())); + return R.data(pageVO); + } + /** * 鏂板鎴栦慨鏀� diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java index 87a2030..4613774 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java @@ -13,6 +13,7 @@ import com.vci.ubcs.omd.service.IBtmTypeService; import com.vci.ubcs.omd.vo.BtmTypeTreeVO; import com.vci.ubcs.omd.vo.BtmTypeVO; +import com.vci.ubcs.omd.vo.DomainVO; import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; import io.swagger.annotations.*; import lombok.AllArgsConstructor; @@ -146,7 +147,7 @@ @GetMapping("/domain") @ApiOperationSupport(order = 6) @ApiOperation(value = "鑾峰彇棰嗗煙鍊�") - public R<List<String>> getDomain(){ + public R<List<DomainVO>> getDomain(){ try { return R.data(DomainRepeater.getDomain()); } catch (NacosException e) { diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java index e7ad4cc..3a2df3a 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java @@ -7,15 +7,17 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.pojo.Instance; -import com.alibaba.nacos.api.naming.pojo.ServiceInfo; import com.vci.ubcs.common.constant.LauncherConstant; import com.vci.ubcs.omd.dto.BtmAndLinkTypeDdlDTO; import com.vci.ubcs.omd.vo.BtmTypeVO; +import com.vci.ubcs.omd.vo.DomainVO; import com.vci.ubcs.omd.vo.LinkTypeVO; +import com.vci.ubcs.starter.web.enumpck.NewAppConstantEnum; import org.springblade.core.launch.constant.AppConstant; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.StringPool; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.*; import org.springframework.stereotype.Component; @@ -243,11 +245,18 @@ * @return 涓嶅寘鍚粯璁ゆ湇鍔$殑鍏朵粬鏈嶅姟 * @throws NacosException */ - public static List<String> getDomain() throws NacosException { + public static List<DomainVO> getDomain() throws NacosException { RestTemplate restTemplate = new RestTemplate(); String url = "http://" +LauncherConstant.NACOS_DEV_ADDR + "/nacos/v1/ns/service/list?pageNo=1&pageSize=50"; String forObject = restTemplate.getForObject(url, String.class); JSONObject jsonObject = JSON.parseObject(forObject); - return (List<String>) jsonObject.get("doms"); + List<String> doms = (List<String>) jsonObject.get("doms"); + NewAppConstantEnum[] apps = NewAppConstantEnum.values(); + return Arrays.stream(apps).filter(app -> doms.stream().anyMatch(s -> StringUtil.equals(app.getName(), s))).map(app -> { + DomainVO domain = new DomainVO(); + domain.setValue(app.getName()); + domain.setLabel(app.getText()); + return domain; + }).collect(Collectors.toList()); } } diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java index 70559e2..c12be50 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java @@ -6,6 +6,7 @@ import com.alibaba.nacos.api.exception.NacosException; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.vci.ubcs.omd.cache.EnumCache; import com.vci.ubcs.omd.constant.BtmTypeFieldConstant; import com.vci.ubcs.omd.dto.BtmAndLinkTypeDdlDTO; import com.vci.ubcs.omd.entity.Attribute; @@ -13,7 +14,7 @@ import com.vci.ubcs.omd.service.IAttributeService; import com.vci.ubcs.omd.service.IBtmTypeAttributeService; import com.vci.ubcs.omd.service.IModifyAttributeService; -import com.vci.ubcs.omd.vo.BtmTypeTreeVO; +import com.vci.ubcs.omd.vo.*; import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; import com.vci.ubcs.omd.wrapper.ModifyAttributeWrapper; import com.vci.ubcs.starter.web.constant.OmdRegExpConstant; @@ -24,9 +25,6 @@ import com.vci.ubcs.omd.entity.ModifyAttributeInfo; import com.vci.ubcs.omd.mapper.BtmTypeMapper; import com.vci.ubcs.omd.service.IBtmTypeService; -import com.vci.ubcs.omd.vo.BtmTypeVO; -import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; -import com.vci.ubcs.omd.vo.LinkTypeVO; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.web.enumpck.BooleanEnum; import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; @@ -496,6 +494,7 @@ btmTypeDO.setTableName(getTableName(btmTypeDO.getId(),btmTypeDO.getDomain())); } // 娣诲姞灞炴�� + btmTypeDTO.setOid(btmTypeDO.getOid()); afterAttributes = addAttributeForBtm(btmTypeDTO); baseMapper.insert(btmTypeDO); }else { @@ -620,9 +619,6 @@ // 闇�瑕佹帶鍒跺瘑绾� btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP)); } - if (StringUtils.isBlank(btmTypeDTO.getOid())) { - btmTypeDTO.setOid(VciBaseUtil.getPk()); - } } @Override public boolean deleteLogic(@NotEmpty List<Long> ids) { @@ -642,18 +638,21 @@ @Override public List<BtmTypeTreeVO> treeDomain() { try { - List<String> domain = DomainRepeater.getDomain(); + Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(s -> s.getValue(), t -> t.getLabel())); List<BtmTypeVO> vos = BtmTypeWrapper.build().listEntityVO(baseMapper.selectAll()); Map<String, List<BtmTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(BtmTypeVO::getDomain)); List<BtmTypeTreeVO> treeList = new ArrayList<>(); domainMap.forEach((k,v)-> { - if (domain.contains(k)){ + if (domain.containsKey(k)){ + String label = domain.get(k); BtmTypeTreeVO parent = new BtmTypeTreeVO(); - parent.setName(k); + parent.setName(label); + parent.setId(k); parent.setChildList(v.stream().map(s -> { BtmTypeTreeVO child = new BtmTypeTreeVO(); child.setOid(s.getOid()); child.setName(s.getId() + " " + (s.getName() == null ? "" : s.getName())); + child.setId(s.getId()); return child; }).collect(Collectors.toList())); treeList.add(parent); @@ -675,7 +674,7 @@ public List<BtmTypeVO> getFromTable(String domain) { VciBaseUtil.alertNotNull(domain,"棰嗗煙鍊�"); try { - if (!DomainRepeater.getDomain().contains(domain)){ + if (!DomainRepeater.getDomain().stream().collect(Collectors.toMap(DomainVO::getValue, DomainVO::getLabel)).containsKey(domain)){ return null; } R result = DomainRepeater.getFromTable(domain); @@ -737,7 +736,9 @@ Attribute attribute = new Attribute(); attribute.setKey(attr.getId()); attribute.setLabel(attr.getName()); - attribute.setDictKey(attr.getAttrDataType()); + attribute.setTypeCode("attributeType"); + attribute.setTypeKey(attr.getAttrDataType()); +// attribute.setDictKey(attr.getAttrDataType()); attribute.setMaxLength(attr.getAttributeLength()); attribute.setPrecision(attr.getPrecisionLength()); attribute.setDescription(attr.getDescription()); diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/AttributeWrapper.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/AttributeWrapper.java index 15dbf9b..d279695 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/AttributeWrapper.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/AttributeWrapper.java @@ -36,9 +36,8 @@ if (StringUtil.isNotBlank(vo.getReferTypeCode())){ vo.setReferTypeValue(DictBizCache.getValue(vo.getReferTypeCode(),vo.getReferTypeKey())); } - if (StringUtil.isNotBlank(vo.getDictCode())){ - vo.setDictValue(DictBizCache.getValue(vo.getDictCode(),vo.getDictKey())); - } + vo.setDictValue(vo.getDictKey()); + vo.setTypeValue(vo.getTypeKey()); return vo; } diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeAttributeWrapper.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeAttributeWrapper.java index dfb98cc..ac9030c 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeAttributeWrapper.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeAttributeWrapper.java @@ -3,6 +3,7 @@ import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; import com.vci.ubcs.omd.entity.BtmTypeAttribute; import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; +import com.vci.ubcs.starter.web.util.VciBaseUtil; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; @@ -53,7 +54,13 @@ */ public BtmTypeAttribute copyBtmTypeAttributeDTO2Entity(BtmTypeLinkAttributesDTO dto, String btmTypeOid, String creator, Date now){ BtmTypeAttribute entity = Objects.requireNonNull(BeanUtil.copy(dto, BtmTypeAttribute.class)); + entity.setOid(VciBaseUtil.getPk()); + entity.setBtmName("btmTypeAttribute"); + entity.setOwner(creator); + entity.setCreator(creator); + entity.setCreateTime(now); entity.setLastModifier(creator); + entity.setLastModifyTime(now); entity.setTs(now); entity.setPkBtmType(btmTypeOid); // 鍦ㄨ繖杩涜閫氱敤瀛楁澶勭悊 diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeWrapper.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeWrapper.java index 4a60ab2..c5b577a 100644 --- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeWrapper.java +++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/BtmTypeWrapper.java @@ -4,6 +4,7 @@ import com.vci.ubcs.omd.entity.BtmType; import com.vci.ubcs.omd.vo.BtmTypeVO; import com.vci.ubcs.starter.web.enumpck.BooleanEnum; +import com.vci.ubcs.starter.web.enumpck.NewAppConstantEnum; import com.vci.ubcs.starter.web.util.VciBaseUtil; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.secure.utils.AuthUtil; @@ -11,6 +12,7 @@ import java.util.Date; import java.util.List; +import java.util.Locale; import java.util.Objects; import java.util.stream.Collectors; @@ -33,12 +35,15 @@ @Override public BtmTypeVO entityVO(BtmType entity) { BtmTypeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, BtmTypeVO.class)); + vo.setDomainText(NewAppConstantEnum.getTextByName(vo.getDomain())); + vo.setTableName(vo.getTableName().toUpperCase(Locale.ROOT)); // 鍦ㄨ繖閲岃缃灇涓炬樉绀哄�� vo.setRevisionFlag(BooleanEnum.TRUE.getValue().equals(entity.getRevisionFlag())); vo.setSecretFlag(BooleanEnum.TRUE.getValue().equals(entity.getSecretFlag())); vo.setLifeCycleFlag(BooleanEnum.TRUE.getValue().equals(entity.getLifeCycleFlag())); vo.setInputRevisionFlag(BooleanEnum.TRUE.getValue().equals(entity.getInputRevisionFlag())); vo.setViewFlag(BooleanEnum.TRUE.getValue().equalsIgnoreCase(entity.getViewFlag())); + vo.setViewText(vo.isViewFlag() ? "瑙嗗浘" : "闈炶鍥�"); vo.setAbstractFlag(BooleanEnum.TRUE.getValue().equals(entity.getAbstractFlag())); return vo; } -- Gitblit v1.9.3