业务类型新增按钮联调修正。
业务类型弹出表单细节修正。
| | |
| | | }) |
| | | } |
| | | |
| | | export const queryPage = (key,notInStr,current,size) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/attribute/query-page', |
| | | method: 'get', |
| | | params: { |
| | | key, |
| | | notInStr, |
| | | current, |
| | | size |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | <!-- 屿§å表--> |
| | | <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> |
| | |
| | | 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: "é»è®¤å¼", |
| | |
| | | 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 => { |
| | |
| | | }, |
| | | initTreeOnLoad() { |
| | | initTree().then(res => { |
| | | console.log('123'); |
| | | this.treeData = res.data.data; |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | console.log(this.selectionList); |
| | | }, |
| | | dialoghandelfalse() { |
| | | this.ref.visible = false; |
| | |
| | | }, |
| | | 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(); |
| | | } |
| | | }, |
| | | } |
| | |
| | | @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" |
| | |
| | | </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="屿§æ± " |
| | |
| | | :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> |
| | |
| | | |
| | | <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: { |
| | |
| | | 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 |
| | | }, |
| | |
| | | label: "é»è®¤å¼", |
| | | prop: "defaultValue", |
| | | cell: 'true', |
| | | align: 'center' |
| | | align: 'center', |
| | | cell: true |
| | | }, |
| | | { |
| | | label: "说æ", |
| | | prop: "description", |
| | | cell: 'true', |
| | | align: 'center' |
| | | align: 'center', |
| | | cell:true |
| | | } |
| | | ] |
| | | }, |
| | |
| | | page: { |
| | | currentPage:1, |
| | | pageSize:10, |
| | | key:'' |
| | | }, |
| | | key: null, |
| | | option:{ |
| | | height: 360, |
| | | addBtn: false, |
| | |
| | | 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' |
| | | }, |
| | |
| | | { |
| | | label: "说æ", |
| | | prop: "description", |
| | | cell:true, |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | queryNotIn: [] |
| | | queryNotIn: null |
| | | } |
| | | } |
| | | }, |
| | |
| | | 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(); |
| | | }, |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | label: '屿§ç¼å·', |
| | | prop: 'key', |
| | | align: 'left', |
| | | display: false |
| | | display: false, |
| | | width: 200 |
| | | }, { |
| | | label: '屿§åç§°', |
| | | prop: 'label', |
| | |
| | | |
| | | private String name; |
| | | |
| | | private String id; |
| | | |
| | | private String oid; |
| | | |
| | | private List<BtmTypeTreeVO> childList; |
| | |
| | | */ |
| | | private boolean viewFlag; |
| | | |
| | | /** |
| | | * è§å¾æ¾ç¤ºå段 |
| | | */ |
| | | private String viewText; |
| | | /** |
| | | * è§å¾å建çsqlè¯å¥ |
| | | */ |
| | |
| | | */ |
| | | private String domain; |
| | | |
| | | /** |
| | | * é¢åæ¾ç¤ºå段 |
| | | */ |
| | | private String domainText; |
| | | |
| | | /** |
| | | * å
å«å±æ§ |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.starter.web.enumpck; |
| | | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | public enum NewAppConstantEnum { |
| | | |
| | | /** |
| | | * ç¼ç è§åï¼æå¡å¯å¨å |
| | | */ |
| | | APPLICATION_NAME_CODE(AppConstant.APPLICATION_NAME_CODE,"ç¼ç è§åæå¡"), |
| | | ; |
| | | |
| | | /** |
| | | * æä¸¾çname |
| | | */ |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | if (!CollectionUtils.isEmpty(linkTypeVOList)) { |
| | | modifyAttributeInfoList.addAll(checkLinkType(linkTypeVOList)); |
| | | } |
| | | if (CollectionUtils.isEmpty(modifyAttributeInfoList)) { |
| | | if (!CollectionUtils.isEmpty(modifyAttributeInfoList)) { |
| | | reflexDifferent(modifyAttributeInfoList, btmTypeVOList, linkTypeVOList); |
| | | } |
| | | return modifyAttributeInfoList; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | }) |
| | | @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); |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | |
| | | 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; |
| | |
| | | @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) { |
| | |
| | | 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; |
| | |
| | | * @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()); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | btmTypeDO.setTableName(getTableName(btmTypeDO.getId(),btmTypeDO.getDomain())); |
| | | } |
| | | // æ·»å 屿§ |
| | | btmTypeDTO.setOid(btmTypeDO.getOid()); |
| | | afterAttributes = addAttributeForBtm(btmTypeDTO); |
| | | baseMapper.insert(btmTypeDO); |
| | | }else { |
| | |
| | | // éè¦æ§å¶å¯çº§ |
| | | 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) { |
| | |
| | | @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); |
| | |
| | | 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); |
| | |
| | | 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()); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | 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); |
| | | // å¨è¿è¿è¡éç¨å段å¤ç |
| | |
| | | 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; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @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; |
| | | } |