Merge remote-tracking branch 'origin/master'
| | |
| | | type: String,
|
| | | default: "",
|
| | | },
|
| | | type: String
|
| | | },
|
| | | computed: {
|
| | | dialogVisible: {
|
| | |
| | | filterText(val) {
|
| | | this.$refs.tree.filter(val);
|
| | | },
|
| | | leftTree: {
|
| | | immediate: true,
|
| | | deep: true,
|
| | | handler(arr) {
|
| | | if (arr.length > 0 && this.type === 'batchImportApply') {
|
| | | this.treeNodeClick(arr[0])
|
| | | }
|
| | | }
|
| | | }
|
| | | },
|
| | | };
|
| | | </script>
|
| | |
| | | :on-exceed="handleExceed"
|
| | | :headers="uploadHeaders"
|
| | | :on-success="onSuccess"
|
| | | :on-error="onError"
|
| | | :show-file-list="false"
|
| | | :on-change="uploadChange"
|
| | | :data="upParams"
|
| | |
| | | leftTree: [],
|
| | | redisOid: "",
|
| | | pageLoading: null,
|
| | | showCodeApply: false,
|
| | | currentTypeObj: {
|
| | | historyImport: {
|
| | | title: "å岿°æ®å¯¼å
¥",
|
| | |
| | | },
|
| | | methods: {
|
| | | async beforeUpload(file) {
|
| | | console.log(file, 'file');
|
| | | const fileType = file.name.split(".").pop();
|
| | | if (fileType !== "xlsx" && fileType !== "xls") {
|
| | | // ä¸ä¼ æ ¼å¼ä¸ç¬¦åè¦æ±ï¼æç¤ºé误信æ¯å¹¶åæ¶ä¸ä¼
|
| | | this.$message.error("åªå
许ä¸ä¼ xlsxãxlsæ ¼å¼çæä»¶");
|
| | | return Promise.reject(false);
|
| | | }
|
| | | if (this.type === "batchImportApply") {
|
| | | const flag = await this.$refs.CodeApply.validate();
|
| | | if (!flag) {
|
| | | return Promise.reject(false);
|
| | | }
|
| | | if (this.type === "batchImportApply" && this.showCodeApply) {
|
| | | // const flag = await this.$refs.CodeApply.validate();
|
| | | // if (!flag) {
|
| | | // return Promise.reject(false);
|
| | | // }
|
| | | }
|
| | | this.pageLoading = this.$loading({
|
| | | lock: true,
|
| | |
| | | this.dialogVisible = false
|
| | | return
|
| | | }
|
| | | let fileName = res.data.filePath.split("/").pop();
|
| | | if (res.data.fileOid) {
|
| | | const fileName = res.data.filePath.split("/").pop();
|
| | | this.$message.error("请ä¸è½½éè¯¯ä¿¡æ¯æä»¶è¿è¡æ¥çï¼");
|
| | | downloadErrorFile({ uuid: res.data.fileOid }).then((res2) => {
|
| | | this.$utilFunc.downloadFileByBlob(res2.data, fileName);
|
| | |
| | | });
|
| | | }
|
| | | },
|
| | | onError(err) {
|
| | | console.log(err, 'err');
|
| | | this.pageLoading.close();
|
| | | },
|
| | | uploadChange(file) {
|
| | | console.log(file, 'file', file.status === "success");
|
| | | if (file.status === "success" || file.status === "error") {
|
| | | this.pageLoading.close();
|
| | | }
|
| | |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :sortable="item.sortable" |
| | | :formatter="formatBoolean" |
| | | :formatter="item.formatter" |
| | | :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'" |
| | | :show-overflow-tooltip="true" |
| | | align="center" |
| | |
| | | import SetPersonnel from "@/components/template/SetPersonnel"; |
| | | import ResembleQueryDialog from "@/components/FormTemplate/ResembleQueryDialog.vue"; |
| | | import BatchImport from '@/components/BatchImport' |
| | | import { validatenull } from "@/util/validate"; |
| | | export default { |
| | | components: { |
| | | integrationTransfer, |
| | |
| | | }, |
| | | tableHeadFindData: { |
| | | handler(newval, oldval) { |
| | | newval.forEach((record,_index) =>{ |
| | | if(record.field == 'id' && validatenull(record.templet)){ |
| | | //ä¼ä¸ç¼ç çé»è®¤æ·»å è¶
龿¥,ææªå®ç° |
| | | record.formatter = ''; |
| | | }else { |
| | | if (record.templet && typeof (record.templet) == 'string' && !validatenull(record.templet) && record.templet.indexOf("function(row,column)")>-1) { |
| | | record.formatter = eval("(" + record.templet + ")"); |
| | | //function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'æ¯':'å¦'} |
| | | }else if(record.fieldType=="truefalse"){ |
| | | record.formatter = function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'æ¯':'å¦'} |
| | | } |
| | | } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | // è½¬æ¢æ°æ®trueåfalse |
| | | formatBoolean(row, column) { |
| | | if (column.property === "xiaoshouwl" |
| | | ||column.property === "shifoupihaoguanli" |
| | | ||column.property === "caigouwl" |
| | | ||column.property === "kucunwl" |
| | | ||column.property === "passing") { |
| | | return row[column.property] =='true'? "æ¯" : "å¦"; |
| | | } |
| | | return row[column.property]; |
| | | }, |
| | | // åå¸ |
| | | setHandler() { |
| | | if (this.selectRow.length <= 0) { |
| | |
| | | ></formula-editor> |
| | | <!-- æ°å¢ --> |
| | | <el-dialog :visible.sync="addVisible" append-to-body title="ä»ä¸å¡ç±»åä¸éæ©å±æ§"> |
| | | <avue-crud :data="businessData" :option="businessOption" @select="businessSelect"> |
| | | <avue-crud :data="businessData" :option="businessOption" @selection-change="businessSelect"> |
| | | <template slot="menuLeft"> |
| | | <div style="display: flex;"> |
| | | <el-select> |
| | |
| | | type="selection" |
| | | width="55"> |
| | | </el-table-column> |
| | | <el-table-column fixed label="åºå·" type="index" width="55"></el-table-column> |
| | | <!--<el-table-column fixed label="åºå·" type="index" width="55"></el-table-column>--> |
| | | <el-table-column v-for="item in this.option.column" :key="item.id" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop" v-model="row[item.prop]" |
| | | <el-input v-if="editingRows === row && editShows== item.prop && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer')" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input> |
| | | <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-switch |
| | | v-if="item.label === 'true' || item.label === 'false'" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | 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> |
| | | </template> |
| | |
| | | }, |
| | | // ç¼ç ç³è¯·é¢è§data |
| | | applicationData: [], |
| | | //ä¸å¡ç±»ååéæ°ç» |
| | | //ä¸å¡ç±»åéæ©æ°ç» |
| | | busineSelectList: [], |
| | | //ä¸å¡ç±»åæ·»å æ°æ® |
| | | busineAddList: {}, |
| | | //è¡¨æ ¼åéæ°ç» |
| | | CrudSelect: [], |
| | | attrSelectList: [], |
| | | //è¡¨æ ¼oid |
| | | CrudOid: "", |
| | | attrOid: "", |
| | | //åºæ¯åé |
| | | thisSceneTableData: [ |
| | | { |
| | |
| | | rowCellList: [], |
| | | List: [], |
| | | option: { |
| | | index: true, |
| | | index: false, |
| | | border: true, |
| | | editBtn: false, |
| | | selection: true, |
| | |
| | | prop: 'name', |
| | | order: 'descending' |
| | | }, |
| | | column: [ |
| | | { |
| | | column: [{ |
| | | prop: 'orderNum', |
| | | label: 'æåºå·', |
| | | sortable: true, |
| | | edit: 'number', |
| | | width: 60, |
| | | fixed: true |
| | | }, { |
| | | label: "屿§è±æç¼å·", |
| | | prop: "id", |
| | | fixed: true, |
| | |
| | | fixed: true, |
| | | cell: false, |
| | | width: 125, |
| | | edit: 'text', |
| | | sortable: true |
| | | }, |
| | | { |
| | |
| | | prop: "attributeGroup", |
| | | cell: false, |
| | | sortable: true, |
| | | edit: 'text', |
| | | width: 125, |
| | | }, |
| | | { |
| | |
| | | cell: false, |
| | | sortable: true, |
| | | width: 105, |
| | | edit: 'number' |
| | | }, |
| | | { |
| | | label: "å
³é®å±æ§", |
| | | prop: "keyAttrFlag", |
| | | cell: false, |
| | | type: "switch", |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "æ¥è¯¢å±æ§", |
| | | prop: "queryAttrFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "é«çº§æ¥è¯¢å±æ§", |
| | | prop: "seniorQueryAttrFlag", |
| | | width: 95, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "ç¸ä¼¼æ¥è¯¢å±æ§", |
| | | label: "ç¸ä¼¼æ¥é屿§", |
| | | prop: "sameRepeatAttrFlag", |
| | | width: 95, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "å¿
è¾", |
| | | prop: "requireFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "è¡¨åæ¾ç¤º", |
| | | prop: "formDisplayFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "å表æ¾ç¤º", |
| | | prop: "tableDisplayFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "åªè¯»", |
| | | prop: "readonlyFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "å表æåº", |
| | | prop: "sortAttrFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | |
| | | { |
| | | label: "å¤è¡ææ¬", |
| | | prop: "textareaFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "é»è®¤å¼", |
| | | prop: "defaultValue", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'text', |
| | | width: 95, |
| | | }, |
| | | { |
| | | label: "åç¼", |
| | | prop: "prefixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | | label: "åç¼", |
| | | prop: "suffixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | |
| | | prop: "componentRule", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'refer', |
| | | width: 105, |
| | | }, |
| | | { |
| | |
| | | prop: "verifyRule", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'refer', |
| | | width: 105, |
| | | }, |
| | | { |
| | |
| | | prop: "codeDateFormat", |
| | | sortable: true, |
| | | width: 105, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | | label: "å类注å
¥", |
| | | prop: "classifyInvokeLevel", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "æä¸¾æ³¨å
¥", |
| | | prop: "enumString", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "级è屿§", |
| | | prop: "parentCode", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "åç
§é
ç½®", |
| | | prop: "referConfig", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "çº§èæ¥è¯¢å±æ§", |
| | | prop: "parentQueryAttr", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "éæ©åºæ è¯", |
| | | prop: "libraryIdentification", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "å¡«åæç¤º", |
| | | prop: "explain", |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "è¡¨åæ¾ç¤ºæ ·å¼", |
| | | prop: "formDisplayStyle", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "è¡¨æ ¼æ¾ç¤ºæ ·å¼", |
| | | prop: "tableDisplayStyle", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表åè¶
龿¥", |
| | | prop: "formHref", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "è¡¨æ ¼è¶
龿¥", |
| | | prop: "tableHref", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "è¡¨æ ¼æ¾ç¤ºjs", |
| | | prop: "tableDisplayJs", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "é¿åº¦", |
| | | prop: "controlLength", |
| | | cell: false, |
| | | cell: false |
| | | }, |
| | | { |
| | | label: "å°æ°ç²¾åº¦", |
| | | prop: "precisionLength", |
| | | cell: false, |
| | | cell: false |
| | | }, |
| | | { |
| | | label: "åå¼èå´", |
| | |
| | | sortable: true, |
| | | cell: false, |
| | | width: 105, |
| | | edit: 'text' |
| | | }, |
| | | ], |
| | | List: [] |
| | | }, |
| | | vciFieldTypeMap : { |
| | | VTBoolean: "å¸å°å", |
| | | VTClob: "é¿ææ¬", |
| | | VTDate: "æ¥æ", |
| | | VTDateTime: "æ¥ææ¶é´", |
| | | VTTime: "æ¶é´", |
| | | VTLong: "é¿æ´å", |
| | | VTDouble: "éé¢/å精度", |
| | | VTInteger: "æ´å½¢", |
| | | VTFilePath: "æä»¶", |
| | | VTString: "å符串" |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | attrOids() { |
| | | let oids = []; |
| | | this.attrSelectList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | }, |
| | | busineOids() { |
| | | let oids = []; |
| | | this.busineSelectList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | }, |
| | | //屿§åç»æé® |
| | | attrVisibleHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect < 1) { |
| | | } else if (this.attrSelectList < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.attrVisible = true; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //ä¸å¡ç±»åä¿å |
| | | busineAddHandle() { |
| | | if (this.busineSelectList.length > 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡ä¸å¡ç±»åæ°æ®') |
| | | } else { |
| | | this.$set(this.busineAddList, 'classifytemplateoid', this.crudOid) |
| | | this.$set(this.busineAddList, 'oid', '') |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | this.addVisible = false; |
| | | if (this.busineSelectList.length == 0) { |
| | | this.$message.warning('è¯·éæ©å±æ§é'); |
| | | return false; |
| | | } |
| | | debugger; |
| | | let ordernum = this.ProData.length; |
| | | this.busineSelectList.forEach((citem) => { |
| | | let isCopy = false; |
| | | this.ProData.forEach((item) => { |
| | | if (citem.id == item.id) { |
| | | isCopy = true; |
| | | return false; |
| | | } |
| | | }) |
| | | if (!isCopy) { |
| | | citem.oid = '' |
| | | this.busineAddList=Object.assign(citem, { |
| | | orderNum: ++ordernum, |
| | | attributedatatype: citem.attrDataType, |
| | | attributeDataTypeText: this.vciFieldTypeMap[citem.attrDataType], |
| | | controlLength: citem.attributeLength, |
| | | valueArea: citem.range, |
| | | referbtmid: citem.referBtmTypeId, |
| | | referbtmname: citem.referBtmTypeName, |
| | | referConfig: '', |
| | | enumid: citem.enumId, |
| | | precisionLength: (citem.precisionLength ? citem.precisionLength : '') + (citem.scaleLength ? '(' + citem.scaleLength + ')' : ''), |
| | | classifyTemplateOid: this.crudOid, |
| | | classifytemplateoid: this.crudOid, |
| | | formDisplayFlag: true, |
| | | tableDisplayFlag: true, |
| | | sortAttrFlag: false, |
| | | queryAttrFlag: true, |
| | | seniorQueryAttrFlag: true, |
| | | attrTableWidth: 120 |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | } |
| | | }) |
| | | |
| | | |
| | | this.addVisible = false; |
| | | |
| | | }, |
| | | //ä¸å¡ç±»ååé |
| | | //ä¸å¡ç±»åéæ© |
| | | businessSelect(selection, row) { |
| | | this.busineSelectList = selection |
| | | this.busineAddList = row |
| | | }, |
| | | // ä»ä¸å¡ç±»åä¸éæ©æ°æ® |
| | | // ä»ä¸å¡ç±»åä¸éæ©æ°æ®å¼¹çª |
| | | busineHandle() { |
| | | this.addVisible = true; |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => { |
| | | this.businessData = res.data.data; |
| | | }) |
| | | this.addVisible = true; |
| | | this.busineSelectList = [] |
| | | this.busineAddList = []; |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => { |
| | | this.businessData = res.data.data; |
| | | }) |
| | | }, |
| | | // 级è屿§æé® |
| | | CascadeHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.CascadeVisible = true; |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CrudOid |
| | | 'conditionMap[oid_notequal]': this.attrOid |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | |
| | | }, |
| | | //è¡¨æ ¼åé |
| | | selectHandle(selection, row) { |
| | | this.CrudOid = row.oid; |
| | | this.CrudSelect = selection; |
| | | this.attrOid = row.oid; |
| | | this.attrRow = row; |
| | | console.log('123',row,selection) |
| | | }, |
| | | //è¡¨æ ¼éæ© |
| | | selectionChange(list) { |
| | | this.attrSelectList = list; |
| | | }, |
| | | //ä¿å |
| | | addsHandler() { |
| | |
| | | }, |
| | | //è¡¨æ ¼è¡ç¼è¾ |
| | | handleCellClicks(row, column) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | |
| | | }, |
| | | //æä¸¾æ³¨å
¥æé® |
| | | enmuVisHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect < 1) { |
| | | } else if (this.attrSelectList < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.enumVisible = true; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //ç¹å»å类注å
¥æé® |
| | | injectBtn() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿æ°æ®') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿æ°æ®') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.injectVisible = true |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //忥å°å
¶ä»æ¨¡æ¿ |
| | | syncHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | copyto({oid: this.attrRow.oid}).then(res => { |
| | | this.$message.success('忥æå') |
| | | }) |
| | |
| | | }, |
| | | //ç»åè§å |
| | | isShowHandler() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.isShowformulaEdit = true; |
| | | } |
| | | }, |
| | |
| | | <template> |
| | | <div> |
| | | <el-button @click="HandlerRend"></el-button> |
| | | <el-table :data="data"> |
| | | <el-table-column |
| | | fixed |
| | | type="selection" |
| | | width="55"> |
| | | <el-button @click="HandlerRend" size="small" type="primary">ä¿å</el-button> |
| | | <el-table |
| | | v-loading="isLoading" |
| | | :data="tableData" |
| | | max-height="700" |
| | | style="" |
| | | @cell-click="handleCellClick" |
| | | > |
| | | <el-table-column fixed type="selection" width="55"> </el-table-column> |
| | | <el-table-column fixed label="åºå·" type="index" width="55"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed |
| | | label="åºå·" |
| | | type="index" |
| | | width="55"> |
| | | v-for="item in this.tableHeadData" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :sortable="item.sortable" |
| | | :formatter="item.formatter" |
| | | :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'" |
| | | :show-overflow-tooltip="true" |
| | | align="center" |
| | | > |
| | | <!-- ç¼è¾åå±ç¤ºé»è¾ --> |
| | | <!-- <template slot-scope="{ row }">--> |
| | | <!-- <el-input v-if="editingRow === row && editShow== item.prop" v-model="row[item.prop]" @blur="saveRow"></el-input>--> |
| | | <!-- <span v-else>{{row[item.prop]}}</span>--> |
| | | <!-- <el-switch--> |
| | | <!-- v-if="editShow === 'true'"--> |
| | | <!-- v-model="row[item.prop]"--> |
| | | <!-- active-color="#13ce66"--> |
| | | <!-- inactive-color="#ff4949">--> |
| | | <!-- </el-switch>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import {businese} from '@/api/work/businese' |
| | | import {MasterTable} from "@/api/GetItem"; |
| | | import {validatenull} from "@/util/validate"; |
| | | export default { |
| | | name: "BusinessWork", |
| | | props:['ids','templateId'], |
| | | data() { |
| | | return { |
| | | BuinessOids:[], |
| | | data:[ |
| | | { |
| | | label:'app' |
| | | } |
| | | ] |
| | | isLoading:false, |
| | | tableHeadData:[], |
| | | tableData:[], |
| | | editingRow: null, |
| | | editShow: "", |
| | | editAttr: "" |
| | | } |
| | | }, |
| | | watch:{ |
| | |
| | | handler(newval,oldval){ |
| | | this.BuinessOids=newval; |
| | | this.BuinseseRend() |
| | | console.log(newval) |
| | | console.log(this.BuinessOids) |
| | | }, |
| | | deep:true |
| | | } |
| | |
| | | mounted() { |
| | | }, |
| | | methods:{ |
| | | HandlerRend(){ |
| | | this.editingRow = null; |
| | | }, |
| | | //è¡¨æ ¼å¤´æ¸²æ |
| | | CrudHeaderRend() { |
| | | if (this.codeClassifyOid != "") { |
| | | MasterTable({ |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | functionId: 5, |
| | | }).then((res) => { |
| | | this.options = res.data.tableDefineVO.seniorQueryColumns; |
| | | this.List = res.data.tableDefineVO.cols[0]; |
| | | this.tableHeadData=[]; |
| | | this.List.forEach((item) => { |
| | | let columnItem = { |
| | | label: item.title, |
| | | prop: item.field, |
| | | type: this.columnType[item.type], |
| | | sortable: item.sort, |
| | | width: item.minWidth |
| | | }; |
| | | if(item.field == 'id' && validatenull(item.templet)){ |
| | | //ä¼ä¸ç¼ç çé»è®¤æ·»å è¶
龿¥,ææªå®ç° |
| | | columnItem.formatter = ''; |
| | | }else { |
| | | if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)")>-1) { |
| | | columnItem.formatter = eval("(" + item.templet + ")"); |
| | | //function(row,column){return row[column.property]=='true'?'æ¯':'å¦'} |
| | | } |
| | | } |
| | | this.tableHeadData.push(columnItem) |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | //è¡¨æ ¼æ°æ® |
| | | BuinseseRend(){ |
| | | businese({ |
| | | btmType:'wupin', |
| | | 'conditionMap[oid]':this.BuinessOids.toString() |
| | | }).then(res=>{ |
| | | console.log(res) |
| | | this.tableData = res.data.data; |
| | | }) |
| | | } |
| | | }, |
| | | // çå¬åå
æ ¼ç¹å»äºä»¶å¹¶å卿£å¨ç¼è¾çè¡ |
| | | handleCellClick(row, column) { |
| | | this.editingRow = row; |
| | | this.editShow = column.property; |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | 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; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @GetMapping("page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页æ¥è¯¢çå½å¨æ",notes = "å页æ¥è¯¢çå½å¨æ") |
| | | public R<IPage<LifeCycleVO>> page(BaseQueryObject baseQueryObject){ |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | public R<IPage<LifeCycleVO>> page(BladeQueryObject baseQueryObject){ |
| | | Map<String, Object> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | return R.data(lifeCycleService.listLife(conditionMap,baseQueryObject.getPageHelper())); |
| | | return R.data(lifeCycleService.listLife(conditionMap,baseQueryObject.getQuery())); |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.entity.LifeCycleEdge; |
| | | |
| | | /** |
| | | * çå½å¨æçè¿æ¥çº¿ |
| | | * @author weidy |
| | | * @date 2023/7/4 |
| | | */ |
| | | public interface LifeCycleEdgeMapper extends BaseMapper<LifeCycleEdge> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.dto.LifeCycleLineEventDTO; |
| | | import com.vci.ubcs.omd.entity.LifeCycleLineEvent; |
| | | |
| | | /** |
| | | * çå½å¨æè¿æ¥çº¿çäºä»¶ |
| | | * @author weidy |
| | | * @date 2023/7/4 |
| | | */ |
| | | public interface LifeCycleLineEventMapper extends BaseMapper<LifeCycleLineEvent> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.entity.LifeCycleNode; |
| | | |
| | | /** |
| | | * çå½å¨æçèç¹åå¨ |
| | | * @author weidy |
| | | * @date 2023/7/4 |
| | | */ |
| | | public interface LifeCycleNodeMapper extends BaseMapper<LifeCycleNode> { |
| | | } |
| | |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | BtmTypeVO getAllAttributeByBtmOid(String btmTypeOid); |
| | | |
| | | /** |
| | | * è·åå¼ç¨æä¸ªçå½å¨æçä¸å¡ç±»å |
| | | * @param lifeOid çå½å¨æçä¸»é® |
| | | * @return ä¸å¡ç±»åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | List<BtmTypeVO> selectByLifeId(String lifeId); |
| | | |
| | | /** |
| | | * ç»è®¡å¼ç¨æä¸ªçå½å¨æçä¸å¡ç±»å |
| | | * @param lifeOid çå½å¨æçä¸»é® |
| | | * @return ä¸ªæ° |
| | | */ |
| | | Integer countByLifeId(String lifeId); |
| | | } |
| | |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.LifeCycleVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | /** |
| | | * è·åçå½å¨æå表 |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页 |
| | | * @param query å页 |
| | | * @return çå½å¨æçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | IPage<LifeCycleVO> listLife(Map<String, String> conditionMap, PageHelper pageHelper); |
| | | IPage<LifeCycleVO> listLife(Map<String, Object> conditionMap, Query query); |
| | | |
| | | /** |
| | | * æ·»å ä¿å |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.api.exception.NacosException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | |
| | | btmType.setAttributes(btmTypeAttributeService.getAllAttribute(btmType)); |
| | | return btmType; |
| | | } |
| | | |
| | | /** |
| | | * è·åå¼ç¨æä¸ªçå½å¨æçä¸å¡ç±»å |
| | | * |
| | | * @param lifeId çå½å¨æçç¼å· |
| | | * @return ä¸å¡ç±»åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public List<BtmTypeVO> selectByLifeId(String lifeId) { |
| | | if(StringUtils.isBlank(lifeId)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | LambdaQueryWrapper<BtmType> query = new LambdaQueryWrapper<BtmType>(); |
| | | query.eq(BtmType::getLifeCycleId,lifeId); |
| | | return BtmTypeWrapper.build().listEntityVO(getBaseMapper().selectList(query)); |
| | | } |
| | | |
| | | /** |
| | | * ç»è®¡å¼ç¨æä¸ªçå½å¨æçä¸å¡ç±»å |
| | | * |
| | | * @param lifeId çå½å¨æçç¼å· |
| | | * @return ä¸ªæ° |
| | | */ |
| | | @Override |
| | | public Integer countByLifeId(String lifeId) { |
| | | if(StringUtils.isBlank(lifeId)){ |
| | | return 0; |
| | | } |
| | | LambdaQueryWrapper<BtmType> query = new LambdaQueryWrapper<BtmType>(); |
| | | query.eq(BtmType::getLifeCycleId,lifeId); |
| | | return baseMapper.selectCount(query).intValue(); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.omd.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.dto.LifeCycleDTO; |
| | | import com.vci.ubcs.omd.dto.LifeCycleEdgeDTO; |
| | | import com.vci.ubcs.omd.dto.LifeCycleLineEventDTO; |
| | | import com.vci.ubcs.omd.dto.LifeCycleNodeDTO; |
| | | import com.vci.ubcs.omd.entity.LifeCycleEdge; |
| | | import com.vci.ubcs.omd.entity.LifeCycleLineEvent; |
| | | import com.vci.ubcs.omd.entity.LifeCycleNode; |
| | | import com.vci.ubcs.omd.entity.LifeCycleRule; |
| | | import com.vci.ubcs.omd.mapper.LifeCycleEdgeMapper; |
| | | import com.vci.ubcs.omd.mapper.LifeCycleLineEventMapper; |
| | | import com.vci.ubcs.omd.mapper.LifeCycleMapper; |
| | | import com.vci.ubcs.omd.mapper.LifeCycleNodeMapper; |
| | | import com.vci.ubcs.omd.repeater.DomainRepeater; |
| | | import com.vci.ubcs.omd.service.IBtmTypeService; |
| | | import com.vci.ubcs.omd.service.ILifeCycleService; |
| | | import com.vci.ubcs.omd.service.IStatusService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.LifeCycleVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.omd.vo.StatusVO; |
| | | import com.vci.ubcs.omd.wrapper.LifeCycleRuleWrapper; |
| | | import com.vci.ubcs.starter.enumpack.NewAppConstantEnum; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.constant.RegExpConstant; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * çå½å¨æçæå¡ |
| | |
| | | @Service |
| | | public class LifeCycleServiceImpl extends ServiceImpl<LifeCycleMapper, LifeCycleRule> implements ILifeCycleService{ |
| | | |
| | | /** |
| | | * èç¹çæ°æ®å± |
| | | */ |
| | | @Resource |
| | | private LifeCycleNodeMapper nodeMapper; |
| | | |
| | | /** |
| | | * è¿æ¥çº¿æ°æ®å± |
| | | */ |
| | | @Resource |
| | | private LifeCycleEdgeMapper edgeMapper; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private IStatusService statusService; |
| | | |
| | | /** |
| | | * è¿æ¥çº¿çäºä»¶ |
| | | */ |
| | | @Resource |
| | | private LifeCycleLineEventMapper lineEventMapper; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åçæå¡ |
| | | */ |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private IBtmTypeService btmTypeService; |
| | | |
| | | |
| | | /** |
| | | * è·åçå½å¨æå表 |
| | | * |
| | | * @param conditionMap æ¥è¯¢æ¡ä»¶ |
| | | * @param pageHelper å页 |
| | | * @param query å页 |
| | | * @return çå½å¨æçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public IPage<LifeCycleVO> listLife(Map<String, String> conditionMap, PageHelper pageHelper) { |
| | | return null; |
| | | public IPage<LifeCycleVO> listLife(Map<String, Object> conditionMap, Query query) { |
| | | return LifeCycleRuleWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query),Condition.getQueryWrapper(conditionMap,LifeCycleRule.class).lambda().orderByAsc(LifeCycleRule::getId))); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ·»å åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public LifeCycleVO addSave(LifeCycleDTO lifeCycleDTO) { |
| | | return null; |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"çå½å¨æä¿¡æ¯",lifeCycleDTO.getId(),"çå½å¨æçç¼å·",lifeCycleDTO.getName(),"çå½å¨æåç§°",lifeCycleDTO.getNodes(),"çå½å¨æçèç¹",lifeCycleDTO.getStartStatus(),"èµ·å§ç¶æ"); |
| | | //å
æ¥è¯¢æ¯å¦åå¨ |
| | | QueryWrapper wrapper = new QueryWrapper(LifeCycleRule.class); |
| | | wrapper.eq("lower(id)",lifeCycleDTO.getId().toLowerCase(Locale.ROOT)); |
| | | if(baseMapper.selectCount(wrapper)>0){ |
| | | throw new VciBaseException("çå½å¨æçç¼å·ä¸è½éå¤"); |
| | | } |
| | | String lifeOid = addLifeCycle(lifeCycleDTO); |
| | | return LifeCycleRuleWrapper.build().entityVO(baseMapper.selectById(lifeOid)); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å çå½å¨æ |
| | | * @param lifeCycleDTO |
| | | * @return ä¸»é® |
| | | */ |
| | | private String addLifeCycle(LifeCycleDTO lifeCycleDTO){ |
| | | //ç¼å·ä¸è½æç¹æ®çå
容 |
| | | if(!lifeCycleDTO.getId().matches(RegExpConstant.LETTER)){ |
| | | throw new VciBaseException("çå½å¨æçç¼å·åªè½æ¯åæ¯"); |
| | | } |
| | | LifeCycleRule life = LifeCycleRuleWrapper.build().copyDTO2DO(lifeCycleDTO); |
| | | life.setOid(VciBaseUtil.getPk()); |
| | | String creator = AuthUtil.getUserAccount(); |
| | | Date now = new Date(); |
| | | life.setBtmname(BtmTypeConstant.LIFE_CYCLE); |
| | | life.setOwner(creator); |
| | | life.setCreator(creator); |
| | | life.setCreateTime(now); |
| | | life.setLastModifier(creator); |
| | | life.setLastModifyTime(now); |
| | | life.setTs(now); |
| | | |
| | | 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.insert(life); |
| | | return life.getOid(); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å çå½å¨æçè¿æ¥çº¿ä¸çäºä»¶ |
| | | * @param eventDTO |
| | | * @param edgeOid |
| | | * @param creator |
| | | * @param now |
| | | */ |
| | | private void addLifeCycleLineEvent(LifeCycleLineEventDTO eventDTO,String edgeOid,String creator,Date now){ |
| | | VciBaseUtil.alertNotNull(eventDTO.getBizDomain(),"æå±é¢å",eventDTO.getEventFullName(),"äºä»¶çå
¨è·¯å¾"); |
| | | NewAppConstantEnum[] values = NewAppConstantEnum.values(); |
| | | Boolean fined = false; |
| | | for (int i = 0; i < values.length; i++) { |
| | | NewAppConstantEnum value = values[i]; |
| | | if(value.getName().equalsIgnoreCase(eventDTO.getBizDomain())){ |
| | | fined = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!fined){ |
| | | throw new VciBaseException(eventDTO.getBizDomain() + "è¿ä¸ªé¢åè¿æ²¡æå¼æ¾,请让å¼å人åå¨NewAppConstantEnumç±»ä¸æ·»å "); |
| | | } |
| | | LifeCycleLineEvent event = org.springblade.core.tool.utils.BeanUtil.copy(eventDTO, LifeCycleLineEvent.class); |
| | | event.setOid(VciBaseUtil.getPk()); |
| | | event.setPkLifeCycleEdge(edgeOid); |
| | | event.setBtmname(BtmTypeConstant.LIFE_CYCLE_LINE_EVENT); |
| | | event.setOwner(creator); |
| | | event.setCreator(creator); |
| | | event.setCreateTime(now); |
| | | event.setLastModifier(creator); |
| | | event.setLastModifyTime(now); |
| | | event.setTs(now); |
| | | lineEventMapper.insert(event); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å çå½å¨æçèç¹ |
| | | * @param nodeDTO |
| | | * @param lifeOid |
| | | * @param creator |
| | | * @param now |
| | | */ |
| | | private void addLifeCycleNode(LifeCycleNodeDTO nodeDTO,String lifeOid,String creator,Date now){ |
| | | VciBaseUtil.alertNotNull(nodeDTO.getId(),"ç¶ææ è¯",nodeDTO.getName(),"ç¶æåç§°"); |
| | | LifeCycleNode node = org.springblade.core.tool.utils.BeanUtil.copy(nodeDTO, LifeCycleNode.class); |
| | | node.setOid(VciBaseUtil.getPk()); |
| | | node.setLifeCycleOid(lifeOid); |
| | | node.setBtmname(BtmTypeConstant.LIFE_CYCLE_NODE); |
| | | node.setOwner(creator); |
| | | node.setCreator(creator); |
| | | node.setCreateTime(now); |
| | | node.setLastModifier(creator); |
| | | node.setLastModifyTime(now); |
| | | node.setTs(now); |
| | | nodeMapper.insert(node); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å çå½å¨æçè¿æ¥çº¿ |
| | | * @param edgeDTO |
| | | * @param statusList |
| | | * @param lifeOid |
| | | * @param creator |
| | | * @param now |
| | | * @return è¿æ¥çº¿çä¸»é® |
| | | */ |
| | | private String addLifeCycleEdge(LifeCycleEdgeDTO edgeDTO,List<String> statusList,String lifeOid,String creator,Date now){ |
| | | VciBaseUtil.alertNotNull(edgeDTO.getSource(),"æ¥æºç¶æ",edgeDTO.getTarget(),"ç®æ ç¶æ",edgeDTO.getName(),"è¿æ¥çº¿åç§°"); |
| | | if(!statusList.contains(edgeDTO.getSource()) |
| | | ||!statusList.contains(edgeDTO.getTarget())){ |
| | | throw new VciBaseException("æ°æ®é误ï¼[" + edgeDTO.getName() + "]è¿æ¥çº¿ä¸ä¸ä½¿ç¨çç¶ææ²¡ææ¾å°"); |
| | | } |
| | | LifeCycleEdge edge = org.springblade.core.tool.utils.BeanUtil.copy(edgeDTO, LifeCycleEdge.class); |
| | | edge.setOid(VciBaseUtil.getPk()); |
| | | edge.setLifeCycleOid(lifeOid); |
| | | edge.setBtmname(BtmTypeConstant.LIFE_CYCLE_EDGE); |
| | | edge.setOwner(creator); |
| | | edge.setCreator(creator); |
| | | edge.setCreateTime(now); |
| | | edge.setLastModifier(creator); |
| | | edge.setLastModifyTime(now); |
| | | edge.setTs(now); |
| | | edgeMapper.insert(edge); |
| | | return edge.getOid(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ¹éæ·»å å
容 |
| | |
| | | * @return æ·»å åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public List<LifeCycleVO> batchAddSave(List<LifeCycleDTO> lifeCycleDTOs) { |
| | | return null; |
| | | VciBaseUtil.alertNotNull(lifeCycleDTOs,"çå½å¨æçä¿¡æ¯"); |
| | | //å
é使 ¡éªä¸ä¸ |
| | | 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(LifeCycleDTO::getId)); |
| | | 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.toLowerCase(Locale.ROOT)); |
| | | wrapper.or(); |
| | | }); |
| | | wrapper.eq("1","2"); |
| | | if(baseMapper.selectCount(wrapper)>0){ |
| | | throw new VciBaseException("çå½å¨æçç¼å·ä¸è½éå¤"); |
| | | } |
| | | } |
| | | ); |
| | | //å
循ç¯å¤çä¸ï¼å 为ç°å¨å½åç¨æ·æ²¡æå¤ç为线ç¨å
±äº«çï¼åé¢ä¿®æ¹åï¼å¯ä»¥ç¨å¹¶åæµå»å¤ç |
| | | List<String> oidList = new ArrayList<>(); |
| | | lifeCycleDTOs.stream().forEach(dto->{ |
| | | oidList.add(addLifeCycle(dto)); |
| | | }); |
| | | return LifeCycleRuleWrapper.build().listEntityVO(listByIds(oidList)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void delete(LifeCycleDTO lifeCycleDTO) { |
| | | VciBaseUtil.alertNotNull(lifeCycleDTO,"æ°æ®ä¼ è¾å¯¹è±¡",lifeCycleDTO.getOid(),"主é®"); |
| | | LifeCycleRule rule = null; |
| | | try { |
| | | rule = getById(lifeCycleDTO.getOid()); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("使ç¨ä¸»é®è·å对象åºéï¼è¿ä¸ªæ°æ®å¯è½ä¸åå¨ï¼æè
æ°æ®éå¤äº"); |
| | | } |
| | | //æ£æ¥è¢«å¼ç¨ä¸è½å é¤ |
| | | Integer count = btmTypeService.countByLifeId(lifeCycleDTO.getOid()); |
| | | if(count !=null && count>0){ |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | public BtmTypeAttributeVO entityVO(BtmTypeAttribute entity) { |
| | | BtmTypeAttributeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, BtmTypeAttributeVO.class)); |
| | | // å¨è¿é设置æä¸¾æ¾ç¤ºå¼ |
| | | vo.setPrecisionLength(vo.getPrecisionLength() == -1 ? null : vo.getPrecisionLength()); |
| | | vo.setScaleLength(vo.getScaleLength() == -1 ? null : vo.getPrecisionLength()); |
| | | vo.setAttrDataTypeText(EnumCache.getValue("attributeType",vo.getAttrDataType())); |
| | | return vo; |
| | | } |
| | |
| | | package com.vci.ubcs.omd.wrapper; |
| | | |
| | | import com.vci.ubcs.omd.dto.LifeCycleDTO; |
| | | import com.vci.ubcs.omd.entity.LifeCycleRule; |
| | | import com.vci.ubcs.omd.vo.LifeCycleVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | |
| | | } |
| | | |
| | | |
| | | public LifeCycleRule copyDTO2DO(LifeCycleDTO lifeCycleDTO) { |
| | | LifeCycleRule LifeCycleRule = BeanUtil.copy(lifeCycleDTO, LifeCycleRule.class); |
| | | return LifeCycleRule; |
| | | } |
| | | } |