| | |
| | | .DS_Store |
| | | node_modules |
| | | # /dist |
| | | |
| | | /vue.config/ |
| | | /tests/e2e/videos/ |
| | | /tests/e2e/screenshots/ |
| | | |
| | |
| | | } |
| | | }) |
| | | } |
| | | export const referDataGrid = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/referBtmTypeController/referDataGrid', |
| | | method: 'get', |
| | | params:{ |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | //时间格式下拉菜单 |
| | | export const listByFlag = (params) =>{ |
| | | return request({ |
| | | url:'/api/ubcs-code/bdSelectInputController/listByFlag', |
| | | method: 'get', |
| | | params:{ |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | code: "", |
| | | type: "PUBLIC", |
| | | template: "", |
| | | codeClassifyOid:"" |
| | | vars:{ |
| | | codeClassifyOid:"" |
| | | } |
| | | }, |
| | | visibleFlow: false, |
| | | transferData: [], |
| | |
| | | codeClassifyOid: { |
| | | handler(newval, oldval) { |
| | | this.codeClassifyOid = newval; |
| | | this.parameter.codeClassifyOid=newval |
| | | this.parameter.vars.codeClassifyOid=newval |
| | | }, |
| | | deep: true, |
| | | }, |
| | |
| | | <template> |
| | | <div> |
| | | <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag"> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">添加 {{ msg }}</el-button> |
| | | <!-- 全屏编辑--> |
| | |
| | | <el-button icon="el-icon-info" size="small" @click="rulesVisible=true">验证规则</el-button> |
| | | <!-- 属性分组--> |
| | | <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <<<<<<< HEAD |
| | | <!-- 分类注入--> |
| | | <el-button icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <!-- 组合规则--> |
| | |
| | | <el-button size="small" @click="CascadeHandle">级联属性</el-button> |
| | | <!-- 预览排序--> |
| | | <el-button size="small" icon="el-icon-arrow-down">预览排序</el-button> |
| | | ======= |
| | | <!-- 分类注入--> |
| | | <el-button icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <!-- 组合规则--> |
| | |
| | | <el-button size="small" @click="CascadeHandle">级联属性</el-button> |
| | | <!-- 预览排序--> |
| | | <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button> |
| | | >>>>>>> 92e7dde00a56aff46e01efe72e1f7ab9b76dcf69 |
| | | </el-button-group> |
| | | <!-- 保存--> |
| | | <el-button size="small" @click="addsHandler" icon="el-icon-check">保存</el-button> |
| | | <!-- 删除--> |
| | |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | | v-if="this.crudArrayFlag" |
| | | ref="referAttrCrud" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :formatter="formAttr" |
| | | :width="item.width||(item.label.length >=4 ?'150':item.label.length==3 ?'120':'90')" |
| | | :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" |
| | | :show-overflow-tooltip="true" |
| | | :sortable="item.sortable" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer')" v-model="row[item.prop]" |
| | | <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer' )" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input> |
| | | <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number> |
| | | <el-input-number controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input-number> |
| | | <el-select v-model="row[item.prop]" slot="prepend" v-if="editingRows === row && editShows== item.prop && item.prop == 'codeDateFormat' && row[item.prop] ==''" @focus="DataChangeHandler"> |
| | | <el-option label="餐厅名" value="1"></el-option> |
| | | <el-option label="订单号" value="2"></el-option> |
| | | <el-option label="用户电话" value="3"></el-option> |
| | | </el-select> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | | <span v-else >{{ row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作" |
| | | width="70"> |
| | | width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="small" |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!-- </avue-crud>--> |
| | | </template> |
| | | |
| | | <script> |
| | | import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto} from '@/api/template/templateAttr' |
| | | import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr' |
| | | |
| | | export default { |
| | | name: "attrCrud .vue", |
| | |
| | | isShowformulaEdit: false, |
| | | // 级联单选 |
| | | selectRow: '', |
| | | //级联单选数组 |
| | | selectRowArr:[], |
| | | // 级联data |
| | | CascadeData: [], |
| | | // 级联option |
| | |
| | | label: '排序号', |
| | | sortable: true, |
| | | edit: 'number', |
| | | width: 100, |
| | | width: 90, |
| | | fixed: true |
| | | }, { |
| | | label: "属性英文编号", |
| | |
| | | prop: "name", |
| | | fixed: true, |
| | | cell: false, |
| | | width: 125, |
| | | width: 145, |
| | | edit: 'text', |
| | | sortable: true |
| | | }, |
| | |
| | | label: "时间格式", |
| | | prop: "codeDateFormat", |
| | | sortable: true, |
| | | width: 105, |
| | | width: 135, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | |
| | | VTInteger: "整形", |
| | | VTFilePath: "文件", |
| | | VTString: "字符串" |
| | | } |
| | | }, |
| | | //时间格式下拉框 |
| | | codeDataFlag:false, |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | formAttr(row, column) { |
| | | console.log(row,column) |
| | | }, |
| | | //时间下拉格式 |
| | | DataChangeHandler(){ |
| | | debugger |
| | | listByFlag({comboxKey: 'codedateformat', |
| | | id: 'codedateformat', |
| | | namespace: 'codeclstempattr', |
| | | flag: 'dateFormates'}).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | //属性分组按钮 |
| | | attrVisibleHandle() { |
| | | |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.attrSelectList < 1) { |
| | |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.attrOid |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | } |
| | | }, |
| | | // 排序预览按钮 |
| | | orderHandle(){ |
| | | this.$refs.referAttrCrud.sort("orderNum"); |
| | | //级联保存 |
| | | CascadeAddHandle() { |
| | | let CascadeString = ""; |
| | | CascadeString = this.selectRowArr.id + (this.selectRowArr.name); |
| | | this.$set(this.attrRow, 'parentCode', CascadeString) |
| | | this.CascadeVisible = false; |
| | | }, |
| | | //级联属性清除 |
| | | casRemove() { |
| | | this.selectRow = "" |
| | | }, |
| | | // 级联属性行单选 |
| | | CascaderowClick(row) { |
| | | this.selectRow = row.$index; |
| | | this.selectRowArr=row |
| | | }, |
| | | //表格单选 |
| | | selectHandle(selection, row) { |
| | | this.attrOid = row.oid; |
| | | this.attrRow = row; |
| | | console.log(row) |
| | | }, |
| | | //表格选择 |
| | | selectionChange(list) { |
| | |
| | | this.$message.success('保存成功') |
| | | }) |
| | | }, |
| | | //级联保存 |
| | | CascadeAddHandle() { |
| | | let CascadeString = ""; |
| | | CascadeString = this.attrRow.id + (this.attrRow.name); |
| | | this.$set(this.attrRow, 'parentCode', CascadeString) |
| | | this.CascadeVisible = false; |
| | | }, |
| | | //级联属性清除 |
| | | casRemove() { |
| | | this.selectRow = "" |
| | | }, |
| | | // 级联属性行单选 |
| | | CascaderowClick(row) { |
| | | this.selectRow = row.$index |
| | | }, |
| | | |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | console.log(row,column) |
| | | if(column.property == 'codeDateFormat' ){ |
| | | |
| | | } |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | | console.log('1321') |
| | | }, |
| | | // 枚举注入添加一行空数据 |
| | | addRow() { |
| | |
| | | "层级设置": this.injectOption.injectNum, |
| | | "是否可修改": this.injectOption.change |
| | | } |
| | | console.log(this.injectOption) |
| | | console.log(this.injectOption) |
| | | this.$set(this.attrRow, 'classifyInvokeLevel', data); |
| | | this.injectVisible = false |
| | | }, |
| | |
| | | this.injectVisible = false |
| | | }, |
| | | //属性模板表格单元格点击事件 |
| | | handleRowClick(row, column, cell, event) { |
| | | //判断点击不是操作栏才可执行 |
| | | if (column.property != "menu") { |
| | | // 当前行变为可编辑状态 |
| | | this.rowList = row |
| | | row.$cellEdit = true |
| | | // 每一个单元格加上cell为true才是编辑状态 |
| | | //拿到每个columnKey,点击时设置为true,就实现单元格编辑状态了 |
| | | this.rowCellList = this.findObject(this.option.column, column.columnKey) |
| | | this.rowCellList.cell = true |
| | | if (this.List.indexOf(column.columnKey) == -1) { |
| | | this.List.push(column.columnKey) |
| | | } |
| | | // if(this.List.length >= 2){ |
| | | // const cellName=this.List[0] |
| | | // |
| | | // } |
| | | } |
| | | }, |
| | | //表格操作栏删除 |
| | | CrudRowDel(row) { |
| | | this.ProData.splice(row.$index, 1) |
| | | }, |
| | | //表格删除 |
| | | CrudRemove() { |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.ProData.splice(item.$index, 1) |
| | | }) |
| | | |
| | | this.ProData.splice(this.attrRow.$index, 1) |
| | | }, |
| | | //表格重置 |
| | | reset() { |
| | |
| | | <template> |
| | | <div> |
| | | <avue-form v-model="loneTreeNewForm" :option="option" @submit="submit" v-if="flag == 'renonly'"> |
| | | <avue-form v-model="loneTreeNewForm" :option="option" v-if="flag == 'renonly'"> |
| | | </avue-form> |
| | | <avue-form v-model="loneTreeNewForm" :option="options" @submit="submits" v-else-if="flag == 'edit'"> |
| | | </avue-form> |
| | | <div> |
| | | <!-- 为【编码规则】选取值--> |
| | | <el-dialog :visible.sync="MasterdialogVisible" title="为【编码规则】选取值" append-to-body> |
| | | <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud> |
| | | |
| | | <!-- 存储业务类型--> |
| | | <el-dialog :visible.sync="BtmdialogVisible" title="为【存储业务类型】选取值" append-to-body> |
| | | <avue-crud :data="BtmData" :option="btmOption" @select="btmSelect"></avue-crud> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end" > |
| | | <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="MasterdialogVisible=false">取消</el-button> |
| | |
| | | </el-dialog> |
| | | <!-- 关键属性查询规则--> |
| | | <el-dialog :visible.sync="KeydialogVisible" title="为【关键属性查询规则】选取值" append-to-body> |
| | | <avue-crud :data="KeyData" :option="masterOption" @select="masterSelect"></avue-crud> |
| | | <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end" > |
| | | <el-button type="primary" size="small" @click="KeyHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="KeydialogVisible=false">取消</el-button> |
| | |
| | | </el-dialog> |
| | | <!-- 相似项查询规则--> |
| | | <el-dialog :visible.sync="SimidialogVisible" title="为【相似项查询规则】选取值" append-to-body> |
| | | <avue-crud :data="simData" :option="masterOption" @select="masterSelect"></avue-crud> |
| | | <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end" > |
| | | <el-button type="primary" size="small" @click="simHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="SimidialogVisible=false">取消</el-button> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {defaultReferDataGrid} from '@/api/MasterData/master' |
| | | import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master' |
| | | import {TreeEditSave} from '@/api/template/templateAttr' |
| | | export default { |
| | | name: "classifyTreeform.vue", |
| | | props: ['loneTreeNewForm','flag'], |
| | | props: ['loneTreeNewForm','flag','Editclose'], |
| | | data() { |
| | | return { |
| | | name:"", |
| | | oid:"", |
| | | masterName:"", |
| | | masterOid:"", |
| | | KeyName:"", |
| | | KeyOid:"", |
| | | simName:"", |
| | | simOid:"", |
| | | btmName:"", |
| | | btmOid:"", |
| | | masterInput:'', |
| | | MasterSearchSelects:"", |
| | | masterData:[], |
| | | KeyData:[], |
| | | simData:[], |
| | | BtmData:[], |
| | | btmOption:{ |
| | | addBtn:false, |
| | | index:true, |
| | | border:true, |
| | | selection:true, |
| | | menu:false, |
| | | height:380, |
| | | column:[ |
| | | { |
| | | label:'业务类型编号', |
| | | prop:'id' |
| | | }, |
| | | { |
| | | label:'业务类型名称', |
| | | prop:'name' |
| | | }, |
| | | { |
| | | label:'描述', |
| | | prop:'description' |
| | | } |
| | | ] |
| | | }, |
| | | masterOption:{ |
| | | addBtn:false, |
| | | index:true, |
| | |
| | | MasterdialogVisible:false, |
| | | KeydialogVisible:false, |
| | | SimidialogVisible:false, |
| | | BtmdialogVisible:false, |
| | | form: { |
| | | name: "哈哈", |
| | | sex: "男" |
| | |
| | | label: '存储的业务类型', |
| | | prop: 'btmtypename', |
| | | labelWidth:128, |
| | | focus:this.btmFoucus, |
| | | rules: [{ |
| | | required: true, |
| | | message: "存储的业务类型", |
| | |
| | | ] |
| | | }, |
| | | FormList: {}, |
| | | masterSelectList:[] |
| | | masterSelectList:[], |
| | | KeySelectLIst:[], |
| | | simSelectList:[], |
| | | btmSelectList:[] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | submits(form,done){ |
| | | console.log(this.loneTreeNewForm) |
| | | TreeEditSave(this.loneTreeNewForm).then(res=>{ |
| | | this.$message.success('修改成功'); |
| | | }).catch(res=>{ |
| | | this.$message.error(res) |
| | | this.Editclose() |
| | | done() |
| | | }) |
| | | done() |
| | | }, |
| | | error(err) { |
| | | this.$message.success('请查看控制台'); |
| | |
| | | }else { |
| | | this.MasterdialogVisible=false; |
| | | this.masterSelectList=[] |
| | | this.loneTreeNewForm.codeRuleOidName=this.name; |
| | | this.loneTreeNewForm.codeRuleOid=this.oid; |
| | | console.log(this.masterSelectList) |
| | | this.$set(this.loneTreeNewForm,'coderuleoidName',this.masterName) |
| | | this.$set(this.loneTreeNewForm,'coderuleOid',this.masterOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | console.log(this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //编码多选 |
| | | masterSelect(row){ |
| | | console.log(row) |
| | | this.masterSelectList=row; |
| | | this.name=row[0].name; |
| | | this.oid=row[0].oid; |
| | | this.masterName=row[0].name; |
| | | this.masterOid=row[0].oid; |
| | | console.log('oid',this.oid) |
| | | }, |
| | | //编码接口 |
| | |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Released' |
| | | }).then(res=>{ |
| | | console.log('---',res) |
| | | this.masterData=res.data.records; |
| | | console.log('masterData',this.masterData) |
| | | |
| | | }) |
| | | }, |
| | | // 关键属性失焦 |
| | |
| | | }, |
| | | //关键属性确定 |
| | | KeyHandlerClick(){ |
| | | if(this.masterSelectList.length>1){ |
| | | if(this.KeySelectLIst.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.masterSelectList.length<=0){ |
| | | }else if(this.KeySelectLIst.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | |
| | | this.KeydialogVisible=false; |
| | | this.KeySelectLIst=[] |
| | | this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName) |
| | | this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //关键属性接口 |
| | | KeydefaultRend(){ |
| | | defaultReferDataGrid({ |
| | | referType:'codekeyattrrepeat', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.keyData=res.data.records; |
| | | console.log('key',this.keyData) |
| | | this.KeyData=res.data.records; |
| | | }) |
| | | }, |
| | | // 关键多选 |
| | | KeySelect(row){ |
| | | this.KeySelectLIst=row; |
| | | this.KeyName=row[0].name; |
| | | this.KeyOid=row[0].oid; |
| | | }, |
| | | // 相似项失焦 |
| | | simFouce(){ |
| | | this.SimidialogVisible=true; |
| | | this.simdefaultRend() |
| | | }, |
| | | //相似项确定 |
| | | simHandlerClick(){ |
| | | |
| | | if(this.simSelectList.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.simSelectList.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.SimidialogVisible=false; |
| | | this.simSelectList=[] |
| | | this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName) |
| | | this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | // 相似项多选 |
| | | simSelect(row){ |
| | | this.simSelectList=row; |
| | | this.simName=row[0].name; |
| | | this.simOid=row[0].oid; |
| | | console.log('oid',this.oid) |
| | | }, |
| | | //相似项项接口 |
| | | simdefaultRend(){ |
| | | defaultReferDataGrid({ |
| | | referType:'coderesemblerule', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.simData=res.data.records; |
| | | }) |
| | | }, |
| | | //业务类型失焦 |
| | | btmFoucus(){ |
| | | this.BtmdialogVisible=true; |
| | | this.btmdefaultRend() |
| | | }, |
| | | // 业务类型多选 |
| | | btmSelect(row){ |
| | | this.btmSelectList=row; |
| | | this.btmName=row[0].name; |
| | | this.btmOid=row[0].oid; |
| | | }, |
| | | //业务类型接口 |
| | | btmdefaultRend(){ |
| | | referDataGrid({valueField:'id',isMuti:'false'}).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | |
| | | <!--uiDataController/defaultReferDataGrid?referBo=coderule&isMuti=false&conditionMap%5B%22lcstatus%22%5D=Released--> |
| | | <!--uiDataController/defaultReferDataGrid?conditionMap%5B%22lcstatus%22%5D=Released&referBo=coderule&isMuti=false&_=1687831291212--> |
| | |
| | | <el-form-item label="描述:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="this.TreeFlag==false" label="存储的业务类型:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.btmtypename" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.coderuleoidName" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | |
| | | </el-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'"></classifyTreeform> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}"></classifyTreeform> |
| | | </el-dialog> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | |
| | | <el-button plain size="small" type="primary" @click="Enable">启用</el-button> |
| | | <el-button plain size="small" type="primary" @click="Deactivate">停用</el-button> |
| | | <el-button plain size="small" type="primary" @click="CloneBtn">从其它模板克隆</el-button> |
| | | <!-- <div style="display: inline-block"> |
| | | <el-select v-model="searchTemplate.searchCondition" placeholder="请选择" class="search-condition"> |
| | | <el-option |
| | | v-for="item in searchTemplateOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="searchTemplate.findText" placeholder="请输入关键字按回车查询" |
| | | size="small" |
| | | @keyup.enter.native="EnterFind"> |
| | | </el-input> |
| | | </div> --> |
| | | <!-- 查询对话框--> |
| | | <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询"> |
| | | <div> |
| | |
| | | </el-container> |
| | | </template> |
| | | <script> |
| | | //这里声明一些菜单组件用法:首先布局分为左侧菜单右侧表格,可能会有右侧Tab栏加表单的情况。所以另外引入了一个右侧表单的组件"classifyTreeform"。 |
| | | //首先父组件调用子组件菜单,通过provide传递参数。有Treeoption左侧树新增表单项 Treedata左侧树节点配置项 crudTreeOption右侧表格配置项 crudTreeData右侧表格显示内容 |
| | | //其中表格的配置项直接父传子传递过来就行,直接:option=传递的参数名,里面数据显示的内容因为是和左侧联动的,所以重新一个Formlist,通过点击树节点下标来动态渲染右侧表格,下面方法都有具体注释 |
| | | //然后再说右侧的表单,专门定义了一个组件,通过父传子再把表单数据TreeList传递过去,传递前在10deCLi1ck方法里面便了处理也是一个联动的效果,表单的配置项在哪个子组件或者父组件写都可以。 |
| | | import { |
| | | getAtrrList, |
| | | TreeSave, |
| | |
| | | inject: [, "crudTreeData"], |
| | | data() { |
| | | return { |
| | | // //表格option配置项 |
| | | // crudTreeOption: { |
| | | // index: true, |
| | | // border: true, |
| | | // height:180, |
| | | // selection:true, |
| | | // addBtn:this.addFlag, |
| | | // column: [ |
| | | // { |
| | | // label: "模板编号", |
| | | // prop: "id" |
| | | // }, |
| | | // { |
| | | // label:"模板名称", |
| | | // prop:"name" |
| | | // }, |
| | | // { |
| | | // label: "模板描述", |
| | | // prop:"description" |
| | | // }, |
| | | // { |
| | | // label:"版本号", |
| | | // prop:"revisionSeq" |
| | | // }, |
| | | // { |
| | | // label:"状态", |
| | | // prop:"lcStatusText" |
| | | // } |
| | | // ] |
| | | // }, |
| | | // searchTemplateOptions: [ |
| | | // { |
| | | // value: 'id', |
| | | // label: '模板编号' |
| | | // }, { |
| | | // value: 'name', |
| | | // label: '模板名称' |
| | | // } |
| | | // ], |
| | | addFlag:false, |
| | | // 表格当前行id |
| | | crudOid:"", |
| | |
| | | searchCondition: 'id', |
| | | findText: "", |
| | | }, |
| | | |
| | | |
| | | //高级查询对话框 |
| | | FindFormVisible: false, |
| | | //克隆模板对话框 |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | MasterHandler(val){ |
| | | console.log('父亲',val) |
| | | this.TreeList=val |
| | | }, |
| | | //行单选事件 |
| | | selectHandle(selection,row){ |
| | | this.crudOid=row.oid; |
| | |
| | | return this.initFrom.findIndex(i => i.taskId === arr1) |
| | | }, |
| | | async apiInit() { |
| | | const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code],ids:this.parameter.ids, codeClassifyOid:this.parameter.codeClassifyOid}) |
| | | const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code]}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.initFrom = response.data.data.user |
| | |
| | | // console.log(this.form); |
| | | }, |
| | | // 第一次请求的枚举数据放缓存 |
| | | getLocalStorageEnum(key){ |
| | | let enumCach = JSON.parse(localStorage.getItem(key)); |
| | | getLocalStorageEnum(enumKey){ |
| | | let enumCach = JSON.parse(localStorage.getItem(enumKey)); |
| | | if(enumCach == null) { |
| | | getDictionary({code: key}).then(res=>{ |
| | | getDictionary({code: enumKey}).then(res=>{ |
| | | enumCach = res.data.data; |
| | | localStorage.setItem(key,JSON.stringify(res.data.data)); |
| | | localStorage.setItem(enumKey,JSON.stringify(res.data.data)); |
| | | }) |
| | | } |
| | | return enumCach; |
| | |
| | | loadCodeGetValueType(){ |
| | | this.enumParam.codeGetValueType = this.getLocalStorageEnum("codeGetValueType"); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }; |
| | | |
| | |
| | | */ |
| | | package com.vci.ubcs.report.config; |
| | | |
| | | import com.vci.ubcs.core.report.datasource.ReportDataSource; |
| | | import org.springblade.core.report.datasource.ReportDataSource; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.LifeCycleVO; |
| | | import com.vci.ubcs.omd.wrapper.LifeCycleRuleWrapper; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "新增或修改",notes = "传入生命周期页面对象") |
| | | public R<LifeCycleVO> submit(@RequestBody LifeCycleDTO lifeCycleDTO){ |
| | | @ApiOperation(value = "新增",notes = "传入生命周期页面对象") |
| | | public R<LifeCycleVO> addSave(@RequestBody LifeCycleDTO lifeCycleDTO){ |
| | | return R.data(lifeCycleService.addSave(lifeCycleDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * 修改 |
| | | */ |
| | | @PutMapping("/edit-save") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "修改",notes = "传入生命周期页面对象") |
| | | public R<LifeCycleVO> editSave(@RequestBody LifeCycleDTO lifeCycleDTO){ |
| | | return R.data(lifeCycleService.editSave(lifeCycleDTO)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/batch-submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "新增或修改",notes = "传入状态池页面对象") |
| | | public R<List<LifeCycleVO>> batchSubmit(@RequestBody List<LifeCycleDTO> lifeCycleDTOs){ |
| | | @ApiOperation(value = "新增或修改",notes = "传入生命周期页面对象") |
| | | public R<List<LifeCycleVO>> batchAddSave(@RequestBody List<LifeCycleDTO> lifeCycleDTOs){ |
| | | return R.data(lifeCycleService.batchAddSave(lifeCycleDTOs)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/batch-edit-save") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "修改",notes = "传入生命周期页面对象") |
| | | public R<List<LifeCycleVO>> batchEditSave(@RequestBody List<LifeCycleDTO> lifeCycleDTOs){ |
| | | return R.data(lifeCycleService.batchEditSave(lifeCycleDTOs)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import io.swagger.models.auth.In; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | |
| | | /** |
| | | * 获取引用某个生命周期的业务类型 |
| | | * @param lifeOid 生命周期的主键 |
| | | * @param lifeId 生命周期的编号 |
| | | * @return 业务类型显示对象 |
| | | */ |
| | | List<BtmTypeVO> selectByLifeId(String lifeId); |
| | | |
| | | /** |
| | | * 获取引用某些生命周期的业务类型 |
| | | * @param lifeIds 生命周期的编号集合 |
| | | * @return 业务类型显示对象 |
| | | */ |
| | | List<BtmTypeVO> selectByLifeIds(Collection<String> lifeIds); |
| | | |
| | | /** |
| | | * 统计引用某个生命周期的业务类型 |
| | | * @param lifeOid 生命周期的主键 |
| | | * @param lifeId 生命周期的编号 |
| | | * @return 个数 |
| | | */ |
| | | Integer countByLifeId(String lifeId); |
| | | |
| | | /** |
| | | * 统计引用某些生命周期的业务类型 |
| | | * @param lifeIds 生命周期的编号集合 |
| | | * @return 个数 |
| | | */ |
| | | Integer countByLifeIds(Collection<String> lifeIds); |
| | | } |
| | |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @param lifeCycleDTOs 数据传输对象 |
| | | * @return 添加后的显示对象 |
| | | */ |
| | | List<LifeCycleVO> batchAddSave(List<LifeCycleDTO> lifeCycleDTOs); |
| | | List<LifeCycleVO> batchAddSave(Collection<LifeCycleDTO> lifeCycleDTOs); |
| | | |
| | | /** |
| | | * 修改保存 |
| | | * @param lifeCycleDTO 数据传输对象 |
| | | * @return |
| | | */ |
| | | LifeCycleVO editSave(LifeCycleDTO lifeCycleDTO); |
| | | |
| | | /** |
| | | * 批量修改保存 |
| | | * @param lifeCycleDTOs |
| | | * @return |
| | | */ |
| | | List<LifeCycleVO> batchEditSave(Collection<LifeCycleDTO> lifeCycleDTOs); |
| | | |
| | | /** |
| | | * 删除生命周期 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取引用某些生命周期的业务类型 |
| | | * |
| | | * @param lifeIds 生命周期的编号集合 |
| | | * @return 业务类型显示对象 |
| | | */ |
| | | @Override |
| | | public List<BtmTypeVO> selectByLifeIds(Collection<String> lifeIds) { |
| | | if(CollectionUtils.isEmpty(lifeIds)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<BtmType> btmTypeList = new ArrayList<>(); |
| | | VciBaseUtil.switchCollectionForOracleIn(lifeIds).stream().forEach(ids->{ |
| | | LambdaQueryWrapper<BtmType> query = new LambdaQueryWrapper<BtmType>(); |
| | | ids.stream().forEach(id->{ |
| | | query.eq(BtmType::getLifeCycleId,id); |
| | | query.or(); |
| | | }); |
| | | query.eq(BtmType::getLifeCycleId,"-1"); |
| | | btmTypeList.addAll(baseMapper.selectList(query)); |
| | | }); |
| | | return BtmTypeWrapper.build().listEntityVO(btmTypeList); |
| | | } |
| | | |
| | | /** |
| | | * 统计引用某个生命周期的业务类型 |
| | | * |
| | | * @param lifeId 生命周期的编号 |
| | |
| | | query.eq(BtmType::getLifeCycleId,lifeId); |
| | | return baseMapper.selectCount(query).intValue(); |
| | | } |
| | | |
| | | /** |
| | | * 统计引用某些生命周期的业务类型 |
| | | * |
| | | * @param lifeIds 生命周期的编号集合 |
| | | * @return 个数 |
| | | */ |
| | | @Override |
| | | public Integer countByLifeIds(Collection<String> lifeIds) { |
| | | if(CollectionUtils.isEmpty(lifeIds)){ |
| | | return 0; |
| | | } |
| | | final Integer[] total = {0}; |
| | | VciBaseUtil.switchCollectionForOracleIn(lifeIds).stream().forEach(ids->{ |
| | | LambdaQueryWrapper<BtmType> query = new LambdaQueryWrapper<BtmType>(); |
| | | ids.stream().forEach(id->{ |
| | | query.eq(BtmType::getLifeCycleId,id); |
| | | query.or(); |
| | | }); |
| | | query.eq(BtmType::getLifeCycleId,"-1"); |
| | | total[0] += baseMapper.selectCount(query).intValue(); |
| | | }); |
| | | return total[0]; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public List<LifeCycleVO> batchAddSave(List<LifeCycleDTO> lifeCycleDTOs) { |
| | | public List<LifeCycleVO> batchAddSave(Collection<LifeCycleDTO> lifeCycleDTOs) { |
| | | VciBaseUtil.alertNotNull(lifeCycleDTOs,"生命周期的信息"); |
| | | //先集体校验一下 |
| | | if(lifeCycleDTOs.stream().anyMatch(s->!StringUtils.hasLength(s.getId()) || !StringUtils.hasLength(s.getName()) |
| | |
| | | throw new VciBaseException("生命周期的编号,名称,起始状态,包含的节点不能为空"); |
| | | } |
| | | //统一校验重复 |
| | | Map<String, List<LifeCycleDTO>> dtoMap = lifeCycleDTOs.stream().collect(Collectors.groupingBy(LifeCycleDTO::getId)); |
| | | Map<String, List<LifeCycleDTO>> dtoMap = lifeCycleDTOs.stream().collect(Collectors.groupingBy(s->s.getId().toLowerCase(Locale.ROOT))); |
| | | dtoMap.forEach((id,dtos)->{ |
| | | if(dtos.size()>1){ |
| | | throw new VciBaseException("编号为【" + id + "】的生命周期重复"); |
| | |
| | | ids->{ |
| | | QueryWrapper wrapper = new QueryWrapper(LifeCycleRule.class); |
| | | ids.stream().forEach(id->{ |
| | | wrapper.eq("lower(id)",id.toLowerCase(Locale.ROOT)); |
| | | wrapper.eq("lower(id)",id); |
| | | wrapper.or(); |
| | | }); |
| | | wrapper.eq("1","2"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改保存 |
| | | * |
| | | * @param lifeCycleDTO 数据传输对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public LifeCycleVO editSave(LifeCycleDTO lifeCycleDTO) { |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"生命周期信息",lifeCycleDTO.getId(),"生命周期的编号",lifeCycleDTO.getName(),"生命周期名称" |
| | | ,lifeCycleDTO.getNodes(),"生命周期的节点",lifeCycleDTO.getStartStatus(),"起始状态", |
| | | lifeCycleDTO.getOid(),"主键"); |
| | | LifeCycleRule rule = selectByOid(lifeCycleDTO.getOid()); |
| | | //查询重复 |
| | | QueryWrapper wrapper = new QueryWrapper(LifeCycleRule.class); |
| | | if(rule.getId().equals(lifeCycleDTO.getId())){ |
| | | throw new VciBaseException("生命周期编号不能修改"); |
| | | } |
| | | wrapper.eq("lower(id)",lifeCycleDTO.getId().toLowerCase(Locale.ROOT)); |
| | | wrapper.ne("oid",lifeCycleDTO.getOid()); |
| | | if(baseMapper.selectCount(wrapper)>0){ |
| | | throw new VciBaseException("生命周期的编号不能重复"); |
| | | } |
| | | editLifeCycle(lifeCycleDTO,rule); |
| | | return LifeCycleRuleWrapper.build().entityVO(getById(rule.getOid())); |
| | | } |
| | | |
| | | /** |
| | | * 修改生命周期 |
| | | * @param lifeCycleDTO |
| | | * @param life |
| | | */ |
| | | private void editLifeCycle(LifeCycleDTO lifeCycleDTO,LifeCycleRule life){ |
| | | if(!lifeCycleDTO.getId().matches(RegExpConstant.LETTER)){ |
| | | throw new VciBaseException("生命周期的编号只能是字母"); |
| | | } |
| | | BeanUtil.convert(lifeCycleDTO,life); |
| | | String creator = AuthUtil.getUserAccount(); |
| | | Date now = new Date(); |
| | | life.setLastModifier(creator); |
| | | life.setLastModifyTime(now); |
| | | life.setTs(now); |
| | | |
| | | //删除现在全部的数据,然后重新添加= |
| | | List<LifeCycleNode> nodeList = selectNodeByLifeOid(life.getOid()); |
| | | List<LifeCycleEdge> edges = selectEdgeByLifeOid(life.getOid()); |
| | | List<LifeCycleLineEvent> eventList = selectEventByEdgeOids(Optional.ofNullable(edges).orElseGet(ArrayList::new).stream().map(LifeCycleEdge::getOid).collect(Collectors.toList())); |
| | | if(!CollectionUtils.isEmpty(nodeList)){ |
| | | nodeMapper.deleteBatchIds(nodeList.stream().map(LifeCycleNode::getOid).collect(Collectors.toList())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(edges)){ |
| | | edgeMapper.deleteBatchIds(edges.stream().map(LifeCycleEdge::getOid).collect(Collectors.toList())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(eventList)){ |
| | | lineEventMapper.deleteBatchIds(eventList.stream().map(LifeCycleLineEvent::getOid).collect(Collectors.toList())); |
| | | } |
| | | |
| | | List<String> statusList = new ArrayList<>(); |
| | | //处理节点 |
| | | if(!CollectionUtils.isEmpty(lifeCycleDTO.getNodes())){ |
| | | lifeCycleDTO.getNodes().stream().forEach(nodeDTO->{ |
| | | addLifeCycleNode(nodeDTO,life.getOid(),creator,now); |
| | | statusList.add(nodeDTO.getId()); |
| | | }); |
| | | } |
| | | if(!statusList.contains(life.getStartStatus())){ |
| | | throw new VciBaseException("起始状态不在生命周期的画布中"); |
| | | } |
| | | //判断所有的节点在系统里都存在 |
| | | List<String> existStatusIdList = statusService.listStatusByIdCollection(statusList).stream().map(StatusVO::getId).collect(Collectors.toList()); |
| | | String unExistStatus = statusList.stream().filter(s -> !existStatusIdList.contains(s)).collect(Collectors.joining(",")); |
| | | if(StringUtils.hasLength(unExistStatus)){ |
| | | throw new VciBaseException(unExistStatus + "这些状态在状态池里不存在,不能添加到生命周期中"); |
| | | } |
| | | //处理边界和连接线 |
| | | if(!CollectionUtils.isEmpty(lifeCycleDTO.getEdges())){ |
| | | lifeCycleDTO.getEdges().stream().forEach(edgeDTO->{ |
| | | String edgeOid = addLifeCycleEdge(edgeDTO,statusList,life.getOid(),creator,now); |
| | | if(!CollectionUtils.isEmpty(edgeDTO.getEvents())){ |
| | | //有事件 |
| | | edgeDTO.getEvents().stream().forEach(eventDTO->{ |
| | | addLifeCycleLineEvent(eventDTO,edgeOid,creator,now); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | baseMapper.updateById(life); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 使用主键查询 |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | private LifeCycleRule selectByOid(String oid){ |
| | | LifeCycleRule rule = null; |
| | | try { |
| | | rule = getById(oid); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("使用主键获取对象出错,这个数据可能不存在,或者数据重复了"); |
| | | } |
| | | return rule; |
| | | } |
| | | |
| | | /** |
| | | * 批量修改保存 |
| | | * |
| | | * @param lifeCycleDTOs |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<LifeCycleVO> batchEditSave(Collection<LifeCycleDTO> lifeCycleDTOs) { |
| | | if(CollectionUtils.isEmpty(lifeCycleDTOs)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | if(lifeCycleDTOs.stream().anyMatch(s->!StringUtils.hasLength(s.getId()) || !StringUtils.hasLength(s.getName()) |
| | | || CollectionUtils.isEmpty(s.getNodes()) || !StringUtils.hasLength(s.getStartStatus()))){ |
| | | throw new VciBaseException("生命周期的编号,名称,起始状态,包含的节点不能为空"); |
| | | } |
| | | //统一校验重复 |
| | | Map<String, List<LifeCycleDTO>> dtoMap = lifeCycleDTOs.stream().collect(Collectors.groupingBy(s->s.getId().toLowerCase(Locale.ROOT))); |
| | | dtoMap.forEach((id,dtos)->{ |
| | | if(dtos.size()>1){ |
| | | throw new VciBaseException("编号为【" + id + "】的生命周期重复"); |
| | | } |
| | | }); |
| | | VciBaseUtil.switchCollectionForOracleIn(dtoMap.keySet()).stream().forEach( |
| | | ids->{ |
| | | QueryWrapper wrapper = new QueryWrapper(LifeCycleRule.class); |
| | | ids.stream().forEach(id->{ |
| | | wrapper.eq("lower(id)",id); |
| | | wrapper.ne("oid",dtoMap.get(id).get(0).getOid()); |
| | | wrapper.or(); |
| | | }); |
| | | wrapper.eq("1","2"); |
| | | if(baseMapper.selectCount(wrapper)>0){ |
| | | throw new VciBaseException("生命周期的编号不能重复"); |
| | | } |
| | | } |
| | | ); |
| | | List<String> oidList = lifeCycleDTOs.stream().map(LifeCycleDTO::getOid).collect(Collectors.toList()); |
| | | List<LifeCycleRule> rules = listByIds(oidList); |
| | | if(!CollectionUtils.isEmpty(rules)){ |
| | | rules.stream().forEach(life->{ |
| | | editLifeCycle(dtoMap.get(life.getId().toLowerCase(Locale.ROOT)).get(0),life); |
| | | }); |
| | | } |
| | | return LifeCycleRuleWrapper.build().listEntityVO(listByIds(oidList)); |
| | | } |
| | | |
| | | /** |
| | | * 删除生命周期 |
| | | * |
| | | * @param lifeCycleDTO 数据传输对象 |
| | |
| | | @Transactional |
| | | public void delete(LifeCycleDTO lifeCycleDTO) { |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"数据传输对象",lifeCycleDTO.getOid(),"主键"); |
| | | LifeCycleRule rule = null; |
| | | try { |
| | | rule = getById(lifeCycleDTO.getOid()); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("使用主键获取对象出错,这个数据可能不存在,或者数据重复了"); |
| | | } |
| | | LifeCycleRule rule = selectByOid(lifeCycleDTO.getOid()); |
| | | //检查被引用不能删除 |
| | | Integer count = btmTypeService.countByLifeId(lifeCycleDTO.getOid()); |
| | | Integer count = btmTypeService.countByLifeId(lifeCycleDTO.getId()); |
| | | if(count !=null && count>0){ |
| | | throw new VciBaseException("生命周期被使用,不能被删除"); |
| | | } |
| | | //我们查询全部node和edge,然后一起删除 |
| | | List<LifeCycleNode> nodeList = selectNodeByLifeOid(rule.getOid()); |
| | | List<LifeCycleEdge> edges = selectEdgeByLifeOid(rule.getOid()); |
| | | List<LifeCycleLineEvent> eventList = selectEventByEdgeOids(Optional.ofNullable(edges).orElseGet(ArrayList::new).stream().map(LifeCycleEdge::getOid).collect(Collectors.toList())); |
| | | if(!CollectionUtils.isEmpty(nodeList)){ |
| | | nodeMapper.deleteBatchIds(nodeList.stream().map(LifeCycleNode::getOid).collect(Collectors.toList())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(edges)){ |
| | | edgeMapper.deleteBatchIds(edges.stream().map(LifeCycleEdge::getOid).collect(Collectors.toList())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(eventList)){ |
| | | lineEventMapper.deleteBatchIds(eventList.stream().map(LifeCycleLineEvent::getOid).collect(Collectors.toList())); |
| | | } |
| | | baseMapper.deleteById(rule); |
| | | } |
| | | |
| | | /** |
| | | * 查询链接线 |
| | | * @param lifeOid |
| | | * @return |
| | | */ |
| | | private List<LifeCycleEdge> selectEdgeByLifeOid(String lifeOid){ |
| | | if(!StringUtils.hasLength(lifeOid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | LambdaQueryWrapper<LifeCycleEdge> query = new LambdaQueryWrapper<LifeCycleEdge>(); |
| | | query.eq(LifeCycleEdge::getLifeCycleOid,lifeOid); |
| | | return edgeMapper.selectList(query); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取节点的信息 |
| | | * @param lifeOids 生命周期的主键集合 |
| | | * @return |
| | | */ |
| | | private List<LifeCycleEdge> selectEdgeByLifeOids(Collection<String> lifeOids){ |
| | | if(!CollectionUtils.isEmpty(lifeOids)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<LifeCycleEdge> edgeList = new ArrayList<>(); |
| | | VciBaseUtil.switchCollectionForOracleIn(lifeOids).stream().forEach(lOids->{ |
| | | LambdaQueryWrapper<LifeCycleEdge> query = new LambdaQueryWrapper<LifeCycleEdge>(); |
| | | lOids.stream().forEach(lOid->{ |
| | | query.eq(LifeCycleEdge::getLifeCycleOid,lOid); |
| | | query.or(); |
| | | }); |
| | | query.eq(LifeCycleEdge::getLifeCycleOid,"-1"); |
| | | edgeList.addAll(edgeMapper.selectList(query)); |
| | | }); |
| | | return edgeList; |
| | | } |
| | | |
| | | /** |
| | | * 查询链接线上的事件 |
| | | * @param edgeOids |
| | | * @return |
| | | */ |
| | | private List<LifeCycleLineEvent> selectEventByEdgeOids(Collection<String> edgeOids){ |
| | | if(CollectionUtils.isEmpty(edgeOids)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<LifeCycleLineEvent> eventList = new ArrayList<>(); |
| | | VciBaseUtil.switchCollectionForOracleIn(edgeOids).stream().forEach(edgeOidList->{ |
| | | LambdaQueryWrapper<LifeCycleLineEvent> query = new LambdaQueryWrapper<LifeCycleLineEvent>(); |
| | | edgeOidList.stream().forEach(edgeOid->{ |
| | | query.eq(LifeCycleLineEvent::getPkLifeCycleEdge,edgeOid); |
| | | query.or(); |
| | | }); |
| | | query.eq(LifeCycleLineEvent::getPkLifeCycleEdge,"-1"); |
| | | eventList.addAll(lineEventMapper.selectList(query)); |
| | | }); |
| | | return eventList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取节点的信息 |
| | | * @param lifeOid |
| | | * @return |
| | | */ |
| | | private List<LifeCycleNode> selectNodeByLifeOid(String lifeOid){ |
| | | if(!StringUtils.hasLength(lifeOid)){ |
| | | return new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取节点的信息 |
| | | * @param lifeOids 生命周期的主键集合 |
| | | * @return |
| | | */ |
| | | private List<LifeCycleNode> selectNodeByLifeOids(Collection<String> lifeOids){ |
| | | if(!CollectionUtils.isEmpty(lifeOids)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<LifeCycleNode> nodeList = new ArrayList<>(); |
| | | VciBaseUtil.switchCollectionForOracleIn(lifeOids).stream().forEach(lOids->{ |
| | | LambdaQueryWrapper<LifeCycleNode> query = new LambdaQueryWrapper<LifeCycleNode>(); |
| | | lOids.stream().forEach(lOid->{ |
| | | query.eq(LifeCycleNode::getLifeCycleOid,lOid); |
| | | query.or(); |
| | | }); |
| | | query.eq(LifeCycleNode::getLifeCycleOid,"-1"); |
| | | nodeList.addAll(nodeMapper.selectList(query)); |
| | | }); |
| | | return nodeList; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除生命周期 |
| | | * |
| | | * @param lifeCycleDTOs 数据传输对象列表 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void batchDelete(List<LifeCycleDTO> lifeCycleDTOs) { |
| | | |
| | | VciBaseUtil.alertNotNull(lifeCycleDTOs,"生命周期的信息"); |
| | | if(lifeCycleDTOs.stream().anyMatch(s->!StringUtils.hasLength(s.getOid()))){ |
| | | throw new VciBaseException("生命周期的主键不能为空"); |
| | | } |
| | | List<String> oidList = lifeCycleDTOs.stream().map(LifeCycleDTO::getOid).collect(Collectors.toList()); |
| | | List<LifeCycleRule> lifeList = baseMapper.selectBatchIds(oidList); |
| | | //批量查询 |
| | | String usedBtmTypeId = Optional.ofNullable(btmTypeService.selectByLifeIds(lifeList.stream().map(LifeCycleRule::getId).collect(Collectors.toList()))).orElseGet(ArrayList::new).stream().map(BtmTypeVO::getId).collect(Collectors.joining(",")); |
| | | if(StringUtils.hasLength(usedBtmTypeId)){ |
| | | throw new VciBaseException(usedBtmTypeId + "这些业务类型引用了生命周期,不能删除"); |
| | | } |
| | | List<LifeCycleNode> nodeList = selectNodeByLifeOids(oidList); |
| | | List<LifeCycleEdge> edgeList = selectEdgeByLifeOids(oidList); |
| | | if(!CollectionUtils.isEmpty(nodeList)){ |
| | | nodeMapper.deleteBatchIds(nodeList.stream().map(LifeCycleNode::getOid).collect(Collectors.toList())); |
| | | } |
| | | if(!CollectionUtils.isEmpty(edgeList)){ |
| | | List<String> edgeOids = edgeList.stream().map(LifeCycleEdge::getOid).collect(Collectors.toList()); |
| | | edgeMapper.deleteBatchIds(edgeOids); |
| | | List<LifeCycleLineEvent> eventList = selectEventByEdgeOids(edgeOids); |
| | | if(!CollectionUtils.isEmpty(eventList)){ |
| | | lineEventMapper.deleteBatchIds(eventList.stream().map(LifeCycleLineEvent::getOid).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | baseMapper.deleteBatchIds(oidList); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<BtmTypeVO> listUses(LifeCycleDTO lifeCycleDTO) { |
| | | return null; |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"数据传输对象",lifeCycleDTO.getOid(),"主键"); |
| | | LifeCycleRule rule = selectByOid(lifeCycleDTO.getOid()); |
| | | return btmTypeService.selectByLifeId(rule.getId()); |
| | | } |
| | | } |