| | |
| | | "script-loader": "^0.7.2", |
| | | "vue": "^2.6.10", |
| | | "vue-axios": "^2.1.2", |
| | | "vue-flowchart-editor": "^1.0.2", |
| | | "vue-i18n": "^8.7.0", |
| | | "vue-router": "^3.0.1", |
| | | "vuex": "^3.1.1" |
| | |
| | | |
| | | export const MasterTable =(params)=>{ |
| | | return request({ |
| | | url: 'api/ubcs-code/ubcs-code/mdmEngineController/getUIInfoByClassifyOid', |
| | | url: 'api/ubcs-code/mdmEngineController/getUIInfoByClassifyOid', |
| | | method: 'get', |
| | | params:{ |
| | | ...params |
| | |
| | | |
| | | export const TableData =(params)=>{ |
| | | return request({ |
| | | url: 'api/ubcs-code/ubcs-code/mdmEngineController/gridTableDataByClassifyOid', |
| | | url: 'api/ubcs-code/mdmEngineController/gridTableDataByClassifyOid', |
| | | method: 'get', |
| | | params:{ |
| | | ...params |
| | |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | export const remove = (oid) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/attribute/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | oid, |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export const getLazyList = (parentId, params) => { |
| | | export const getLazyList = (parentId, params,current, size,) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/dept/lazy-list', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | parentId |
| | | parentId, |
| | | current, |
| | | size |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const combination = () => { |
| | | return request({ |
| | | url: '/api/ubcs-system/combination/select', |
| | | method: 'get', |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // 人å设置åå§å |
| | | export const personnelInit = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | // 人å设置æ¶è |
| | | export const personnelCollect = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/su', |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | // 人åè®¾ç½®åæ¶æ¶è |
| | | export const cancelCollect = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/du', |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | // 人å设置ä¿å |
| | | export const personnelSave = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/vciflow/start', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | // 人å设置ä¿å |
| | | export const personnelDict = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-user/allPage', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | |
| | | <FormTemplateDialog |
| | | :visible.sync="addvisible" |
| | | :type="add" |
| | | :templateOid="this.templateOid" |
| | | :templateOid="templateOid" |
| | | :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" |
| | |
| | | <FormTemplateDialog |
| | | :visible.sync="editvisible" |
| | | :type="edit" |
| | | :templateOid="this.templateOids" |
| | | :templateOid="templateOid" |
| | | :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" |
| | |
| | | <el-button size="small" type="primary" plain>å é¤</el-button> |
| | | <el-button size="small" type="primary" plain>åå¸</el-button> |
| | | <el-button size="small" type="primary" plain>æ°æ®æ´æ¹</el-button> |
| | | <el-button size="small" type="primary" plain>åæ¶</el-button> |
| | | <el-button size="small" type="primary" plain @click="huishouHandler">åæ¶</el-button> |
| | | <el-button size="small" type="primary" plain @click="openD">å¯¼åº |
| | | <integration-transfer :visible.sync="dialogPush" :data="transferData" |
| | | :props="transferProps" @save="handelTransferSave"></integration-transfer> |
| | | </el-button> |
| | | <el-button size="small" type="primary" plain @click="findvisible=true">æ¥è¯¢ |
| | | <<<<<<< HEAD |
| | | <advanced-query :visible.sync="findvisible" :options="options"></advanced-query> |
| | | ======= |
| | | <advanced-query :visible.sync="findvisible" :options="this.options"></advanced-query> |
| | | >>>>>>> 859a64b36d107b147f44eccd0c0a76471c5e49ea |
| | | </el-button> |
| | | <el-button size="small" type="primary" plain>ç¸ä¼¼é¡¹æ¥è¯¢</el-button> |
| | | <el-button size="small" type="primary" plain style="margin-left: 1px;margin-top:10px">å·æ°</el-button> |
| | | <el-input placeholder="请è¾å
¥å
³é®åæå车æ¥è¯¢" style="width: 180px;margin-left: 5px;margin-top:10px" size="small"></el-input> |
| | | </div> |
| | | <el-row style="height: 700px;width: 100%"> |
| | | <el-table :data="tableData" style="" @cell-click="handleCellClick" max-height="700" @selection-change="handleSelectionChange" @sort-change="sortChange"> |
| | | <el-table :data="tableData" style="" @cell-click="handleCellClick" max-height="700" v-loading="isLoading" @selection-change="handleSelectionChange" @sort-change="sortChange"> |
| | | <el-table-column |
| | | type="selection" |
| | | fixed |
| | |
| | | }, |
| | | tableDataArray:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | total:{ |
| | | type:String, |
| | | default:"" |
| | | }, |
| | | templateOid:{ |
| | | type:String, |
| | | }, |
| | | tableHeadDataFateher:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | isLoading:{ |
| | | type:Boolean, |
| | | default:false |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | editingRow:null, |
| | | editShow: "", |
| | | editAttr:"", |
| | | loading: false, |
| | | data: [], |
| | | options:[], |
| | | option: { |
| | |
| | | }, |
| | | tableData:[], |
| | | tableHeadData:[], |
| | | tableHeadDataFateher:[], |
| | | items:{}, |
| | | seniorQueryColumns:[] |
| | | } |
| | |
| | | this.page.total=newval; |
| | | } |
| | | }, |
| | | tableHeadData:{ |
| | | tableHeadDataFateher:{ |
| | | handler(newval,oldval){ |
| | | this.tableHeadDataFateher=newval |
| | | let List=newval.tableDefineVO.cols[0]; |
| | | List.forEach(item=>{ |
| | | let columnItem = { |
| | | label: item.title, |
| | | prop: item.field, |
| | | type: this.columnType[item.type], |
| | | sortable: item.sort, |
| | | width: item.minWidth |
| | | }; |
| | | this.option.column.push(columnItem); |
| | | this.option.column=this.tableHeadData; |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | huishouHandler(){ |
| | | console.log('tem',this.templateOid) |
| | | console.log('table',this.tableData) |
| | | console.log('tabheadle',this.tableHeadData) |
| | | console.log('tableFather',this.tableHeadDataFateher) |
| | | }, |
| | | openD(){ |
| | | this.dialogPush=true; |
| | | this.getListCodeByClassId() |
| | |
| | | this.page.pageSize=val |
| | | this.$emit('pageSize',val) |
| | | this.CrudRend() |
| | | console.log(this.tableData) |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.page.currentPage=val |
| | | this.$emit('currentPage',val) |
| | | this.CrudRend() |
| | | console.log(val) |
| | | console.log(this.tableData) |
| | | }, |
| | | // çå¬åå
æ ¼ç¹å»äºä»¶å¹¶å卿£å¨ç¼è¾çè¡ |
| | | handleCellClick(row, column) { |
| | | this.editingRow = row; |
| | | this.editShow = column.property; |
| | | console.log(row) |
| | | this.rowOid=row.oid |
| | | }, |
| | | //å é¤ |
| | | enumDeleteRow(row) { |
| | | console.log(row) |
| | | this.tableData.splice(row, 1) |
| | | }, |
| | | // å°æ£å¨ç¼è¾çè¡çç¶æå为 null ï¼å³éåºç¼è¾ç¶æ |
| | |
| | | this.option.column=this.tableHeadData; |
| | | this.templateOid=res.data.tableDefineVO.oid |
| | | this.$emit('templateOid',this.templateOid) |
| | | console.log(this.templateOid) |
| | | }) |
| | | }) |
| | | } |
| | |
| | | }, |
| | | // æåº |
| | | sortChange(val) { |
| | | this.loading = true; |
| | | this.isLoading = true; |
| | | let order = "" |
| | | if (val.order == "ascending") { |
| | | order = "asc"; |
| | |
| | | }).then(res => { |
| | | setTimeout(() => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.isLoading = false; |
| | | }, 100); |
| | | }) |
| | | }, |
| | |
| | | v-if=" |
| | | type !== 'detail' && |
| | | dialogVisible && |
| | | (showCodeApply || showResembleQuery) |
| | | (showCodeApply || showResembleQuery) && |
| | | type !== 'preview' |
| | | " |
| | | > |
| | | <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> |
| | |
| | | <div class="avue-dialog__footer" v-if="type !== 'detail'"> |
| | | <el-button @click="close()">å æ¶</el-button> |
| | | <el-button @click="submit()" type="primary" :loading="submitBtnLoading" |
| | | >ç¡® å®</el-button |
| | | >{{ submitText }}</el-button |
| | | > |
| | | <el-button |
| | | @click="resembleQuerySubmit" |
| | |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | submitText: { |
| | | type: String, |
| | | default: 'ç¡® å®' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | this.coderuleoid=res.data[0].attributes.coderuleoid; |
| | | this.$emit("codeClassifyOid", this.codeClassifyOid ) |
| | | this.$emit("coderuleoid", this.coderuleoid ) |
| | | this.TableHeadRends() |
| | | }).catch(res=>{ |
| | | console.log(res) |
| | | }) |
| | |
| | | page: this.currentPage, |
| | | limit: this.pageSize, |
| | | }).then(res => { |
| | | // this.page.total = res.data.total; |
| | | // this.data = res.data.data; |
| | | this.tableDataArray=res.data.data; |
| | | this.$emit('tableDataArray',this.tableDataArray) |
| | | this.$emit('total',res.data.total) |
| | | console.log('table',this.tableDataArray) |
| | | }) |
| | | }, |
| | | //è¡¨æ ¼å¤´é¨ |
| | | TableHeadRend(){ |
| | | return new Promise((resolve,reject)=>{ |
| | | MasterTable({ |
| | | codeClassifyOid:this.nodeClickList.oid, |
| | | functionId: 5, |
| | | }).then(res=>{ |
| | | this.tableHeadDataFateher=res.data; |
| | | this.templateOids=res.data.tableDefineVO.oid |
| | | this.$emit("tableHeadDataFateher",this.tableHeadDataFateher) |
| | | console.log("123",res) |
| | | this.templateOids = res.data.tableDefineVO.oid; |
| | | this.$emit('tableHeadDataFateher', this.tableHeadDataFateher); |
| | | resolve(); |
| | | }).catch(err=>{ |
| | | reject(err) |
| | | }) |
| | | }, |
| | | TableHeadRends(){ |
| | | MasterTable({ |
| | | codeClassifyOid:this.codeClassifyOid, |
| | | functionId: 5, |
| | | }).then(res=>{ |
| | | this.tableHeadDataFateher=res.data; |
| | | this.templateOids=res.data.tableDefineVO.oid |
| | | this.$emit("tableHeadDataFateher",this.tableHeadDataFateher) |
| | | console.log("123",res) |
| | | }) |
| | | }, |
| | | //æ ç¹å»äºä»¶ |
| | | nodeClick(data){ |
| | | async nodeClick(data) { |
| | | try { |
| | | this.nodeClickList = data; |
| | | this.TableHeadRend() |
| | | this.TableRend() |
| | | console.log('code',this.nodeClickList.oid) |
| | | console.log('teoid',this.templateOids) |
| | | console.log() |
| | | await this.TableHeadRend(); // å
æ§è¡ TableHeadRend() |
| | | this.TableRend(); // TableHeadRend() æ¹æ³å®æååæ§è¡ TableRend() |
| | | this.$emit('nodeClick',this.templateOids) |
| | | console.log(this.templateOids) |
| | | } catch (error) { |
| | | // å¤çé误 |
| | | this.$message.error(error) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <attrCrud :ProData="ProData" :crudOid="crudOid" :crudArray="crudArray" :Formlist="Formlist" :codeClassifyOid="codeClassifyOid"></attrCrud> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab2'"> |
| | | <FlowPath code="8b5e2017-990f-454a-9c39-4c4eeeb57553"></FlowPath> |
| | | <FlowPath :code="this.codeClassifyOid"></FlowPath> |
| | | |
| | | </span> |
| | | <span v-else-if="type.prop==='tab3'"> |
| | | <!-- <stage :visible.sync="visibleStage" code="8b5e2017-990f-454a-9c39-4c4eeeb57553"></stage>--> |
| | | <stage :code="this.codeClassifyOid"></stage> |
| | | </span> |
| | | </basic-container> |
| | | |
| | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <!--<template>--> |
| | | <!-- <!– ä½¿ç¨ Element UI çè¡¨æ ¼ç»ä»¶å±ç¤ºæ°æ® –>--> |
| | | <!-- <!– 对æ¯è¡æ°æ®æ¸²æä¸ä¸ªè¡¨æ ¼è¡ç»ä»¶ –>--> |
| | | <!-- <el-table :data="data">--> |
| | | <!-- <el-table-column v-for="column in columns" :key="column.prop" :label="column.label">--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <template v-if="isEditing(scope.$index, column.prop)">--> |
| | | <!-- <!– 使ç¨èªå®ä¹è¾å
¥æ¡ï¼ç»å®æ°æ®å¹¶çå¬ blur äºä»¶ –>--> |
| | | <!-- <el-input v-model="editorModel[scope.$index][column.prop]" ref="editor"--> |
| | | <!-- @blur="onEditorBlur(scope.$index, column.prop)">--> |
| | | <!-- </el-input>--> |
| | | <!-- </template>--> |
| | | <!-- <template v-else>--> |
| | | <!-- <!– å°æ°æ®æ¸²æä¸ºè¡¨æ ¼åå
æ ¼ï¼ç»å® click äºä»¶ –>--> |
| | | <!-- <div @click="onCellClick(scope.$index, column.prop)"--> |
| | | <!-- :style="{cursor: 'pointer', backgroundColor: isEditing(scope.$index, column.prop) ? '#F0F0F0' : 'transparent'}">--> |
| | | <!-- {{ scope.row[column.prop] === "" ? '' : scope.row[column.prop] }}--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- </el-table>--> |
| | | <!--</template>--> |
| | | |
| | | <!--<script>--> |
| | | <!--export default {--> |
| | | <!-- data() {--> |
| | | <!-- // ç»ä»¶çæ°æ®ï¼å
æ¬è¡¨æ ¼çæ°æ®ãåå®ä¹åå½åæ£å¨ç¼è¾çè¡åå--> |
| | | <!-- return {--> |
| | | <!-- data: [--> |
| | | <!-- { id: 1, name: 'å¼ ä¸', age: 18, attributegroup: 'ç·', attributeDataTypeText: '广ä¸çæ·±å³å¸' },--> |
| | | <!-- { id: 2, name: 'æå', age: 20, attributegroup: '女', attributeDataTypeText: 'åäº¬å¸æµ·æ·åº' },--> |
| | | <!-- { id: 3, name: 'çäº', age: 22, attributegroup: 'ç·', attributeDataTypeText: '䏿µ·å¸æµ¦ä¸æ°åº' },--> |
| | | <!-- { id: 4, name: 'èµµå
', age: 24, attributegroup: '女', attributeDataTypeText: '广ä¸ç广å·å¸' }--> |
| | | <!-- ],--> |
| | | <!-- columns: [ // å®ä¹è¡¨æ ¼çå--> |
| | | <!-- {--> |
| | | <!-- label: "屿§è±æç¼å·",--> |
| | | <!-- prop: "id",--> |
| | | <!-- fixed: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- labelWidth: 110,--> |
| | | <!-- width: 125,--> |
| | | <!-- sortable: true,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "屿§ä¸æåç§°",--> |
| | | <!-- prop: "name",--> |
| | | <!-- fixed: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- width: 125,--> |
| | | <!-- sortable: true--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "屿§åç»",--> |
| | | <!-- prop: "attributegroup",--> |
| | | <!-- cell: false,--> |
| | | <!-- sortable: true,--> |
| | | <!-- width: 125,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "ç±»å",--> |
| | | <!-- prop: "attributeDataTypeText",--> |
| | | <!-- cell: false,--> |
| | | <!-- sortable: true,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å表宽度",--> |
| | | <!-- prop: "attrTableWidth",--> |
| | | <!-- cell: false,--> |
| | | <!-- sortable: true,--> |
| | | <!-- width: 105,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å
³é®å±æ§",--> |
| | | <!-- prop: "keyattrflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "æ¥è¯¢å±æ§",--> |
| | | <!-- prop: "queryattrflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "é«çº§æ¥è¯¢å±æ§",--> |
| | | <!-- prop: "seniorqueryattrflag",--> |
| | | <!-- width: 95,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "ç¸ä¼¼æ¥è¯¢å±æ§",--> |
| | | <!-- prop: "samerepeatattrflag",--> |
| | | <!-- width: 95,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å¿
è¾",--> |
| | | <!-- prop: "requireflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "è¡¨åæ¾ç¤º",--> |
| | | <!-- prop: "formdisplayflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å表æ¾ç¤º",--> |
| | | <!-- prop: "tabledisplayflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "åªè¯»",--> |
| | | <!-- prop: "readonlyflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å表æåº",--> |
| | | <!-- prop: "sortattrflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | |
| | | <!-- {--> |
| | | <!-- label: "å¤è¡ææ¬",--> |
| | | <!-- prop: "textareaflag",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "é»è®¤å¼",--> |
| | | <!-- prop: "defaultvalue",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- width: 95,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "åç¼",--> |
| | | <!-- prop: "prefixvalue",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "åç¼",--> |
| | | <!-- prop: "suffixvalue",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "ç»åè§å",--> |
| | | <!-- prop: "componentrule",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- width: 105,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "éªè¯è§å",--> |
| | | <!-- prop: "verifyrule",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- width: 105,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "æ¶é´æ ¼å¼",--> |
| | | <!-- prop: "codedateformat",--> |
| | | <!-- sortable: true,--> |
| | | <!-- width: 105,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å类注å
¥",--> |
| | | <!-- prop: "classifyinvokelevel",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "æä¸¾æ³¨å
¥",--> |
| | | <!-- prop: "enumString",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "级è屿§",--> |
| | | <!-- prop: "parentCode",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "åç
§é
ç½®",--> |
| | | <!-- prop: "referConfig",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "çº§èæ¥è¯¢å±æ§",--> |
| | | <!-- prop: "parentQueryAttr",--> |
| | | <!-- width: 105,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "éæ©åºæ è¯",--> |
| | | <!-- prop: "libraryIdentification",--> |
| | | <!-- width: 105,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å¡«åæç¤º",--> |
| | | <!-- prop: "explain",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "è¡¨åæ¾ç¤ºæ ·å¼",--> |
| | | <!-- prop: "formdisplaystyle",--> |
| | | <!-- width: 105,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "è¡¨æ ¼æ¾ç¤ºæ ·å¼",--> |
| | | <!-- prop: "tabledisplaystyle",--> |
| | | <!-- width: 105,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "表åè¶
龿¥",--> |
| | | <!-- prop: "formhref",--> |
| | | <!-- width: 95,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "è¡¨æ ¼è¶
龿¥",--> |
| | | <!-- prop: "tablehref",--> |
| | | <!-- width: 95,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "è¡¨æ ¼æ¾ç¤ºjs",--> |
| | | <!-- prop: "tabledisplayjs",--> |
| | | <!-- width: 95,--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "é¿åº¦",--> |
| | | <!-- prop: "controllength",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "å°æ°ç²¾åº¦",--> |
| | | <!-- prop: "precisionlength",--> |
| | | <!-- cell: false,--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- label: "åå¼èå´",--> |
| | | <!-- prop: "valuearea",--> |
| | | <!-- sortable: true,--> |
| | | <!-- cell: false,--> |
| | | <!-- width: 105,--> |
| | | <!-- },--> |
| | | |
| | | <!-- ],--> |
| | | <!-- editingIndex: -1, // å½åæ£å¨ç¼è¾çè¡çç´¢å¼--> |
| | | <!-- editingColumn: '', // å½åæ£å¨ç¼è¾çåç屿§å--> |
| | | <!-- editorModel: [] // ç¼è¾æ¡çæ°æ®ï¼ä½¿ç¨æ°ç»ä¿åæ¯ä¸ªåå
æ ¼çæ°æ®--> |
| | | <!-- };--> |
| | | <!-- },--> |
| | | <!-- created() {--> |
| | | <!-- // å¨ç»ä»¶å建æ¶ï¼åå§åç¼è¾æ¡çæ°æ®--> |
| | | <!-- this.editorModel = this.data.map(row => {--> |
| | | <!-- const editorRow = {};--> |
| | | <!-- this.columns.forEach(column => {--> |
| | | <!-- editorRow[column.prop] = row[column.prop];--> |
| | | <!-- });--> |
| | | <!-- return editorRow;--> |
| | | <!-- });--> |
| | | <!-- },--> |
| | | <!-- methods: {--> |
| | | <!-- // åå
æ ¼ç¹å»äºä»¶å¤ç彿°--> |
| | | <!-- onCellClick(rowIndex, columnProp) {--> |
| | | <!-- if (this.editingIndex >= 0 && this.editingColumn) {--> |
| | | <!-- this.onEditorBlur(this.editingIndex, this.editingColumn);--> |
| | | <!-- return;--> |
| | | <!-- }--> |
| | | |
| | | <!-- const cellValue = this.data[rowIndex][columnProp];--> |
| | | <!-- if (cellValue === undefined || cellValue === null) {--> |
| | | <!-- this.data[rowIndex][columnProp] = '';--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.editingIndex = rowIndex;--> |
| | | <!-- this.editingColumn = columnProp;--> |
| | | |
| | | <!-- this.$nextTick(() => {--> |
| | | <!-- this.$refs.editor.focus();--> |
| | | <!-- });--> |
| | | <!-- },--> |
| | | |
| | | <!-- // ç¼è¾æ¡å¤±ç¦äºä»¶å¤ç彿°--> |
| | | <!-- onEditorBlur(rowIndex, columnProp) {--> |
| | | <!-- // å°å½åç¼è¾æ¡çæ°æ®ä¿åå°è¡¨æ ¼æ°æ®ä¸--> |
| | | <!-- const editorValue = this.editorModel[rowIndex][columnProp];--> |
| | | <!-- if (editorValue === '') {--> |
| | | <!-- this.data[rowIndex][columnProp] = undefined;--> |
| | | <!-- } else {--> |
| | | <!-- this.data[rowIndex][columnProp] = editorValue;--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.editingIndex = -1;--> |
| | | <!-- this.editingColumn = '';--> |
| | | <!-- },--> |
| | | <!-- // 夿æå®åå
æ ¼æ¯å¦å¨ç¼è¾ç¶æ--> |
| | | <!-- isEditing(rowIndex, columnProp) {--> |
| | | <!-- return rowIndex === this.editingIndex && columnProp === this.editingColumn;--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!--};--> |
| | | <!--</script>--> |
| | | |
| | | |
| | | <style lang="scss"> |
| | | //ä¿®æ¹å类注å
¥å¯¹è¯æ¡å
Œ
±æ ·å¼ |
| | | .mydialog .el-dialog__body { |
| | |
| | | </template> |
| | | <!-- ç»åè§å--> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" @click="isShowformulaEdit=true">ç»åè§å</el-button> |
| | | <formula-editor :visible.sync="isShowformulaEdit" :systemVariableTableData="systemVariableTableData" :thisSceneTableData="thisSceneTableData"></formula-editor> |
| | | <el-button size="small" @click="isShowHandler">ç»åè§å</el-button> |
| | | <formula-editor :visible.sync="isShowformulaEdit" |
| | | :systemVariableTableData="systemVariableTableData" |
| | | :thisSceneTableData="thisSceneTableData" |
| | | @updateFormulaContent="updataFormlaContent" |
| | | ></formula-editor> |
| | | |
| | | </template> |
| | | <!-- éªè¯è§å--> |
| | |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | { |
| | | label: "使ç¨è¯´æ", |
| | | prop: "shiyong" |
| | | prop: "description" |
| | | } |
| | | ] |
| | | }, |
| | | //屿§éªè¯è§ådata |
| | | rulesData: [ |
| | | { |
| | | bds: "æµè¯ä¸", |
| | | shiyong: "æµè¯ä¸" |
| | | }, |
| | | {bds: '[\u3000\uff01-\uff5f]+', description: 'å
¨è§ç¬¦å·'}, |
| | | {bds: '[^\u3000\uff01-\uff5f]+', description: 'åè§ç¬¦å·'}, |
| | | {bds: '(([-|+]{1}[\\d]+âï½[-|+]{1}[\\d]+â)|æ )', description: '温度èå´ï¼ç¤ºä¾ -55âï½+125â'}, |
| | | {bds: '[\\d]{15}|[\\d]{18}|[\\d]{17}X', description: '身份è¯å·ç (15æ18使°åã17使°åX) '}, |
| | | {bds: 'ç·|女|ç·æ§|女æ§', description: '䏿æ§å«'}, |
| | | {bds: '[\\d]+', description: 'æ°å'}, |
| | | {bds: '[a-zA-Z]+', description: '忝'}, |
| | | {bds: '[A-Z]+', description: '大å忝'}, |
| | | {bds: '[a-z]+', description: 'å°å忝'}, |
| | | {bds: '[0-9a-zA-Z]+', description: 'åæ¯ãæ°åç»å'}, |
| | | {bds: '((0[\\d]{3}-[\\d]{7})|(0[\\d]{2}-[\\d]{8})|([\\d]{7,8}))', description: 'çµè¯å·ç '}, |
| | | {bds: '-?[1-9]\\d*', description: 'æ´æ°'}, |
| | | {bds: '[1-9]\\d*', description: 'æ£æ´æ°'}, |
| | | {bds: '-[1-9]\\d*', description: 'è´æ´æ°'}, |
| | | {bds: '-[1-9]\\d*|0', description: 'éæ£æ´æ°(è´æ´æ°+0)'}, |
| | | {bds: '[1-9]\\d*|0', description: 'éè´æ´æ°(æ£æ´æ°+0)'}, |
| | | {bds: '-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)', description: 'æµ®ç¹æ°'}, |
| | | {bds: '[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*', description: 'æ£æµ®ç¹æ°'}, |
| | | {bds: '-[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*', description: 'è´æµ®ç¹æ°'}, |
| | | {bds: '[(-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*))|0?\\.0+|0', description: 'éæ£æµ®ç¹æ°ï¼è´æµ®ç¹æ° + 0ï¼'}, |
| | | {bds: '[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0', description: 'éè´æµ®ç¹æ°ï¼æ£æµ®ç¹æ° + 0ï¼'}, |
| | | {bds: 'x', description: 'å符 x'}, |
| | | {bds: '\\\\', description: 'åæçº¿å符'}, |
| | | {bds: '\\0n', description: '带æå
«è¿å¶å¼ 0 çå符 n (0 <= n <= 7)'}, |
| | | {bds: '\\0nn', description: '带æå
«è¿å¶å¼ 0 çå符 nn (0 <= n <= 7)'}, |
| | | {bds: '\\0mnn', description: '带æå
«è¿å¶å¼ 0 çå符 mnnï¼0 <= m <= 3ã0 <= n <= 7ï¼'}, |
| | | {bds: '\\xhh', description: '带æåå
è¿å¶å¼ 0x çå符 hh'}, |
| | | {bds: '\\uhhhh', description: '带æåå
è¿å¶å¼ 0x çå符 hhhh'}, |
| | | {bds: '\\t', description: 'å¶è¡¨ç¬¦ (\'\u0009\')'}, |
| | | {bds: '\\n', description: 'æ°è¡ï¼æ¢è¡ï¼ç¬¦ (\'\u000A\')'}, |
| | | {bds: '\\r', description: 'å车符 (\'\u000D\')'}, |
| | | {bds: '\\f', description: 'æ¢é¡µç¬¦ (\'\u000C\')'}, |
| | | {bds: '\\a', description: 'æ¥è¦ (bell) 符 (\'\u0007\')'}, |
| | | {bds: '\\e', description: '转ä¹ç¬¦ (\'\u001B\')'}, |
| | | {bds: '\\cx', description: '对åºäº x çæ§å¶ç¬¦'}, |
| | | {bds: '[abc]', description: 'aãb æ cï¼ç®åç±»ï¼'}, |
| | | {bds: '[^abc]', description: 'ä»»ä½å符ï¼é¤äº aãb æ cï¼å¦å®ï¼'}, |
| | | {bds: '[a-zA-Z]', description: 'a å° z æ A å° Zï¼ä¸¤å¤´ç忝å
æ¬å¨å
ï¼èå´ï¼'}, |
| | | {bds: '[a-d[m-p]]', description: 'a å° d æ m å° pï¼[a-dm-p]ï¼å¹¶éï¼'}, |
| | | {bds: '[a-z&&[def]]', description: '\tdãe æ fï¼äº¤éï¼'}, |
| | | {bds: '[a-z&&[^bc]]', description: 'a å° zï¼é¤äº b å cï¼[ad-z]ï¼åå»ï¼'}, |
| | | {bds: '[a-z&&[^m-p]]', description: 'a å° zï¼èé m å° pï¼[a-lq-z]ï¼åå»ï¼'}, |
| | | {bds: '.', description: 'ä»»ä½å符ï¼ä¸è¡ç»æç¬¦å¯è½å¹é
ä¹å¯è½ä¸å¹é
ï¼'}, |
| | | {bds: '\\d', description: 'æ°åï¼[0-9]'}, |
| | | {bds: '\\D', description: 'éæ°åï¼ [^0-9]'}, |
| | | {bds: '\\s', description: '空ç½å符ï¼[ \\t\\n\x0B\\f\\r]'}, |
| | | {bds: '\\S', description: 'é空ç½å符ï¼[^\\s]'}, |
| | | {bds: '\\w', description: 'åè¯å符ï¼[a-zA-Z_0-9]'}, |
| | | {bds: '\\W', description: 'éåè¯å符ï¼[^\\w]'}, |
| | | {bds: '\\p{Lower}', description: 'å°å忝å符ï¼[a-z]'}, |
| | | {bds: '\\p{Upper}', description: '大å忝å符ï¼[A-Z]'}, |
| | | {bds: '\\p{ASCII}', description: 'ææ ASCIIï¼[\x00-\x7F]'}, |
| | | {bds: '\\p{Alpha}', description: '忝å符ï¼[\\p{Lower}\\p{Upper}]'}, |
| | | {bds: '\\p{Digit}', description: 'åè¿å¶æ°åï¼[0-9]'}, |
| | | {bds: '\\p{Alnum}', description: '忝æ°åå符ï¼[\\p{Alpha}\\p{Digit}]'}, |
| | | {bds: '\\p{Punct}', description: 'æ ç¹ç¬¦å·ï¼!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'}, |
| | | {bds: '\\p{Graph}', description: 'å¯è§å符ï¼[\\p{Alnum}\\p{Punct}]'}, |
| | | {bds: '\\p{Print}', description: '坿å°å符ï¼[\\p{Graph}\x20]'}, |
| | | {bds: '\\p{Blank}', description: 'ç©ºæ ¼æå¶è¡¨ç¬¦ï¼[ \\t]'}, |
| | | {bds: '\\p{Cntrl}', description: 'æ§å¶å符ï¼[\x00-\x1F\x7F]'}, |
| | | {bds: '\\p{XDigit}', description: 'åå
è¿å¶æ°åï¼[0-9a-fA-F]'}, |
| | | {bds: '\\p{Space}', description: '空ç½å符ï¼[ \\t\\n\x0B\\f\\r]'}, |
| | | {bds: '\\p{javaLowerCase}', description: 'çæäº java.lang.Character.isLowerCase()'}, |
| | | {bds: '\\p{javaUpperCase}', description: 'çæäº java.lang.Character.isUpperCase()'}, |
| | | {bds: '\\p{javaWhitespace}', description: 'çæäº java.lang.Character.isWhitespace()'}, |
| | | {bds: '\\p{javaMirrored}', description: 'çæäº java.lang.Character.isMirrored()'}, |
| | | {bds: '\\p{InGreek}', description: 'Greek åï¼ç®ååï¼ä¸çå符'}, |
| | | {bds: '\\p{Lu}', description: '大å忝ï¼ç®åç±»å«ï¼'}, |
| | | {bds: '\\p{Sc}', description: 'è´§å¸ç¬¦å·'}, |
| | | {bds: '\\P{InGreek}', description: 'ææå符ï¼Greek åä¸çé¤å¤ï¼å¦å®ï¼'}, |
| | | {bds: '[\\p{L}&&[^\\p{Lu}]]', description: 'ææåæ¯ï¼å¤§å忝é¤å¤ï¼åå»ï¼'}, |
| | | {bds: '^', description: 'è¡çå¼å¤´'}, |
| | | {bds: '$', description: 'è¡çç»å°¾'}, |
| | | {bds: '\\b', description: 'åè¯è¾¹ç'}, |
| | | {bds: '\\B', description: 'éåè¯è¾¹ç'}, |
| | | {bds: '\\A', description: 'è¾å
¥çå¼å¤´'}, |
| | | {bds: '\\G', description: 'ä¸ä¸ä¸ªå¹é
çç»å°¾'}, |
| | | {bds: '\\Z', description: 'è¾å
¥çç»å°¾ï¼ä»
ç¨äºæåçç»æç¬¦ï¼å¦ææçè¯ï¼'}, |
| | | {bds: '\\z', description: 'è¾å
¥çç»å°¾'}, |
| | | {bds: 'X ?', description: 'Xï¼ä¸æ¬¡æä¸æ¬¡ä¹æ²¡æ'}, |
| | | {bds: 'X *', description: 'Xï¼é¶æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X +', description: 'Xï¼ä¸æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X {n }', description: 'Xï¼æ°å¥½ n 次'}, |
| | | {bds: 'X {n ,}', description: 'Xï¼è³å° n 次'}, |
| | | {bds: 'X {n ,m }', description: 'Xï¼è³å° n 次ï¼ä½æ¯ä¸è¶
è¿ m 次'}, |
| | | {bds: 'X ??', description: 'Xï¼ä¸æ¬¡æä¸æ¬¡ä¹æ²¡æ'}, |
| | | {bds: 'X *?', description: 'Xï¼é¶æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X +?', description: 'Xï¼ä¸æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X {n }?', description: 'Xï¼æ°å¥½ n 次'}, |
| | | {bds: 'X {n ,}?', description: 'Xï¼è³å° n 次'}, |
| | | {bds: 'X {n ,m }?', description: 'Xï¼è³å° n 次ï¼ä½æ¯ä¸è¶
è¿ m 次'}, |
| | | {bds: 'X ?+', description: 'Xï¼ä¸æ¬¡æä¸æ¬¡ä¹æ²¡æ'}, |
| | | {bds: 'X *+', description: 'Xï¼é¶æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X ++', description: 'Xï¼ä¸æ¬¡æå¤æ¬¡'}, |
| | | {bds: 'X {n }+', description: 'Xï¼æ°å¥½ n 次'}, |
| | | {bds: 'X {n ,}+', description: 'Xï¼è³å° n 次'}, |
| | | {bds: 'X {n ,m }+', description: 'Xï¼è³å° n 次ï¼ä½æ¯ä¸è¶
è¿ m 次'}, |
| | | {bds: 'XY', description: 'X åè· Y'}, |
| | | {bds: 'X |Y', description: 'X æ Y'}, |
| | | {bds: '(X )', description: 'Xï¼ä½ä¸ºæè·ç»'}, |
| | | {bds: '\\n', description: 'ä»»ä½å¹é
ç n<sup>th</sup> æè·ç»'}, |
| | | {bds: '\\', description: 'Nothingï¼ä½æ¯å¼ç¨ä»¥ä¸å符'}, |
| | | {bds: '\\Q', description: 'Nothingï¼ä½æ¯å¼ç¨ææå符ï¼ç´å° \\E'}, |
| | | {bds: '\\E', description: 'Nothingï¼ä½æ¯ç»æä» \\Q å¼å§çå¼ç¨'}, |
| | | {bds: '(?:X )', description: 'Xï¼ä½ä¸ºéæè·ç»'}, |
| | | {bds: '(?idmsux-idmsux)', description: 'Nothingï¼ä½æ¯å°å¹é
æ å¿ç± on 转为 off'}, |
| | | {bds: '(?idmsux-idmsux:X )', description: 'Xï¼ä½ä¸ºå¸¦æç»å®æ å¿ on - off çéæè·ç»'}, |
| | | {bds: '(?=X )', description: 'Xï¼éè¿é¶å®½åº¦çæ£ lookahead'}, |
| | | {bds: '(?!X )', description: 'Xï¼éè¿é¶å®½åº¦çè´ lookahead'}, |
| | | {bds: '(?<=X )', description: 'Xï¼éè¿é¶å®½åº¦çæ£ lookbehind'}, |
| | | {bds: '(?<!X )', description: 'Xï¼éè¿é¶å®½åº¦çè´ lookbehind'}, |
| | | {bds: '(?>X )', description: 'Xï¼ä½ä¸ºç¬ç«çéæè·ç»'} |
| | | ], |
| | | // æ°å¢ä¸å¡ç±»å |
| | | businessData: [], |
| | | businessOption: { |
| | | indexClassName:"åºå·", |
| | | indexLabelClassName:'åºå·', |
| | | index: true, |
| | | border: true, |
| | | addBtn: false, |
| | |
| | | }, |
| | | //éªè¯è§åæ£æ¥ |
| | | rulesExamine() { |
| | | |
| | | if(this.RulesForm.expressionText.test(this.RulesForm.TestContent)){ |
| | | this.$message.success('æ ¡éªæå') |
| | | } |
| | | }, |
| | | //ç¹å»å类注å
¥æé® |
| | | injectBtn(){ |
| | |
| | | // console.log(res) |
| | | // }) |
| | | }, |
| | | //ç»åè§å |
| | | isShowHandler(){ |
| | | if(this.CrudSelect.length>1){ |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | }else if(this.CrudSelect.length<1){ |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ¨¡æ¿å±æ§æ°æ®') |
| | | }else if(this.CrudSelect.length === 1){ |
| | | this.isShowformulaEdit=true; |
| | | } |
| | | }, |
| | | //å
¨å±ç¼è¾ |
| | | fullscreenHandle(){ |
| | | if(this.crudArray.length<1){ |
| | |
| | | this.attrEditVisible=false; |
| | | console.log(this.attrEditVisible) |
| | | }, |
| | | updataFormlaContent(val){ |
| | | console.log(val) |
| | | this.$set(this.attrRow,'componentRule',val) |
| | | }, |
| | | // æåº |
| | | sortChange(val) { |
| | | console.log(val) |
| | |
| | | @select="selectHandle" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button plain size="small" type="primary" @click="FindFormVisible = true;">æ¥è¯¢</el-button> |
| | | <el-button plain size="small" type="primary" @click="FindeHanler">æ¥è¯¢</el-button> |
| | | <el-button plain size="small" type="primary" @click="TemRefresh">å·æ°</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeEdit">ä¿®æ¹</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeDel">å é¤</el-button> |
| | |
| | | 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" |
| | | } |
| | | ] |
| | | }, |
| | | // //è¡¨æ ¼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" |
| | | // } |
| | | // ] |
| | | // }, |
| | | addFlag:false, |
| | | // è¡¨æ ¼å½åè¡id |
| | | crudOid:"", |
| | |
| | | mounted() { |
| | | this.type = this.tabOption.column[0]; |
| | | this.getAttr(); |
| | | console.log('11',this.nodeClickList) |
| | | }, |
| | | computed:{ |
| | | crudTreeOption(){ |
| | | return{ |
| | | index: true, |
| | | indexClassName:"åºå·", |
| | | indexLabelClassName:'åºå·', |
| | | border: true, |
| | | height:180, |
| | | selection:true, |
| | | addBtn:this.Formlist.length<=0 && this.nodeClickList != "", |
| | | column: [ |
| | | { |
| | | label: "模æ¿ç¼å·", |
| | | prop: "id" |
| | | }, |
| | | { |
| | | label:"模æ¿åç§°", |
| | | prop:"name" |
| | | }, |
| | | { |
| | | label: "æ¨¡æ¿æè¿°", |
| | | prop:"description" |
| | | }, |
| | | { |
| | | label:"çæ¬å·", |
| | | prop:"revisionSeq" |
| | | }, |
| | | { |
| | | label:"ç¶æ", |
| | | prop:"lcStatusText" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | //è¡åéäºä»¶ |
| | |
| | | async nodeClick(data) { |
| | | //å®ä¹ä¸ä¸ªæ¨¡æ¿å±æ§idï¼æ°æ®æ¯æ¨¡æ¿ç®¡çè¡¨æ ¼éé¢çoid |
| | | this.nodeClickList = data |
| | | console.log(data.oid) |
| | | console.log(data) |
| | | this.ProData=[] |
| | | try { |
| | | await TreeObjcet(data.oid).then(res => { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | // æ¥è¯¢ |
| | | FindeHanler(){ |
| | | if(this.nodeClickList != ""){ |
| | | this.FindFormVisible=true |
| | | }else { |
| | | this.$message.warning('è¯·ä»æ ä¸éæ©ä¸æ¡æ°æ®') |
| | | } |
| | | }, |
| | | //å
鿍¡æ¿éæ©ç¡®å® |
| | | Clonehandler(){ |
| | | if(this.CloneSelect.length <= 0){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <context-menu class="contextMenu"> |
| | | <node-menu> |
| | | <menu-li command="copy" text="æ·è´" /> |
| | | <menu-li command="delete" text="å é¤" /> |
| | | </node-menu> |
| | | <edge-menu> |
| | | <menu-li command="delete" text="å é¤" /> |
| | | </edge-menu> |
| | | <group-menu> |
| | | <menu-li command="copy" text="æ·è´" /> |
| | | <menu-li command="delete" text="å é¤" /> |
| | | <menu-li command="unGroup" icon="ungroup" text="åæ¶ç¼ç»" /> |
| | | </group-menu> |
| | | <multi-menu> |
| | | <menu-li command="copy" text="æ·è´" /> |
| | | <menu-li command="paste" text="ç²è´´" /> |
| | | <menu-li command="addGroup" icon="group" text="ç¼ç»" /> |
| | | <menu-li command="delete" text="å é¤" /> |
| | | </multi-menu> |
| | | <canvas-menu> |
| | | <menu-li command="undo" text="æ¤é" /> |
| | | <menu-li command="redo" text="éå" /> |
| | | <menu-li command="pasteHere" icon="paste" text="ç²è´´å°è¿é" /> |
| | | </canvas-menu> |
| | | </context-menu> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | NodeMenu, |
| | | EdgeMenu, |
| | | GroupMenu, |
| | | MultiMenu, |
| | | CanvasMenu, |
| | | ContextMenu, |
| | | } from 'vue-flowchart-editor' |
| | | import MenuLi from './ContextMenuItem' |
| | | |
| | | export default { |
| | | name: 'EditorContextMenu', |
| | | components: { |
| | | NodeMenu, |
| | | EdgeMenu, |
| | | GroupMenu, |
| | | MultiMenu, |
| | | CanvasMenu, |
| | | ContextMenu, |
| | | MenuLi, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .contextMenu { |
| | | display: none; |
| | | overflow: hidden; |
| | | font-size: 12px; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
| | | } |
| | | |
| | | .contextMenu .command.disable .item { |
| | | color: rgba(0, 0, 0, 0.25); |
| | | cursor: auto; |
| | | } |
| | | |
| | | .contextMenu .command.disable .item:hover { |
| | | background: #fff; |
| | | } |
| | | |
| | | .contextMenu .item { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 5px 12px; |
| | | cursor: pointer; |
| | | transition: all 0.3s; |
| | | user-select: none; |
| | | } |
| | | |
| | | .contextMenu .item:hover { |
| | | background: #e6f7ff; |
| | | } |
| | | |
| | | .contextMenu .item i { |
| | | margin-right: 8px; |
| | | margin-top: 3px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <command :name="command"> |
| | | <div class="item"> |
| | | <icon :type="iconType" :title="text" /> |
| | | <span>{{ label }}</span> |
| | | </div> |
| | | </command> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Command } from 'vue-flowchart-editor' |
| | | import Icon from './Icon' |
| | | import upperFirst from 'lodash/upperFirst' |
| | | |
| | | export default { |
| | | name: 'EditorContextMenuItem', |
| | | |
| | | components: { |
| | | Command, |
| | | Icon, |
| | | }, |
| | | |
| | | props: ['command', 'icon', 'text'], |
| | | |
| | | computed: { |
| | | iconType() { |
| | | return `icon${this.icon || this.command}` |
| | | }, |
| | | |
| | | label() { |
| | | return this.text || upperFirst(this.command) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <register-command |
| | | name="generateData" |
| | | :config="generateDataCommandConfig" |
| | | extend="copy" |
| | | /> |
| | | <register-command |
| | | name="downloadImage" |
| | | :config="downloadImageCommandConfig" |
| | | extend="copy" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { RegisterCommand } from 'vue-flowchart-editor' |
| | | |
| | | export default { |
| | | name: 'CustomCommand', |
| | | |
| | | components: { |
| | | RegisterCommand, |
| | | }, |
| | | |
| | | inject: ['root'], |
| | | |
| | | props: ['save', 'download'], |
| | | |
| | | data() { |
| | | const { propsAPI } = this.root |
| | | const { save, download } = this |
| | | return { |
| | | generateDataCommandConfig: { |
| | | queue: false, // æ¯å¦è¿å
¥åéï¼é»è®¤ä¸º true |
| | | enable(/* editor */) { |
| | | // å½ä»¤æ¯å¦å¯ç¨ |
| | | return true |
| | | }, |
| | | execute(/* editor */) { |
| | | // æ£åå½ä»¤é»è¾ |
| | | console.log('æ§è¡æ£åå½ä»¤') |
| | | const data = propsAPI.save() |
| | | console.log(data) |
| | | console.log(JSON.stringify(data)) |
| | | save(data) |
| | | alert(JSON.stringify(data)) |
| | | }, |
| | | back(/* editor */) { |
| | | // ååå½ä»¤é»è¾ |
| | | console.log('æ§è¡ååå½ä»¤') |
| | | }, |
| | | }, |
| | | downloadImageCommandConfig: { |
| | | queue: false, |
| | | enable() { |
| | | return true |
| | | }, |
| | | execute() { |
| | | download() |
| | | }, |
| | | back() {}, |
| | | }, |
| | | } |
| | | }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="right_box"> |
| | | <hr /> |
| | | <div v-if="type === 'node'"> |
| | | <el-form |
| | | label-width="80px" |
| | | :model="formModel" |
| | | size="mini" |
| | | ref="form" |
| | | :rules="rules" |
| | | > |
| | | <el-form-item label="åç§°" prop="label"> |
| | | <el-input v-model.trim="formModel.label" :maxLength="20" disabled/> |
| | | </el-form-item> |
| | | <el-form-item label="å½¢ç¶"> |
| | | <el-select |
| | | v-model="formModel.shape" |
| | | placeholder="è¯·éæ©å½¢ç¶" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in shapeTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é¢è²"> |
| | | <el-input v-model.trim="formModel.color" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="宽度" prop="width"> |
| | | <el-input v-model.trim.number="formModel.width" clearable> |
| | | <template slot="prepend">宽</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é«åº¦" prop="height"> |
| | | <el-input v-model.trim.number="formModel.height" clearable> |
| | | <template slot="prepend">é«</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div v-else-if="type === 'edge'"> |
| | | <el-form |
| | | label-width="80px" |
| | | :model="formModel" |
| | | size="small" |
| | | :rules="rules" |
| | | > |
| | | <el-form-item label="èµ·å§ç¶æ"> |
| | | <el-input v-model.trim="formModel.source" disabled/> |
| | | </el-form-item> |
| | | <el-form-item label="ç®æ ç¶æ"> |
| | | <el-input v-model.trim="formModel.target" disabled/> |
| | | </el-form-item> |
| | | <el-form-item label="åç§°"> |
| | | <el-input v-model.trim="formModel.label"/> |
| | | </el-form-item> |
| | | <el-form-item label="å½¢ç¶"> |
| | | <el-select |
| | | v-model="formModel.shape" |
| | | placeholder="è¯·éæ©å½¢ç¶" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in lineTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="btn_box"> |
| | | <el-button type="primary" size="mini" @click="handleSubmit" |
| | | >æ´æ°å±æ§</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export default { |
| | | name: 'EditorDetailForm', |
| | | |
| | | inject: ['root'], |
| | | |
| | | props: ['type', 'readOnly'], |
| | | |
| | | data() { |
| | | return { |
| | | formModel: {}, |
| | | fontSize: 12, |
| | | shapeTypeList: [ |
| | | { label: 'ç©å½¢', value: 'flow-rect' }, |
| | | { label: 'æ¤å', value: 'flow-circle' }, |
| | | { label: 'è±å½¢', value: 'flow-rhombus' }, |
| | | { label: 'è¶å', value: 'flow-capsule' }, |
| | | ], |
| | | lineTypeList: [ |
| | | { label: 'æ²çº¿', value: 'flow-smooth' }, |
| | | { label: 'æçº¿', value: 'flow-polyline' }, |
| | | { label: 'åè§æçº¿', value: 'flow-polyline-round' }, |
| | | ], |
| | | rules: { |
| | | label: [{ required: true, message: 'åç§°ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | width: [ |
| | | { required: true, message: '宽度ä¸è½ä¸ºç©º', trigger: 'blur' }, |
| | | { pattern: /^[0-9]+$/, message: '宽度åªè½ä¸ºæ°å', trigger: 'blur' }, |
| | | ], |
| | | height: [ |
| | | { required: true, message: 'é«åº¦ä¸è½ä¸ºç©º', trigger: 'blur' }, |
| | | { pattern: /^[0-9]+$/, message: 'é«åº¦åªè½ä¸ºæ°å', trigger: 'blur' }, |
| | | ], |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | const formModel = this.root.propsAPI.getSelected()[0].getModel() |
| | | console.log(formModel, 'formModel'); |
| | | this.formModel = Object.assign( |
| | | { width: 80, height: 48 }, |
| | | { shape: 'flow-smooth' }, |
| | | cloneDeep(formModel) // 鲿¢è¯¯ç¼è¾ |
| | | ) |
| | | }, |
| | | |
| | | methods: { |
| | | async handleSubmit() { |
| | | if (this.type === 'node') { |
| | | await this.$refs.form.validate() |
| | | } |
| | | const { getSelected, executeCommand, update } = this.root.propsAPI |
| | | const { formModel } = this |
| | | setTimeout(() => { |
| | | const item = getSelected()[0] |
| | | if (!item) return |
| | | |
| | | // èªå¨è°æ´å°ºå¯¸ |
| | | const adjustSize = (model) => { |
| | | if (model.type !== 'node' || model.shape !== 'flow-rect') { |
| | | return model |
| | | } |
| | | const canvas = document.createElement('canvas') |
| | | const canvasContext = canvas.getContext('2d') |
| | | canvasContext.font = this.fontSize + 'px System' |
| | | let label = model.label.replace('\n', '') |
| | | let sourceWidth = this.formModel.width |
| | | let sourceHeight = this.formModel.height |
| | | const spacing = 10 |
| | | // è·åæå宽度 |
| | | const widthWithSpacing = canvasContext.measureText(label).width + spacing |
| | | model.size = `${sourceWidth}*${sourceHeight}` // å
æ¢å¤é»è®¤å°ºå¯¸ |
| | | |
| | | if (widthWithSpacing <= sourceWidth) { |
| | | return model |
| | | } |
| | | |
| | | // èªå¨æè¡ |
| | | let multilineText = '' |
| | | let multilineCount = 1 |
| | | let multilineTextWidth = 0 |
| | | |
| | | for (const char of label) { |
| | | const { width } = canvasContext.measureText(char) |
| | | console.log(multilineTextWidth + width + spacing, 'multilineTextWidth'); |
| | | if (multilineTextWidth + width + spacing >= sourceWidth) { |
| | | multilineText += '\n' |
| | | multilineTextWidth = 0 |
| | | multilineCount++ |
| | | } |
| | | multilineText += char |
| | | multilineTextWidth += width |
| | | } |
| | | |
| | | return { |
| | | ...model, |
| | | label: multilineText, |
| | | size: `${sourceWidth}*${Math.max( |
| | | sourceHeight, |
| | | this.fontSize * multilineCount * 1.2 + spacing |
| | | )}`, |
| | | } |
| | | } |
| | | |
| | | const newFormModel = adjustSize(formModel) |
| | | console.log(newFormModel, 'newFormModel') |
| | | executeCommand(() => { |
| | | update(item, newFormModel) |
| | | }) |
| | | }, 0) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .btn_box { |
| | | text-align: center; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="tree_data_box"> |
| | | <el-form |
| | | ref="form" |
| | | size="mini" |
| | | label-width="80px" |
| | | :model="newRowData" |
| | | :rules="rules" |
| | | > |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model.trim="newRowData.name" :maxLength="20" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="æ ç¾" prop="label"> |
| | | <el-input v-model.trim="newRowData.label" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="èµ·å§ç¶æ" prop="startState"> |
| | | <el-select |
| | | v-model="newRowData.startState" |
| | | placeholder="è¯·éæ©èµ·å§ç¶æ" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in []" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°"> |
| | | <el-input v-model.trim="newRowData.remark" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <detail-panel> |
| | | <template v-slot="{ status }"> |
| | | <node-panel :status="status"> |
| | | <detail-form type="node" /> |
| | | </node-panel> |
| | | <edge-panel :status="status"> |
| | | <detail-form type="edge" /> |
| | | </edge-panel> |
| | | <group-panel :status="status"> |
| | | <detail-form type="group" /> |
| | | </group-panel> |
| | | <multi-panel :status="status" /> |
| | | <canvas-panel :status="status" /> |
| | | </template> |
| | | </detail-panel> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | NodePanel, |
| | | EdgePanel, |
| | | GroupPanel, |
| | | MultiPanel, |
| | | CanvasPanel, |
| | | DetailPanel, |
| | | } from "vue-flowchart-editor"; |
| | | import DetailForm from "./DetailForm"; |
| | | |
| | | export default { |
| | | name: "EditorDetailPanel", |
| | | components: { |
| | | NodePanel, |
| | | EdgePanel, |
| | | GroupPanel, |
| | | MultiPanel, |
| | | CanvasPanel, |
| | | DetailPanel, |
| | | DetailForm, |
| | | }, |
| | | props: ["readOnly", "rowData"], |
| | | data() { |
| | | return { |
| | | newRowData: {}, |
| | | rules: { |
| | | name: [{ required: true, message: "åç§°ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | label: [{ required: true, message: "æ ç¾ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | startState: [ |
| | | // { required: true, message: "èµ·å§ç¶æä¸è½ä¸ºç©º", trigger: "change" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | getNewRowDate() { |
| | | return new Promise((resolve) => { |
| | | this.$refs.form.validate((flag) => { |
| | | if (!flag) { |
| | | resolve(false); |
| | | } else { |
| | | resolve(this.newRowData); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | rowData: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newV) { |
| | | if ( |
| | | typeof newV === "object" && |
| | | newV !== null && |
| | | Object.keys(this.rowData).length > 0 |
| | | ) { |
| | | this.newRowData = Object.assign({}, newV); |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <minimap :height="200" /> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Minimap } from 'vue-flowchart-editor' |
| | | export default { |
| | | name: 'EditorMinimap', |
| | | components: { Minimap }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <i class="action" :title="text"> |
| | | <svg width="1em" height="1em" fill="currentColor"> |
| | | <use :xlink:href="'#' + type" /> |
| | | </svg> |
| | | </i> |
| | | </template> |
| | | |
| | | <script> |
| | | import '../iconfont' |
| | | export default { |
| | | name: 'EditorIcon', |
| | | props: ['type', 'text'], |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="item_panel_box"> |
| | | <el-input size="mini" placeholder="è¾å
¥å
³é®åè¿è¡è¿æ»¤" v-model="filterText"> |
| | | </el-input> |
| | | <div class="box_item"> |
| | | <item-panel class="item-panel" v-loading="loading"> |
| | | <template v-for="(item, index) in filterNode"> |
| | | <item |
| | | :key="index" |
| | | :type="item.type || 'node'" |
| | | :size="item.size || '80*48'" |
| | | :shape="item.shape || 'flow-rect'" |
| | | :model="{ |
| | | // must have model property |
| | | color: item.color || '#1890FF', |
| | | label: item.id || 'èç¹' |
| | | }" |
| | | > |
| | | <template v-if="item.src"> |
| | | <div class="item item-img"> |
| | | <img :src="item.src" :alt="item.id" /> |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <div :class="'item item-' + (item.shape || 'flow-rect')"> |
| | | <span>{{ item.id }}</span> |
| | | </div> |
| | | </template> |
| | | </item> |
| | | </template> |
| | | </item-panel> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Item, ItemPanel } from 'vue-flowchart-editor' |
| | | import { getPage } from '../../../api/omd/status' |
| | | |
| | | export default { |
| | | name: 'EditorItemPanel', |
| | | components: { ItemPanel, Item }, |
| | | props: { |
| | | // all nodes for drag to generate flowchart |
| | | treeClick: { |
| | | type: Function, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | filterText: '', |
| | | existList: [ |
| | | { |
| | | id: 0, |
| | | label: 'çå½å¨ææ¨¡æ¿å表', |
| | | children: [ |
| | | { |
| | | id: 1, |
| | | label: 'æµè¯æ°æ®1', |
| | | data: { |
| | | nodes: [ |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹1', |
| | | x: 358, |
| | | y: 262.66666412353516, |
| | | id: '5f2fae92', |
| | | index: 0, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹1', |
| | | x: 349, |
| | | y: 398.66666412353516, |
| | | id: '39784055', |
| | | index: 1, |
| | | }, |
| | | ], |
| | | edges: [ |
| | | { |
| | | source: '5f2fae92', |
| | | sourceAnchor: 2, |
| | | target: '39784055', |
| | | targetAnchor: 0, |
| | | id: '40ff05c5', |
| | | index: 2, |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | id: 2, |
| | | label: 'æµè¯æ°æ®2', |
| | | data: { |
| | | nodes: [ |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹1', |
| | | x: 319.5416564941406, |
| | | y: 396.66666412353516, |
| | | id: 'ee3b0618', |
| | | index: 0, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹2', |
| | | x: 192.54165649414062, |
| | | y: 277.66666412353516, |
| | | id: 'a96bfab6', |
| | | index: 4, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹3', |
| | | x: 360.5416564941406, |
| | | y: 152.66666412353516, |
| | | id: 'e76e769e', |
| | | index: 5, |
| | | }, |
| | | ], |
| | | edges: [ |
| | | { |
| | | source: 'e76e769e', |
| | | sourceAnchor: 2, |
| | | target: 'a96bfab6', |
| | | targetAnchor: 0, |
| | | id: '72117e49', |
| | | index: 1, |
| | | }, |
| | | { |
| | | source: 'a96bfab6', |
| | | sourceAnchor: 2, |
| | | target: 'ee3b0618', |
| | | targetAnchor: 0, |
| | | id: '21db19e2', |
| | | index: 2, |
| | | }, |
| | | { |
| | | source: 'e76e769e', |
| | | sourceAnchor: 1, |
| | | target: 'ee3b0618', |
| | | targetAnchor: 1, |
| | | id: '324dd9ae', |
| | | index: 3, |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | id: 3, |
| | | label: 'æµè¯æ°æ®3', |
| | | data: { |
| | | nodes: [ |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹1', |
| | | x: 130.54165649414062, |
| | | y: 108.66666412353516, |
| | | id: '9bc884ca', |
| | | index: 0, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹2', |
| | | x: 129.54165649414062, |
| | | y: 227.66666412353516, |
| | | id: 'd5997173', |
| | | index: 1, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹3', |
| | | x: 129.54165649414062, |
| | | y: 348.66666412353516, |
| | | id: '79e40c28', |
| | | index: 2, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹4', |
| | | x: 319.5416564941406, |
| | | y: 349.16666412353516, |
| | | id: '91a6982c', |
| | | index: 3, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹5', |
| | | x: 537.5416564941406, |
| | | y: 350.66666412353516, |
| | | id: '3939704b', |
| | | index: 4, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹6', |
| | | x: 533.5416564941406, |
| | | y: 230.66666412353516, |
| | | id: 'de373e3a', |
| | | index: 5, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹7', |
| | | x: 537.5416564941406, |
| | | y: 107.66666412353516, |
| | | id: '7bdf94ba', |
| | | index: 6, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹8', |
| | | x: 343.5416564941406, |
| | | y: 106.66666412353516, |
| | | id: '3e739b8e', |
| | | index: 7, |
| | | }, |
| | | ], |
| | | edges: [ |
| | | { |
| | | source: '9bc884ca', |
| | | sourceAnchor: 2, |
| | | target: 'd5997173', |
| | | targetAnchor: 0, |
| | | id: '88e19734', |
| | | index: 8, |
| | | }, |
| | | { |
| | | source: 'd5997173', |
| | | sourceAnchor: 2, |
| | | target: '79e40c28', |
| | | targetAnchor: 0, |
| | | id: 'e38664d6', |
| | | index: 9, |
| | | }, |
| | | { |
| | | source: '79e40c28', |
| | | sourceAnchor: 1, |
| | | target: '91a6982c', |
| | | targetAnchor: 3, |
| | | id: '3c95a9f2', |
| | | index: 10, |
| | | }, |
| | | { |
| | | source: '91a6982c', |
| | | sourceAnchor: 1, |
| | | target: '3939704b', |
| | | targetAnchor: 3, |
| | | id: '5c517fcd', |
| | | index: 11, |
| | | }, |
| | | { |
| | | source: '3939704b', |
| | | sourceAnchor: 0, |
| | | target: 'de373e3a', |
| | | targetAnchor: 2, |
| | | id: '037bce01', |
| | | index: 12, |
| | | }, |
| | | { |
| | | source: 'de373e3a', |
| | | sourceAnchor: 0, |
| | | target: '7bdf94ba', |
| | | targetAnchor: 2, |
| | | id: 'b09bb221', |
| | | index: 13, |
| | | }, |
| | | { |
| | | source: '7bdf94ba', |
| | | sourceAnchor: 3, |
| | | target: '3e739b8e', |
| | | targetAnchor: 1, |
| | | id: '466db0ea', |
| | | index: 14, |
| | | }, |
| | | { |
| | | source: '3e739b8e', |
| | | sourceAnchor: 3, |
| | | target: '9bc884ca', |
| | | targetAnchor: 1, |
| | | id: '0ad68e07', |
| | | index: 15, |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | id: 4, |
| | | label: 'æµè¯æ°æ®4', |
| | | data: { |
| | | nodes: [ |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹6', |
| | | x: 387.5416564941406, |
| | | y: 310.66666412353516, |
| | | id: '61775a95', |
| | | index: 0, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹7', |
| | | x: 559.0416564941406, |
| | | y: 122.16666412353516, |
| | | id: '3ecf3a2c', |
| | | index: 4, |
| | | }, |
| | | { |
| | | type: 'node', |
| | | size: '80*48', |
| | | shape: 'flow-rect', |
| | | color: '#1890FF', |
| | | label: 'æµè¯èç¹8', |
| | | x: 226.54165649414062, |
| | | y: 121.16666412353516, |
| | | id: '065c9aa9', |
| | | index: 5, |
| | | }, |
| | | ], |
| | | edges: [ |
| | | { |
| | | source: '065c9aa9', |
| | | sourceAnchor: 2, |
| | | target: '61775a95', |
| | | targetAnchor: 0, |
| | | id: 'd9ddab89', |
| | | index: 1, |
| | | }, |
| | | { |
| | | source: '61775a95', |
| | | sourceAnchor: 0, |
| | | target: '3ecf3a2c', |
| | | targetAnchor: 2, |
| | | id: 'a010883c', |
| | | index: 2, |
| | | }, |
| | | { |
| | | source: '3ecf3a2c', |
| | | sourceAnchor: 3, |
| | | target: '065c9aa9', |
| | | targetAnchor: 1, |
| | | id: '93207803', |
| | | index: 3, |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | |
| | | ], |
| | | }, |
| | | ], |
| | | nodeItems: [], |
| | | loading: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.loading = true |
| | | getPage(1, 99999).then(res => { |
| | | this.loading = false |
| | | if (res.data.code === 200) { |
| | | this.nodeItems = res.data.data.records |
| | | } |
| | | }) |
| | | }, |
| | | computed: { |
| | | filterNode() { |
| | | return this.nodeItems.filter(item => item.id.includes(this.filterText)) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .item_panel_box { |
| | | height: 100%; |
| | | padding: 5px; |
| | | overflow: hidden; |
| | | .exist_list { |
| | | max-height: 40%; |
| | | overflow-y: scroll; |
| | | .title { |
| | | padding: 10px 0; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | .box_item { |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | .item-panel { |
| | | width: 100%; |
| | | height: 500px; |
| | | text-align: center; |
| | | overflow-y: scroll; |
| | | .item { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 12px; |
| | | margin-left: auto; |
| | | margin-right: auto; |
| | | margin-bottom: 10px; |
| | | user-select: none; |
| | | |
| | | &.item-flow-rect { |
| | | padding: 6px; |
| | | box-sizing: border-box; |
| | | border: 1px solid rgb(24, 144, 255); |
| | | background-color: rgba(24, 144, 255, 0.2); |
| | | } |
| | | |
| | | &.item-flow-circle { |
| | | width: 70px; |
| | | height: 70px; |
| | | border-radius: 60px; |
| | | border: 1px solid rgb(250, 140, 22); |
| | | background-color: rgba(250, 140, 22, 0.2); |
| | | } |
| | | |
| | | &.item-flow-rhombus { |
| | | width: 70px; |
| | | height: 70px; |
| | | margin: 25px auto; |
| | | border: 1px solid rgb(19, 194, 194); |
| | | background-color: rgba(19, 194, 194, 0.2); |
| | | transform: rotate(45deg); |
| | | |
| | | span { |
| | | transform: rotate(-45deg); |
| | | } |
| | | } |
| | | |
| | | &.item-img { |
| | | max-width: 100px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <toolbar class="toolbar"> |
| | | <template> |
| | | <toolbar-button command="undo" text="æ¤é" /> |
| | | <toolbar-button command="redo" text="éå" /> |
| | | <toolbar-button command="copy" text="å¤å¶" /> |
| | | <toolbar-button command="paste" text="ç²è´´" /> |
| | | <div class="split"></div> |
| | | </template> |
| | | <toolbar-button command="zoomIn" icon="zoom-in" text="æ¾å¤§" /> |
| | | <toolbar-button command="zoomOut" icon="zoom-out" text="缩å°" /> |
| | | <toolbar-button command="autoZoom" icon="fit" text="èªéåº" /> |
| | | <toolbar-button command="resetZoom" icon="actual-size" text="å®é
尺寸" /> |
| | | <template> |
| | | <div class="split"></div> |
| | | <!-- <toolbar-button command="toBack" icon="to-back" text="åä¸ä¸å±" /> --> |
| | | <!-- <toolbar-button command="toFront" icon="to-front" text="åä¸ä¸å±" /> --> |
| | | <!-- <toolbar-button command="addGroup" icon="group" text="ç¼ç»" /> --> |
| | | <!-- <toolbar-button command="unGroup" icon="ungroup" text="åæ¶ç¼ç»" /> --> |
| | | <toolbar-button command="selectAll" icon="select-all" text="å
¨é" /> |
| | | <toolbar-button command="multiSelect" icon="select" text="æ¡é" /> |
| | | <div class="split"></div> |
| | | <toolbar-button command="delete" text="å é¤"/> |
| | | <toolbar-button command="clear" icon="clear" text="æ¸
空ç»å¸" /> |
| | | </template> |
| | | <template> |
| | | <div class="split"></div> |
| | | <toolbar-button |
| | | command="downloadImage" |
| | | icon="image" |
| | | text="ä¸è½½å¾å" |
| | | /> |
| | | </template> |
| | | <!-- right toolbar button --> |
| | | <!-- <div class="pull-right"> |
| | | <toolbar-button |
| | | command="generateData" |
| | | icon="save" |
| | | text="çææ°æ®" |
| | | label="ä¿åæ°æ®" |
| | | /> |
| | | </div> --> |
| | | </toolbar> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Toolbar } from 'vue-flowchart-editor' |
| | | import ToolbarButton from './ToolbarButton' |
| | | |
| | | export default { |
| | | name: 'FlowToolbar', |
| | | |
| | | components: { |
| | | Toolbar, |
| | | ToolbarButton, |
| | | }, |
| | | |
| | | props: ['chartData', 'toggleReadOnly'], |
| | | |
| | | methods: { |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .toolbar { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 27px; |
| | | |
| | | .split { |
| | | width: 10px; |
| | | height: 100%; |
| | | border-right: 1px solid #eee; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .pull-right { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: auto; |
| | | } |
| | | |
| | | .command { |
| | | margin-right: 15px; |
| | | display: flex; |
| | | color: #333; |
| | | |
| | | i { |
| | | display: block; |
| | | width: 27px; |
| | | height: 27px; |
| | | margin: 0 6px; |
| | | padding-top: 10px; |
| | | text-align: center; |
| | | border: 1px solid #fff; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | span { |
| | | display: block; |
| | | font-size: 12px; |
| | | padding-top: 10px; |
| | | margin-left: -6px; |
| | | padding-right: 6px; |
| | | line-height: 20px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | &:hover { |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | |
| | | .disable { |
| | | color: rgba(0, 0, 0, 0.25); |
| | | i { |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | span { |
| | | cursor: not-allowed; |
| | | } |
| | | |
| | | &:hover { |
| | | color: rgba(0, 0, 0, 0.25); |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <command :name="command"> |
| | | <icon :type="iconType" :title="text" /> |
| | | <span v-if="label">{{ label }}</span> |
| | | </command> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Command } from 'vue-flowchart-editor' |
| | | import Icon from './Icon' |
| | | |
| | | export default { |
| | | name: 'EditorToolbarButton', |
| | | |
| | | props: ['command', 'icon', 'text', 'label'], |
| | | |
| | | computed: { |
| | | iconType() { |
| | | return `icon${this.icon || this.command}` |
| | | }, |
| | | }, |
| | | |
| | | components: { |
| | | Command, |
| | | Icon, |
| | | }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vue-flowchart-editor class="vue-flowchart-editor" ref="flowChart"> |
| | | <div class="vfe-chart"> |
| | | <!-- Top Menu --> |
| | | <div class="vfe-chart-header" v-if="type !== 'detail'"> |
| | | <editor-toolbar :chart-data="flowChartData" /> |
| | | </div> |
| | | <div class="vfe-chart-container"> |
| | | <!-- Left Items --> |
| | | <div class="vfe-chart-sidebar" v-if="type !== 'detail'"> |
| | | <editor-item-panel :node-items="flowChartNodeItems" /> |
| | | </div> |
| | | <!-- Main Chart --> |
| | | <div class="vfe-chart-main"> |
| | | <flow :data="flowChartData" :onAfterChange="onAfterChange" /> |
| | | <div class="tooltip"> |
| | | <template v-for="item in tooltipData"> |
| | | <p :key="item.name">{{ item.name }}: {{ item.value }}</p> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | <div class="vfe-chart-panel" v-if="type !== 'detail'"> |
| | | <div class="vfe-chart-panel-detail"> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- Mouse Right Button Context Menu --> |
| | | <editor-context-menu v-if="type !== 'detail'" /> |
| | | <register-edge |
| | | name="custom-polyline" |
| | | extend="flow-polyline" |
| | | :config="customEdgeConfig" |
| | | /> |
| | | <custom-command :download="downloadImage" /> |
| | | </vue-flowchart-editor> |
| | | </template> |
| | | |
| | | <script> |
| | | import VueFlowchartEditor, { Flow, RegisterEdge } from "vue-flowchart-editor"; |
| | | import EditorToolbar from "./components/Toolbar"; |
| | | import EditorItemPanel from "./components/ItemPanel"; |
| | | import EditorDetailPanel from "./components/DetailPanel"; |
| | | import EditorMinimap from "./components/EditorMinimap"; |
| | | import EditorContextMenu from "./components/ContextMenu"; |
| | | import CustomCommand from "./components/CustomCommand"; |
| | | |
| | | export default { |
| | | name: "FlowchartEditor", |
| | | |
| | | components: { |
| | | VueFlowchartEditor, |
| | | Flow, |
| | | EditorToolbar, |
| | | EditorItemPanel, |
| | | EditorDetailPanel, |
| | | EditorMinimap, |
| | | EditorContextMenu, |
| | | CustomCommand, |
| | | RegisterEdge, |
| | | }, |
| | | |
| | | props: ["chartData", "chartDataNodeItems", "saveData", "rowData", "type"], |
| | | |
| | | data() { |
| | | return { |
| | | flowChartData: this.chartData, |
| | | flowChartNodeItems: this.chartDataNodeItems, |
| | | customEdgeConfig: { |
| | | getActivedStyle(/*item*/) { |
| | | return { |
| | | lineWidth: 3, |
| | | }; |
| | | }, |
| | | getSelectedStyle(/*item*/) { |
| | | return { |
| | | lineWidth: 3, |
| | | }; |
| | | }, |
| | | }, |
| | | tooltipShow: true, |
| | | tooltipData: [], |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | if (this.type === "add") { |
| | | this.$nextTick(() => { |
| | | this.$refs.flowChart.propsAPI.executeCommand("autoZoom"); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | // onAfterChange(e) { |
| | | // const model = e.model |
| | | // console.log(JSON.parse(JSON.stringify(e))); |
| | | // if (!model.change) { |
| | | // model.id = model.label |
| | | // model.change = true |
| | | // } else { |
| | | // return |
| | | // } |
| | | // const { nodes } = this.$refs.flowChart.propsAPI.save() |
| | | // if (Array.isArray(nodes) && nodes.length > 0) { |
| | | |
| | | // } else { |
| | | // this.$refs.flowChart.propsAPI.add("node", model); |
| | | // } |
| | | // throw 'ç¦æ¢åçæ°å¢æ¹æ³' |
| | | // }, |
| | | onAfterChange(e) { |
| | | console.log(e); |
| | | try { |
| | | if (e.action === "add" && e.model.type === "node") { |
| | | if (!e.model.change) { |
| | | this.$refs.flowChart.propsAPI.remove(e.item); |
| | | e.model.id = e.model.label; |
| | | e.model.change = true; |
| | | this.$refs.flowChart.propsAPI.add("node", e.model); |
| | | } |
| | | } |
| | | } catch (err) { |
| | | if ( |
| | | err.message === |
| | | `id:${e.model.label} has already been set, please set new one` |
| | | ) { |
| | | this.$message.error("ä¸è½æ·»å å·²åå¨çèç¹ï¼"); |
| | | } |
| | | } |
| | | }, |
| | | _downloadImage(data, filename = "flowchart.png") { |
| | | const a = document.createElement("a"); |
| | | a.href = data; |
| | | a.download = filename; |
| | | document.body.appendChild(a); |
| | | a.click(); |
| | | }, |
| | | |
| | | downloadImage() { |
| | | const page = this.$refs["flowChart"].propsAPI.editor.getCurrentPage(); |
| | | this._downloadImage(page.saveImage().toDataURL("image/png")); |
| | | }, |
| | | getNewRowData() { |
| | | return this.$refs.EditorDetailPanel.getNewRowDate(); |
| | | }, |
| | | getFlowData() { |
| | | return this.$refs.flowChart.propsAPI.save(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .vue-flowchart-editor { |
| | | display: flex; |
| | | flex: 1; |
| | | flex-direction: column; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: #fff; |
| | | } |
| | | |
| | | .vfe-chart { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .vfe-chart-header { |
| | | border: 1px solid #e6e9ed; |
| | | padding: 8px; |
| | | } |
| | | |
| | | .vfe-chart-container { |
| | | flex: 1; |
| | | display: flex; |
| | | height: 550px; |
| | | overflow: hidden; |
| | | .vfe-chart-main { |
| | | position: relative; |
| | | flex: 1; |
| | | max-height: calc(100% - 5px); // fix scroll show |
| | | |
| | | .tooltip { |
| | | position: absolute; |
| | | display: none; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100px; |
| | | height: auto; |
| | | padding: 15px; |
| | | border-radius: 10px; |
| | | z-index: 999; |
| | | opacity: 0.8; |
| | | color: #ffffff; |
| | | font-size: 12px; |
| | | background-color: #000; |
| | | |
| | | p { |
| | | margin: 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .vfe-chart-sidebar { |
| | | position: relative; |
| | | display: flex; |
| | | justify-content: center; |
| | | width: 15%; |
| | | background-color: #fafafa; |
| | | border-right: 1px solid #e6e9ed; |
| | | } |
| | | |
| | | .vfe-chart-panel { |
| | | position: relative; |
| | | width: 300px; |
| | | background-color: #fafafa; |
| | | border-left: 1px solid #e6e9ed; |
| | | |
| | | .vfe-chart-panel-detail { |
| | | box-sizing: border-box; |
| | | padding: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | !function(v){var c,h='<svg><symbol id="iconto-back" viewBox="0 0 1024 1024"><path d="M640 726.016l0-86.016 86.016 0 0 86.016-86.016 0zM640 214.016l0-86.016 86.016 0 0 86.016-86.016 0zM214.016 297.984l0 512 512 0 0 86.016-512 0q-36.010667 0-61.013333-25.984t-25.002667-59.989333l0-512 86.016 0zM809.984 726.016l0-86.016 86.016 0q0 34.005333-25.984 59.989333t-59.989333 25.984zM809.984 384l0-86.016 86.016 0 0 86.016-86.016 0zM809.984 553.984l0-84.010667 86.016 0 0 84.010667-86.016 0zM384 726.016q-36.010667 0-61.013333-25.984t-25.002667-59.989333l86.016 0 0 86.016zM553.984 128l0 86.016-84.010667 0 0-86.016 84.010667 0zM809.984 128q34.005333 0 59.989333 25.984t25.984 59.989333l-86.016 0 0-86.016zM553.984 640l0 86.016-84.010667 0 0-86.016 84.010667 0zM384 128l0 86.016-86.016 0q0-34.005333 25.002667-59.989333t61.013333-25.984zM384 470.016l0 84.010667-86.016 0 0-84.010667 86.016 0zM384 297.984l0 86.016-86.016 0 0-86.016 86.016 0z" ></path></symbol><symbol id="iconfit" viewBox="0 0 1024 1024"><path d="M597.333333 405.376c0-0.128 0.085333-0.256 0.085333-0.384C597.418667 404.821333 597.333333 404.650667 597.333333 404.522667L597.333333 192.768C597.333333 180.522667 606.933333 170.538667 618.666667 170.666667c11.733333-0.042667 21.376 9.813333 21.376 22.144L640.042667 384l191.189333 0c12.16 0 22.186667 9.6 22.101333 21.333333 0 11.733333-9.813333 21.333333-22.186667 21.333333l-211.754667 0c-0.128 0-0.256-0.085333-0.384-0.085333S618.837333 426.666667 618.709333 426.666667c-4.821333 0-9.045333-1.962667-12.629333-4.736-0.853333-0.64-1.749333-0.981333-2.432-1.706667-0.213333-0.213333-0.298667-0.469333-0.512-0.725333C599.68 415.744 597.333333 410.837333 597.333333 405.376zM362.666667 170.666667C350.933333 170.624 341.290667 180.48 341.290667 192.810667L341.290667 384 150.101333 384C137.898667 384 127.914667 393.6 128 405.333333 128 417.066667 137.813333 426.666667 150.186667 426.666667l211.754667 0c0.128 0 0.256-0.085333 0.384-0.085333S362.496 426.666667 362.624 426.666667c4.821333 0 9.045333-1.962667 12.629333-4.736 0.853333-0.64 1.749333-0.981333 2.432-1.706667 0.213333-0.213333 0.298667-0.469333 0.512-0.725333C381.653333 415.744 384 410.837333 384 405.376c0-0.128-0.085333-0.256-0.085333-0.384C383.914667 404.821333 384 404.650667 384 404.522667L384 192.768C384 180.522667 374.4 170.538667 362.666667 170.666667zM831.146667 640l-211.754667 0c-0.128 0-0.256 0.085333-0.384 0.085333S618.837333 640 618.709333 640c-4.821333 0-9.088 2.005333-12.672 4.778667-0.810667 0.597333-1.706667 0.938667-2.389333 1.664-0.213333 0.213333-0.298667 0.469333-0.512 0.725333C599.68 650.922667 597.333333 655.829333 597.333333 661.290667c0 0.128 0.085333 0.256 0.085333 0.384 0 0.170667-0.085333 0.341333-0.085333 0.469333l0 211.797333c0 12.202667 9.6 22.229333 21.333333 22.101333 11.733333 0.042667 21.376-9.813333 21.376-22.144L640.042667 682.666667l191.189333 0c12.16 0 22.186667-9.6 22.101333-21.333333C853.333333 649.6 843.52 640 831.146667 640zM378.154667 647.168c-0.213333-0.256-0.298667-0.512-0.512-0.725333-0.682667-0.725333-1.578667-1.066667-2.389333-1.664C371.712 642.005333 367.445333 640 362.624 640c-0.128 0-0.213333 0.085333-0.341333 0.085333S362.026667 640 361.898667 640L150.186667 640C137.813333 640 128 649.6 128 661.333333 127.914667 673.066667 137.898667 682.666667 150.101333 682.666667l191.189333 0 0 191.189333c0 12.288 9.642667 22.186667 21.376 22.144C374.4 896.128 384 886.144 384 873.898667l0-211.797333c0-0.128-0.085333-0.298667-0.085333-0.469333C383.914667 661.546667 384 661.418667 384 661.290667 384 655.829333 381.653333 650.922667 378.154667 647.168zM490.666667 469.333333c-35.328 0-64 28.672-64 64s28.672 64 64 64 64-28.672 64-64S525.994667 469.333333 490.666667 469.333333z" ></path></symbol><symbol id="iconpaste" viewBox="0 0 1024 1024"><path d="M776 248 704 248 704 192l99.968 0C819.392 192 832 204.608 832 220.032l0 98.88-56 0L776 248zM255.104 904 184 904 184 248 256 248 256 192 156.032 192C140.608 192 128 204.608 128 220.032l0 712C128 947.392 140.608 960 156.032 960l99.136 0L255.168 904zM640 320 320 320 320 192l64 0L384 120C384 89.216 409.216 64 440 64l72.064 0c30.784 0 56 25.216 56 56L568.064 192 640 192 640 320zM512.128 120.128C512.064 120.064 512 120 512 120L440.064 120.064c0 0 0 0.064-0.064 0.064L440 192l72.064 0 0.064 0L512.128 120.128zM888.256 995.776 888.256 578.88l-182.4-192L351.488 386.88c-18.624 0-31.232 12.608-31.232 28.032l0 580.864c0 15.36 12.608 28.032 28.032 28.032l512 0C875.648 1023.744 888.256 1011.136 888.256 995.776zM824.256 586.88l-129.6 0L694.656 450.88 824.256 586.88zM832.256 970.88 376.256 970.88 376.256 442.88l265.6 0 0 196.864 190.4 0L832.256 970.88z" ></path></symbol><symbol id="iconactual-size" viewBox="0 0 1024 1024"><path d="M829.013333 810.666667l-640 0c-58.794667 0-106.666667-47.829333-106.666667-106.666667l0-469.333333c0-58.794667 47.872-106.666667 106.666667-106.666667l640 0c58.837333 0 106.666667 47.872 106.666667 106.666667l0 469.333333C935.68 762.837333 887.850667 810.666667 829.013333 810.666667zM189.013333 170.666667c-35.285333 0-64 28.714667-64 64l0 469.333333c0 35.285333 28.714667 64 64 64l640 0c35.285333 0 64-28.714667 64-64l0-469.333333c0-35.285333-28.714667-64-64-64L189.013333 170.666667zM338.346667 640.256c0 11.733333-9.557333 21.333333-21.333333 21.333333s-21.333333-9.6-21.333333-21.333333l0-341.333333c0-11.818667 9.557333-21.333333 21.333333-21.333333s21.333333 9.514667 21.333333 21.333333L338.346667 640.256zM722.346667 640.256c0 11.733333-9.557333 21.333333-21.333333 21.333333s-21.333333-9.6-21.333333-21.333333l0-341.333333c0-11.818667 9.557333-21.333333 21.333333-21.333333s21.333333 9.514667 21.333333 21.333333L722.346667 640.256zM509.013333 341.333333c-23.594667 0-42.666667 19.072-42.666667 42.666667s19.072 42.666667 42.666667 42.666667 42.666667-19.072 42.666667-42.666667S532.565333 341.333333 509.013333 341.333333zM509.013333 512c-23.594667 0-42.666667 19.072-42.666667 42.666667s19.072 42.666667 42.666667 42.666667 42.666667-19.072 42.666667-42.666667S532.565333 512 509.013333 512z" ></path></symbol><symbol id="iconredo" viewBox="0 0 1024 1024"><path d="M708.16 635.904c-39.36 35.968-48.32 41.344-50.496-25.856-3.968-49.152 0-103.552 0-103.552-1.408-3.072-86.464-35.008-227.072 25.856C290.048 593.28 195.2 783.36 178.432 842.88 177.088 877.248 132.288 943.616 128 841.472c-0.576-166.656 64.512-341.12 230.336-441.152 154.624-93.248 283.264-83.776 297.408-78.848 0.256 1.344 0.64 1.856 1.344 1.024 0.192-0.256-0.384-0.64-1.344-1.024-1.216-6.208 2.496-38.272 2.88-98.56-2.368-54.144 12.096-55.808 49.536-26.944 68.544 56.32 251.776 231.36 251.776 231.36S776.768 580.608 708.16 635.904z" ></path></symbol><symbol id="iconundo" viewBox="0 0 1024 1024"><path d="M379.776 635.904c39.36 35.968 48.32 41.344 50.496-25.856 3.968-49.152 0-103.552 0-103.552 1.408-3.072 86.464-35.008 227.072 25.856 140.544 60.928 235.456 251.008 252.16 310.528 1.344 34.368 46.144 100.736 50.432-1.344 0.576-166.656-64.512-341.12-230.336-441.152C574.976 307.072 446.4 316.608 432.192 321.472c-0.256 1.344-0.64 1.856-1.344 1.024-0.192-0.256 0.384-0.64 1.344-1.024 1.216-6.208-2.496-38.272-2.88-98.56 2.368-54.144-12.096-55.808-49.536-26.944C311.168 252.288 128 427.264 128 427.264S311.168 580.608 379.776 635.904z" ></path></symbol><symbol id="icondelete" viewBox="0 0 1024 1024"><path d="M677.647059 256l0-90.352941c0-37.436235-23.461647-60.235294-61.771294-60.235294L408.094118 105.411765c-38.249412 0-61.741176 22.799059-61.741176 60.235294l0 90.352941-180.705882 0 0 60.235294 60.235294 0 0 512c0 54.272 33.972706 90.352941 90.352941 90.352941l391.529412 0c55.085176 0 90.352941-33.490824 90.352941-90.352941l0-512 60.235294 0 0-60.235294L677.647059 256zM406.588235 165.647059l210.823529 0-1.264941 90.352941L406.588235 256 406.588235 165.647059zM737.882353 858.352941l-451.764706 0 0-542.117647 451.764706 0L737.882353 858.352941zM466.823529 376.470588l-58.729412 0-1.505882 391.529412 60.235294 0L466.823529 376.470588zM617.411765 376.470588l-60.235294 0 0 391.529412 60.235294 0L617.411765 376.470588z" ></path></symbol><symbol id="iconzoom-in" viewBox="0 0 1024 1024"><path d="M1000.146824 957.500235l-311.597176-311.597176c58.729412-68.487529 94.509176-157.214118 94.509176-254.373647 0-215.883294-175.646118-391.529412-391.529412-391.529412-104.628706 0-202.932706 40.719059-276.901647 114.688-73.968941 73.908706-114.627765 172.272941-114.627765 276.841412 0 215.883294 175.646118 391.529412 391.529412 391.529412 97.099294 0 185.886118-35.779765 254.433882-94.509176l311.597176 311.597176 42.586353-42.646588zM391.529412 722.823529c-182.693647 0-331.294118-148.600471-331.294118-331.294118 0-88.545882 34.394353-171.730824 96.978824-234.315294 62.584471-62.524235 145.769412-96.978824 234.315294-96.978824 182.693647 0 331.294118 148.600471 331.294118 331.294118 0 182.693647-148.600471 331.294118-331.294118 331.294118zM421.647059 361.411765l120.470588 0 0 60.235294-120.470588 0 0 120.470588-60.235294 0 0-120.470588-120.470588 0 0-60.235294 120.470588 0 0-120.470588 60.235294 0 0 120.470588z" ></path></symbol><symbol id="iconzoom-out" viewBox="0 0 1024 1024"><path d="M999.344139 955.925769l-311.084802-311.084802c58.63284-68.374912 94.35377-157.015739 94.35377-253.955368 0-215.528306-175.357294-390.8856-390.8856-390.8856-104.396523 0-202.599013 40.652102-276.50646 114.439276-73.787174 73.84731-114.439276 172.0498-114.37914 276.446324 0 215.528306 175.357294 390.8856 390.8856 390.8856 96.939629 0 185.640592-35.72093 254.015504-94.35377l311.084802 311.084802 42.516326-42.576462zM391.727508 721.634954c-182.333098 0-330.749354-148.356119-330.749354-330.749354-0.060136-88.400282 34.337797-171.448438 96.819356-233.869861 62.421424-62.48156 145.529716-96.879493 233.929998-96.879493 182.333098 0 330.749354 148.356119 330.749354 330.749354 0 182.333098-148.416256 330.749354-330.749354 330.749354zM241.386892 360.817477l300.681231 0 0 60.136246-300.681231 0 0-60.136246z" ></path></symbol><symbol id="iconcopy" viewBox="0 0 1024 1024"><path d="M880 247.008l-162.016-166.016Q700.992 64 677.984 64h-316.992q-26.016 0-46.016 18.016-16.992 15.008-23.008 36.992H231.968q-43.008 0-73.504 31.008t-30.496 76v627.008q0 44 30.496 75.488T231.968 960h508q43.008 0 73.504-31.488t30.496-75.488v-63.008q23.008-6.016 37.504-25.504t14.496-44.512V287.008q0-24-16-40z m-168-160.992l-3.008-3.008z m98.016 177.984L744 196z m-126.016-116.992l108 110.016h-108V147.008zM676.992 128zM204.992 948q4 0.992 4.992 2.016-2.016-0.992-4.992-2.016z m27.008 4q-6.016 0-12-0.992 4.992 0.992 12 0.992z m543.008-99.008q0 15.008-10.016 25.504t-24.992 10.496H232q-14.016 0-24.512-10.496t-10.496-25.504V225.984q0-15.008 10.496-25.504t24.512-10.496h58.016v531.008q0 30.016 20.992 51.008t50.016 20.992H775.04v60z m52-132.992q0 2.016-2.016 2.016h-464q-2.016 0-2.016-2.016V136.992q0-2.016 2.016-2.016h251.008v156.992q0 15.008 10.016 24.992t24 10.016h180.992v392.992z m9.984 64q4-0.992 8.992-2.016-4.992 0.992-8.992 2.016z m-244-168.992h-107.008q-15.008 0-24.992 10.496t-10.016 24.992 10.016 24.992 24.992 10.496h107.008q14.016 0 24.512-10.496t10.496-24.992-10.496-24.992-24.512-10.496z m107.008-111.008h-214.016q-14.016 0-24.512 10.496t-10.496 24.992 10.496 24.992 24.512 10.496h214.016q14.016 0 24-10.496t10.016-24.992-10.016-24.992-24-10.496z m-240.992 36q0 4 0.992 8-0.992-4-0.992-8zM700 512z m12 52l4-2.016z m-260.992-135.488q0 14.496 10.496 24.992t24.512 10.496h214.016q14.016 0 24-10.496t10.016-24.992-10.016-24.992-24-10.496h-214.016q-14.016 0-24.512 10.496t-10.496 24.992z m8 1.504z" ></path></symbol><symbol id="iconsave" viewBox="0 0 1024 1024"><path d="M886.4 265.6l-128-128c-6.4-6.4-12.8-9.6-22.4-9.6H160c-19.2 0-32 12.8-32 32v704c0 19.2 12.8 32 32 32h704c19.2 0 32-12.8 32-32V288c0-9.6-3.2-16-9.6-22.4zM352 192h320v256H352V192z m480 640H192V192h96v288c0 19.2 12.8 32 32 32h384c19.2 0 32-12.8 32-32V204.8l96 96V832z" ></path><path d="M576 256c-19.2 0-32 12.8-32 32v64c0 19.2 12.8 32 32 32s32-12.8 32-32V288c0-19.2-12.8-32-32-32z" ></path></symbol><symbol id="iconselect-all" viewBox="0 0 1024 1024"><path d="M128 213.333333h85.333333V128c-47.146667 0-85.333333 38.186667-85.333333 85.333333z m0 341.333334h85.333333v-85.333334H128v85.333334z m170.666667 341.333333h85.333333v-85.333333h-85.333333v85.333333zM128 384h85.333333v-85.333333H128v85.333333zM554.666667 128h-85.333334v85.333333h85.333334V128z m256 0v85.333333h85.333333c0-47.146667-38.186667-85.333333-85.333333-85.333333zM213.333333 896v-85.333333H128c0 47.146667 38.186667 85.333333 85.333333 85.333333z m-85.333333-170.666667h85.333333v-85.333333H128v85.333333zM384 128h-85.333333v85.333333h85.333333V128z m85.333333 768h85.333334v-85.333333h-85.333334v85.333333z m341.333334-341.333333h85.333333v-85.333334h-85.333333v85.333334z m0 341.333333c47.146667 0 85.333333-38.186667 85.333333-85.333333h-85.333333v85.333333z m0-512h85.333333v-85.333333h-85.333333v85.333333z m0 341.333333h85.333333v-85.333333h-85.333333v85.333333z m-170.666667 170.666667h85.333333v-85.333333h-85.333333v85.333333z m0-682.666667h85.333333V128h-85.333333v85.333333zM298.666667 725.333333h426.666666V298.666667H298.666667v426.666666z m85.333333-341.333333h256v256H384V384z" fill="" ></path></symbol><symbol id="iconselect" viewBox="0 0 1024 1024"><path d="M324.266667 34.133333h-102.4c-10.24 0-17.066667 6.826667-17.066667 17.066667s6.826667 17.066667 17.066667 17.066667h102.4c10.24 0 17.066667-6.826667 17.066666-17.066667S334.506667 34.133333 324.266667 34.133333zM597.333333 34.133333h-102.4c-10.24 0-17.066667 6.826667-17.066666 17.066667s6.826667 17.066667 17.066666 17.066667h102.4c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066667zM324.266667 716.8h-102.4c-10.24 0-17.066667 6.826667-17.066667 17.066667s6.826667 17.066667 17.066667 17.066666h102.4c10.24 0 17.066667-6.826667 17.066666-17.066666s-6.826667-17.066667-17.066666-17.066667zM563.2 716.8h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667s6.826667 17.066667 17.066666 17.066666h68.266667c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM34.133333 597.333333c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066667-17.066667v-102.4c0-10.24-6.826667-17.066667-17.066667-17.066666s-17.066667 6.826667-17.066667 17.066666v102.4zM51.2 341.333333c10.24 0 17.066667-6.826667 17.066667-17.066666v-102.4c0-10.24-6.826667-17.066667-17.066667-17.066667s-17.066667 6.826667-17.066667 17.066667v102.4c0 10.24 6.826667 17.066667 17.066667 17.066666zM768 477.866667c-10.24 0-17.066667 6.826667-17.066667 17.066666v68.266667c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066667-17.066667v-68.266667c0-10.24-6.826667-17.066667-17.066667-17.066666zM785.066667 221.866667c0-10.24-6.826667-17.066667-17.066667-17.066667s-17.066667 6.826667-17.066667 17.066667v102.4c0 10.24 6.826667 17.066667 17.066667 17.066666s17.066667-6.826667 17.066667-17.066666v-102.4zM733.866667 102.4h68.266666c10.24 0 17.066667-6.826667 17.066667-17.066667v-68.266666c0-10.24-6.826667-17.066667-17.066667-17.066667h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v68.266666c0 10.24 6.826667 17.066667 17.066667 17.066667zM85.333333 0h-68.266666C6.826667 0 0 6.826667 0 17.066667v68.266666c0 10.24 6.826667 17.066667 17.066667 17.066667h68.266666c10.24 0 17.066667-6.826667 17.066667-17.066667v-68.266666c0-10.24-6.826667-17.066667-17.066667-17.066667zM85.333333 682.666667h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066666v68.266667c0 10.24 6.826667 17.066667 17.066667 17.066667h68.266666c10.24 0 17.066667-6.826667 17.066667-17.066667v-68.266667c0-10.24-6.826667-17.066667-17.066667-17.066666zM1013.76 788.48l-375.466667-204.8c-6.826667-3.413333-13.653333-3.413333-20.48 3.413333-3.413333 3.413333-3.413333 10.24-3.413333 17.066667l170.666667 409.6c3.413333 6.826667 6.826667 10.24 13.653333 10.24s13.653333-3.413333 13.653333-10.24l64.853334-133.12 133.12-64.853333c6.826667-3.413333 10.24-10.24 10.24-13.653334 3.413333-6.826667 0-10.24-6.826667-13.653333z" fill="" ></path></symbol><symbol id="iconto-front" viewBox="0 0 1024 1024"><path d="M128 554.666667h85.333333v-85.333334H128v85.333334z m0 170.666666h85.333333v-85.333333H128v85.333333z m85.333333 170.666667v-85.333333H128c0 47.146667 38.186667 85.333333 85.333333 85.333333zM128 384h85.333333v-85.333333H128v85.333333z m512 512h85.333333v-85.333333h-85.333333v85.333333z m170.666667-768H384c-47.146667 0-85.333333 38.186667-85.333333 85.333333v426.666667c0 47.146667 38.186667 85.333333 85.333333 85.333333h426.666667c47.146667 0 85.333333-38.186667 85.333333-85.333333V213.333333c0-47.146667-38.186667-85.333333-85.333333-85.333333z m0 512H384V213.333333h426.666667v426.666667zM469.333333 896h85.333334v-85.333333h-85.333334v85.333333z m-170.666666 0h85.333333v-85.333333h-85.333333v85.333333z" ></path></symbol><symbol id="iconimage" viewBox="0 0 1024 1024"><path d="M847.657 64.016H175.703c-61.766 0-111.993 50.227-111.993 111.992v671.954c0 61.765 50.226 111.993 111.993 111.993h671.954c61.765 0 111.992-50.228 111.992-111.993V176.01c0-61.765-50.227-111.993-111.992-111.993z m55.995 783.946c0 30.87-25.127 55.997-55.996 55.997H175.703c-30.87 0-55.996-25.127-55.996-55.997V176.01c0-30.87 25.128-55.996 55.996-55.996h671.954c30.87 0 55.996 25.127 55.996 55.996v671.953zM835.19 544.686l-83.995-55.996c-10.444-6.945-23.54-5.688-32.782 1.722l-0.246-0.3-133.184 106.551-197.435-135.752c-0.083-0.055-0.164-0.055-0.218-0.11-2.297-1.53-4.895-2.379-7.52-3.199-0.874-0.273-1.666-0.875-2.57-1.04-2.378-0.492-4.811-0.218-7.273-0.081-1.121 0.082-2.27-0.218-3.363 0-1.23 0.218-2.35 0.984-3.554 1.394-2.27 0.739-4.566 1.367-6.616 2.707-0.083 0.055-0.192 0.055-0.274 0.11L188.17 572.684c-12.878 8.585-16.35 25.946-7.765 38.824 5.386 8.094 14.273 12.47 23.323 12.47 5.332 0 10.718-1.533 15.503-4.704L371.444 517.81 803.8 815.042a27.793 27.793 0 0 0 15.831 4.923c8.913 0 17.663-4.238 23.105-12.14 8.749-12.74 5.523-30.156-7.219-38.934L633.214 629.802l103.956-83.147 66.959 44.621c4.786 3.172 10.171 4.704 15.503 4.704 9.05 0 17.937-4.374 23.323-12.469 8.584-12.877 5.112-30.24-7.766-38.825zM581.674 427.991c69.476 0 125.992-56.516 125.992-125.99 0-69.477-56.516-125.993-125.992-125.993-69.475 0-125.99 56.516-125.99 125.992s56.516 125.991 125.99 125.991z m0-195.985c38.607 0 69.995 31.387 69.995 69.994s-31.388 69.995-69.995 69.995c-38.606 0-69.995-31.39-69.995-69.995 0-38.607 31.39-69.994 69.995-69.994z" ></path></symbol><symbol id="iconclear" viewBox="0 0 1024 1024"><path d="M686.464 452.821333c5.461333-15.274667 20.394667-43.690667 40.533333-77.952 14.549333-24.746667 39.466667-55.978667 64.810667-87.466666 6.4-7.978667 13.909333-17.152 22.357333-27.562667l34.304 19.456c-8.533333 10.752-15.914667 19.968-22.186666 27.733333-25.770667 31.914667-50.261333 62.165333-65.024 87.296-8.576 14.634667-15.872 27.562667-21.76 38.741334l116.906666 66.304a77.013333 77.013333 0 0 1 28.970667 106.24l-197.973333 336.810666a80 80 0 0 1-108.245334 28.458667l-411.562666-233.344a77.013333 77.013333 0 0 1-28.970667-106.24l197.973333-336.810667a80 80 0 0 1 108.245334-28.501333l116.821333 66.261333c6.912-10.624 14.634667-23.253333 23.253333-37.888 14.762667-25.173333 29.226667-61.056 44.501334-98.986666 3.712-9.173333 8.106667-20.053333 13.354666-32.725334l34.304 19.456-13.141333 32.853334c-15.061333 37.248-30.165333 74.069333-44.714667 98.816-20.138667 34.261333-37.717333 61.184-48.469333 73.429333l-118.229333-67.029333c-33.152-18.773333-73.301333-11.989333-92.074667 19.882666l-167.552 285.056c-18.773333 31.914667-6.826667 73.088 26.325333 91.904l352.554667 199.893334c33.109333 18.773333 75.050667 8.106667 93.781333-23.765334l167.594667-285.056c18.773333-31.914667 5.034667-69.248-28.117333-88.021333l-118.613334-67.242667z m-43.690667-290.133333c22.613333-36.906667 90.026667-47.786667 146.432-15.786667 56.405333 32 80.554667 94.762667 59.306667 132.437334l-34.304-19.456c9.984-18.944-7.68-57.728-45.056-78.890667-37.290667-21.162667-80.341333-16.810667-92.074667 1.109333l-34.304-19.456zM314.112 418.858667l472.704 267.989333-21.888 37.248L292.224 456.106667l21.888-37.205334z" ></path></symbol><symbol id="icongroup" viewBox="0 0 1024 1024"><path d="M912 820.1V203.9c28-9.9 48-36.6 48-67.9 0-39.8-32.2-72-72-72-31.3 0-58 20-67.9 48H203.9C194 84 167.3 64 136 64c-39.8 0-72 32.2-72 72 0 31.3 20 58 48 67.9v616.2C84 830 64 856.7 64 888c0 39.8 32.2 72 72 72 31.3 0 58-20 67.9-48h616.2c9.9 28 36.6 48 67.9 48 39.8 0 72-32.2 72-72 0-31.3-20-58-48-67.9zM888 112c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zM136 912c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24z m0-752c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24z m704 680H184V184h656v656z m48 72c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24z" ></path><path d="M288 474h448c8.8 0 16-7.2 16-16V282c0-8.8-7.2-16-16-16H288c-8.8 0-16 7.2-16 16v176c0 8.8 7.2 16 16 16z m56-136h336v64H344v-64zM288 758h448c8.8 0 16-7.2 16-16V566c0-8.8-7.2-16-16-16H288c-8.8 0-16 7.2-16 16v176c0 8.8 7.2 16 16 16z m56-136h336v64H344v-64z" ></path></symbol><symbol id="iconungroup" viewBox="0 0 1024 1024"><path d="M736 550H288c-8.8 0-16 7.2-16 16v176c0 8.8 7.2 16 16 16h448c8.8 0 16-7.2 16-16V566c0-8.8-7.2-16-16-16z m-56 136H344v-64h336v64zM888 816c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z m0 96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zM736 266H288c-8.8 0-16 7.2-16 16v176c0 8.8 7.2 16 16 16h448c8.8 0 16-7.2 16-16V282c0-8.8-7.2-16-16-16z m-56 136H344v-64h336v64zM888 208c39.8 0 72-32.2 72-72s-32.2-72-72-72-72 32.2-72 72 32.2 72 72 72z m0-96c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zM136 64c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z m0 96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zM136 816c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z m0 96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24z" ></path></symbol></svg>',l=(c=document.getElementsByTagName("script"))[c.length-1].getAttribute("data-injectcss");if(l&&!v.__iconfont__svg__cssinject__){v.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(c){console&&console.log(c)}}!function(c){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(c,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),c()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(o=c,e=v.document,z=!1,(h=function(){try{e.documentElement.doScroll("left")}catch(c){return void setTimeout(h,50)}t()})(),e.onreadystatechange=function(){"complete"==e.readyState&&(e.onreadystatechange=null,t())});function t(){z||(z=!0,o())}var o,e,z,h}(function(){var c,l,t,o,e,z;(c=document.createElement("div")).innerHTML=h,h=null,(l=c.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",t=l,(o=document.body).firstChild?(e=t,(z=o.firstChild).parentNode.insertBefore(e,z)):o.appendChild(t))})}(window); |
| | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | total: this.referConfig.options.data?this.referConfig.options.data.length :0 |
| | | }, |
| | | data:this.referConfig.options.data || [], |
| | | selectionList: [], |
| | |
| | | console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.page.limit || this.referConfig.options.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; |
| | | } |
| | | }, |
| | | computed:{ |
| | | valueInfo:function (){ |
| | |
| | | }, |
| | | setValue(){ |
| | | if(this.selectionList.length==0){ |
| | | this.$message.error( '没æéæ©æ°æ®'); |
| | | this.$message.warning( '没æéæ©æ°æ®'); |
| | | return false; |
| | | }else if(this.selectionList.length>1 && !this.isMuti){ |
| | | this.$message.error( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | this.$message.warning( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | return false; |
| | | } |
| | | |
| | |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.referCrud.toggleSelection(); |
| | | this.$refs.referCrud.clearSelection(); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="icon" slot-scope="scope"> |
| | | <i :class="scope.row.icon" style="font-size:24px"></i> |
| | | </template> |
| | | </avue-crud> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> |
| | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | total: this.referConfig.options.data?this.referConfig.options.data.length :0 |
| | | }, |
| | | data:this.referConfig.options.data || [], |
| | | selectionList: [], |
| | | objTree: {//ç¨äºè¡¨æ ¼æ ï¼ç®åè¿æ²¡å ä¸ä½¿ç¨ |
| | | keyId: 'oid',//æ å½¢idåæ®µåç§° |
| | | keyPid: 'parentSaleProduct',//æ å½¢ç¶idåæ®µåç§° |
| | | title: 'id',//以æ 形弿¾ç¤ºçåæ®µ |
| | | defaultShow: false//é»è®¤æå |
| | | }, |
| | | option: { |
| | | addBtn: false, |
| | | height: this.referConfig.options.height ? this.referConfig.options.height : 475, |
| | |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | rowKey:'oid', |
| | | rowParentKey:'parentSaleProduct', |
| | | column: [] |
| | | } |
| | | }; |
| | |
| | | console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.page.limit || this.referConfig.options.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; |
| | | } |
| | | }, |
| | | computed:{ |
| | | valueInfo:function (){ |
| | |
| | | }, |
| | | setValue(){ |
| | | if(this.selectionList.length==0){ |
| | | this.$message.error( '没æéæ©æ°æ®'); |
| | | this.$message.warning( '没æéæ©æ°æ®'); |
| | | return false; |
| | | }else if(this.selectionList.length>1 && !this.isMuti){ |
| | | this.$message.error( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | this.$message.warning( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | return false; |
| | | } |
| | | |
| | |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.referCrud.toggleSelection(); |
| | | this.$refs.referCrud.clearSelection(); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | |
| | | if(this.url){ |
| | | this.loading = true; |
| | | getList(Object.assign(params, this.query),page.currentPage, page.pageSize, this.url).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | debugger; |
| | | this.page.total = res.total; |
| | | this.data = res.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | queryParams['replaceMap["' + key + '"]'] = this.options.replaceParams[key];//æ°çæ¹å¼ |
| | | } |
| | | } |
| | | queryParams['parentValue']='\\IN(SELECT oid from PL_CODE_CLASSIFY where id =\'hesuanfenlei\')' |
| | | this.params=queryParams; |
| | | |
| | | }, |
| | |
| | | <template> |
| | | |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page" |
| | | :search.sync="search" @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" |
| | | @row-update="handleEdit" @refresh-change="handleRefresh" @size-change="handleSizePage" |
| | | @current-change="handleCurrentPage"> |
| | | </avue-crud> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | default: "" |
| | | } |
| | | }, |
| | | watch: { |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | loading: false, |
| | | page: { |
| | | currentPage: 1, |
| | |
| | | { |
| | | label: '模æ¿key', |
| | | prop: 'modelKey', |
| | | width:120, |
| | | sortable: true, |
| | | type: 'tree', |
| | | dicData: [], |
| | |
| | | label: '模æ¿åç§°', |
| | | prop: 'modelName', |
| | | sortable: true, |
| | | width:220, |
| | | addDisabled: true, |
| | | editDisabled: true, |
| | | }, |
| | | { |
| | | label: 'æµç¨æ¨¡æ¿ç¨é', |
| | | label: '模æ¿ç¨é', |
| | | prop: 'buttonTypeKey', |
| | | type: 'tree', |
| | | width:120, |
| | | dicUrl: '/api/ubcs-flow/processTS/tt', |
| | | dicMethod: 'post', |
| | | props: { |
| | | value: "codee", |
| | | label: "namee", |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æ¨¡æ¿æè¿°', |
| | | prop: 'description', |
| | | type:'textarea' |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | // ç¼è¾ |
| | | async handleEdit(row, index, done, loading) { |
| | | console.log(row) |
| | | const { modelName, modelKey, buttonTypeKey, id } = row |
| | | let param = { modelName, modelKey, buttonTypeKey, id } |
| | | const { modelName, modelKey, buttonTypeKey, id ,description} = row |
| | | let param = { modelName, modelKey, buttonTypeKey, id,description } |
| | | const response = await flowpathSave({ ...param, ...{ templateId: this.code } }) |
| | | if (response.status === 200) { |
| | | loading() |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true"> |
| | | <div> |
| | | <el-tag v-for="tag in tags" :key="tag" closable disable-transitions effect="dark" @click="handleClickTag(tag)" |
| | | @close="handleCloseTag(tag)"> |
| | | <span> {{ tag.name }}</span> |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <el-divider v-if="tags.length !== 0"></el-divider> |
| | | <div class="btns-icon"> |
| | | <el-button type="primary" icon="el-icon-star-off" @click="handleCollect"></el-button> |
| | | <!-- <el-button type="primary" icon="el-icon-refresh" ></el-button> --> |
| | | </div> |
| | | <el-form :model="saveParam" class="demo-form-inline" label-position="left"> |
| | | <el-form-item :label="item.taskName" v-for="(item, index) in initFrom" :key="index"> |
| | | <el-select style="width: 50%;" v-model="saveParam.flowTaskUsers[index]['userId']" |
| | | :placeholder="item.taskName" @change="handleSelect($event, index)"> |
| | | <el-option :label="key.userNames" :value="key.userId" v-for="(key, keyi) in typeName" |
| | | :key="keyi"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleCancel">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | <script> |
| | | import { personnelInit, personnelCollect, cancelCollect, personnelSave, personnelDict } from '@/api/template/setPersonnel.js' |
| | | export default { |
| | | name: 'SetPersonnel', |
| | | props: { |
| | | // æ¯å¦æå¼ |
| | | visible: { |
| | | typeof: Boolean, |
| | | default: false |
| | | }, |
| | | // æ é¢ |
| | | title: { |
| | | typeof: String, |
| | | default: '人å设置' |
| | | }, |
| | | // 模æ¿id |
| | | code: { |
| | | typeof: String, |
| | | default: '' |
| | | }, |
| | | // 模æ¿ç¨é |
| | | type: { |
| | | typeof: String, |
| | | default: '' |
| | | } |
| | | }, |
| | | watch: { |
| | | visible(n) { |
| | | this.dialogVisible = n; |
| | | }, |
| | | dialogVisible(n) { |
| | | this.$emit('update:visible', n) |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: this.visible, |
| | | initFrom: [], |
| | | tags: [], |
| | | typeName: [], |
| | | saveParam: {}, |
| | | users: [], |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.apiInit() |
| | | this.apiDict() |
| | | }, |
| | | methods: { |
| | | async apiInit() { |
| | | const response = await personnelInit({ type: this.type, templateId: this.code }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.initFrom = response.data.data.user |
| | | this.tags = response.data.data.collect |
| | | const { modelKey, templateId } = response.data.data.flow |
| | | let flowTaskUsers = response.data.data.user |
| | | this.saveParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers } |
| | | this.handleClickTag(this.tags[0]) |
| | | } |
| | | }, |
| | | async apiDict() { |
| | | const response = await personnelDict() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | const data = response.data.data |
| | | this.typeName = data.map(item => { |
| | | const { account, deptName, id, realName } = item |
| | | let userNames = `${deptName} - ${realName} - ${account}` |
| | | return { userId: id, userName: realName, userNames: userNames } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | handleCollect() { |
| | | this.$prompt('请è¾å
¥ä¸ä¸ªåå', 'æä½', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | }).then(async ({ value }) => { |
| | | console.log(this.users) |
| | | this.saveParam.flowTaskUsers = this.users |
| | | this.saveParam = { ...this.saveParam, name: value } |
| | | console.log(this.saveParam) |
| | | const response = await personnelCollect(this.saveParam) |
| | | if (response.status === 200) { |
| | | this.$nextTick(() => { |
| | | this.apiInit() |
| | | }) |
| | | console.log(response) |
| | | } |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }, |
| | | async canCollect(name) { |
| | | const response = await cancelCollect({ name: name }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.apiInit() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: response.data.msg |
| | | }); |
| | | } |
| | | }, |
| | | async apiSave() { |
| | | try { |
| | | const { modelKey, templateId } = this.saveParam |
| | | const response = await personnelSave({ modelKey, templateId }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: response.data.msg |
| | | }); |
| | | this.done() |
| | | } |
| | | } catch { |
| | | console.error('æ¥å£è°ç¨å¤±è´¥') |
| | | } |
| | | }, |
| | | handleClickTag(event) { |
| | | console.log(event) |
| | | const flowTaskUsers = event.flowTaskUsers |
| | | this.saveParam.flowTaskUsers = flowTaskUsers.map(item => { |
| | | const { taskId, taskName, userId, userName } = item |
| | | return { taskId, taskName, userId, userName } |
| | | }) |
| | | }, |
| | | handleCloseTag(event) { |
| | | console.log(event) |
| | | this.canCollect(event.name) |
| | | }, |
| | | handleSelect(event, index) { |
| | | const res = this.typeName.find(item => item.userId === event) |
| | | const { userName } = res |
| | | let users = { ... this.saveParam.flowTaskUsers[index], userName } |
| | | console.log(users) |
| | | this.users[index] = users |
| | | }, |
| | | done() { |
| | | this.dialogVisible = false |
| | | }, |
| | | handleCancel() { |
| | | this.done() |
| | | }, |
| | | handleConfirm() { |
| | | console.log(this.users) |
| | | console.log(this.saveParam) |
| | | this.apiSave() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .el-tag+.el-tag { |
| | | margin-left: 10px; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .button-new-tag { |
| | | margin-left: 10px; |
| | | height: 32px; |
| | | line-height: 30px; |
| | | padding-top: 0; |
| | | padding-bottom: 0; |
| | | } |
| | | |
| | | .input-new-tag { |
| | | width: 90px; |
| | | margin-left: 10px; |
| | | vertical-align: bottom; |
| | | } |
| | | |
| | | .btns-icon { |
| | | display: flex; |
| | | justify-content: end; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog title="模æ¿é¶æ®µ" width="90%" append-to-body="true" :visible.sync="dialogVisible"> |
| | | <div> |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | <table-transfer :visible.sync="dialogTransfer" v-model="listVal" :dataList="tableData" :columns="columns" |
| | | keyName="oid" @save="handleSave"></table-transfer> |
| | | </el-dialog> |
| | | <table-transfer v-if="flag" :visible.sync="dialogTransfer" v-model="attributeValue" :dataList="attributeData" |
| | | :columns="columns" keyName="oid" @save="handleSave" @close="handelClose"></table-transfer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | TableTransfer |
| | | }, |
| | | props: { |
| | | // æ¯å¦æå¼ |
| | | visible: { |
| | | typeof: Boolean, |
| | | default: false |
| | | }, |
| | | code: { |
| | | typeof: String, |
| | | required: true, |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | visible(n) { |
| | | this.dialogVisible = n; |
| | | }, |
| | | dialogVisible(n) { |
| | | this.$emit('update:visible', n) |
| | | }, |
| | | }, |
| | | computed: { |
| | | tableData() { |
| | | return this.setTable() |
| | | }, |
| | | listVal() { |
| | | let data = this.setTable() |
| | | let newdata = data.map(item => { |
| | | return item.checked ? item.oid : undefined |
| | | }) |
| | | console.log(newdata.filter(item => item)) |
| | | return newdata.filter(item => item) |
| | | } |
| | | |
| | | }, |
| | | data() { |
| | | const options = { |
| | |
| | | editBtn: false, |
| | | } |
| | | return { |
| | | list: [], |
| | | listRight: [], |
| | | dialogVisible: this.visible, |
| | | attributeData: [], |
| | | attributeValue: [], |
| | | flag: false, |
| | | dialogTransfer: false, |
| | | dialogNode: false, |
| | | visibleTable: false, |
| | |
| | | }, |
| | | stageOption: { |
| | | ...options, |
| | | height:620, |
| | | column: [ |
| | | { label: 'é¶æ®µç¼å·', prop: 'taskId' }, |
| | | { label: 'é¶æ®µåç§°', prop: 'taskName' }, |
| | |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getAttributeList() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | return this.list.map(item => { |
| | | if (this.listRight.length !== 0) { |
| | | this.listRight.forEach(element => { |
| | | setTable(data, list) { |
| | | return data.map(item => { |
| | | if (list.length !== 0) { |
| | | list.forEach(element => { |
| | | if (item.id === element.attrId) item.checked = true |
| | | }); |
| | | } |
| | |
| | | // è·åå
¨é¨å±æ§ |
| | | async getAttributeList() { |
| | | const response = await attributeList({ 'conditionMap[classifyTemplateOid]': this.code }) |
| | | if (response.status === 200) { |
| | | const data = response.data.data |
| | | this.list = data.records.map(item => { |
| | | const responseRight = await attributeListRight({ templateId: this.code, modelKey: this.modelKey, taskId: this.saveParam.taskId }) |
| | | if (response.status === 200 && responseRight.status === 200) { |
| | | let datas = response.data.data.records |
| | | let dataRight = responseRight.data.data |
| | | datas = datas.map(item => { |
| | | const { oid, id, name, attributeGroup } = item |
| | | return { oid, id, name, attributeGroup, ...{ checked: false } } |
| | | item = { oid, id, name, attributeGroup, ...{ checked: false } } |
| | | if (dataRight.length !== 0) { |
| | | dataRight.forEach(element => { if (item.id === element.attrId) item.checked = true }); |
| | | return item |
| | | } |
| | | }) |
| | | let dataValue = datas.map(item => item.checked ? item.oid : undefined) |
| | | this.attributeValue = dataValue.filter(item => item) |
| | | this.attributeData = datas |
| | | this.flag = true |
| | | } |
| | | }, |
| | | // è·åå·²ä¿å屿§ |
| | |
| | | this.saveParam.modelKey = row.modelKey |
| | | }, |
| | | handleMaintenanceTransfer(row) { |
| | | console.log(row) |
| | | this.dialogTransfer = true |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeListRight() |
| | | }, |
| | | handleSizePage(event) { |
| | | this.page.pageSize = event |
| | | }, |
| | | handleCurrentPage(event) { |
| | | this.page.currentPage = event |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | handleRowClick(row) { |
| | | console.log(row) |
| | |
| | | this.dialogNode = true |
| | | }, |
| | | handleRowStageClick(row) { |
| | | this.dialogTransfer = true |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeListRight() |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | async handleSave(event) { |
| | | console.log(event) |
| | |
| | | type: 'success', |
| | | message: 'æ°å¢æ°æ®æåï¼' |
| | | }) |
| | | this.flag = false |
| | | // done() |
| | | // this.getDataList() |
| | | } |
| | | }, |
| | | handelClose() { |
| | | this.flag = false |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-dialog :title="title" width="70%" append-to-body="true" :visible.sync="dialogVisible"> |
| | | <el-dialog :title="title" width="70%" append-to-body="true" :visible.sync="dialogVisible" @close="handelClose"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="11"> |
| | | <el-card class="box-card"> |
| | |
| | | <el-input class="input" v-if="showSearch" v-model="searchLeft" placeholder="请è¾å
¥æç´¢å
容" |
| | | @keyup.enter.native="handleEnter"></el-input> |
| | | </div> |
| | | <el-table ref="transferLeftTable" :data="leftData" height="500" highlight-current-row |
| | | tooltip-effect="dark" @selection-change="handleLeftSelectionChange" @row-click="handleLeftRowClick"> |
| | | <el-table-column type="selection" width="50" align="center" fixed="left" :selectable="selectable" /> |
| | | <el-table ref="transferTable" :data="leftData" height="500" highlight-current-row tooltip-effect="dark" |
| | | @selection-change="handleLeftSelectionChange" @row-click="handleLeftRowClick"> |
| | | <el-table-column type="selection" width="50" align="center" fixed="left" /> |
| | | <div v-for="(item, index) in columns" :key="index"> |
| | | <el-table-column v-if="item.visible" :label="item.label" align="center" :prop="item.key" /> |
| | | </div> |
| | |
| | | //主é®keyå¼ |
| | | keyName: { |
| | | type: String, |
| | | default: "id", |
| | | default: "oid", |
| | | }, |
| | | columns: { |
| | | type: Array, |
| | |
| | | }, |
| | | deep: true, |
| | | }, |
| | | dataList: { |
| | | handler(data) { |
| | | console.log(data) |
| | | |
| | | }, |
| | | deep: true, |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: this.visible, |
| | | indeterminate: false, |
| | | isCheck: false, |
| | | searchLeft: "", |
| | | leftIds: [], |
| | | leftMultiple: true, |
| | |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | console.log(this.$refs.transferTable) |
| | | }, |
| | | methods: { |
| | | selectable(row, index) { |
| | | console.log(row) |
| | | return row.checked === false //为trueçæ¶åå¯ä»¥éï¼ä¸ºfalseåä¸å¯éæ© |
| | | }, |
| | | init() { |
| | | this.rightIds = this.value; |
| | | console.log(this.rightIds) |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | if (this.value.some((item) => item == this.dataList[i][this.keyName])) { |
| | | this.rightDataList.push(this.dataList[i]); |
| | | } else { |
| | | this.leftDataList.push(this.dataList[i]); |
| | | let that = this |
| | | that.rightIds = that.value; |
| | | for (let i = 0; i < that.dataList.length; i++) { |
| | | if (that.value.some((item) => item == that.dataList[i][that.keyName])) { |
| | | that.rightDataList.push(that.dataList[i]); |
| | | } |
| | | // else{ |
| | | // that.leftDataList.push(that.dataList[i]) |
| | | // } |
| | | that.leftDataList.push(that.dataList[i]) |
| | | |
| | | } |
| | | this.leftData = [...this.leftDataList]; |
| | | this.rightData = [...this.rightDataList]; |
| | | that.leftData = [...that.leftDataList]; |
| | | that.rightData = [...that.rightDataList]; |
| | | }, |
| | | |
| | | // leftå¤éæ¡é䏿°æ® |
| | | handleLeftSelectionChange(selection) { |
| | | this.leftIds = selection.map((item) => item[this.keyName]); |
| | |
| | | let a = this.leftIds.findIndex( |
| | | (item) => item == this.leftDataList[i][this.keyName] |
| | | ); |
| | | console.log(a) |
| | | if (a !== -1) { |
| | | let moveLefti = this.leftDataList[i];//左边ç½è¿æ¥ç |
| | | let moveLeftiKey = moveLefti['id']; |
| | | let isMove = true; |
| | | for (let j = 0; j < this.rightDataList.length; j++) { |
| | | let rifhtDataListi = this.rightDataList[j];//å³è¾¹å¾ªç¯åºæ¥çæ¯ä¸ä¸ª |
| | | let rightDataListiKey = rifhtDataListi['id'];//æ¯ä¸ä¸ªkey |
| | | if (rightDataListiKey == moveLeftiKey) { |
| | | isMove = false; |
| | | break; |
| | | } |
| | | } |
| | | if (isMove) { |
| | | this.rightDataList.push(this.leftDataList[i]); |
| | | // this.leftDataList[i].checked = true |
| | | // this.$refs.transferLeftTable.toggleRowSelection(this.leftDataList[i],true) |
| | | this.$delete(this.leftDataList, i); |
| | | i--; |
| | | this.leftDataList[i].checked = true |
| | | // this.$delete(this.leftDataList, i); |
| | | // i--; |
| | | } |
| | | } |
| | | // let obj = {} |
| | | // let filterright = this.rightDataList.reduce((cur, next) => { |
| | | // obj[next.id] ? "" : obj[next.id] = true && cur.push(next); |
| | | // return cur; |
| | | // }, []) |
| | | // console.log('filterright', filterright) |
| | | } |
| | | this.leftData = this.setData(this.leftDataList, this.searchLeft); |
| | | this.rightData = this.setData(this.rightDataList, this.searchRight); |
| | | this.$emit( |
| | |
| | | (item) => item == this.rightDataList[i][this.keyName] |
| | | ); |
| | | if (a !== -1) { |
| | | this.leftDataList.push(this.rightDataList[i]); |
| | | this.leftDataList[i].checked = false |
| | | // this.leftDataList.push(this.rightDataList[i]); |
| | | this.$delete(this.rightDataList, i); |
| | | i--; |
| | | } |
| | | } |
| | | // let obj = {} |
| | | // let filterleft = this.leftDataList.reduce((cur, next) => { |
| | | // obj[next.id] ? "" : obj[next.id] = true && cur.push(next); |
| | | // return cur; |
| | | // }, []) |
| | | // console.log('filterright', filterleft) |
| | | console.log(this.rightDataList) |
| | | this.leftData = this.setData(this.leftDataList, this.searchLeft); |
| | | this.rightData = this.setData(this.rightDataList, this.searchRight); |
| | | this.$emit( |
| | |
| | | // åé |
| | | handleLeftRowClick(row) { |
| | | if (this.leftData) { |
| | | this.$refs.transferLeftTable.toggleRowSelection(row) |
| | | this.$refs.transferTable.toggleRowSelection(row) |
| | | } else { |
| | | this.$refs.transferLeftTable.clearSelection() |
| | | this.$refs.transferTable.clearSelection() |
| | | } |
| | | }, |
| | | // åé |
| | |
| | | console.log(this.value) |
| | | }, |
| | | done() { |
| | | this.leftData = [] |
| | | this.leftDataList = [] |
| | | this.rightDataList = [] |
| | | this.rightData = [] |
| | | this.dialogVisible = false |
| | | }, |
| | | tableTransferSave() { |
| | | this.$emit('save', this.rightData) |
| | | this.leftData = [...this.rightData, ...this.leftData] |
| | | this.leftDataList = [...this.rightDataList, ...this.leftDataList] |
| | | this.rightDataList = [] |
| | | this.rightData = [] |
| | | this.done() |
| | | |
| | | } |
| | | |
| | | }, |
| | | // å
³éæ¸
é¤æææ°æ® |
| | | handelClose() { |
| | | this.$emit('close') |
| | | this.done() |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | disabledProp: ["id", 'lcstatus'],
|
| | | // 表åç±»å
|
| | | type: "add",
|
| | | templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
|
| | | codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
|
| | | templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
|
| | | codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
|
| | | codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
|
| | | rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9'
|
| | | };
|
| | |
| | | @coderuleoid="coderuleoidList" |
| | | :pageSize="this.pageSize" |
| | | :currentPage="this.currentPage" |
| | | :templateOid="this.templateOid" |
| | | @tableDataArray="tableDataArrays" |
| | | @tableHeadDataFateher="tableHeadDatas" |
| | | @total="totals" |
| | | @nodeClick="nodeClick" |
| | | ></master-tree> |
| | | </basic-container> |
| | | </el-aside> |
| | |
| | | :coderuleoid="this.coderuleoid" |
| | | @pageSize="pageSizes" |
| | | @currentPage="currentPages" |
| | | @templateOid="templateOids" |
| | | :tableDataArray="tableDataArray" |
| | | :total="this.total" |
| | | :tableHeadDataFateher="this.tableHeadDataFateher" |
| | | :isLoading="isLoading" |
| | | :templateOid="templateOid" |
| | | ></TableCrud> |
| | | </el-main> |
| | | </el-container> |
| | |
| | | templateOid:"", |
| | | tableDataArray:[], |
| | | tableHeadDataFateher:[], |
| | | total:"" |
| | | total:"", |
| | | isLoading: false, |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | currentPages(val){ |
| | | this.currentPage=val |
| | | }, |
| | | templateOids(val){ |
| | | this.templateOid=val |
| | | }, |
| | | tableDataArrays(val){ |
| | | this.tableDataArray=val |
| | | }, |
| | |
| | | }, |
| | | tableHeadDatas(val){ |
| | | this.tableHeadDataFateher=val |
| | | }, |
| | | nodeClick(val){ |
| | | this.templateOid=val; |
| | | console.log('val',val) |
| | | this.isLoading=true; |
| | | setTimeout(() => { |
| | | this.isLoading = false; |
| | | }, 2000); |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div> |
| | | <el-button @click="outerVisible = true">æµç¨æµè¯</el-button> |
| | | <el-button @click="visibleFlow = true">æ¨¡æ¿æµç¨</el-button> |
| | | <el-button @click="visibleStage = true">模æ¿é¶æ®µ</el-button> |
| | | <el-button @click="visibleTable = true">tableç©¿æ¢æ¡</el-button> |
| | | <el-button @click="handleTable">人å设置</el-button> |
| | | <flow-business :visible.sync="outerVisible"></flow-business> |
| | | <flow-path :visible.sync="visibleFlow" code="8b5e2017-990f-454a-9c39-4c4eeeb57553"></flow-path> |
| | | <stage :visible.sync="visibleStage" code="8b5e2017-990f-454a-9c39-4c4eeeb57553"></stage> |
| | | <table-transfer :visible.sync="visibleTable" v-model="value" :dataList="list" :columns="columns" keyName="id" |
| | | @change="change"></table-transfer> |
| | | <set-personnel :visible.sync="visibleFlow" code="8b5e2017-990f-454a-9c39-4c4eeeb57553" type="PUBLIC"></set-personnel> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import FlowBusiness from '@/components/template/Business' |
| | | import FlowPath from '@/components/template/FlowPath' |
| | | import Stage from '@/components/template/Stage' |
| | | import TableTransfer from '@/components/template/TableTransfer' |
| | | import SetPersonnel from '@/components/template/SetPersonnel' |
| | | export default { |
| | | components: { |
| | | FlowBusiness, |
| | | FlowPath, |
| | | Stage, |
| | | TableTransfer |
| | | SetPersonnel |
| | | }, |
| | | data() { |
| | | const getTables = () => { |
| | | let data = [] |
| | | for (let i = 0; i < 5; i++) { |
| | | let item = { |
| | | id: `${i+1}`, |
| | | name: 'name', |
| | | address: 'éå¢ç ', |
| | | data:'', |
| | | checked:false, |
| | | } |
| | | data.push(item) |
| | | } |
| | | return data |
| | | } |
| | | return { |
| | | list: getTables(), |
| | | value: [], |
| | | outerVisible: false, |
| | | visibleFlow: false, |
| | | visibleStage: false, |
| | | visibleTable: false, |
| | | |
| | | columns: [ |
| | | { |
| | | key: "id", |
| | | label: "id", |
| | | visible: false, |
| | | }, |
| | | { |
| | | key: "name", |
| | | label: "屿§ç¼å·", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "address", |
| | | label: "屿§åç§°", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "address", |
| | | label: "屿§åç»", |
| | | visible: true, |
| | | }, |
| | | ], |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | change(val) { |
| | | console.log(val); |
| | | console.log(this.value) |
| | | handleSave(event) { |
| | | console.log(event) |
| | | }, |
| | | handleTable(){ |
| | | this.visibleFlow = true |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | }, |
| | | async getDataList() { |
| | | this.loading = true |
| | | console.log(this.searchParam) |
| | | const { pageSize, currentPage, total } = this.page |
| | | let param = { size: pageSize, current: currentPage } |
| | | console.log(this.searchParam) |
| | | this.searchParam = Object.keys(this.searchParam) |
| | | .filter((key) => this.searchParam[key] !== null && this.searchParam[key] !== undefined && this.searchParam[key] !== "") |
| | | .reduce((acc, key) => ({ ...acc, [key]: this.searchParam[key] }), {}); |
| | | console.log(this.searchParam) |
| | | const response = await getList({ ...param, ...this.searchParam }) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | |
| | | }, |
| | | handleReset() { |
| | | this.searchParam = {} |
| | | this.getDataList() |
| | | }, |
| | | handleSearch(form, done) { |
| | | console.log(form) |
| | | const { id, groupCode, operationType } = form |
| | | let dataTime = { id, groupCode, operationType } |
| | | if (form.hasOwnProperty('createTime')) { |
| | |
| | | if (form.hasOwnProperty('lastModifyTime')) { |
| | | dataTime = { lastModifyTime: dateFormat(form.lastModifyTime), ...dataTime } |
| | | } |
| | | console.log(dataTime) |
| | | this.searchParam = dataTime |
| | | this.page.currentPage = 1 |
| | | this.getDataList() |
| | |
| | | @refresh-change="handleRefresh" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @selection-change="selectionChange" @row-click="handleRowClick"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">æ¥ è¯¢ |
| | | </el-button> |
| | | <!-- <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">æ¥ è¯¢ |
| | | </el-button> --> |
| | | <el-button icon="el-icon-delete" size="small" type="danger" @click="handleDeleteByIds">å é¤ |
| | | </el-button> |
| | | </template> |
| | |
| | | required: true, |
| | | message: 'ç³»ç»ç¼å·ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //åæ°éå¶ |
| | | }, { |
| | | label: 'ç³»ç»åç§°', |
| | | prop: 'name', |
| | |
| | | required: true, |
| | | message: 'ç³»ç»åç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //åæ°éå¶ |
| | | }, |
| | | { |
| | | label: 'ç³»ç»æè¿°', |
| | |
| | | console.log(this.search) |
| | | const { pageSize, currentPage } = this.page |
| | | let param = { size: pageSize, current: currentPage } |
| | | this.search = Object.keys(this.search) |
| | | .filter((key) => this.search[key] !== null && this.search[key] !== undefined && this.search[key] !== "") |
| | | .reduce((acc, key) => ({ ...acc, [key]: this.search[key] }), {}); |
| | | const response = await getSysInfoList({ ...param, ...this.search }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | |
| | | }, |
| | | // æ°å¢ |
| | | async handleSave(row, done, loading) { |
| | | try { |
| | | const response = await sysInfoAdd(row) |
| | | if (response.status === 200) { |
| | | loading() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'æ°å¢æ°æ®æåï¼' |
| | | }) |
| | | done() |
| | | this.$refs.crud.refreshTable() |
| | | this.getDataList() |
| | | done(row) |
| | | // this.$refs.crud.refreshTable() |
| | | // this.getDataList() |
| | | } |
| | | } catch { |
| | | loading() |
| | | } |
| | | }, |
| | | // ç¼è¾ |
| | | async handleEdit(row, index, done, loading) { |
| | | console.log(row) |
| | | try { |
| | | const { oid, id, name, description } = row |
| | | const response = await sysInfoEdit({ oid, id, name, description }) |
| | | if (response.status === 200) { |
| | |
| | | type: 'success', |
| | | message: 'ä¿®æ¹æ°æ®æåï¼' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | done(row) |
| | | } |
| | | } catch { |
| | | loading() |
| | | } |
| | | }, |
| | | // å é¤åæ¡ |
| | |
| | | <el-button-group> |
| | | <el-button type="primary" @click="businessAdd" size="small"> <i class="el-icon-plus"></i> æ°å¢</el-button> |
| | | <el-button type="primary" @click="businessEdit" size="small"><i class="el-icon-edit"></i> ä¿®æ¹</el-button> |
| | | <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i> ä»å·²æä¸è·å</el-button> |
| | | <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i> |
| | | ä»å·²æä¸è·å</el-button> |
| | | </el-button-group> |
| | | </el-header> |
| | | <el-container> |
| | |
| | | <basic-container> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">åºæ¬ä¿¡æ¯</p> |
| | | <el-descriptions class="margin-top" :column="3" :size="size" border> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.key"></i> |
| | | è±æåç§° |
| | | </template> |
| | | {{ obj.id }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.name"></i> |
| | | 䏿åç§° |
| | |
| | | {{ obj.name }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label" :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label" :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <i :class="icons.tableName"></i> |
| | | æ°æ®åºè¡¨å |
| | | </template> |
| | | {{ obj.tableName }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.domain"></i> |
| | | æå±é¢å |
| | |
| | | </template> |
| | | {{ obj.sss }} |
| | | </el-descriptions-item> --> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.revisionRule"></i> |
| | | çæ¬è§å |
| | | </template> |
| | | {{ obj.versionRule }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.lifeCycle"></i> |
| | | çå½å¨æ |
| | | </template> |
| | | {{ obj.lifeCycleId }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.view"></i> |
| | | è§å¾ |
| | |
| | | </template> |
| | | {{ obj.implClass }} |
| | | </el-descriptions-item> --> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" :contentStyle="descriptionOption.contentStyle"> |
| | | <el-descriptions-item :labelStyle="descriptionOption.labelStyle" |
| | | :contentStyle="descriptionOption.contentStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.desc"></i> |
| | | æè¿° |
| | |
| | | <div class="sep" style="height:7px"> |
| | | |
| | | </div> |
| | | <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange"> |
| | | <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" |
| | | @selection-change="selectionChange"> |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialoghandelfalse">å æ¶</el-button> |
| | |
| | | </el-dialog> |
| | | </el-container> |
| | | </el-container> |
| | | <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad"> |
| | | <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" |
| | | @refreshTable="initTreeOnLoad"> |
| | | </business-add> |
| | | </el-container> |
| | | </template> |
| | |
| | | }, |
| | | methods: { |
| | | nodeClick(data) { |
| | | if (data.oid) { |
| | | getDetail(data.oid).then(res => { |
| | | this.obj = res.data.data; |
| | | }) |
| | | }else{ |
| | | this.$message.warning('请ç¹å»åèç¹'); |
| | | } |
| | | }, |
| | | // åºæ¬ä¿¡æ¯æ·»å |
| | | basicSave(row, done, loading) { |
| | |
| | | .businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | } |
| | | |
| | | .attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{ |
| | | display: none !important; |
| | | } |
| | | |
| | | .businessTreeContainer > .el-card > .el-card__body { |
| | | height: 775px; |
| | | } |
| | | </style> |
| | | }</style> |
| | |
| | | this.addOption.linkType = JSON.parse(json); |
| | | this.$refs.linkAdd.linkType = this.addOption.linkType; |
| | | this.$refs.linkAdd.showSubmitDialog = true; |
| | | console.log(this.obj); |
| | | }, |
| | | // ä»å·²æä¸è·åæé®ç¹å»äºä»¶ |
| | | selectFromTable() { |
| | |
| | | searchMenuSpan:5, |
| | | highlightCurrentRow: true, |
| | | stripe:true, |
| | | viewBtn:false, |
| | | columnBtn:false, |
| | | column:[ |
| | | { |
| | | label: '', |
| | | label: 'éæ©', |
| | | prop: 'radio', |
| | | width: 120 |
| | | width: 120, |
| | | display:false |
| | | }, |
| | | { |
| | | label:'è±æåç§°', |
| | | prop: 'id' |
| | | prop: 'id', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'è±æåç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label:"䏿åç§°", |
| | | prop:"name", |
| | | search:true, |
| | | required: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '䏿åç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label:"è·³è·å符", |
| | |
| | | }, |
| | | { |
| | | label: "åå§å¼", |
| | | prop:"startCode" |
| | | prop:"startCode", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'åå§å¼ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "æ¥é¿", |
| | | prop: "serialStep" |
| | | prop: "serialStep", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'æ¥é¿ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "åç¼", |
| | |
| | | }) |
| | | }, |
| | | searchChange(params, done) { |
| | | if (done) done(); |
| | | this.params = params; |
| | | this.page.currentPage = 1; |
| | | this.getList(); |
| | | this.$message.success('æç´¢æå') |
| | | var p = {"name_like" : params.name} |
| | | getPage(this.page.currentPage,this.page.pageSize,p).then(res => { |
| | | const data = res.data.data |
| | | this.loading = false; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | }); |
| | | if (done) { |
| | | done(); |
| | | } |
| | | }, |
| | | refreshChange() { |
| | | this.getList(); |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside width="240px"> |
| | | <el-button @click="addHandlers"></el-button> |
| | | <basic-container style="margin-top: 10px"> |
| | | <avue-tree id="basic" :data="treeData" :option="treeOption" > |
| | | </avue-tree> |
| | | </basic-container> |
| | | </el-aside> |
| | | <basic-container > |
| | | <el-button type="primary" @click="dialogTableVisible=true" size="small">å建模æ¿</el-button> |
| | | <el-button type="primary" size="small" @click="addHandlers">ç¼è¾æ¨¡æ¿</el-button> |
| | | <el-button type="primary" size="small" @click="$refs.flow.addNode('ffff')">æ·»å èç¹</el-button> |
| | | <br/><br/> |
| | | <avue-flow ref="flow" v-model="form" :height="703" :option="option" :width="1500"> |
| | | <template slot="header" slot-scope="scope"> |
| | | <i class="el-icon-delete" @click="$refs.flow.deleteNode(scope.node.id)" style="margin-top: 8px"></i> |
| | | <basic-container class=""> |
| | | <avue-crud :data="data" :option="option" @refresh-change="gettableList" :table-loading="loading"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | @click="openDialog('add', {})" |
| | | >æ°å¢</el-button |
| | | > |
| | | </template> |
| | | <div slot-scope="{node}"> |
| | | <span>{{ (node || {}).name }}</span> |
| | | </div> |
| | | </avue-flow> |
| | | <!-- åå»ºå¯¹è¯æ¡--> |
| | | <el-dialog title="å建模æ¿" :visible.sync="dialogTableVisible" append-to-body> |
| | | <avue-form :data="addData" :option="addoption" v-model="forms"> |
| | | |
| | | <template slot="filetype"> |
| | | <el-select v-model="forms.select" slot="prepend" placeholder="è¯·éæ©" style="max-width: 300px"> |
| | | <el-option label="æµè¯1" value="1"></el-option> |
| | | <el-option label="æµè¯2" value="2"></el-option> |
| | | <el-option label="æµè¯3" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" @click="handelLife" style="display: inline-block;margin-left: 5px"> |
| | | æ·»å èµ·å§ç¶æ |
| | | </el-button> |
| | | <template slot-scope="{ row, index }" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | @click="openDialog('edit', row)" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-view" |
| | | size="mini" |
| | | @click="openDialog('detail', row)" |
| | | >é¢è§</el-button |
| | | > |
| | | </template></avue-crud |
| | | > |
| | | <el-dialog |
| | | :visible="visible" |
| | | :width="dialogWidth" |
| | | :title="title" |
| | | append-to-body |
| | | :before-close="() => {visible = false}" |
| | | top="10vh" |
| | | > |
| | | <CycleFlow |
| | | v-if="visible" |
| | | class="cycle_flow" |
| | | :type="type" |
| | | :chart-data="rowData.data || {}" |
| | | :chart-data-node-items="flowChartNodeItems" |
| | | :rowData="rowData" |
| | | ref="vueFlowchartEditor" |
| | | @save-data="save" |
| | | /> |
| | | <template #footer v-if="type !== 'detail'"> |
| | | <el-button type="primary" size="mini" @click="submit">ä¿å</el-button> |
| | | <el-button type="" size="mini" @click="visible = false">åæ¶</el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | |
| | | |
| | | </el-container> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import CycleFlow from "@/components/flow-cycle/flowchartEditor.vue"; |
| | | export default { |
| | | name: "cycle.vue", |
| | | components: { CycleFlow }, |
| | | data() { |
| | | return { |
| | | //模æ¿å¯¹è¯æ¡, |
| | | dialogTableVisible:false, |
| | | forms:{ |
| | | select:"" |
| | | }, |
| | | addData:[], |
| | | addoption:{ |
| | | formslot:true, |
| | | option: { |
| | | border: true, |
| | | align: "center", |
| | | menuAlign: "center", |
| | | menu: true, |
| | | delBtn: false, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | column:[ |
| | | { |
| | | label:"åç§°", |
| | | prop:"name" |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label:"æ ç¾", |
| | | prop:"tag" |
| | | prop: "label", |
| | | }, |
| | | { |
| | | label:"èµ·å§ç¶æ", |
| | | prop:"filetype", |
| | | formslot: true, |
| | | span:24 |
| | | prop: "startState", |
| | | }, |
| | | { |
| | | label: "æè¿°", |
| | | prop:"desc", |
| | | type:"textarea", |
| | | span:13 |
| | | } |
| | | ] |
| | | prop: "remark", |
| | | }, |
| | | count: 0, |
| | | form: {}, |
| | | treeData: [{ |
| | | value: 0, |
| | | label: 'çå½å¨ææ¨¡æ¿å表', |
| | | children: [ |
| | | { |
| | | value: 1, |
| | | label: 'A', |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: 'B', |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: 'C', |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: 'D', |
| | | }, |
| | | { |
| | | value: 5, |
| | | label: 'E', |
| | | } |
| | | ] |
| | | }], |
| | | treeOption: { |
| | | defaultExpandAll: true, |
| | | }, |
| | | option: { |
| | | nodeList: [ |
| | | { |
| | | "id": "nodeA", |
| | | "name": "æµç¨A-èç¹A", |
| | | "left": 39, |
| | | "top": 110, |
| | | }, |
| | | { |
| | | "id": "nodeB", |
| | | "name": "æµç¨A-èç¹B", |
| | | "left": 340, |
| | | "top": 161, |
| | | }, |
| | | { |
| | | "id": "nodeC", |
| | | "name": "æµç¨A-èç¹C", |
| | | "left": 739, |
| | | "top": 161, |
| | | }, |
| | | { |
| | | "id": "nodeD", |
| | | "name": "èç¹D", |
| | | "left": 739, |
| | | "top": 20, |
| | | } |
| | | ], |
| | | lineList: [ |
| | | }, |
| | | data: [ |
| | | { |
| | | "from": "nodeA", |
| | | "to": "nodeB" |
| | | name: "ææ¯name", |
| | | label: "ææ¯label", |
| | | startState: "ææ¯startState", |
| | | remark: "ææ¯remark", |
| | | data: { |
| | | nodes: [ |
| | | { |
| | | type: "node", |
| | | size: "80*48", |
| | | shape: "flow-rect", |
| | | color: "#1890FF", |
| | | label: "Auditing", |
| | | x: 110.50303650877106, |
| | | y: 59.22389408123915, |
| | | id: "Auditing", |
| | | index: 0, |
| | | }, |
| | | { |
| | | "from": "nodeB", |
| | | "to": "nodeC" |
| | | type: "node", |
| | | size: "80*48", |
| | | shape: "flow-rect", |
| | | color: "#1890FF", |
| | | label: "Editing", |
| | | x: 120.87992069414531, |
| | | y: 156.76660542375714, |
| | | id: "Editing", |
| | | index: 1, |
| | | }, |
| | | { |
| | | "from": "nodeC", |
| | | "to": "nodeD" |
| | | } |
| | | ] |
| | | type: "node", |
| | | size: "80*48", |
| | | shape: "flow-rect", |
| | | color: "#1890FF", |
| | | label: "Released", |
| | | x: 100.12615232339681, |
| | | y: 252.2339399292003, |
| | | id: "Released", |
| | | index: 2, |
| | | }, |
| | | computed: { |
| | | nodeList() { |
| | | return this.option.nodeList |
| | | } |
| | | ], |
| | | edges: [ |
| | | { |
| | | source: "Auditing", |
| | | sourceAnchor: 1, |
| | | target: "Released", |
| | | targetAnchor: 1, |
| | | }, |
| | | mounted() { |
| | | this.form = this.nodeList[this.count].id; |
| | | { |
| | | source: "Editing", |
| | | sourceAnchor: 3, |
| | | target: "Auditing", |
| | | targetAnchor: 3, |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | title: "é¢è§çå½å¨ææµç¨å¾", |
| | | visible: false, |
| | | flowChartNodeItems: [], |
| | | rowData: {}, |
| | | dialogWidth: "50%", |
| | | type: "detail", |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleClick(node) { |
| | | this.$message.success(JSON.stringify(node)) |
| | | console.log(node) |
| | | gettableList() { |
| | | this.loading = true |
| | | }, |
| | | addHandler(){ |
| | | this.dialogTableVisible=true |
| | | console.log(1) |
| | | openDialog(type, row) { |
| | | if (type === "detail") { |
| | | this.title = "é¢è§çå½å¨ææµç¨å¾"; |
| | | this.dialogWidth = "50%"; |
| | | } else if (type === "edit") { |
| | | this.title = "ç¼è¾çå½å¨ææµç¨å¾"; |
| | | this.dialogWidth = "95%"; |
| | | } else if (type === "add") { |
| | | this.title = "æ°å¢çå½å¨ææµç¨å¾"; |
| | | this.dialogWidth = "95%"; |
| | | } |
| | | this.type = type; |
| | | this.rowData = row; |
| | | this.visible = true; |
| | | }, |
| | | |
| | | handelLife(){ |
| | | console.log("ç¹å»æå") |
| | | async submit() { |
| | | const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData(); |
| | | if (!newRowData) { |
| | | return; |
| | | } |
| | | const flowData = this.$refs.vueFlowchartEditor.getFlowData(); |
| | | console.log(JSON.stringify(flowData)); |
| | | }, |
| | | addHandlers(){ |
| | | console.log(111) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | #basic { |
| | | height: 761px; |
| | | border-radius: 10px; |
| | | <style lang="scss" scoped> |
| | | /deep/ .el-dialog__body { |
| | | padding: 0 20px; |
| | | } |
| | | .cycle_flow { |
| | | height: 600px !important; |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | |
| | | <el-radio v-model="selectRow" :label="row.$index"> |
| | | </el-radio> |
| | | </template> |
| | | <template slot="menu"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave">å é¤</el-button> |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave(row,index)">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave(row,index)">å é¤</el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave">æ° å¢ |
| | | </el-button> |
| | | <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | <el-input placeholder="æå±æ§è±æåç§°æ¥è¯¢" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch" |
| | | size="small" @change="doSearch" type="text"></el-input> |
| | | <el-button size="small" plain type="primary" icon="el-icon-search" @click="doSearch"> æç´¢</el-button> |
| | | </template> |
| | | <template slot="typeValue" slot-scope="{row}"> |
| | | <el-tag>{{ row.typeValue }}</el-tag> |
| | |
| | | </el-tabs> |
| | | </basic-container> |
| | | </el-aside> |
| | | <originalAdd ref="originalAdd" :attribute="attribute" @refreshTable="refreshChange"></originalAdd> |
| | | <originalAdd ref="originalAdd" @refreshTable="refreshChange"></originalAdd> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | attribute: { |
| | | nullable: true |
| | | }, |
| | | editAttibute: {}, |
| | | applyRangeData: [], |
| | | option: { |
| | | height: "550px", |
| | |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | columnBtn:false, |
| | | column: [{ |
| | | label: "éæ©", |
| | | prop: "radio", |
| | |
| | | itemData: {}, |
| | | activeName: "referTab", |
| | | form: {} |
| | | } |
| | | }, |
| | | searchId: '', |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.$refs.originalAdd.showSubmitDialog = true; |
| | | this.$refs.originalAdd.attribute = {}; |
| | | }, |
| | | updateSave() { |
| | | updateSave(row,index) { |
| | | this.selectRow = index; |
| | | var json = JSON.stringify(row); |
| | | this.editAttibute = JSON.parse(json); |
| | | this.editAttibute.nullable = row.nullable == 'true' ? true : false; |
| | | this.$refs.originalAdd.attribute = this.editAttibute; |
| | | this.$refs.originalAdd.showSubmitDialog = true; |
| | | this.$refs.originalAdd.attribute = this.attribute; |
| | | this.refreshChange() |
| | | }, |
| | | deleteSave() { |
| | | remove(this.itemForm.itemData).then(res => { |
| | | deleteSave(row,index) { |
| | | console.log(row); |
| | | remove(row.oid).then(res => { |
| | | this.$message.success("å 餿å"); |
| | | }); |
| | | this.refreshChange(); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | |
| | | |
| | | }); |
| | | }, |
| | | doSearch(){ |
| | | var params = {"id_like":this.searchId}; |
| | | this.onLoad(this.page,params); |
| | | } |
| | | }, |
| | | components: { Versionpackage } |
| | | } |
| | |
| | | .applyRangeTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | .attrSearch { |
| | | width:201px; |
| | | } |
| | | .attrSearch > .el-input__inner { |
| | | width: 200px; |
| | | } |
| | | </style> |
| | |
| | | <el-switch v-model="attribute.nullable" active-text="å
许" inactive-text="ä¸å
许"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦" label-width="100px" prop="maxLength"> |
| | | <el-input-number v-model="attribute.maxLength" :min="1" :max="4000" :step="1" controls-position="right"></el-input-number> |
| | | <el-input-number v-model="attribute.maxLength" :min="1" :max="4000" :step="1" |
| | | controls-position="right"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="精度" label-width="100px" v-if="attribute.typeValue == 'VTDouble'"> |
| | | <el-input-number v-model="attribute.precision" :min="1" :max="20" :step="1" controls-position="right" @change="changeNumber"></el-input-number> |
| | | <el-form-item label="精度" label-width="100px" v-if="attribute.typeKey == 'VTDouble'"> |
| | | <el-input-number v-model="attribute.precision" :min="1" :max="20" :step="1" controls-position="right" |
| | | @change="changeNumber"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" label-width="100px"> |
| | | <el-input v-model="attribute.description" type="text"></el-input> |
| | |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="btmTable" :option="btmRefer.option" :data="btmRefer.data" class="btmTable" @row-click="btmReferClick"> |
| | | <avue-crud ref="btmTable" :option="btmRefer.option" :data="btmRefer.data" class="btmTable" |
| | | @row-click="btmReferClick"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="btmRefer.selectRow" :label="row.$index"> |
| | | </el-radio> |
| | |
| | | <!-- éæ©æä¸¾æ¶çå¼¹çª --> |
| | | <el-dialog title="æä¸¾å表" :visible.sync="enumRefer.show" append-to-body @close="closeEnumDialog" width="70%" |
| | | style="height: 115vh;"> |
| | | <avue-crud ref="eunmTable" :option="enumRefer.option" :data="enumRefer.data" class="enumTable" @row-click="enumReferClick" :page.sync="enumRefer.enumPage"> |
| | | <avue-crud ref="eunmTable" :option="enumRefer.option" :data="enumRefer.data" class="enumTable" |
| | | @row-click="enumReferClick" :page.sync="enumRefer.enumPage"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="enumRefer.selectRow" :label="row.$index"> |
| | | </el-radio> |
| | |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | submitAttribute() { |
| | | add(this.attribute).then(res => { |
| | | this.$message.success("ä¿åæå"); |
| | | this.showSubmitDialog = false; |
| | | this.attribute = {}; |
| | | this.$emit('refreshTable'); |
| | | const that = this; |
| | | this.$refs.form.validate(function (pass, field) { |
| | | if (pass) { |
| | | add(that.attribute).then(res => { |
| | | that.$message.success("ä¿åæå"); |
| | | that.showSubmitDialog = false; |
| | | that.attribute = {}; |
| | | that.$emit('refreshTable'); |
| | | }); |
| | | |
| | | } else { |
| | | that.$message.error('å¿
å¡«'); |
| | | } |
| | | }) |
| | | }, |
| | | cancleSubmit() { |
| | | this.closeSubmitDialog(); |
| | |
| | | this.btmRefer.selectItem = {}; |
| | | this.btmRefer.selectRow = ''; |
| | | }, |
| | | handleClick(tab){ |
| | | // å 为åªè½åç
§åæä¸¾äºéä¸ãæä»¥å¨åæ¢çæ¶åæå±æ§ç»æ¸
空ã |
| | | this.$delete(this.attribute,'referTypeCode'); |
| | | this.$delete(this.attribute,'referTypeKey'); |
| | | this.$delete(this.attribute,'referTypeValue'); |
| | | this.$delete(this.attribute,'referToId'); |
| | | this.$delete(this.attribute,'referToName'); |
| | | this.$delete(this.attribute,'dictCode'); |
| | | this.$delete(this.attribute,'dictKey'); |
| | | this.$delete(this.attribute,'dictValue'); |
| | | this.$delete(this.attribute,'usingDict'); |
| | | } |
| | | // handleClick(tab){ |
| | | // // å 为åªè½åç
§åæä¸¾äºéä¸ãæä»¥å¨åæ¢çæ¶åæå±æ§ç»æ¸
空ã |
| | | // this.$delete(this.attribute,'referTypeCode'); |
| | | // this.$delete(this.attribute,'referTypeKey'); |
| | | // this.$delete(this.attribute,'referTypeValue'); |
| | | // this.$delete(this.attribute,'referToId'); |
| | | // this.$delete(this.attribute,'referToName'); |
| | | // this.$delete(this.attribute,'dictCode'); |
| | | // this.$delete(this.attribute,'dictKey'); |
| | | // this.$delete(this.attribute,'dictValue'); |
| | | // this.$delete(this.attribute,'usingDict'); |
| | | // } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | .attributeForm>.el-form-item>.el-form-item__content> .el-select>.el-input>.el-input__inner { |
| | | width: 200px; |
| | | } |
| | | </style> |
| | | }</style> |
| | |
| | | stripe:true, |
| | | column:[ |
| | | { |
| | | label: '', |
| | | label: 'éæ©', |
| | | prop: 'radio', |
| | | width: 120 |
| | | width: 120, |
| | | display: false |
| | | }, |
| | | { |
| | | label:'è±æåç§°', |
| | | prop: 'id', |
| | | search: true |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: 'è±æåç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label:'䏿åç§°', |
| | | prop:'name', |
| | | search:true, |
| | | rules: [{ |
| | | required: true, |
| | | message: '䏿åç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | |
| | | }) |
| | | }, |
| | | searchChange(params, done) { |
| | | if (done) done(); |
| | | this.params = params; |
| | | this.loading = true; |
| | | this.page.currentPage = 1; |
| | | this.getList(); |
| | | const p = {}; |
| | | if(params.id){ |
| | | p["id_like"] = params.id; |
| | | } |
| | | if(params.name){ |
| | | p["name_like"] = params.name |
| | | } |
| | | getPage(this.page.currentPage,this.page.pageSize,p).then(res => { |
| | | const data = res.data.data |
| | | this.loading = false; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | done(); |
| | | }) |
| | | this.$message.success('æç´¢æå') |
| | | }, |
| | | refreshChange() { |
| | |
| | | // getOnesearch, |
| | | getadd, |
| | | getupdata, |
| | | getremove |
| | | getremove, |
| | | combination |
| | | } from "@/api/system/passwords"; |
| | | export default { |
| | | name: "passwords.vue", |
| | |
| | | message: "è¯·éæ©ç»åæ¹æ³", |
| | | trigger: "blur" |
| | | }], |
| | | dicData: [ |
| | | { |
| | | label: "æ°å", |
| | | value: '1638024706425188354' |
| | | dicUrl: '/api/ubcs-system/combination/select', |
| | | dicMethod: 'get', |
| | | props: { |
| | | value: "ID", |
| | | label: "NAME", |
| | | }, |
| | | { |
| | | label: "符å·", |
| | | value: '1638097837516926977' |
| | | }, |
| | | { |
| | | label: "å°å忝", |
| | | value: '1638097772983365634' |
| | | }, |
| | | { |
| | | label: "大å忝", |
| | | value: '1638097733707902977' |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'å¿
å¡«ç§ç±»', |
| | |
| | | }], |
| | | dicData:[{ |
| | | label:'1ç§', |
| | | value:0, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'2ç§', |
| | | value:1, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'3ç§', |
| | | label:'2ç§', |
| | | value:2, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'4ç§', |
| | | label:'3ç§', |
| | | value:3, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'4ç§', |
| | | value:4, |
| | | disabled:false |
| | | } |
| | | ] |
| | |
| | | }, |
| | | created() { |
| | | this.onLoad() |
| | | combination().then(res=>{ |
| | | console.log("111",res) |
| | | }) |
| | | }, |
| | | mount() { |
| | | }, |
| | |
| | | }); |
| | | done(row) |
| | | this.onLoad() |
| | | console.log(res) |
| | | }).catch((res)=>{ |
| | | console.log(res) |
| | | this.$message.warning(res) |
| | | }) |
| | | }, |
| | | rowEdit(row){ |
| | |
| | | // this.loading = false; |
| | | // this.selectionClear(); |
| | | console.log(res) |
| | | this.page.total=res.data.data.totalElements |
| | | this.data=res.data.data.content |
| | | this.page.total=res.data.data.total |
| | | this.data=res.data.data.records |
| | | }); |
| | | } |
| | | } |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | <style lang="scss" scoped> |
| | | </style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | option: { |
| | | lazy: true, |
| | | tip: false, |
| | | simplePage: true, |
| | | height:'auto', |
| | | maxHeight:600, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | tree: true, |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | getLazyList(this.parentId,Object.assign(params, this.query),this.page.currentPage, this.page.pageSize).then(res => { |
| | | this.data = res.data.data.records; |
| | | this.page.total=res.data.data.total |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | resolve(res.data.data.records); |
| | | }); |
| | | } |
| | | } |
| | |
| | | }) |
| | | //è¦ä¼ éçidï¼ä¸ä¸ªæ¯æ°ç»å¦ä¸ä¸ªæ¯å符串 |
| | | this.UserPwdstrategyVO.userIds=this.selid; |
| | | this.UserPwdstrategyVO.pwdstrategyId=this.id; |
| | | this.UserPwdstrategyVO.pwdstrategyId=this.id |
| | | |
| | | //è¯·æ± |
| | | insert(this.UserPwdstrategyVO).then(()=>{ |
| | | insert(this.UserPwdstrategyVO.userIds).then(()=>{ |
| | | this.passVisible=false |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | if (this.selectionList.length === 1) { |
| | | this.roleTreeObj = this.selectionList[0].roleId.split(","); |
| | | } |
| | | getRoleTree(this.selectionList[0].tenantId).then(res => { |
| | | getRoleTree().then(res => { |
| | | this.roleGrantList = res.data.data; |
| | | this.roleBox = true; |
| | | |
| | | }); |
| | | }, |
| | | handlePlatform() { |
| | |
| | | '/api': { |
| | | //æ¬å°æå¡æ¥å£å°å |
| | | target: 'http://localhost:37000', |
| | | // target: 'http://localhost:37000', |
| | | // target: 'http://192.168.1.51:37000', |
| | | // target: 'http://192.168.1.46:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | |
| | | //target: 'http://192.168.3.7:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | //target: 'http://192.168.1.51:37000/', |
| | | // target:'http://192.168.1.104:37000', |
| | | //è¿ç¨æ¼ç¤ºæå¡å°å,å¯ç¨äºç´æ¥å¯å¨é¡¹ç® |
| | | // target: 'https://saber.bladex.vip/api', |
| | | ws: true, |
| | |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-util-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-user-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | </project> |
| | |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-tenant</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-util-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.bo; |
| | | |
| | | import com.vci.ubcs.resource.vo.FileObjectVO; |
| | | import lombok.Data; |
| | | |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * æä»¶çä¸å¡å¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Data |
| | | public class FileObjectBO extends FileObjectVO { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -4887973911424096779L; |
| | | /** |
| | | * æä»¶çæµ |
| | | */ |
| | | private InputStream inputStream; |
| | | |
| | | /** |
| | | * æä»¶æ¬å°çä¿¡æ¯ |
| | | */ |
| | | private String fileLocalPath; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.constant; |
| | | |
| | | /** |
| | | * æä»¶æå¡é¨åçéæå¼ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | public class FileBusConstant { |
| | | |
| | | /** |
| | | * æä»¶å¯¹è±¡ |
| | | */ |
| | | public static final String FILE_OBJECT = "fileObject"; |
| | | |
| | | /** |
| | | * æä»¶ä¸è½½è®°å½ |
| | | */ |
| | | public static final String FILE_DOWNLOAD_RECORD = "fileDownloadRecord"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.constant; |
| | | |
| | | /** |
| | | * æä»¶ç¶æ |
| | | * @author weidy |
| | | * @date 2023/6/9 9:07 |
| | | */ |
| | | public class FileLifeConstant { |
| | | |
| | | /** |
| | | * æä»¶çç¶æ |
| | | */ |
| | | public static final String FILE = "fileStatus"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.dto; |
| | | |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æä»¶æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Data |
| | | public class FileObjectDTO extends FileObject { |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 497836915363113260L; |
| | | |
| | | |
| | | /** |
| | | * æ¯å¦ä¿®æ¹æä»¶ |
| | | */ |
| | | private Boolean updateFileFlag ; |
| | | |
| | | |
| | | /** |
| | | * æä»¶å¤¹è·¯å¾ |
| | | */ |
| | | private String dirPath; |
| | | |
| | | |
| | | /** |
| | | * æä»¶ä¸ä¼ 忝å¦ç«å³çæ |
| | | */ |
| | | private Boolean effect = true; |
| | | |
| | | /** |
| | | * ä¸ä¼ åæä»¶è·¯å¾ |
| | | */ |
| | | private String sourceFilePath; |
| | | |
| | | /** |
| | | * æ ¡éªç¸åçåç§°çæä»¶ï¼å¿
é¡»å¨ownbizæå¼çæ
åµä¸ |
| | | */ |
| | | private Boolean checkSameFile = false; |
| | | |
| | | /** |
| | | * æ¡¶çåç§° |
| | | */ |
| | | private String bucketName; |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä»¶åå¸çæ°æ®æä½å¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Data |
| | | public class FileReleaseDTO implements java.io.Serializable{ |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -218379391237684940L; |
| | | /** |
| | | * æå±æ°æ®ä¸»é® |
| | | */ |
| | | private String ownbizOid; |
| | | |
| | | /** |
| | | * æå±æ°æ®çä¸å¡ç±»å |
| | | */ |
| | | private String ownBtmName; |
| | | |
| | | /** |
| | | * æä»¶çä¸»é® |
| | | */ |
| | | private List<String> oids; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä»¶åäº«çæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Data |
| | | public class FileShareDTO implements java.io.Serializable{ |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -2947163604655993790L; |
| | | /** |
| | | * æ¥æºä¸å¡ |
| | | */ |
| | | private String sourceBus; |
| | | /** |
| | | * æ¥æºä¸å¡æ°æ®ä¸»é® |
| | | */ |
| | | private String sourceBusOid; |
| | | /** |
| | | * ç®æ çä¸å¡ |
| | | */ |
| | | private String targetBus; |
| | | /** |
| | | * ç®æ çä¸å¡æ°æ®ä¸»é® |
| | | */ |
| | | private String targetBusOid; |
| | | /** |
| | | * æºæä»¶çä¸»é® |
| | | */ |
| | | private List<String> oids; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * æä»¶å¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/8 |
| | | */ |
| | | @Data |
| | | @TableName("PL_SYS_FILEOBJECT") |
| | | @ApiModel(value = "æä»¶å¯¹è±¡", description = "åå¨ä¸å¡æ°æ®å
³èçæä»¶ä¿¡æ¯") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class FileObject extends BaseModel { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = -7116754635114431150L; |
| | | |
| | | /** |
| | | * æ¾ç¤ºçåç§° |
| | | */ |
| | | private String id; |
| | | /** |
| | | * æä»¶åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * å¨minioéçåç§° |
| | | */ |
| | | private String objectName; |
| | | |
| | | /** |
| | | * æä»¶åç¼å |
| | | */ |
| | | private String fileExtension; |
| | | |
| | | /** |
| | | * ææ¡£ç±»åç¼å· |
| | | */ |
| | | private String fileDocClassify; |
| | | |
| | | /** |
| | | * ææ¡£ç±»åææ¬ |
| | | */ |
| | | private String fileDocClassifyName; |
| | | |
| | | /** |
| | | * æä»¶å¤§å° |
| | | */ |
| | | private Long fileSize; |
| | | |
| | | /** |
| | | * å
³é®è¯ä¿¡æ¯ |
| | | */ |
| | | private String keyInfos; |
| | | |
| | | /** |
| | | * æå±æ°æ®ä¸»é® |
| | | */ |
| | | private String ownbizOid; |
| | | |
| | | /** |
| | | * æå±æ°æ®çä¸å¡ç±»å |
| | | */ |
| | | private String ownBtmName; |
| | | |
| | | /** |
| | | * å
³èçæ°æ®çä¿¡æ¯ |
| | | */ |
| | | private String linkInfos; |
| | | |
| | | /** |
| | | * æä»¶çåå¨è·¯å¾ |
| | | */ |
| | | private String fileLink; |
| | | |
| | | /** |
| | | * æ¡¶çåç§° |
| | | */ |
| | | private String bucketName; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.life; |
| | | import com.vci.ubcs.starter.web.enumpck.BaseEnum; |
| | | |
| | | /** |
| | | * æä»¶çç¶æéå |
| | | * @author weidy |
| | | * @date 2023/6/11 |
| | | */ |
| | | public enum FileLife implements BaseEnum { |
| | | /** |
| | | * åå§å |
| | | */ |
| | | INIT("fileInit","åå§å"), |
| | | |
| | | /** |
| | | * ä¸ä¼ ä¸ |
| | | */ |
| | | TRANSITING("fileTransiting","ä¸ä¼ ä¸"), |
| | | |
| | | /** |
| | | * ä¸ä¼ 宿 |
| | | */ |
| | | TRANS_FINISH("fileTransitFinish","ä¸ä¼ 宿"), |
| | | |
| | | /** |
| | | * å·²çæ |
| | | */ |
| | | FILE_RELEASE("fileRelease","å·²çæ"); |
| | | |
| | | /** |
| | | * æä¸¾å¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºå¼ |
| | | */ |
| | | private String text; |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¾ç¤ºææ¬ |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æä¸¾å
é¨æé æ¹æ³ |
| | | * @param value æä¸¾å¼ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | private FileLife(String value, String text){ |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.query; |
| | | |
| | | |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æä»¶çæ¥è¯¢ |
| | | * @author weidy |
| | | * @date 2023/1/31 |
| | | */ |
| | | @Data |
| | | public class FileQuery extends FileObject { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 2442917107957942183L; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime_begin; |
| | | |
| | | /** |
| | | * å建æ¶é´ç»æ |
| | | */ |
| | | private Date createTime_end; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.utils; |
| | | |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.MediaTypeFactory; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶çå·¥å
· |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Slf4j |
| | | public class FileDownloadUtil { |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶ |
| | | * @param response ååºå¯¹è±¡ |
| | | * @param fileObjectBO æä»¶çä¿¡æ¯ï¼å
嫿件çè¾å
¥æµ |
| | | * @throws IOException ä¸è½½å¼å¸¸ä¼æåº |
| | | */ |
| | | public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO) throws IOException { |
| | | downloadFile(response,fileObjectBO,true); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶ |
| | | * @param response ååºå¯¹è±¡ |
| | | * @param fileObjectBO æä»¶çä¿¡æ¯ï¼å
嫿件çè¾å
¥æµ |
| | | * @param closeInputStream æ¯å¦å
³éæµ |
| | | * @throws IOException ä¸è½½åºéçæ¶åæåºå¼å¸¸ |
| | | */ |
| | | public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO,boolean closeInputStream) throws IOException { |
| | | MediaType mediaType = MediaTypeFactory.getMediaType(fileObjectBO.getName() + "." + fileObjectBO.getFileExtension()).orElse(MediaType.APPLICATION_OCTET_STREAM); |
| | | // 设置强å¶ä¸è½½ä¸æå¼ |
| | | response.setContentType(mediaType.getType()); |
| | | try{ |
| | | String fileName = URLEncoder.encode(fileObjectBO.getName() + "." + fileObjectBO.getFileExtension(), "UTF8"); |
| | | response.addHeader("Content-Disposition", "attachment; filename="+ fileName+ ";filename*=utf-8''" + fileName); |
| | | }catch(Exception e){ |
| | | if(log.isErrorEnabled()){ |
| | | log.error("设置æä»¶çåç§°å°ååºæµçæ¶ååºé",e); |
| | | } |
| | | } |
| | | response.setCharacterEncoding("UTF-8"); |
| | | Cookie cookie = new Cookie("fileDownload", "true"); |
| | | cookie.setPath("/"); |
| | | response.addCookie(cookie); |
| | | if(closeInputStream) { |
| | | try (InputStream ins = (fileObjectBO.getInputStream() != null ? fileObjectBO.getInputStream() : new FileInputStream(fileObjectBO.getFileLocalPath()))) { |
| | | IOUtils.copy(ins, response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | //æå¯è½å®¢æ·ç«¯ç龿¥ |
| | | if (log.isErrorEnabled()) { |
| | | log.error("åå
¥æä»¶å°ååºæµåºé", e); |
| | | } |
| | | throw e; |
| | | } |
| | | }else{ |
| | | try { |
| | | InputStream ins = (fileObjectBO.getInputStream() != null ? fileObjectBO.getInputStream() : new FileInputStream(fileObjectBO.getFileLocalPath())); |
| | | IOUtils.copy(ins, response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | //æå¯è½å®¢æ·ç«¯ç龿¥ |
| | | if (log.isErrorEnabled()) { |
| | | log.error("åå
¥æä»¶å°ååºæµåºé", e); |
| | | } |
| | | throw e; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.utils; |
| | | |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.boot.system.ApplicationHome; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.*; |
| | | import java.nio.channels.FileChannel; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¬å°æä»¶æä½ç±» |
| | | * @author weidy |
| | | * @date 2021-04-19 |
| | | */ |
| | | public class FileUtil { |
| | | |
| | | /** |
| | | * å 餿件夹 |
| | | * @param file è¦å é¤çæä»¶æè
æä»¶å¤¹ |
| | | */ |
| | | public static void deleteFile(File file) { |
| | | if(file == null || !file.exists()){ |
| | | return; |
| | | } |
| | | if (file.isDirectory()) { |
| | | File[] files = file.listFiles(); |
| | | for (int i = 0; i < files.length; i++) { |
| | | deleteFile(files[i]); |
| | | } |
| | | } |
| | | file.delete(); |
| | | } |
| | | |
| | | /** |
| | | * æ·è´æä»¶ |
| | | * @param source æºæä»¶ |
| | | * @param target ç®æ æä»¶ |
| | | * @throws VciBaseException æ·è´æä»¶åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static void copyFile(File source, File target) throws VciBaseException { |
| | | try(FileInputStream is = new FileInputStream(source); |
| | | FileOutputStream os = new FileOutputStream(target)){ |
| | | FileChannel sourceChannel = is.getChannel(); |
| | | FileChannel targetChannel = os.getChannel(); |
| | | int i=0; |
| | | int length=2097152; |
| | | while(true){ |
| | | if(sourceChannel.position()==sourceChannel.size()){ |
| | | sourceChannel.close(); |
| | | targetChannel.close(); |
| | | break; |
| | | } |
| | | if((sourceChannel.size()-sourceChannel.position())<20971520) { |
| | | length = (int) (sourceChannel.size() - sourceChannel.position()); |
| | | }else { |
| | | length = 20971520; |
| | | } |
| | | sourceChannel.transferTo(sourceChannel.position(),length,targetChannel); |
| | | sourceChannel.position(sourceChannel.position()+length); |
| | | i++; |
| | | } |
| | | }catch(Throwable e){ |
| | | throw new VciBaseException("æ·è´æä»¶åºé",new String[0],e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸´æ¶æä»¶å¤¹çåç¼ |
| | | */ |
| | | public static String DEFAULT_TEMP_FOLDER_PREFIX = ""; |
| | | |
| | | /** |
| | | * è·åé»è®¤çä¸´æ¶æä»¶å¤¹ |
| | | * @return ä¸´æ¶æä»¶å¤¹ï¼é»è®¤ä¸ºå½å项ç®çè¿è¡è·¯å¾ä¸çtempFolderä¸çéæºå¼ |
| | | */ |
| | | public static String getDefaultTempFolder() throws VciBaseException{ |
| | | String path = (!StringUtils.hasLength(DEFAULT_TEMP_FOLDER_PREFIX)?getProjectFolder():DEFAULT_TEMP_FOLDER_PREFIX) + File.separator + "temp" + File.separator + VciBaseUtil.getPk(); |
| | | File folder = new File(path); |
| | | if(!folder.exists()){ |
| | | folder.mkdirs(); |
| | | } |
| | | return path; |
| | | } |
| | | |
| | | /** |
| | | * è·å项ç®çè·¯å¾ |
| | | * @return 项ç®çè·¯å¾ |
| | | * @throws VciBaseException è·åè·¯å¾åºç°äºéè¯¯ä¼æåºå¼å¸¸ |
| | | */ |
| | | public static String getProjectFolder() throws VciBaseException{ |
| | | return getProjectFolder(FileUtil.class); |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸ªclassæå¨é¡¹ç®çè·¯å¾ |
| | | * @param classObj æä¸ªclass |
| | | * @return 项ç®çè·¯å¾ |
| | | * @throws VciBaseException è·åè·¯å¾åºç°äºéè¯¯ä¼æåºå¼å¸¸ |
| | | */ |
| | | public static String getProjectFolder(Class classObj) throws VciBaseException{ |
| | | String path = ""; |
| | | try { |
| | | ApplicationHome h = new ApplicationHome(classObj == null? FileUtil.class:classObj); |
| | | File jarF = h.getSource(); |
| | | if(jarF == null){ |
| | | jarF = h.getDir(); |
| | | } |
| | | path = jarF.getParentFile().toString(); |
| | | if(path.contains("!")){ |
| | | path = new File(path).getParentFile().getParent(); |
| | | } |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("è·åå½åæå¡æå¨çæä»¶å¤¹åºç°äºé误",new String[0],e); |
| | | } |
| | | if(path.startsWith("file:\\")){ |
| | | path = path.substring(6); |
| | | } |
| | | if (System.getProperty("os.name").toLowerCase().startsWith("win") && path.startsWith("/")) { |
| | | path = path.substring(path.indexOf("/") + 1); |
| | | } |
| | | return path; |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸´æ¶æä»¶ |
| | | * @param tempFile ä¸´æ¶æä»¶ |
| | | * @param deleteRandomFolder æ¯å¦å é¤éæºçé£ä¸ªæä»¶å¤¹ |
| | | * @throws VciBaseException å é¤åºéçæ¶åæåºå¼å¸¸ |
| | | */ |
| | | public static void deleteTempFile(File tempFile,boolean deleteRandomFolder) throws VciBaseException{ |
| | | if(tempFile!=null){ |
| | | tempFile.delete(); |
| | | if(deleteRandomFolder){ |
| | | tempFile.getParentFile().delete(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 夿忰æ¯å¦ä¸ºç©º |
| | | * @param s åæ°ï¼ç¬¬ä¸ä¸ªä¸ºåæ°ï¼ç¬¬äºä¸ªä¸ºæç¤ºä¿¡æ¯ |
| | | * @throws VciBaseException ä¸ºç©ºæ¶æåºè¿ä¸ªå¼å¸¸ |
| | | */ |
| | | public static void alertNotNull(Object... s) throws VciBaseException{ |
| | | if(s!=null && s.length>0){ |
| | | for(int i = 0 ; i < s.length ; i ++){ |
| | | Object obj = s[i]; |
| | | if(obj==null ||!StringUtils.hasLength(obj.toString())){ |
| | | String param = ""; |
| | | try{ |
| | | i++; |
| | | param = s[i].toString(); |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | throw new VciBaseException("åæ°[" + param + "]ä¸è½ä¸ºç©º"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶çåç¼å |
| | | * @param file æä»¶å¯¹è±¡ |
| | | * @return åç¼åï¼ä¸å
å«.ï¼å¦ææä»¶ä¸å卿è
没æåç¼åè¿å"" |
| | | */ |
| | | public static String getFileExtension(File file){ |
| | | if(file!=null){ |
| | | return getFileExtensionByName(file.getName()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ä¸å«åç¼åçåç§° |
| | | * @param file æä»¶ |
| | | * @return åç§° |
| | | */ |
| | | public static String getFileNameUnHasExtension(File file){ |
| | | if(file!=null){ |
| | | String name = file.getName(); |
| | | return name.contains(".")?name.substring(0,name.lastIndexOf(".")):name; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ä¸å«åç¼åçåç§° |
| | | * @param fileName æä»¶åç§° |
| | | * @return åç§° |
| | | */ |
| | | public static String getFileNameUnHasExtensionByName(String fileName){ |
| | | if(fileName!=null){ |
| | | return fileName.contains(".")?fileName.substring(0,fileName.lastIndexOf(".")):fileName; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åæä»¶çåç¼å |
| | | * @param name æä»¶åç§° |
| | | * @return åç¼åï¼ä¸å
å«.ï¼æ²¡æåç¼åè¿å"" |
| | | */ |
| | | public static String getFileExtensionByName(String name){ |
| | | if(StringUtils.hasLength(name)){ |
| | | if(name.contains(".")){ |
| | | return name.substring(name.lastIndexOf(".")+1); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸ä¼ æä»¶çåç§°ï¼å¨IEæµè§å¨ä¸ï¼ä¸ä¼ 伿å
¨è·¯å¾å¸¦è¿æ¥ |
| | | * @param name æä»¶çåç§° |
| | | * @return æ¿æ¢åçå¼ |
| | | */ |
| | | public static String getFileNameForIE(String name){ |
| | | if(!StringUtils.hasLength(name)){ |
| | | return name; |
| | | } |
| | | if(name.contains(File.separator)){ |
| | | return name.substring(name.lastIndexOf(File.separator)+1); |
| | | } |
| | | if(name.contains("\\")){ |
| | | return name.substring(name.lastIndexOf("\\") + 1); |
| | | } |
| | | return name; |
| | | } |
| | | |
| | | /** |
| | | * ä»å·¥ç¨ä¸è¯»åæä»¶çå
容 |
| | | * @param fileName æä»¶çåç§° |
| | | * @return æä»¶çå
容 |
| | | * @throws VciBaseException 读ååºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static String readContentForFileInJar(String fileName) throws VciBaseException{ |
| | | if(!StringUtils.hasLength(fileName)){ |
| | | throw new VciBaseException("æä»¶å为空"); |
| | | } |
| | | if(!fileName.startsWith("/")){ |
| | | fileName = "/" + fileName; |
| | | } |
| | | InputStream in = null; |
| | | ByteArrayOutputStream os = null; |
| | | try{ |
| | | in = FileUtil.class.getResourceAsStream( fileName); |
| | | if(in ==null){ |
| | | in=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); |
| | | } |
| | | os = new ByteArrayOutputStream(); |
| | | IOUtils.copy(in,os); |
| | | return new String(os.toByteArray(),"UTF-8"); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("读åæä»¶çå
容åºç°äºé误",new String[0],e); |
| | | }finally { |
| | | IOUtils.closeQuietly(in); |
| | | IOUtils.closeQuietly(os); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读åæä»¶çå
å®¹ï¼æä»¶ä¸è½æ¯jaréç |
| | | * @param fileName æä»¶çåç§° |
| | | * @return æä»¶çå
å®¹ï¼æ¯UTF-8çå符é |
| | | * @throws VciBaseException æä»¶ä¸åå¨ï¼å读ååºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static String readContentForFile(String fileName) throws VciBaseException{ |
| | | return new String(readDataForFile(fileName),StandardCharsets.UTF_8); |
| | | } |
| | | |
| | | /** |
| | | * 读åæä»¶éçæ°æ® |
| | | * @param fileName æä»¶åç§° |
| | | * @return æä»¶çæ°æ® |
| | | * @throws VciBaseException æä»¶ä¸åå¨ï¼åè·ååºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static byte[] readDataForFile(String fileName) throws VciBaseException{ |
| | | File file = new File(fileName); |
| | | if(!file.exists()){ |
| | | throw new VciBaseException("æä»¶æªæ¾å°ï¼{0}",new String[]{fileName}); |
| | | } |
| | | try(InputStream in = new FileInputStream( file); |
| | | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| | | ){ |
| | | IOUtils.copy(in,os); |
| | | return os.toByteArray(); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("读åæä»¶çå
容åºç°äºé误",new String[0],e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå
¥åç¬¦ä¸²å°æä»¶ |
| | | * @param content å符串 |
| | | * @param fileName æä»¶çåç§° |
| | | * @throws VciBaseException åå
¥åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static void writeContentToFile(String content,String fileName) throws VciBaseException{ |
| | | File file = new File(fileName); |
| | | if(!file.exists()){ |
| | | File parentFile = file.getParentFile(); |
| | | if(!parentFile.exists()){ |
| | | parentFile.mkdirs(); |
| | | } |
| | | try { |
| | | file.createNewFile(); |
| | | } catch (IOException e) { |
| | | throw new VciBaseException("åå
¥æä»¶çå
容æ¶ååºç°äºå建æä»¶å¤±è´¥çé®é¢,{}",new String[]{fileName},e); |
| | | } |
| | | } |
| | | if(content == null){ |
| | | content = ""; |
| | | } |
| | | try(OutputStream os = new FileOutputStream(file);){ |
| | | os.write(content.getBytes(StandardCharsets.UTF_8)); |
| | | os.flush(); |
| | | }catch(Throwable e){ |
| | | throw new VciBaseException("åå
¥æä»¶çå
容æ¶ååºç°äºåé误,{}",new String[]{fileName},e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä»é¡¹ç®éæè
jarçæä»¶å°ç®æ æä»¶ |
| | | * @param fileInJar jaræè
项ç®éçæä»¶åç§° |
| | | * @param target ç®æ æä»¶ |
| | | * @throws VciBaseException æ·è´æä»¶åºç°éè¯¯çæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | public static void copyFileInJar(String fileInJar,String target) throws VciBaseException{ |
| | | alertNotNull(fileInJar,"æºæä»¶",target,"ç®æ æä»¶"); |
| | | File targetFile = new File(target); |
| | | File folder = targetFile.getParentFile(); |
| | | if(!folder.exists()){ |
| | | folder.mkdirs(); |
| | | } |
| | | if(!targetFile.exists()){ |
| | | try { |
| | | targetFile.createNewFile(); |
| | | } catch (IOException e) { |
| | | throw new VciBaseException("åå»ºç®æ æä»¶çåºç°äºé误",new String[0],e); |
| | | } |
| | | } |
| | | if(!fileInJar.startsWith("/")){ |
| | | fileInJar = "/" + fileInJar; |
| | | } |
| | | InputStream in = null; |
| | | FileOutputStream os = null; |
| | | try{ |
| | | in = FileUtil.class.getResourceAsStream( fileInJar); |
| | | if(in ==null){ |
| | | in=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileInJar); |
| | | } |
| | | os = new FileOutputStream(target); |
| | | IOUtils.copy(in,os); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("æ·è´æä»¶çå
容åºç°äºé误.{0},{1}",new String[]{fileInJar,target},e); |
| | | }finally { |
| | | IOUtils.closeQuietly(in); |
| | | IOUtils.closeQuietly(os); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æä»¶è½¬æ¢ä¸ºè·¯å¾ |
| | | * @param fileList æä»¶å表 |
| | | * @return è·¯å¾å表 |
| | | * @throws VciBaseException åæ°ä¸ºç©ºåæä»¶ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | public static List<String> fileToPatch(Collection<File> fileList) throws VciBaseException { |
| | | alertNotNull("æä»¶å表",fileList); |
| | | List<String> filePath = new ArrayList<>(); |
| | | for(File file : fileList){ |
| | | if(!file.exists()){ |
| | | throw new VciBaseException(file.getAbsolutePath() + "æä»¶æ²¡ææ¾å°",new String[0]); |
| | | } |
| | | filePath.add(file.getAbsolutePath()); |
| | | } |
| | | return filePath; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.utils; |
| | | |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.Charset; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | /** |
| | | * zipç¸å
³çå·¥å
·ç±» |
| | | * @author wanghong |
| | | * @date 2021-02-02 |
| | | */ |
| | | @Component |
| | | public class ZipUtil { |
| | | |
| | | /** |
| | | * è·åzipçå符é |
| | | * @return é»è®¤ä¸ºGBKï¼å¦åéè¦é
ç½® |
| | | */ |
| | | private String getZipCharset(){ |
| | | return (File.separatorChar=='\\')?"GBK":"UTF-8"; |
| | | } |
| | | |
| | | /** |
| | | * 尿件夹å缩æå缩å
|
| | | * @param folder æä»¶å¤¹è·¯å¾ |
| | | * @param zipFileName zipæä»¶å |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
æ·»å åºéç伿åºå¼å¸¸ |
| | | */ |
| | | public void folderToZipFile(String folder, String zipFileName) throws VciBaseException { |
| | | folderToZipFile(folder,zipFileName,getZipCharset()); |
| | | } |
| | | |
| | | /** |
| | | * 尿件夹å缩æå缩å
|
| | | * @param folder æä»¶å¤¹è·¯å¾ |
| | | * @param zipFileName zipæä»¶å |
| | | * @param zipEncode zipçå符éï¼windowsåºè¯¥ä¸ºGBK |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
æ·»å åºéç伿åºå¼å¸¸ |
| | | */ |
| | | public void folderToZipFile(String folder, String zipFileName,String zipEncode) throws VciBaseException{ |
| | | File sourceFile = new File(folder); |
| | | if(!sourceFile.exists()){ |
| | | throw new VciBaseException("æä»¶{0}æ²¡ææ¾å°",new String[]{folder}); |
| | | } |
| | | try( ZipOutputStream zos =new ZipOutputStream(new FileOutputStream(zipFileName), StringUtils.hasLength(zipEncode)?Charset.forName(zipEncode): Charset.forName(getZipCharset()));) { |
| | | //é»è®¤æ¯UTF-8æ ¼å¼ç |
| | | addFileToZip(zos, new File(folder).listFiles(),folder + File.separator); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 尿件夹å缩æå缩å
|
| | | * @param zos zipè¾åºæµ |
| | | * @param files è¦å缩çæä»¶ |
| | | * @param rootPath å缩çæä»¶ä¸çé¡¶å±ç®å½ |
| | | * @throws VciBaseException æä»¶ä¸åå¨ï¼æè
å
容åºç°éè¯¯ä¼æåºå¼å¸¸ |
| | | */ |
| | | private void addFileToZip(ZipOutputStream zos,File[] files,String rootPath) throws VciBaseException{ |
| | | if(files!=null && files.length>0) { |
| | | for (File file : files) { |
| | | if(!StringUtils.hasLength(rootPath)){ |
| | | try { |
| | | rootPath = file.getParent(); |
| | | if (rootPath == null) { |
| | | rootPath = file.getPath(); |
| | | } |
| | | }catch (Throwable e){ |
| | | rootPath = file.getPath(); |
| | | } |
| | | } |
| | | if (!file.exists()) { |
| | | throw new VciBaseException("æä»¶{0}æ²¡ææ¾å°",new String[]{file.getAbsolutePath()}); |
| | | } |
| | | if (file.isDirectory()) { |
| | | addFileToZip(zos, file.listFiles(),rootPath); |
| | | }else{ |
| | | try (InputStream is = new FileInputStream(file); ){ |
| | | String entryName = file.getAbsolutePath().replace(rootPath,""); |
| | | if(entryName.startsWith("\\")) { |
| | | entryName = entryName.substring(1); |
| | | } |
| | | ZipEntry zipEntry = new ZipEntry(entryName); |
| | | zos.putNextEntry(zipEntry); |
| | | byte[] b = new byte[100]; |
| | | int length = 0; |
| | | while ((length = is.read(b)) != -1) { |
| | | zos.write(b, 0, length); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("ZIPå缩åºé{0}",new String[]{file.getAbsolutePath()},e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å°å个æä»¶æ·»å å°zipä¸ |
| | | * @param file æä»¶ |
| | | * @param zipFile zipæä»¶ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
æ·»å åºéç伿åºå¼å¸¸ |
| | | */ |
| | | public void addFileToZip(File file, String zipFile) throws VciBaseException{ |
| | | if(file == null || !file.exists() ){ |
| | | throw new VciBaseException("æä»¶{0}æ²¡ææ¾å°" ,new String[]{file.getAbsolutePath()}); |
| | | } |
| | | if(!StringUtils.hasLength(zipFile)){ |
| | | throw new VciBaseException("zipæä»¶{0}为空",new String[0]); |
| | | } |
| | | addFileToZip(new File[]{file},zipFile); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å°å¤ä¸ªä¸ªæä»¶æ·»å å°zipä¸ |
| | | * @param files æä»¶ |
| | | * @param zipFile zipæä»¶ |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
æ·»å åºéç伿åºå¼å¸¸ |
| | | */ |
| | | public void addFileToZip(File[] files, String zipFile) throws VciBaseException{ |
| | | addFileToZip(files, zipFile,getZipCharset()); |
| | | } |
| | | |
| | | /** |
| | | * å°å¤ä¸ªä¸ªæä»¶æ·»å å°zipä¸ |
| | | * @param files æä»¶ |
| | | * @param zipFile zipæä»¶ |
| | | * @param zipEncode zipçå符é |
| | | * @throws VciBaseException åæ°ä¸ºç©ºæè
æ·»å åºéç伿åºå¼å¸¸ |
| | | */ |
| | | public void addFileToZip(File[] files, String zipFile,String zipEncode) throws VciBaseException{ |
| | | if(files == null || files.length == 0){ |
| | | throw new VciBaseException("æä»¶{0}å
容æ¯ç©º",new String[0]); |
| | | } |
| | | if(!StringUtils.hasLength(zipFile)){ |
| | | throw new VciBaseException("zipæä»¶{0}æ¯ç©º",new String[0]); |
| | | } |
| | | try (ZipOutputStream zos =new ZipOutputStream(new FileOutputStream(zipFile), StringUtils.hasLength(zipEncode)?Charset.forName(zipEncode): Charset.forName(getZipCharset()));){ |
| | | addFileToZip(zos, files,""); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.vo; |
| | | |
| | | |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æä»¶çæ¾ç¤ºå¯¹è±¡ |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | @Data |
| | | public class FileObjectVO extends FileObject { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 2685482161288133481L; |
| | | |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.flowable.engine.RepositoryService; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.repository.Deployment; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.task.api.Task; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨äºå¡éç¨æ¥å£ |
| | | * |
| | |
| | | variables = Kv.create(); |
| | | } |
| | | variables.put(ProcessConstant.PASS_KEY, flow.isPass()); |
| | | variables.put("yn","y"); |
| | | // å®æä»»å¡ |
| | | taskService.complete(taskId, variables); |
| | | return true; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.service.FlowTaskUserService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.launch.constant.FlowConstant; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | |
| | | @RestController |
| | | @RequestMapping("model") |
| | | @AllArgsConstructor |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)t |
| | | public class FlowModelController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | |
| | | IPage<FlowModel> pages = flowEngineService.page(Condition.getPage(query), Condition.getQueryWrapper(flow, FlowModel.class) |
| | | .select("id,model_key modelKey,name,description,version,created,last_updated lastUpdated") |
| | | .orderByDesc("last_updated")); |
| | | |
| | | flowEngineService.getNodeByFlowableKey("process_t"); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.bpmn.model.FlowElement; |
| | | import org.flowable.bpmn.model.SubProcess; |
| | | import org.flowable.bpmn.model.UserTask; |
| | | import org.flowable.engine.*; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨éç¨æ§å¶å¨ |
| | |
| | | |
| | | private static final String IMAGE_NAME = "image"; |
| | | private final FlowEngineService flowEngineService; |
| | | |
| | | private final RepositoryService repositoryService; |
| | | private final RuntimeService runtimeService; |
| | | private final HistoryService historyService; |
| | | private final TaskService taskService; |
| | | private final ProcessEngine processEngine; |
| | | |
| | | /** |
| | | * è·åæµè½¬åå²å表 |
| | |
| | | */ |
| | | @GetMapping(value = "model-view") |
| | | public R modelView(String processDefinitionId, String processInstanceId) { |
| | | |
| | | return R.data(flowEngineService.modelView(processDefinitionId, processInstanceId)); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.service.FlowTaskUserService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | /** |
| | | * æµç¨taskå®¡æ¹æ§å¶ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("taskUser") |
| | | @AllArgsConstructor |
| | | public class FlowTaskUserController { |
| | | |
| | | private final FlowTaskUserService taskUserService; |
| | | |
| | | /** |
| | | * æµç¨task审æ¹äººåå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("list") |
| | | public R<FlowTaskUserC> list() { |
| | | return R.data(taskUserService.getUser()); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ãä¿®æ¹ä»»å¡å¤ç人å |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | @PostMapping("su") |
| | | public R<String> saveUser(@RequestBody FlowTaskUserC flowTaskUserC) { |
| | | taskUserService.saveOrUpdateUser(flowTaskUserC); |
| | | return R.success("ä¿åæå"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡å¤ç人å |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | @PostMapping("du") |
| | | public R<String> deleteUser(@RequestBody FlowTaskUserC flowTaskUserC) { |
| | | taskUserService.deleteUser(flowTaskUserC.getName()); |
| | | return R.success("å 餿å"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessStageAttr; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessTemplate; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.service.ProcessStageAttrService; |
| | | import com.vci.ubcs.flow.engine.service.ProcessTemplateService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | *æµç¨æ¨¡æ¿ãæµç¨é¶æ®µæ§å¶ processTemplate processStage |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("processTS") |
| | | @AllArgsConstructor |
| | | public class ProcessTSController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | | private final ProcessTemplateService processTemplateService; |
| | | private final ProcessStageAttrService processStageAttrService; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿å页 |
| | | */ |
| | | @GetMapping("/tlist") |
| | | public R<IPage<ProcessTemplate>> tlist(@RequestParam Map<String, Object> flow, Query query) { |
| | | IPage<ProcessTemplate> pages = processTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(flow, ProcessTemplate.class) |
| | | .select("id,model_key modelKey,model_name modelName,button_Type_Key buttonTypeKey,button_Type_value buttonTypeValue") |
| | | .orderByDesc("last_updated")); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿ç¨é屿§ |
| | | * @return |
| | | */ |
| | | @PostMapping("tt") |
| | | public R<List<Map<String,String>>> processTemplateType() { |
| | | return R.data(processTemplateService.processTemplateType()); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿æ°å¢ãä¿®æ¹ |
| | | * @param processTemplate |
| | | * @return |
| | | */ |
| | | @PostMapping("tsou") |
| | | public R<ProcessTemplate> processTemplateSaveOrUpdate(@RequestBody ProcessTemplate processTemplate) { |
| | | processTemplateService.saveOrUpdateUser(processTemplate); |
| | | return R.success("ä¿åæå"); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿å é¤ |
| | | * @param processTemplate |
| | | * @return |
| | | */ |
| | | @DeleteMapping("dt") |
| | | public R<ProcessTemplate> deleteProcessTemplate(ProcessTemplate processTemplate) { |
| | | processTemplateService.deleteProcessTemplate(processTemplate.getId()); |
| | | return R.success("å 餿å"); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µï¼è¿ä¸ªæµç¨çå个èç¹ |
| | | */ |
| | | @GetMapping("/sslist") |
| | | public R<List<Map<String,String>>> sslist(@RequestParam String modelKey) { |
| | | return R.data(flowEngineService.getNodeByFlowableKey(modelKey)); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µï¼è¿ä¸ªæµç¨,è¿ä¸ªèç¹ï¼ç»å®ç屿§ |
| | | */ |
| | | @GetMapping("/ssslist") |
| | | public R<List<ProcessStageAttr>> ssslist(@RequestParam String templateId,@RequestParam String modelKey,@RequestParam String taskId) { |
| | | Map<String, Object> m = new HashMap<>(); |
| | | m.put("template_id", templateId); |
| | | m.put("task_id", taskId); |
| | | m.put("model_key", modelKey); |
| | | QueryWrapper q = Condition.getQueryWrapper(m, ProcessStageAttr.class) |
| | | .select("attr_id attrId,attr_name attrName,attr_group attrGroup"); |
| | | return R.data(processStageAttrService.list(q)); |
| | | } |
| | | |
| | | /** |
| | | * 模æ¿é¶æ®µå±æ§æ°å¢ãä¿®æ¹ |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | @PostMapping("sasou") |
| | | public R<ProcessTemplate> stageAttributeSaveOrUpdate(@RequestBody FlowTaskUserC flowTaskUserC) { |
| | | processStageAttrService.saveOrUpdateUser(flowTaskUserC); |
| | | return R.success("ä¿åæå"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æµç¨æ¯ä¸ä¸ªèç¹å®¡æ ¸äºº |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Data |
| | | @TableName("ACT_DE_TASK_USER") |
| | | public class FlowTaskUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | private String name;//ä¿åçè¿ä¸ªæ¶èåç§° |
| | | private String modelKey; |
| | | private String classifyId; |
| | | private String templateId; |
| | | private String taskId;//æµç¨taskid |
| | | private String taskName; |
| | | private String userId; |
| | | private String userName; |
| | | private String description; |
| | | private Date created; |
| | | private Date lastUpdated; |
| | | private String createdBy; |
| | | private String lastUpdatedBy; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨èç¹å®¡æ ¸äººæ¶è |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Data |
| | | public class FlowTaskUserC implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String createdBy; |
| | | private String name;//ä¿åçè¿ä¸ªæ¶èåç§° |
| | | private String modelKey; |
| | | private String classifyId; |
| | | private String templateId; |
| | | private String taskId;//é¶æ®µidï¼å°±æ¯æµç¨taskid |
| | | private String taskName;//é¶æ®µåç§° |
| | | private List<FlowTaskUser> flowTaskUsers;//æ¯ä¸ªèç¹æ¶è人 |
| | | private List<ProcessStageAttr> processStageAttr;//æµç¨é¶æ®µä¿åç屿§ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Data |
| | | @TableName("ACT_DE_PROCESS_STAGE_ATTR") |
| | | public class ProcessStageAttr implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | private String modelKey; |
| | | private String classifyId; |
| | | private String templateId; |
| | | private String taskId;//é¶æ®µidï¼å°±æ¯æµç¨taskid |
| | | private String taskName;//é¶æ®µåç§° |
| | | private String attrOid;//屿§è¿æ¡æ°æ®çid |
| | | private String attrId;//屿§è¿æ¡æ°æ®çoid |
| | | private String attrName;//屿§ä¸æåç§° |
| | | private String attrGroup;//屿§åç» |
| | | private String description; |
| | | private Date created; |
| | | private Date lastUpdated; |
| | | private String createdBy; |
| | | private String lastUpdatedBy; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Data |
| | | @TableName("ACT_DE_PROCESS_TEMPLATE") |
| | | public class ProcessTemplate implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | private String templateId;//å½å模æ¿id |
| | | private String modelKey;//æµç¨æ¨¡åkey,é¨ç½²key |
| | | private String modelName;//é¨ç½²æµç¨åç§° |
| | | private String buttonTypeKey;//åºç¨æé®,ProcessTemplateTypeEnumçkey |
| | | private String buttonTypeValue;//åºç¨æé®,ProcessTemplateTypeEnumçvalue |
| | | private String description; |
| | | private Date created; |
| | | private Date lastUpdated; |
| | | private String createdBy; |
| | | private String lastUpdatedBy; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<FlowModel> findByParentModelId(String parentModelId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µå®¡æ ¸äººå |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface FlowTaskUserMapper extends BaseMapper<FlowTaskUser> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessStageAttr; |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface ProcessStageAttrMapper extends BaseMapper<ProcessStageAttr> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessTemplate; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface ProcessTemplateMapper extends BaseMapper<ProcessTemplate> { |
| | | |
| | | } |
| | |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.w3c.dom.Document; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | byte[] getModelEditorXML(FlowModel model); |
| | | |
| | | /** |
| | | * æ ¹æ®æµç¨æ¨¡åkeyè·åXMLä¸èç¹é
ç½®çå¤ç人,读åèç¹åç§°åé
ç½®çå¼ï¼æµç¨æ¨¡åkeyå·²ç»éå¶ä¸éå¤ |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | List<Map<String,String>> getNodeByFlowableKey(String key); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.engine.entity.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * FlowService |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface FlowTaskUserService extends IService<FlowTaskUser> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å½åç»é人对è¿ä¸ªæµç¨çtaskUser |
| | | * @return |
| | | */ |
| | | FlowTaskUserC getUser(); |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹æµç¨èç¹å®¡æ ¸äººé
ç½®ãå¹¶ä¸ä¿®æ¹æµç¨xmlé¨ç½²æä»¶ |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | void saveOrUpdateUser(FlowTaskUserC flowTaskUserC); |
| | | |
| | | /** |
| | | * å 餿µç¨å®¡æ ¸äººå |
| | | * @param name |
| | | */ |
| | | void deleteUser(String name); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessStageAttr; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µæå¡ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface ProcessStageAttrService extends IService<ProcessStageAttr> { |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹æµç¨é¶æ®µ |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | void saveOrUpdateUser(FlowTaskUserC flowTaskUserC); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessTemplate; |
| | | import com.vci.ubcs.starter.web.enumpck.ProcessTemplateTypeEnum; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿æå¡ |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | public interface ProcessTemplateService extends IService<ProcessTemplate> { |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹æµç¨æ¨¡æ¿ |
| | | * @param processTemplate |
| | | * @return |
| | | */ |
| | | void saveOrUpdateUser(ProcessTemplate processTemplate); |
| | | |
| | | /** |
| | | * å 餿µç¨æ¨¡æ¿ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | void deleteProcessTemplate(String id); |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿ç¨é |
| | | * @return |
| | | */ |
| | | List<Map<String,String>> processTemplateType(); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.fasterxml.jackson.databind.ObjectMapper; |
| | |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.bpmn.converter.BpmnXMLConverter; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.*; |
| | | import org.flowable.bpmn.model.Process; |
| | | import org.flowable.common.engine.impl.util.IoUtil; |
| | | import org.flowable.common.engine.impl.util.io.StringStreamSource; |
| | |
| | | import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl; |
| | | import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl; |
| | | import org.flowable.engine.repository.Deployment; |
| | | import org.flowable.engine.repository.DeploymentQuery; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.flowable.engine.repository.ProcessDefinitionQuery; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | |
| | | import org.flowable.engine.task.Comment; |
| | | import org.flowable.image.ProcessDiagramGenerator; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.FileUtil; |
| | |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.w3c.dom.*; |
| | | import org.xml.sax.InputSource; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.xml.parsers.DocumentBuilder; |
| | | import javax.xml.parsers.DocumentBuilderFactory; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.io.StringReader; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private final HistoryService historyService; |
| | | private final TaskService taskService; |
| | | private final ProcessEngine processEngine; |
| | | |
| | | /** |
| | | * æ°æ®æä½å¯¹è±¡ |
| | | */ |
| | | @Resource |
| | | private FlowMapper flowMapper; |
| | | |
| | | @Override |
| | | public IPage<FlowModel> selectFlowPage(IPage<FlowModel> page, FlowModel flowModel) { |
| | |
| | | |
| | | @Override |
| | | public boolean deployModel(String modelId, String category, List<String> tenantIdList) { |
| | | |
| | | FlowModel model = this.getById(modelId); |
| | | if (model == null) { |
| | | throw new ServiceException("æªæ¾å°æ¨¡å id: " + modelId); |
| | |
| | | |
| | | @Override |
| | | public FlowModel submitModel(FlowModel model) { |
| | | |
| | | //éªè¯éå¤key |
| | | if(StringUtils.isEmpty(model.getId())&&getFlowModelByKey(model.getModelKey())!=null){ |
| | | throw new ServiceException("you cannot definition repetition æµç¨key!"); |
| | | } |
| | | |
| | | FlowModel flowModel = new FlowModel(); |
| | | flowModel.setId(model.getId()); |
| | | flowModel.setVersion(Func.toInt(model.getVersion(), 0) + 1); |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æµç¨æ¨¡åkeyè·åXMLä¸èç¹é
ç½®çå¤ç人 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String,String>> getNodeByFlowableKey(String key){ |
| | | String processDefinitionId = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionKey(key).singleResult().getId(); |
| | | BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
| | | Process process = bpmnModel.getProcesses().get(0);//åªæä¸ä¸ª |
| | | |
| | | List<Map<String,String>> ll = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(process.getFlowElements())) { |
| | | for (FlowElement flowElement : process.getFlowElements()) { |
| | | if (flowElement instanceof UserTask) { |
| | | Map<String,String> mi = new HashMap<>(); |
| | | mi.put("taskId",flowElement.getId()); |
| | | mi.put("taskName",flowElement.getName()); |
| | | ll.add(mi); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ll; |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦å·²å®ç» |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | |
| | | return historyService.createHistoricProcessInstanceQuery().finished() |
| | | .processInstanceId(processInstanceId).count() > 0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * xml转bpmn json |
| | |
| | | } |
| | | } |
| | | |
| | | public FlowModel getFlowModelByKey(String key){ |
| | | Map kv = new HashMap(); |
| | | kv.put("model_key",key); |
| | | return baseMapper.selectOne(Condition.getQueryWrapper(kv, FlowModel.class)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service.impl; |
| | | |
| | | 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.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.node.ObjectNode; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.core.enums.FlowModeEnum; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import com.vci.ubcs.flow.engine.entity.*; |
| | | import com.vci.ubcs.flow.engine.mapper.FlowMapper; |
| | | import com.vci.ubcs.flow.engine.mapper.FlowTaskUserMapper; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.service.FlowTaskUserService; |
| | | import com.vci.ubcs.flow.engine.utils.FlowCache; |
| | | import com.vci.ubcs.system.user.cache.UserCache; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.bpmn.converter.BpmnXMLConverter; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.Process; |
| | | import org.flowable.common.engine.impl.util.IoUtil; |
| | | import org.flowable.common.engine.impl.util.io.StringStreamSource; |
| | | import org.flowable.editor.language.json.converter.BpmnJsonConverter; |
| | | import org.flowable.engine.*; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl; |
| | | import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl; |
| | | import org.flowable.engine.repository.Deployment; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.flowable.engine.repository.ProcessDefinitionQuery; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.engine.runtime.ProcessInstanceQuery; |
| | | import org.flowable.engine.task.Comment; |
| | | import org.flowable.image.ProcessDiagramGenerator; |
| | | import org.springblade.core.launch.constant.FlowConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.FileUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.w3c.dom.Document; |
| | | import org.w3c.dom.Element; |
| | | import org.w3c.dom.NodeList; |
| | | import org.xml.sax.InputSource; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.xml.parsers.DocumentBuilder; |
| | | import javax.xml.parsers.DocumentBuilderFactory; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.io.StringReader; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 工使µæå¡å®ç°ç±» |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class FlowTaskUserServiceImpl extends ServiceImpl<FlowTaskUserMapper, FlowTaskUser> implements FlowTaskUserService { |
| | | |
| | | private FlowEngineService flowEngineService; |
| | | private FlowTaskUserMapper flowTaskUserMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å½åç»é人对è¿ä¸ªæµç¨çtaskUser |
| | | * @return |
| | | */ |
| | | @Override |
| | | public FlowTaskUserC getUser(){ |
| | | QueryWrapper<FlowTaskUser> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("CREATED_BY", AuthUtil.getUserId()); |
| | | List<FlowTaskUser> flowTaskUsers = baseMapper.selectList(queryWrapper); |
| | | FlowTaskUserC flowTaskUserCR = new FlowTaskUserC(); |
| | | if(flowTaskUsers.size()==0){ |
| | | return flowTaskUserCR; |
| | | } |
| | | flowTaskUserCR.setName(flowTaskUsers.get(0).getName());//æ¶èåç§° |
| | | flowTaskUserCR.setFlowTaskUsers(flowTaskUsers); |
| | | return flowTaskUserCR; |
| | | } |
| | | |
| | | @Override |
| | | public void saveOrUpdateUser(FlowTaskUserC flowTaskUserC){ |
| | | List<FlowTaskUser> flowTaskUsers = flowTaskUserC.getFlowTaskUsers(); |
| | | String name = flowTaskUserC.getName();//æ¶èåç§° |
| | | |
| | | //æ°å¢æ
åµä¸éªè¯æ¶èåç§°ä¸éå¤ |
| | | if(flowTaskUsers.get(0).getId()!=null) { |
| | | Map<String, Object> m = new HashMap<>(); |
| | | m.put("name", name); |
| | | QueryWrapper q = Condition.getQueryWrapper(m, FlowTaskUser.class) |
| | | .select("id,model_key modelKey,name,description,version,created,last_updated lastUpdated"); |
| | | if(flowTaskUserMapper.selectCount(q)>0){ |
| | | throw new ServiceException("æ¶èåç§°å·²ç»åå¨!"); |
| | | } |
| | | } |
| | | for (FlowTaskUser flowTaskUseri:flowTaskUsers){ |
| | | flowTaskUseri.setName(name); |
| | | } |
| | | //æ°å¢ãä¿®æ¹ |
| | | this.saveOrUpdateBatch(flowTaskUsers); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void deleteUser(String name){ |
| | | Map<String, Object> m = new HashMap<>(); |
| | | m.put("name", name); |
| | | m.put("created_by", AuthUtil.getUserId()); |
| | | baseMapper.deleteByMap(m); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessStageAttr; |
| | | import com.vci.ubcs.flow.engine.mapper.ProcessStageAttrMapper; |
| | | import com.vci.ubcs.flow.engine.service.ProcessStageAttrService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨é¶æ®µæå¡å®ç°ç±» |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProcessStageAttrServiceImpl extends ServiceImpl<ProcessStageAttrMapper, ProcessStageAttr> implements ProcessStageAttrService { |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹æµç¨é¶æ®µ |
| | | * @param flowTaskUserC |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public void saveOrUpdateUser(FlowTaskUserC flowTaskUserC){ |
| | | List<ProcessStageAttr> processStageAttrs = flowTaskUserC.getProcessStageAttr(); |
| | | String modelKey = flowTaskUserC.getModelKey(); |
| | | String templateId = flowTaskUserC.getTemplateId(); |
| | | String taskId = flowTaskUserC.getTaskId(); |
| | | String taskName = flowTaskUserC.getTaskName(); |
| | | |
| | | //ç´æ¥å é¤ä»¥åç |
| | | Map<String, Object> m = new HashMap<>(); |
| | | m.put("template_id", templateId); |
| | | m.put("model_key", modelKey); |
| | | m.put("task_id", taskId); |
| | | QueryWrapper q = Condition.getQueryWrapper(m, FlowTaskUser.class) |
| | | .select("id,model_key modelKey,name,description,version,created,last_updated lastUpdated"); |
| | | int i = baseMapper.deleteByMap(m); |
| | | System.out.println("å é¤ç屿§ä¸ªæ°: "+i); |
| | | |
| | | List<ProcessStageAttr> processStages = flowTaskUserC.getProcessStageAttr(); |
| | | for (ProcessStageAttr processStageAttr:processStages){ |
| | | processStageAttr.setModelKey(modelKey); |
| | | processStageAttr.setTemplateId(templateId); |
| | | processStageAttr.setTaskId(taskId); |
| | | processStageAttr.setTaskName(taskName); |
| | | } |
| | | if(processStages.size()!=0) { |
| | | this.saveOrUpdateBatch(processStages); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUser; |
| | | import com.vci.ubcs.flow.engine.entity.FlowTaskUserC; |
| | | import com.vci.ubcs.flow.engine.entity.ProcessTemplate; |
| | | import com.vci.ubcs.flow.engine.mapper.FlowTaskUserMapper; |
| | | import com.vci.ubcs.flow.engine.mapper.ProcessTemplateMapper; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.service.FlowTaskUserService; |
| | | import com.vci.ubcs.flow.engine.service.ProcessTemplateService; |
| | | import com.vci.ubcs.starter.web.enumpck.ProcessTemplateTypeEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.launch.constant.FlowConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿æå¡å®ç°ç±» |
| | | * |
| | | * @author wang1 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProcessTemplateServiceImpl extends ServiceImpl<ProcessTemplateMapper, ProcessTemplate> implements ProcessTemplateService { |
| | | |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹æµç¨æ¨¡æ¿ |
| | | * @param processTemplate |
| | | * @return |
| | | */ |
| | | public void saveOrUpdateUser(ProcessTemplate processTemplate){ |
| | | //æ ¡éªè¿ä¸ªæ¨¡æ¿ä¸ï¼ä¸ç±»æé®åªè½æä¸ä¸ªæ¨¡æ¿ |
| | | QueryWrapper<ProcessTemplate> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("button_type_key", processTemplate.getButtonTypeKey()); |
| | | if(StringUtils.isNotEmpty(processTemplate.getId())) {//ä¿®æ¹çæ¶å,idä¸ºç©ºå°±æ¯æ°å¢ |
| | | queryWrapper.ne("id", processTemplate.getId()); |
| | | } |
| | | if(baseMapper.selectOne(queryWrapper)!=null){ |
| | | throw new ServiceException(processTemplate.getButtonTypeValue()+"åè½å·²ç»é
ç½®äºæµç¨!"); |
| | | } |
| | | if(StringUtils.isEmpty(processTemplate.getButtonTypeValue())){ |
| | | processTemplate.setButtonTypeValue(ProcessTemplateTypeEnum.getTextByValue(processTemplate.getButtonTypeKey())); |
| | | } |
| | | //æ°å¢æè
ä¿®æ¹ |
| | | if(StringUtils.isEmpty(processTemplate.getId())){ |
| | | processTemplate.setCreated(Calendar.getInstance().getTime()); |
| | | processTemplate.setCreatedBy(TaskUtil.getTaskUser()); |
| | | processTemplate.setLastUpdated(Calendar.getInstance().getTime()); |
| | | processTemplate.setLastUpdatedBy(TaskUtil.getTaskUser()); |
| | | } |
| | | this.saveOrUpdate(processTemplate); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å 餿µç¨æ¨¡æ¿ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public void deleteProcessTemplate(String id){ |
| | | baseMapper.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿ç¨é |
| | | * @return |
| | | */ |
| | | public List<Map<String,String>> processTemplateType(){ |
| | | ProcessTemplateTypeEnum[] es = ProcessTemplateTypeEnum.values(); |
| | | List<Map<String,String>> ll = new ArrayList<>(); |
| | | for (ProcessTemplateTypeEnum p:es){ |
| | | Map<String,String> mi = new HashMap<>(); |
| | | String value = p.getValue(); |
| | | String text = p.getText(); |
| | | mi.put("codee",value); |
| | | mi.put("namee",text); |
| | | ll.add(mi); |
| | | } |
| | | return ll; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * é件表 æ§å¶å¨ |
| | | * |
| | | * |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.dto.FileObjectDTO; |
| | | import com.vci.ubcs.resource.dto.FileReleaseDTO; |
| | | import com.vci.ubcs.resource.dto.FileShareDTO; |
| | | import com.vci.ubcs.resource.query.FileQuery; |
| | | import com.vci.ubcs.resource.service.IFileService; |
| | | import com.vci.ubcs.resource.utils.FileDownloadUtil; |
| | | import com.vci.ubcs.resource.vo.FileObjectVO; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.oss.MinioTemplate; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä»¶æ§å¶å¨ |
| | | * @author weidy |
| | | * @date 2023-6/9 |
| | | */ |
| | | @RestController() |
| | | @RequestMapping("/fileController") |
| | | public class FileController { |
| | | |
| | | /** |
| | | * æä»¶æå¡ |
| | | */ |
| | | @Autowired |
| | | private IFileService fileService; |
| | | |
| | | /** |
| | | * minioçé
ç½® |
| | | */ |
| | | @Autowired |
| | | private MinioTemplate minioTemplate; |
| | | |
| | | /** |
| | | * æ ¹æ®æä»¶ä¸»é®ä¸è½½æä»¶ |
| | | * @param fileOids æä»¶çä¸»é® |
| | | * @param response ååºç对象 |
| | | * @return æ§è¡ç»æï¼åªæä¸è½½å¤±è´¥çæ¶åæä¼è¿æ · |
| | | */ |
| | | @RequestMapping(value = "/downloadFilesByOids",method = {RequestMethod.GET,RequestMethod.POST}) |
| | | public R downloadFilesByOids(@RequestParam String fileOids, HttpServletResponse response){ |
| | | try{ |
| | | FileDownloadUtil.downloadFile(response, fileService.downloadFileByOids(VciBaseUtil.str2List(fileOids))); |
| | | }catch (Throwable e){ |
| | | return R.fail(LangBaseUtil.getErrorMsg(e)); |
| | | } |
| | | return R.success("ä¸è½½å®æ"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æä»¶å é¤ |
| | | * @param oids æä»¶çä¸»é® |
| | | * @return æä»¶å
容 |
| | | */ |
| | | @DeleteMapping("/deleteFile") |
| | | public R deleteFile(@RequestBody Collection<String> oids){ |
| | | fileService.deleteFiles(oids); |
| | | return R.success("å 餿å"); |
| | | } |
| | | |
| | | /** |
| | | * å端页é¢åæä»¶ä¸ä¼ ã(å
æ°æ®ï¼åæä»¶æ¨¡å¼ä¸ä¼ ) |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @param fileObjectDTO æä»¶ä¿¡æ¯ä¼ è¾å¯¹è±¡ |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/uploadFile") |
| | | public R<FileObjectVO> uploadFile(MultipartFile file, FileObjectDTO fileObjectDTO){ |
| | | if (file != null ) { |
| | | return fileService.uploadFile(file, fileObjectDTO); |
| | | } else { |
| | | return R.fail("æ ä¸ä¼ çæä»¶"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¨ä¸ä¼ æä»¶åï¼ä¿åæä»¶çä¿¡æ¯ |
| | | * @param fileObjectDTO æä»¶ä¿¡æ¯ä¼ è¾å¯¹è±¡ |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @PostMapping("/saveFileAfterUpload") |
| | | public R<FileObjectVO> saveFileAfterUpload( @RequestBody FileObjectDTO fileObjectDTO){ |
| | | return fileService.saveFileAfterUpload(fileObjectDTO); |
| | | } |
| | | |
| | | /** |
| | | * å°åæ°æ®ä¸çæææä»¶å
±äº«å°å
¶ä»çä¸å¡æ°æ®ä¸ |
| | | * @param shareDTO æä»¶å享 |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡,æ¯å¤ä¸ª |
| | | */ |
| | | @PostMapping("/shareFiles") |
| | | public R<List<FileObjectVO>> shareFiles(@RequestBody FileShareDTO shareDTO){ |
| | | return fileService.shareFiles(shareDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä¿®æ¹æä»¶ä¿¡æ¯(ä¸å«æä»¶),注æobjectNameåfilePathä¸ä¼åå |
| | | * @param fileDTOs æä»¶çæ°æ®å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping("/updateFileInfos") |
| | | public R updateFileInfos(@RequestBody Collection<FileObjectDTO> fileDTOs){ |
| | | return fileService.updateFileInfos(fileDTOs); |
| | | } |
| | | |
| | | /** |
| | | * æä»¶çæ |
| | | * @param ids æä»¶çä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PutMapping("/releasedFiles") |
| | | public R releasedFiles(@RequestBody Collection<String> ids){ |
| | | return fileService.releasedFiles(ids); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæå®æä»¶ä¸å¡æ°æ®åçæ |
| | | * @param releaseDTOS çæçç¸å
³ä¿¡æ¯ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PutMapping("/releasedFilesForOwn") |
| | | public R releasedFilesForOwn(@RequestBody Collection<FileReleaseDTO> releaseDTOS){ |
| | | return fileService.releasedFilesForOwn(releaseDTOS); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使ç¨ä¸å¡ç±»åæ¥è¯¢æä»¶çä¿¡æ¯ï¼æä¾ç»é¡µé¢è°ç¨ |
| | | * @param fileQuery æ¥è¯¢å¯¹è±¡ |
| | | * @return æä»¶çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @RequestMapping(value = "/listFiles",method = {RequestMethod.GET,RequestMethod.POST}) |
| | | public R<IPage<FileObjectVO>> listFiles(FileQuery fileQuery, Query query){ |
| | | return R.data(fileService.listFiles(fileQuery,query)); |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨æä»¶ä¸»é®è·å对象 |
| | | * @param oid ä¸»é® |
| | | * @return æä»¶æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @GetMapping("/get") |
| | | public FileObjectVO get(String oid){ |
| | | return fileService.get(oid); |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨æä»¶ç䏻鮿¹éè·å对象 |
| | | * @param oids æä»¶ç主é®éå |
| | | * @return æä»¶çæ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/listFilesByOids") |
| | | public List<FileObjectVO> listFilesByOids( Collection<String> oids){ |
| | | return fileService.listFilesByOids(oids); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.resource.endpoint; |
| | | |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.service.IFileService; |
| | | import com.vci.ubcs.resource.utils.FileDownloadUtil; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.resource.builder.oss.OssBuilder; |
| | | import com.vci.ubcs.resource.service.IAttachService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 对象åå¨ç«¯ç¹ |
| | | * |
| | | * è¿ä¸ªç±»ä¸ä½¿ç¨ï¼ç»ä¸ç¨fileController |
| | | * |
| | | * @author Chill |
| | | */ |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/oss/endpoint") |
| | | @Api(value = "对象åå¨ç«¯ç¹", tags = "对象åå¨ç«¯ç¹") |
| | | @Deprecated |
| | | public class OssEndpoint { |
| | | |
| | | /** |
| | |
| | | * é件表æå¡ |
| | | */ |
| | | private final IAttachService attachService; |
| | | |
| | | |
| | | /** |
| | | * å建å卿¡¶ |
| | |
| | | } |
| | | |
| | | /** |
| | | * å建å卿¡¶ |
| | | * å é¤å卿¡¶ |
| | | * |
| | | * @param bucketName å卿¡¶åç§° |
| | | * @return R |
| | |
| | | public R<OssFile> statFile(@RequestParam String fileName) { |
| | | return R.data(ossBuilder.template().statFile(fileName)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åæä»¶ç¸å¯¹è·¯å¾ |
| | |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | * |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach") |
| | | public R<BladeFile> putFileAttach(@RequestParam MultipartFile file) { |
| | | String fileName = file.getOriginalFilename(); |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | | // /** |
| | | // * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | // * |
| | | // * @param file æä»¶ |
| | | // * @return ObjectStat |
| | | // */ |
| | | // @SneakyThrows |
| | | // @PostMapping("/put-file-attach") |
| | | // public R<BladeFile> putFileAttach(@RequestParam MultipartFile file) { |
| | | // String fileName = file.getOriginalFilename(); |
| | | // BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | // Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | // bladeFile.setAttachId(attachId); |
| | | // return R.data(bladeFile); |
| | | // } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach-by-name") |
| | | public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | | // /** |
| | | // * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | // * |
| | | // * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | // * @param file æä»¶ |
| | | // * @return ObjectStat |
| | | // */ |
| | | // @SneakyThrows |
| | | // @PostMapping("/put-file-attach-by-name") |
| | | // public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file) { |
| | | // BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | // Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | // bladeFile.setAttachId(attachId); |
| | | // return R.data(bladeFile); |
| | | // } |
| | | |
| | | /** |
| | | * æå»ºé件表 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | |
| | | /** |
| | | * æä»¶çæ°æ®æä½ç±» |
| | | * @author weidy |
| | | * @date 2023/6/9 |
| | | */ |
| | | public interface FileObjectMapper extends BaseMapper<FileObject> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import com.vci.ubcs.resource.dto.FileObjectDTO; |
| | | import com.vci.ubcs.resource.dto.FileReleaseDTO; |
| | | import com.vci.ubcs.resource.dto.FileShareDTO; |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | import com.vci.ubcs.resource.query.FileQuery; |
| | | import com.vci.ubcs.resource.vo.FileObjectVO; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä»¶çæå¡ |
| | | * @author weidy |
| | | * @date 2023/1/31 |
| | | */ |
| | | public interface IFileService extends IService<FileObject> { |
| | | |
| | | /** |
| | | * ä¸è½½ï¼æ³¨æå¤ä¸ªæä»¶çæ¶åï¼ä¼èªå¨ä¸è½½ä¸ºä¸ä¸ªå缩å
|
| | | * @param oids 主é®éå |
| | | * @return æä»¶çä¿¡æ¯ |
| | | */ |
| | | FileObjectBO downloadFileByOids(Collection<String> oids); |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * @param oids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | void deleteFiles(Collection<String> oids); |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶ |
| | | * @param file æä»¶çä¿¡æ¯ |
| | | * @param fileObjectDTO æä»¶çç¸å
³ä¿¡æ¯ |
| | | * @return æä»¶ä¸ä¼ åçä¿¡æ¯ |
| | | */ |
| | | R<FileObjectVO> uploadFile(MultipartFile file, FileObjectDTO fileObjectDTO); |
| | | |
| | | /** |
| | | * ä¿®æ¹æä»¶çä¿¡æ¯ï¼ä¸ä¼æ¹objectNameåfilePath) |
| | | * @param fileDTOs æä»¶çä¿¡æ¯ |
| | | * @return ä¿®æ¹åçä¿¡æ¯ |
| | | */ |
| | | R<List<FileObjectVO>> updateFileInfos(Collection<FileObjectDTO> fileDTOs); |
| | | |
| | | FileObjectVO do2Vo(FileObject fileObject); |
| | | |
| | | List<FileObjectVO> do2Vos(Collection<FileObject> fileObjects); |
| | | |
| | | /** |
| | | * å享æä»¶å°å
¶ä»æ°æ®ä¸ |
| | | * |
| | | * @param shareDTO æ¥æºä¸å¡ |
| | | * @return å享åçæä»¶ä¿¡æ¯ |
| | | */ |
| | | R<List<FileObjectVO>> shareFiles(FileShareDTO shareDTO); |
| | | |
| | | /** |
| | | * æä»¶å表æ¥è¯¢ |
| | | * @param fileQuery æä»¶æ¥è¯¢ |
| | | * @param query å页æ¥è¯¢å¯¹è±¡ |
| | | * @return æä»¶çæ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | IPage<FileObjectVO> listFiles(FileQuery fileQuery, Query query); |
| | | |
| | | /** |
| | | * ä½¿ç¨æä»¶ç䏻鮿¹éè·å对象 |
| | | * @param oids æä»¶ç主é®éå |
| | | * @return æä»¶çæ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | List<FileObjectVO> listFilesByOids(Collection<String> oids); |
| | | |
| | | /** |
| | | * æä»¶çæ |
| | | * @param oids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | R releasedFiles(Collection<String> oids); |
| | | |
| | | /** |
| | | * æ¹éæå®æä»¶ä¸å¡æ°æ®åçæ |
| | | * @param releaseDTOS çæçç¸å
³ä¿¡æ¯ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | R releasedFilesForOwn(Collection<FileReleaseDTO> releaseDTOS); |
| | | |
| | | /** |
| | | * å¨ä¸ä¼ æä»¶åï¼ä¿åæä»¶çä¿¡æ¯ |
| | | * @param fileObjectDTO æä»¶ä¿¡æ¯ä¼ è¾å¯¹è±¡ |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | R<FileObjectVO> saveFileAfterUpload(FileObjectDTO fileObjectDTO); |
| | | |
| | | |
| | | /** |
| | | * è·å对象 |
| | | * @param oid ä¸»é® |
| | | * @return æä»¶çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | FileObjectVO get(String oid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import com.vci.ubcs.resource.dto.FileObjectDTO; |
| | | import com.vci.ubcs.resource.dto.FileReleaseDTO; |
| | | import com.vci.ubcs.resource.dto.FileShareDTO; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.entity.FileObject; |
| | | import com.vci.ubcs.resource.life.FileLife; |
| | | import com.vci.ubcs.resource.mapper.FileObjectMapper; |
| | | import com.vci.ubcs.resource.query.FileQuery; |
| | | import com.vci.ubcs.resource.service.IFileService; |
| | | import com.vci.ubcs.resource.utils.FileUtil; |
| | | import com.vci.ubcs.resource.utils.ZipUtil; |
| | | import com.vci.ubcs.resource.vo.FileObjectVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.enumpck.BaseEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.UserSecretEnum; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.oss.MinioTemplate; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æä»¶æå¡ |
| | | * @author weidy |
| | | * @date 2023/2/1 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class FileServiceImpl extends ServiceImpl<FileObjectMapper, FileObject> implements IFileService { |
| | | |
| | | /** |
| | | * æä»¶çæ°æ®æä½ç±» |
| | | */ |
| | | @Resource |
| | | private FileObjectMapper fileObjectMapper; |
| | | |
| | | /** |
| | | * å¯¹è±¡çæ¨¡ç |
| | | */ |
| | | @Autowired |
| | | private OssTemplate ossTemplate; |
| | | |
| | | /** |
| | | * æä»¶æå¡çé
ç½® |
| | | */ |
| | | @Autowired |
| | | private OssProperties ossProperties; |
| | | |
| | | /** |
| | | * å缩æä»¶çå·¥å
·ç±» |
| | | */ |
| | | @Autowired |
| | | private ZipUtil zipUtil; |
| | | |
| | | /*** |
| | | * æä»¶çè§å |
| | | */ |
| | | @Autowired |
| | | private OssRule ossRule; |
| | | |
| | | |
| | | /** |
| | | * ä¸è½½ï¼æ³¨æå¤ä¸ªæä»¶çæ¶åï¼ä¼èªå¨ä¸è½½ä¸ºä¸ä¸ªå缩å
|
| | | * |
| | | * @param oids 主é®éå |
| | | * @return æä»¶çä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public FileObjectBO downloadFileByOids(Collection<String> oids) { |
| | | VciBaseUtil.alertNotNull(oids,"æä»¶ç主é®éå"); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("ä¸è½½æä»¶,",oids.stream().collect(Collectors.joining(","))); |
| | | } |
| | | Collection<FileObjectVO> fileVOs = listFilesByOids(oids); |
| | | FileObjectBO fileObjectBO = new FileObjectBO(); |
| | | if(fileVOs.size()==1){ |
| | | //åªæä¸ä¸ª |
| | | FileObjectVO objectVO = fileVOs.stream().findFirst().get(); |
| | | BeanUtil.convert(objectVO,fileObjectBO); |
| | | OssFile ossFile = ossTemplate.statFile(objectVO.getBucketName(), objectVO.getObjectName()); |
| | | if(ossFile == null || !StringUtils.hasLength(ossFile.getLink())){ |
| | | throw new VciBaseException("æä»¶å¨åå¨éæ²¡ææ¾å°",oids.toArray(new String[0])); |
| | | } |
| | | URL url = null; |
| | | try { |
| | | url = new URL(ossFile.getLink()); |
| | | } catch (MalformedURLException e) { |
| | | throw new VciBaseException("æä»¶çè·åè·¯å¾æé®é¢",new String[]{ossFile.getLink()},e); |
| | | } |
| | | try { |
| | | fileObjectBO.setInputStream(url.openStream()); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("è·åæä»¶çæµæé®é¢",new String[]{ossFile.getLink()},e); |
| | | } |
| | | }else{ |
| | | //æå¤ä¸ªï¼éè¦ä½¿ç¨zipè¿è¡å缩 |
| | | String tempFolder = FileUtil.getDefaultTempFolder(); |
| | | fileVOs.stream().forEach(fileVO->{ |
| | | String fileName = tempFolder + File.separator + fileVO.getName() + "." + fileVO.getFileExtension(); |
| | | File file = new File(fileName); |
| | | try { |
| | | if(!file.exists()) { |
| | | file.createNewFile(); |
| | | } |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("å建æä»¶åºé,{0}",new String[]{fileName}); |
| | | } |
| | | OssFile ossFile = ossTemplate.statFile(fileVO.getBucketName(), fileVO.getObjectName()); |
| | | if(ossFile == null || !StringUtils.hasLength(ossFile.getLink())){ |
| | | throw new VciBaseException("æä»¶å¨åå¨éæ²¡ææ¾å°",oids.toArray(new String[0])); |
| | | } |
| | | URL url = null; |
| | | try { |
| | | url = new URL(ossFile.getLink()); |
| | | } catch (MalformedURLException e) { |
| | | throw new VciBaseException("æä»¶çè·åè·¯å¾æé®é¢",new String[]{ossFile.getLink()},e); |
| | | } |
| | | try(OutputStream os = new FileOutputStream(file); |
| | | InputStream ins = url.openStream(); |
| | | ){ |
| | | IOUtils.copy(ins,os); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException("ä¸è½½æä»¶å°ä¸´æ¶æä»¶å¤¹éåºé,{0}",new String[]{fileName}); |
| | | } |
| | | }); |
| | | String zipName = new File(tempFolder).getPath() + File.separator + fileVOs.stream().findFirst().get().getName() + "ç"+fileVOs.size() + "个æä»¶.zip"; |
| | | zipUtil.folderToZipFile(tempFolder,zipName); |
| | | fileObjectBO.setFileLocalPath(zipName); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("ä¸è½½æä»¶çä¿¡æ¯,",zipName); |
| | | } |
| | | } |
| | | return fileObjectBO; |
| | | } |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * |
| | | * @param oids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional() |
| | | public void deleteFiles(Collection<String> oids) { |
| | | VciBaseUtil.alertNotNull(oids,"æä»¶ç主é®éå"); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("å 餿件,",oids.stream().collect(Collectors.joining(","))); |
| | | } |
| | | Collection<FileObject> fileObjects = listByIds(oids); |
| | | if(!CollectionUtils.isEmpty(fileObjects)){ |
| | | VciBaseUtil.switchCollectionForOracleIn(fileObjects).stream().forEach(fileDOs->{ |
| | | fileObjectMapper.deleteBatchIds(fileDOs.stream().map(FileObject::getId).collect(Collectors.toList())); |
| | | }); |
| | | //å é¤minioéçæä»¶ |
| | | fileObjects.parallelStream().forEach(fileObject -> { |
| | | ossTemplate.removeFile(fileObject.getBucketName(),fileObject.getObjectName()); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶ |
| | | * |
| | | * @param file æä»¶çä¿¡æ¯ |
| | | * @param fileObjectDTO æä»¶çç¸å
³ä¿¡æ¯ |
| | | * @return æä»¶ä¸ä¼ åçä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R<FileObjectVO> uploadFile(MultipartFile file, FileObjectDTO fileObjectDTO) { |
| | | VciBaseUtil.alertNotNull(fileObjectDTO,"æä»¶çä¿¡æ¯"); |
| | | |
| | | String sourceFileName = file.getOriginalFilename(); |
| | | String fileExtension = FileUtil.getFileExtensionByName(sourceFileName); |
| | | String fileNameNoExtension = FileUtil.getFileNameUnHasExtensionByName(sourceFileName); |
| | | |
| | | if(fileObjectDTO.getUpdateFileFlag()==null || !fileObjectDTO.getUpdateFileFlag()) { |
| | | return R.data(add(fileObjectDTO,file)); |
| | | }else{ |
| | | //ä¿®æ¹ï¼éè¦å
è·å |
| | | VciBaseUtil.alertNotNull(fileObjectDTO.getOid(),"æä»¶ç主é®"); |
| | | FileObject fileObject = getById(fileObjectDTO.getOid()); |
| | | if (StringUtils.hasLength(fileObjectDTO.getId())) { |
| | | fileObject.setId(fileNameNoExtension); |
| | | } |
| | | fileObject.setName(fileNameNoExtension); |
| | | fileObject.setFileExtension(fileExtension); |
| | | fileObject.setFileSize(file.getSize()); |
| | | //以åçä¿¡æ¯å
è·å |
| | | String oldObjectName = fileObject.getObjectName(); |
| | | String oldBucketName = fileObject.getBucketName(); |
| | | |
| | | String bucketName = StringUtils.hasLength(fileObjectDTO.getBucketName())?fileObjectDTO.getBucketName():ossProperties.getBucketName(); |
| | | BladeFile bladeFile = ossTemplate.putFile(bucketName,file.getOriginalFilename(),file); |
| | | |
| | | fileObject.setBucketName(bucketName); |
| | | fileObject.setObjectName(bladeFile.getName()); |
| | | fileObject.setFileLink(bladeFile.getLink()); |
| | | fileObjectMapper.updateById(fileObject); |
| | | //å é¤ä»¥åç |
| | | ossTemplate.removeFile(oldBucketName,oldObjectName); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("ä¿®æ¹æä»¶",fileObject.toString(),oldObjectName,oldBucketName); |
| | | } |
| | | FileObjectVO fileObjectVO = do2Vo(fileObject); |
| | | return R.data(fileObjectVO); |
| | | } |
| | | } |
| | | |
| | | private FileObjectVO add(FileObjectDTO fileObjectDTO,MultipartFile file){ |
| | | String sourceFileName = file.getOriginalFilename(); |
| | | String fileExtension = FileUtil.getFileExtensionByName(sourceFileName); |
| | | String fileNameNoExtension = FileUtil.getFileNameUnHasExtensionByName(sourceFileName); |
| | | |
| | | //åå¨ä¸å¡æ°æ®ä¸æä»¶ä¿¡æ¯ |
| | | FileObject fileObject = new FileObject(); |
| | | BeanUtil.convert(fileObjectDTO, fileObject); |
| | | if (!StringUtils.hasLength(fileObject.getId())) { |
| | | fileObject.setId(fileNameNoExtension); |
| | | } |
| | | if (!StringUtils.hasLength(fileObject.getName())) { |
| | | fileObject.setName(fileNameNoExtension); |
| | | } |
| | | fileObject.setFileExtension(fileExtension); |
| | | fileObject.setFileSize(file.getSize()); |
| | | if (!StringUtils.hasLength(fileObject.getOid())) { |
| | | fileObject.setOid(VciBaseUtil.getPk()); |
| | | } |
| | | if (fileObjectDTO.getEffect() != null && fileObjectDTO.getEffect()) { |
| | | fileObject.setLcStatus(FileLife.FILE_RELEASE.getValue()); |
| | | } else { |
| | | fileObject.setLcStatus(FileLife.TRANS_FINISH.getValue()); |
| | | } |
| | | if (fileObject.getSecretGrade() == null || fileObject.getSecretGrade() == 0) { |
| | | // VciBaseUtil.getCurrentUserSecret()è¿éè¦å¤çï¼å¨è¿å
¥æå¡çæ¶åï¼æ ¹æ®å½åç¨æ·çä¿¡æ¯è·åç¨æ·ç对象 |
| | | fileObject.setSecretGrade( VciBaseUtil.getCurrentUserSecret()); |
| | | } |
| | | String bucketName = StringUtils.hasLength(fileObjectDTO.getBucketName())?fileObjectDTO.getBucketName():ossProperties.getBucketName(); |
| | | //å
åå°Minioåå说 |
| | | BladeFile bladeFile = ossTemplate.putFile(bucketName,file.getOriginalFilename(),file); |
| | | |
| | | fileObject.setBucketName(bucketName); |
| | | fileObject.setObjectName(bladeFile.getName()); |
| | | fileObject.setFileLink(bladeFile.getLink()); |
| | | fileObjectMapper.insert(fileObject); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("æ°å¢æä»¶",fileObject.toString()); |
| | | } |
| | | FileObjectVO fileObjectVO = do2Vo(fileObject); |
| | | return fileObjectVO; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¾ç¤ºå¯¹è±¡ |
| | | * @param fileObject æä»¶çæ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public FileObjectVO do2Vo(FileObject fileObject) { |
| | | FileObjectVO fileObjectVO = new FileObjectVO(); |
| | | BeanUtil.convert(fileObject,fileObjectVO); |
| | | fileObjectVO.setLcStatusText(BaseEnum.getTextByValue(FileLife.class,fileObjectVO.getLcStatus())); |
| | | //fileObjectVO.setSecretGradeText(UserSecretEnum); |
| | | return fileObjectVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<FileObjectVO> do2Vos(Collection<FileObject> fileObjects){ |
| | | List<FileObjectVO> fileObjectVOList = new ArrayList<>(); |
| | | Optional.ofNullable(fileObjects).orElseGet(ArrayList::new).stream().forEach(fo->{ |
| | | fileObjectVOList.add(do2Vo(fo)); |
| | | }); |
| | | return fileObjectVOList; |
| | | } |
| | | |
| | | /** |
| | | * å享æä»¶å°å
¶ä»æ°æ®ä¸ |
| | | * |
| | | * @param shareDTO æ¥æºä¸å¡ |
| | | * @return å享åçæä»¶ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R<List<FileObjectVO>> shareFiles(FileShareDTO shareDTO) { |
| | | VciBaseUtil.alertNotNull(shareDTO,"å享çä¿¡æ¯",shareDTO.getTargetBus(),"ç®æ çä¸å¡åç§°",shareDTO.getTargetBusOid(),"ç®æ çä¸å¡æ°æ®ä¸»é®"); |
| | | List<FileObject> fileObjectList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(shareDTO.getOids())){ |
| | | fileObjectList.addAll(listByIds(shareDTO.getOids())); |
| | | } |
| | | LambdaQueryWrapper<FileObject> queryWrapper = new LambdaQueryWrapper<FileObject>(FileObject.class); |
| | | if(StringUtils.hasLength(shareDTO.getSourceBus())) { |
| | | queryWrapper.in(FileObject::getOwnBtmName, VciBaseUtil.str2List(shareDTO.getSourceBus())); |
| | | } |
| | | if(StringUtils.hasLength(shareDTO.getSourceBusOid())){ |
| | | queryWrapper.in(FileObject::getOwnbizOid,VciBaseUtil.str2List(shareDTO.getSourceBusOid())); |
| | | } |
| | | fileObjectList.addAll(fileObjectMapper.selectList(queryWrapper)); |
| | | |
| | | if(CollectionUtils.isEmpty(fileObjectList)){ |
| | | throw new VciBaseException("æ²¡ææ¾å°å¯ä»¥å享çæä»¶"); |
| | | } |
| | | BladeUser user = AuthUtil.getUser(); |
| | | Date now = new Date(); |
| | | List<FileObject> newFileObjects = new ArrayList<>(); |
| | | fileObjectList.stream().forEach(fileObject -> { |
| | | FileObject newFileObject = new FileObject(); |
| | | BeanUtil.convert(fileObject,newFileObject); |
| | | newFileObject.setId(VciBaseUtil.getPk()); |
| | | newFileObject.setNameOid(VciBaseUtil.getPk()); |
| | | newFileObject.setRevisionOid(VciBaseUtil.getPk()); |
| | | newFileObject.setCreator(user.getAccount()); |
| | | newFileObject.setCreateTime(now); |
| | | newFileObject.setLastModifier(user.getAccount()); |
| | | newFileObject.setLastModifyTime(now); |
| | | newFileObject.setTs(now); |
| | | newFileObject.setOwnBtmName(shareDTO.getTargetBus()); |
| | | newFileObject.setOwnbizOid(shareDTO.getTargetBusOid()); |
| | | newFileObject.setObjectName(ossRule.fileName( "." + fileObject.getFileExtension())); |
| | | |
| | | //ä¸è½½æä»¶åï¼ä¸ä¼ æä»¶ |
| | | ossTemplate.copyFile(fileObject.getBucketName(),fileObject.getObjectName(),fileObject.getBucketName(),newFileObject.getObjectName()); |
| | | newFileObject.setFileLink(ossTemplate.fileLink(newFileObject.getBucketName(),newFileObject.getObjectName())); |
| | | newFileObjects.add(newFileObject); |
| | | }); |
| | | newFileObjects.stream().forEach(fileObject -> { |
| | | fileObjectMapper.insert(fileObject); |
| | | |
| | | }); |
| | | return R.data(do2Vos(newFileObjects)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æä»¶çä¿¡æ¯ï¼ä¸ä¼æ¹objectNameåfilePath) |
| | | * |
| | | * @param fileDTOs æä»¶çä¿¡æ¯ |
| | | * @return ä¿®æ¹åçä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R<List<FileObjectVO>> updateFileInfos(Collection<FileObjectDTO> fileDTOs) { |
| | | VciBaseUtil.alertNotNull(fileDTOs,"è¦æ´æ°çæä»¶çä¿¡æ¯"); |
| | | if(fileDTOs.stream().anyMatch(s->!StringUtils.hasLength(s.getId()))){ |
| | | throw new VciBaseException("è¦æ´æ°çæä»¶ä¿¡æ¯ç主é®ä¸è½ä¸ºç©º"); |
| | | } |
| | | Map<String, FileObject> fileObjectMap = Optional.ofNullable(listByIds(fileDTOs.stream().map(FileObjectDTO::getId).collect(Collectors.toList()))).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t, (o1, o2) -> o1)); |
| | | BladeUser user = AuthUtil.getUser(); |
| | | Date now = new Date(); |
| | | fileDTOs.stream().forEach(fileDTO->{ |
| | | if(!fileObjectMap.containsKey(fileDTO.getOid())){ |
| | | throw new VciBaseException("å称为{0}çæä»¶å¨ç³»ç»éä¸åå¨",new String[]{StringUtils.hasLength(fileDTO.getId())?fileDTO.getId():fileDTO.getName()}); |
| | | } |
| | | FileObject fileObject = fileObjectMap.get(fileDTO.getId()); |
| | | String oldObjectName = fileObject.getObjectName(); |
| | | String oldBucketName = fileObject.getBucketName(); |
| | | String filePath = fileObject.getFileLink(); |
| | | BeanUtil.convert(fileDTO,fileObject); |
| | | fileObject.setObjectName(oldObjectName); |
| | | fileObject.setBucketName(oldBucketName); |
| | | fileObject.setFileLink(filePath); |
| | | fileObject.setLastModifier(user.getAccount()); |
| | | fileObject.setLastModifyTime(now); |
| | | fileObject.setTs(now); |
| | | }); |
| | | fileObjectMap.values().stream().forEach(fileObject -> { |
| | | fileObjectMapper.updateById(fileObject); |
| | | }); |
| | | return R.data(do2Vos(fileObjectMap.values())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æä»¶å表æ¥è¯¢ |
| | | * |
| | | * @param fileQuery æä»¶æ¥è¯¢ |
| | | * @return æä»¶çæ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public IPage<FileObjectVO> listFiles(FileQuery fileQuery, Query query){ |
| | | IPage<FileObject> pages = page(Condition.getPage(query), Condition.getQueryWrapper(fileQuery)); |
| | | return pages.convert((fileObject -> do2Vo(fileObject))); |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨æä»¶ç䏻鮿¹éè·å对象 |
| | | * |
| | | * @param oids æä»¶ç主é®éå |
| | | * @return æä»¶çæ¾ç¤ºä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<FileObjectVO> listFilesByOids(Collection<String> oids) { |
| | | return do2Vos(listByIds(oids)); |
| | | } |
| | | |
| | | /** |
| | | * æä»¶çæ |
| | | * |
| | | * @param oids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R releasedFiles(Collection<String> oids) { |
| | | Collection<FileObject> fileObjects = listByIds(oids); |
| | | if(!CollectionUtils.isEmpty(fileObjects)){ |
| | | fileObjects.stream().forEach(obj->{ |
| | | obj.setLcStatus(FileLife.FILE_RELEASE.getValue()); |
| | | fileObjectMapper.updateById(obj); |
| | | }); |
| | | } |
| | | return R.success("çææå"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæå®æä»¶ä¸å¡æ°æ®åçæ |
| | | * |
| | | * @param releaseDTOS çæçç¸å
³ä¿¡æ¯ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R releasedFilesForOwn(Collection<FileReleaseDTO> releaseDTOS) { |
| | | VciBaseUtil.alertNotNull(releaseDTOS,"åå¸çä¿¡æ¯"); |
| | | List<FileObject> fileObjectList = new ArrayList<>(); |
| | | List<String> oids = new ArrayList<>(); |
| | | releaseDTOS.stream().filter(s->!CollectionUtils.isEmpty(s.getOids())).forEach(dtos->{ |
| | | oids.addAll(dtos.getOids()); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(oids)){ |
| | | fileObjectList.addAll(listByIds(oids)); |
| | | } |
| | | releaseDTOS.stream().forEach(dto->{ |
| | | LambdaQueryWrapper<FileObject> queryWrapper = new LambdaQueryWrapper<>(FileObject.class); |
| | | if(StringUtils.hasLength(dto.getOwnBtmName())) { |
| | | queryWrapper.in(FileObject::getOwnBtmName, VciBaseUtil.str2List(dto.getOwnBtmName())); |
| | | } |
| | | if(StringUtils.hasLength(dto.getOwnbizOid())) { |
| | | queryWrapper.in(FileObject::getOwnbizOid, VciBaseUtil.str2List(dto.getOwnbizOid())); |
| | | } |
| | | fileObjectList.addAll(fileObjectMapper.selectList(queryWrapper)); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(fileObjectList)){ |
| | | fileObjectList.stream().forEach(objs->{ |
| | | objs.setLcStatus(FileLife.FILE_RELEASE.getValue()); |
| | | fileObjectMapper.updateById(objs); |
| | | }); |
| | | } |
| | | return R.success("çææå"); |
| | | } |
| | | |
| | | /** |
| | | * å¨ä¸ä¼ æä»¶åï¼ä¿åæä»¶çä¿¡æ¯ |
| | | * |
| | | * @param fileObjectDTO æä»¶ä¿¡æ¯ä¼ è¾å¯¹è±¡ |
| | | * @return æä»¶ä¿¡æ¯æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R<FileObjectVO> saveFileAfterUpload(FileObjectDTO fileObjectDTO) { |
| | | if(fileObjectDTO.getEffect() !=null && fileObjectDTO.getEffect() && !StringUtils.hasLength(fileObjectDTO.getLcStatus())){ |
| | | fileObjectDTO.setLcStatus(FileLife.FILE_RELEASE.getValue()); |
| | | } |
| | | return R.data(addOnlyInfo(fileObjectDTO)); |
| | | } |
| | | |
| | | /** |
| | | * è·å对象 |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æä»¶çæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public FileObjectVO get(String oid) { |
| | | return do2Vo(getById(oid)); |
| | | } |
| | | |
| | | /** |
| | | * ä»
æ·»å ä¿¡æ¯ |
| | | * @param fileObjectDTO æä»¶çæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | public FileObjectVO addOnlyInfo(FileObjectDTO fileObjectDTO){ |
| | | //åå¨ä¸å¡æ°æ®ä¸æä»¶ä¿¡æ¯ |
| | | FileObject fileObject = new FileObject(); |
| | | BeanUtil.convert(fileObjectDTO, fileObject); |
| | | if (!StringUtils.hasLength(fileObject.getOid())) { |
| | | fileObject.setOid(VciBaseUtil.getPk()); |
| | | } |
| | | if (fileObject.getSecretGrade() == null || fileObject.getSecretGrade() == 0) { |
| | | // VciBaseUtil.getCurrentUserSecret()è¿éè¦å¤çï¼å¨è¿å
¥æå¡çæ¶åï¼æ ¹æ®å½åç¨æ·çä¿¡æ¯è·åç¨æ·ç对象 |
| | | fileObject.setSecretGrade( VciBaseUtil.getCurrentUserSecret()); |
| | | } |
| | | fileObjectMapper.insert(fileObject); |
| | | if(log.isDebugEnabled()){ |
| | | log.debug("æ°å¢æä»¶",fileObject.toString()); |
| | | } |
| | | return do2Vo(fileObject); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.bo; |
| | | |
| | | import org.omg.CORBA.portable.IDLEntity; |
| | | |
| | | public class AttributeValue implements IDLEntity { |
| | | public String attrName = ""; |
| | | public String attrVal = ""; |
| | | |
| | | public AttributeValue() { |
| | | } |
| | | |
| | | public AttributeValue(String attrName, String attrVal) { |
| | | this.attrName = attrName; |
| | | this.attrVal = attrVal; |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.code.vo.pagemodel; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /**** |
| | | * æ¹éç³è¯·redisç¼å对象 |
| | | * @author xiejun |
| | | * @date 2023-06-14 |
| | | */ |
| | | @Data |
| | | public class CodeImportTemplateVO { |
| | | private List<ColumnVO> cloNamesList=new ArrayList<>(); |
| | | |
| | | private CodeClassifyTemplateVO codeClstemplateVO; |
| | | private CodeClassifyTemplateVO codeClassifyTemplateVO; |
| | | |
| | | private CodeClassifyVO codeClassifyVO; |
| | | |
| | | |
| | | } |
| | |
| | | <artifactId>ubcs-util-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-user-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.vci.ubcs.omd.entity.Enum; |
| | | import com.vci.ubcs.omd.entity.EnumItem; |
| | | import com.vci.ubcs.omd.vo.EnumVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import io.swagger.models.auth.In; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.mp.support.BladePage; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä¸¾å®ä¹ Feignæ¥å£ç±» |
| | | * |
| | | * @author yuxc |
| | | * @since 2023-05-08 |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_NAME_OMD, |
| | | fallback = IWebSecretFallback.class |
| | | ) |
| | | public interface IWebSecretClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String MINUSER = API_PREFIX + "/secret/min-user"; |
| | | String MINDATA = API_PREFIX + "/secret/min-data"; |
| | | String MINIP = API_PREFIX + "/secret/min-ip"; |
| | | String USER = API_PREFIX + "/secret/user"; |
| | | String USERVO = API_PREFIX + "/secret/uservo"; |
| | | String CHECKDATA = API_PREFIX + "/secret/check-data"; |
| | | String CHECKUSERDATA = API_PREFIX + "/secret/chec-user-data"; |
| | | String CHECKUSERIDDATA = API_PREFIX + "/secret/chec-userid-data"; |
| | | String CHECKVO = API_PREFIX + "/secret/checkvo"; |
| | | String IP = API_PREFIX + "/secret/ip"; |
| | | String IPUSER = API_PREFIX + "/secret/ip-user"; |
| | | String IPSECRET = API_PREFIX + "/secret/ip-secret"; |
| | | String IPUSERID = API_PREFIX + "/secret/ip-userid"; |
| | | String IPUSERVO = API_PREFIX + "/secret/ip-uservo"; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§çæå°å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @GetMapping(MINUSER) |
| | | R<Integer> getMinUserSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åæ°æ®å¯çº§çé»è®¤å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @GetMapping(MINDATA) |
| | | R<Integer> getMinDataSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åIPå¯çº§çé»è®¤å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @GetMapping(MINIP) |
| | | R<Integer> getMinIpSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * @param userId ç¨æ·ä¸»é® |
| | | * @return ç¨æ·çå¯çº§ |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | @GetMapping(USER) |
| | | R<Integer> getUserSecret(@RequestParam("userId") String userId) throws VciBaseException ; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * @param userVO ç¨æ·çæ¾ç¤ºå¯¹è±¡ |
| | | * @return ç¨æ·çå¯çº§ |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | @GetMapping(USERVO) |
| | | R<Integer> getUserSecret(@RequestBody UserVO userVO) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¡éªå½åç¨æ·æ¯å¦ææéè®¿é®æ°æ® |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | @GetMapping(CHECKDATA) |
| | | R<Boolean> checkDataSecret(@RequestParam("secret") int secret); |
| | | |
| | | /** |
| | | * æ ¡éªç¨æ·çå¯çº§æ¯å¦æ¯å¦ææéè®¿é®æ°æ® |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userSecret ç¨æ·å¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | @GetMapping(CHECKUSERDATA) |
| | | R<Boolean> checkDataSecret(@RequestParam("secret") int secret, @RequestParam("userSecret") int userSecret) ; |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·åæ¥æ ¡éªæ°æ®å¯çº§ |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userId ç¨æ·å |
| | | * @return true表示å
è®¸è®¿é® |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | @GetMapping(CHECKUSERIDDATA) |
| | | R<Boolean> checkDataSecret(@RequestParam("secret") int secret, @RequestParam("userId") String userId) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·å¯¹è±¡æ¥æ ¡éªæ°æ®å¯çº§ |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userVO ç¨æ·çæ¾ç¤ºå¯¹è±¡ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | @GetMapping(CHECKVO) |
| | | R<Boolean> checkDataSecret(@RequestParam("secret") int secret,@RequestBody UserVO userVO) ; |
| | | |
| | | /** |
| | | * è·åIPå°åçå¯çº§ |
| | | * @param ip ipå°å |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @GetMapping(IP) |
| | | R<Integer> getIpSecret(@RequestParam("ip") String ip) throws VciBaseException; |
| | | /** |
| | | * æ£æ¥æºå¨å¯çº§ |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @param userSecret ç¨æ·çå¯çº§ |
| | | * @return å¯çº§çå¼ |
| | | */ |
| | | @GetMapping(IPUSER) |
| | | R<Boolean> checkIpSecret(@RequestParam("ipSecret") int ipSecret, @RequestParam("userSecret") int userSecret); |
| | | |
| | | /** |
| | | * æ£æ¥å½åç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | @GetMapping(IPSECRET) |
| | | R<Boolean> checkIpSecret(@RequestParam("ipSecret") int ipSecret) ; |
| | | |
| | | /** |
| | | * æ ¡éªæå®ipåç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * @param ip ipå°å |
| | | * @param userId ç¨æ·å |
| | | * @return true表示å
è®¸è®¿é® |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | @GetMapping(IPUSERID) |
| | | R<Boolean> checkIpSecret(@RequestParam("ip") String ip, @RequestParam("userId") String userId) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¡éªæå®IPåç¨æ·å¯¹è±¡ç¬¦åæºå¨å¯çº§ |
| | | * @param ip ipå°å |
| | | * @param userVO ç¨æ·å¯¹è±¡ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | @GetMapping(IPUSERVO) |
| | | R<Boolean> checkIpSecret(@RequestParam("ip") String ip,@RequestBody UserVO userVO) ; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.omd.feign; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Feign失败é
ç½® |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class IWebSecretFallback implements IWebSecretClient { |
| | | |
| | | |
| | | @Override |
| | | public R<Integer> getMinUserSecret() throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getMinDataSecret() throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getMinIpSecret() throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getUserSecret(String userId) throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getUserSecret(UserVO userVO) throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, int userSecret) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, String userId) throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, UserVO userVO) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getIpSecret(String ip) throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(int ipSecret, int userSecret) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(int ipSecret) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(String ip, String userId) throws VciBaseException { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(String ip, UserVO userVO) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.util; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | public class Tool { |
| | | |
| | | public static final String ALLOWNULL = "allowNull"; |
| | | public static final String BTM = "btm"; |
| | | public static final String ISFIXLEN = "isFixLen"; |
| | | public static final String LENGTH = "length"; |
| | | public static final String ENUMNAME = "enumName"; |
| | | public static final String ACCURACY = "accuracy"; |
| | | public static final String LINKTYPENAME = "linkTypeName"; |
| | | public static final String VERSION = "version"; |
| | | |
| | | |
| | | public static ArrayList<String> convertArrayToList(String[] array) { |
| | | ArrayList<String> list = new ArrayList(); |
| | | |
| | | for(int i = 0; i < array.length; ++i) { |
| | | list.add(array[i]); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | public static String getOtherValueByType(String other, String type) { |
| | | String[] otherArray = other.split(";"); |
| | | |
| | | for(int i = 0; i < otherArray.length; ++i) { |
| | | String otherValue = otherArray[i]; |
| | | if (otherValue.contains(type)) { |
| | | return otherValue.substring(otherValue.indexOf("=") + 2, otherValue.length()); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.utils; |
| | | |
| | | import com.vci.ubcs.omd.vo.EnumVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class VciOmdUtil { |
| | | /** |
| | | * å°List<EnumVO> 转æ¢ä¸ºKeyValue ç±»å |
| | | * @param enums æä¸¾éå |
| | | * @return KeyValueéå |
| | | */ |
| | | public static List<KeyValue> enumsToListKeyVale(List<EnumVO> enums) { |
| | | List<KeyValue> keyValues = new ArrayList<>(); |
| | | for (EnumVO anEnum : enums) { |
| | | KeyValue keyValue = new KeyValue(); |
| | | keyValue.setKey(anEnum.getItemName()); |
| | | keyValue.setValue(anEnum.getItemValue()); |
| | | keyValues.add(keyValue); |
| | | } |
| | | return keyValues; |
| | | } |
| | | } |
| | |
| | | private static Logger logger = LoggerFactory.getLogger(ExcelUtil.class); |
| | | public static final String KEY_ATTR_CHAR = "â"; |
| | | public static final String REQUIRED_CHAR = "*"; |
| | | /** |
| | | * æ¿æ¢å符 |
| | | */ |
| | | public static final String SPECIAL_CHAR = "VCI"; |
| | | |
| | | public ExcelUtil() { |
| | | } |
| | |
| | | package com.vci.ubcs.starter.util; |
| | | |
| | | import com.alibaba.druid.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ°å¢æ¶é»è®¤å¼å±æ§èµå¼ |
| | |
| | | baseModel.setVersionSeq(1); |
| | | baseModel.setVersionRule("0"); |
| | | baseModel.setVersionValue("1"); |
| | | baseModel.setNameOid(VciBaseUtil.getPk()); |
| | | baseModel.setRevisionOid(VciBaseUtil.getPk()); |
| | | baseModel.setLastModifier(userId); |
| | | }catch (VciBaseException e){ |
| | | e.printStackTrace(); |
| | |
| | | return (T)baseModel; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æ¶å¡«å
é»è®¤å¼ |
| | | * @param object ç»§æ¿äºBaseModelçå®ä½å¯¹è±¡ |
| | | * @param <T> è¿åå¼çç±»å |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | public static <T extends BaseModel> T copplyDefaultAttrAssimt(Map<String,String> dataMap, T object) throws VciBaseException { |
| | | BaseModel baseModel = object; |
| | | try { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | baseModel.setOid(dataMap.getOrDefault("OID","")); |
| | | String createTime=dataMap.getOrDefault("CREATETIME",""); |
| | | baseModel.setCreateTime(chageStringToDate(createTime)); |
| | | baseModel.setNameOid(dataMap.getOrDefault("NAMEOID","")); |
| | | |
| | | String lastModifyTime=dataMap.getOrDefault("LASTMODIFYTIME",""); |
| | | baseModel.setLastModifyTime(chageStringToDate(lastModifyTime)); |
| | | String ts=dataMap.getOrDefault("TS",""); |
| | | baseModel.setTs(chageStringToDate(ts)); |
| | | baseModel.setRevisionOid(dataMap.getOrDefault("REVISIONOID","")); |
| | | //ç¨æ·id |
| | | String userId = AuthUtil.getUserId().toString(); |
| | | baseModel.setBtmname(dataMap.getOrDefault("BTMNAME","")); |
| | | baseModel.setCreator(dataMap.getOrDefault("CREATOR","")); |
| | | baseModel.setFirstR(dataMap.getOrDefault("FIRSTR","")); |
| | | baseModel.setFirstV(dataMap.getOrDefault("FIRSTV","")); |
| | | baseModel.setLastR(dataMap.getOrDefault("LASTR","")); |
| | | baseModel.setLastV(dataMap.getOrDefault("LASTV","")); |
| | | baseModel.setRevisionSeq(chageStringToInt(dataMap.getOrDefault("REVISIONSEQ",""))); |
| | | baseModel.setOwner(dataMap.getOrDefault("OWNER","")); |
| | | baseModel.setVersionSeq(chageStringToInt(dataMap.getOrDefault("VERSIONSEQ",""))); |
| | | baseModel.setVersionRule(dataMap.getOrDefault("VERSIONRULE","")); |
| | | baseModel.setVersionValue(dataMap.getOrDefault("VERSIONVALUE","")); |
| | | baseModel.setRevisionOid(dataMap.getOrDefault("REVISIONOID","")); |
| | | baseModel.setLastModifier(userId); |
| | | }catch (VciBaseException e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return (T)baseModel; |
| | | } |
| | | |
| | | private static int chageStringToInt(String value){ |
| | | int newValue=0; |
| | | if(StringUtils.isNotBlank(value)){ |
| | | newValue = Integer.parseInt(value); |
| | | } |
| | | return newValue; |
| | | } |
| | | |
| | | private static Date chageStringToDate(String value){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date date=new Date(); |
| | | if(StringUtils.isNotBlank(value)){ |
| | | try { |
| | | date = format.parse(value); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return date; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.starter.web.constant; |
| | | |
| | | /** |
| | | * åºç¡æ¡æ¶ä¸ä¸å¡é¨åçå¤è¯è¨ä»£ç |
| | | * @author weidy |
| | | * @date 2020/4/25 |
| | | */ |
| | | public class FrameWorkBusLangCodeConstant { |
| | | |
| | | //ç»éé¨åç |
| | | /** |
| | | * ç¨æ·å·²ç»ç»å½ |
| | | */ |
| | | public static final String USER_IS_LOGINED = "userIsLogined"; |
| | | |
| | | /** |
| | | * ç¨æ·æ²¡ææ¾å° |
| | | */ |
| | | public static final String USER_NOT_FOUND = "userNotFound"; |
| | | |
| | | /** |
| | | * ç¨æ·å·²ç»åç¨ |
| | | */ |
| | | public static final String USER_IS_DISABLED = "userIsDisabled"; |
| | | |
| | | /** |
| | | * ç¨æ·å·²ç»è¢«éå® |
| | | */ |
| | | public static final String USER_IS_LOCK = "userIsLocked"; |
| | | |
| | | /** |
| | | * ç¨æ·å·²ç»è¶
è¿å¤±ææ¶é´ |
| | | */ |
| | | public static final String USER_MORE_THAN_DISABLE_DATE = "moreDisableDate"; |
| | | |
| | | /** |
| | | * ç¨æ·å¯ç é误被éå® |
| | | */ |
| | | public static final String USER_PWD_LOCK = "userPwdErrorLock"; |
| | | |
| | | /** |
| | | * ç¨æ·å¯ç ä¸ç¸ç |
| | | */ |
| | | public static final String USER_PWD_NOT_EQUAL = "userPwdNotEqual"; |
| | | |
| | | |
| | | //å¯ç ç¸å
³ |
| | | |
| | | /** |
| | | * 确认å¯ç ä¸ç¸å |
| | | */ |
| | | public static final String CHANGE_PWD_NOT_EQUAL="changePwdNotEqual"; |
| | | |
| | | /** |
| | | * 没æå¯ç çç¥ |
| | | */ |
| | | public static final String HAS_NOT_PWD_STRATEGY="hasNotPasswordStrategy"; |
| | | |
| | | /** |
| | | * å¯ç å®å
¨çç¥æªæ¾å° |
| | | */ |
| | | public static final String PASSWORD_STRATEGY_NOT_FOUND = "passwordStrategyNotFound"; |
| | | |
| | | /** |
| | | * å¯ç æéå符类å为空 |
| | | */ |
| | | public static final String REQUIRE_CHAR_TYPE_NULL = "requireCharTypeNull"; |
| | | |
| | | /** |
| | | * å¯ç çå符类åä¸ç¬¦åè¦æ± |
| | | */ |
| | | public static final String REQUIRE_CHAR_TYPE_NOT_EXIST = "requireCharTypeNotExist"; |
| | | |
| | | /** |
| | | * å¯ç å¤æåº¦ä¸ç¬¦åè¦æ± |
| | | */ |
| | | public static final String LESS_CHAR_TYPE = "lessCharType"; |
| | | |
| | | /** |
| | | * å¯ç ä¸å
å«å°å忝 |
| | | */ |
| | | public static final String NOT_HAS_LOW_LETTER= "notHasLowLetter"; |
| | | |
| | | /** |
| | | * å¯ç ä¸å
嫿°å |
| | | */ |
| | | public static final String NOT_HAS_NUMBER = "notHasNumber"; |
| | | |
| | | /** |
| | | * å¯ç ä¸å
å«ç¹æ®åæ¯ |
| | | */ |
| | | public static final String NOT_HAS_SPECIAL ="notHasSpecial"; |
| | | |
| | | /** |
| | | * å¯ç ä¸ç¬¦åæå°é¿åº¦è¦æ± |
| | | */ |
| | | public static final String LESS_MIN_LENGTH = "lessMinLength"; |
| | | |
| | | /** |
| | | * å¯ç ä¸ç¬¦åæå¤§é¿åº¦è¦æ± |
| | | */ |
| | | public static final String MORE_MAX_lENGTH ="moreMaxLength"; |
| | | /** |
| | | * å¯ç å³å°è¿æ |
| | | */ |
| | | public static final String PASSWORD_REMAIN_DAY = "passwordRemainDay"; |
| | | |
| | | //ç»ç» |
| | | |
| | | |
| | | //é¨é¨ |
| | | |
| | | //èå¡ |
| | | |
| | | |
| | | //è级 |
| | | |
| | | //ç¨æ· |
| | | |
| | | //è§è² |
| | | |
| | | //æé |
| | | |
| | | //å°åºåç±» |
| | | |
| | | //å°ç¹ |
| | | |
| | | //è系人 |
| | | |
| | | //ç©æåºæ¬ä¿¡æ¯ |
| | | |
| | | //ç©æ |
| | | |
| | | /** |
| | | * ç©æçåºåå· |
| | | */ |
| | | public static final String BD_MATERIAL_SERIAL_NUMBER_REPEAT = "materialSerialNumberRepeat"; |
| | | |
| | | //åºæ¿ç±»å |
| | | |
| | | /** |
| | | * åºæ¿åç±»çå
鍿 è¯ä¸å
¨æ¯è±æ |
| | | */ |
| | | public static final String BD_WAREHOUSE_CLASSIFY_ID_NOT_LETTER = "warehouseClassifyIdNotLetter"; |
| | | |
| | | /** |
| | | * å ä¸ºå·²ç»æåå¨ä½¿ç¨å½ååç±»çåºæ¿ï¼æä»¥åªæ¯ä¿®æ¹åç§°ï¼æè¿°åä¸çº§åç±» |
| | | */ |
| | | public static final String BD_WAREHOUSE_CLASSIFY_LINK_BY_WAREHOUSE ="warehouseClassifyLinkByWarehouse" ; |
| | | |
| | | /** |
| | | * ä¸ä¸çº§åºæ¿åºæ¬åç±»çåºæ¿ç±»åä¸ç¸å |
| | | */ |
| | | public static final String BD_WAREHOUSE_CLASSIFY_TYPE_NOT_EQUAL_PARENT = "warehouseClassifyParentNotEqualType"; |
| | | |
| | | //åºæ¿ç®¡ç |
| | | |
| | | /** |
| | | * ä¸ä¸çº§åºæ¿çåºæ¿åç±»ä¸ç¸å |
| | | */ |
| | | public static final String BD_WAREHOUSE_PARENT_WAREHOUSE_NOT_EQUAL_CLASSIFY = "warehouseParentNotEqualClassify"; |
| | | |
| | | /** |
| | | * ææ°æ®ä¸è½ä¿®æ¹åºæ¿çæå±åºæ¬åç±» |
| | | */ |
| | | public static final String BD_WAREHOUSE_HAS_DATA_NOT_EDIT_CLASSIFY = "warehouseHasDataNotEditClassify"; |
| | | |
| | | /** |
| | | * 没æä¼ éç¨æ·ç主é®ï¼ä¸è½è®¾ç½®ç®¡çå |
| | | */ |
| | | public static final String BD_WAREHOUSE_ADMIN_USEROID_NOT_HAS = "warehouseAdminUserOidNotHas"; |
| | | |
| | | /** |
| | | * ä¸ºåºæ¿è®¾ç½®ç®¡çåæå |
| | | */ |
| | | public static final String BD_WAREHOUSE_ADMIN_LINK_SUCCESS = "warehouseAdminLinkSuccess"; |
| | | |
| | | /** |
| | | * åºæ¿åç±»ç主é®ä¸åå¨ |
| | | */ |
| | | public static final String BD_WAREHOUSE_CLASSIFY_OID_NOT_EXIST = "warehouseClassifyOidNotExsit"; |
| | | |
| | | /** |
| | | * å½åç¨æ·æ²¡æåºæ¿çæé |
| | | */ |
| | | public static final String BD_WAREHOUSE_NOT_RIGHT = "warehouseNotRight"; |
| | | |
| | | |
| | | //è´§ä½ |
| | | |
| | | /** |
| | | * ä¸çº§ä¸æ¯ä¸ä¸ªè´§æ¶ |
| | | */ |
| | | public static final String BD_GOODS_LOCATION_PARENT_NOT_SHELF = "goodsLocationParentNotShelf"; |
| | | |
| | | //Feign |
| | | |
| | | /** |
| | | * å½åç¨æ·æ²¡æå¯¹è¯¥åºæ¿çæä½æé |
| | | */ |
| | | public static final String BD_FEIGN_WAREHOUSEADMIN_NOT_PERMISSION = "feignCheckWareHouseAdminPermissions"; |
| | | |
| | | //计éåä½ |
| | | /** |
| | | * 计éåä½ä¸åå¨ |
| | | */ |
| | | public static final String UNIT_NOT_EXIST_BY_IDS = "unitNotExistByIds"; |
| | | |
| | | /** |
| | | * æ·»å æå |
| | | */ |
| | | public static final String ADD_SUCCESS ="addSuccess"; |
| | | |
| | | /** |
| | | * æ·»å 失败 |
| | | */ |
| | | public static final String ADD_FAIL = "addFailInDB"; |
| | | |
| | | /** |
| | | * ä¿®æ¹æå |
| | | */ |
| | | public static final String EDIT_SUCCESS = "editSuccess"; |
| | | |
| | | /** |
| | | * ä¿®æ¹å¤±è´¥ |
| | | */ |
| | | public static final String EDIT_FAIL = "editFail"; |
| | | |
| | | /** |
| | | * å 餿å |
| | | */ |
| | | public static final String DELETE_SUCCESS = "deleteSuccess"; |
| | | |
| | | /** |
| | | * 级èå 餿å |
| | | */ |
| | | public static final String DELETE_SUCCESS_CASCADE = "deleteSuccessCascade"; |
| | | |
| | | /** |
| | | * å é¤å¤±è´¥ |
| | | */ |
| | | public static final String DELETE_FAIL = "deleteFail"; |
| | | |
| | | /** |
| | | * å¯ç¨æå |
| | | */ |
| | | public static final String ENABLE_SUCCESS ="enableSuccess"; |
| | | |
| | | /** |
| | | * é宿å |
| | | */ |
| | | public static final String LOCK_SUCCESS = "lockSuccess"; |
| | | |
| | | /** |
| | | * éå®å¤±è´¥ |
| | | */ |
| | | public static final String LOCK_FAIL = "lockFail"; |
| | | |
| | | /** |
| | | * è§£éæå |
| | | */ |
| | | public static final String UNLOCK_SUCCESS = "unlockSuccess"; |
| | | |
| | | /** |
| | | * è§£é失败 |
| | | */ |
| | | public static final String UNLOCK_FAIL = "unlockFail"; |
| | | |
| | | /** |
| | | * 级èå¯ç¨æå |
| | | */ |
| | | public static final String ENABLE_SUCCESS_CASCADE = "enableSuccessCascade"; |
| | | |
| | | /** |
| | | * å¯ç¨å¤±è´¥ |
| | | */ |
| | | public static final String ENABLE_FAIL = "enableFail"; |
| | | |
| | | /** |
| | | * åç¨æå |
| | | */ |
| | | public static final String DISABLE_SUCCESS = "disableSuccess"; |
| | | |
| | | /** |
| | | * 级èåç¨æå |
| | | */ |
| | | public static final String DISABLE_SUCCESS_CASCADE = "disableSuccessCascade"; |
| | | |
| | | /** |
| | | * åç¨å¤±è´¥ |
| | | */ |
| | | public static final String DISABLE_FAIL = "disableFail"; |
| | | |
| | | /** |
| | | * åçæ¬å·æå |
| | | */ |
| | | public static final String UP_REVISION_SUCCESS = "dataUpRevisionSuccess"; |
| | | |
| | | /** |
| | | * åçæ¬å·å¤±è´¥ |
| | | */ |
| | | public static final String UP_REVISION_FAIL = "dataUpRevisionFail"; |
| | | |
| | | /** |
| | | * åçæ¬¡æå |
| | | */ |
| | | public static final String UP_VERSION_SUCCESS = "dataUpVersionSuccess"; |
| | | |
| | | /** |
| | | * åçæ¬¡å¤±è´¥ |
| | | */ |
| | | public static final String UP_VERSION_FAIL = "dataUpVersionFail"; |
| | | |
| | | /** |
| | | * æäº¤æå |
| | | */ |
| | | public static final String SUBMIT_SUCCESS= "submitSuccess"; |
| | | |
| | | /** |
| | | * æäº¤å¤±è´¥ |
| | | */ |
| | | public static final String SUBMIR_FAIL = "submitFail"; |
| | | |
| | | /** |
| | | * å叿å |
| | | */ |
| | | public static final String RELEASE_SUCCESS = "releaseSuccess"; |
| | | |
| | | /** |
| | | * åå¸å¤±è´¥ |
| | | */ |
| | | public static final String RELEASE_FAIL = "releaseFail"; |
| | | |
| | | /** |
| | | * çæ¬å·éå¤ |
| | | */ |
| | | public static final String REVISION_REPEAT = "revisionRepeat"; |
| | | |
| | | /** |
| | | * çæ¬¡å·éå¤ |
| | | */ |
| | | public static final String VERSION_REPEAT= "versionRepeat"; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢æ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_OID_NOT_EXIST = "dataOidNotExist"; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®æ¥è¯¢çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_ID_NOT_EXIST = "dataIdNotExist"; |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°æ¥è¯¢çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_NAME_NOT_EXIST = "dataNameNotExist"; |
| | | |
| | | /** |
| | | * 屿§å¼éå¤ |
| | | */ |
| | | public static final String DATA_ATTR_REPEAT = "dataRepeat"; |
| | | |
| | | /** |
| | | * èçæ¬çæ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String OLD_REVISION_DATA_NOT_EXIST = "oldRevsionDataNotExist"; |
| | | |
| | | /** |
| | | * ä¸çº§ä¸»é®å®é
æ¯å½åèç¹çä¸çº§èç¹ï¼ä¼å¼èµ·æ»å¾ªç¯ |
| | | */ |
| | | public static final String PARENT_OID_IS_CHILD ="parentIsChild"; |
| | | |
| | | /** |
| | | * æ°æ®è¢«å¼ç¨ï¼ä¸å
许å é¤ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_DELETE = "dataLinkedNotDelete"; |
| | | |
| | | /** |
| | | * æ°æ®çåèç¹ä¹è¢«å¼ç¨ï¼ä¸å
许å é¤ |
| | | */ |
| | | public static final String DATA_CASCADE_LINKED_NOT_DELETE = "dataCascadeLinkedNotDelete"; |
| | | |
| | | /** |
| | | * æ°æ®è¢«å¼ç¨ï¼ä¸å
è®¸ä¿®æ¹ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_EDIT ="dataLinkedNotEdit"; |
| | | |
| | | /** |
| | | * æ°æ®ä¸å¼ç¨ï¼ä¸å
è®¸ä¿®æ¹æä¸ªå±æ§ |
| | | */ |
| | | public static final String DATA_LINKED_NOT_EDIT_ATTR="dataLinkedNotEditAttr"; |
| | | |
| | | /** |
| | | * ä¸çº§æ¡£æ¡ä¸åå¨ |
| | | */ |
| | | public static final String DATA_PARENT_NOT_EXIST = "parentNotExist"; |
| | | |
| | | /** |
| | | * åç±»æ°æ®ä¸åå¨ |
| | | */ |
| | | public static final String DATA_CLASSIFY_NOT_EXIST = "classifyNotExist"; |
| | | |
| | | /** |
| | | * å½åç¶æä¸ä¸å
è®¸ä¿®æ¹æ°æ® |
| | | */ |
| | | public static final String LCSTATUS_CAN_NOT_EDIT = "lcStatusCannotEditData"; |
| | | |
| | | /** |
| | | * å½åç¶æä¸ä¸å
许å 餿°æ® |
| | | */ |
| | | public static final String LCSTATUS_CAN_NOT_DELETE = "lcStatusCannotDeleteData"; |
| | | |
| | | /** |
| | | * 导å
¥æå |
| | | */ |
| | | public static final String IMPORT_SUCCESS = "importSuccess"; |
| | | |
| | | /** |
| | | * 导å
¥å¤±è´¥ |
| | | */ |
| | | public static final String IMPORT_FAIL = "importFail"; |
| | | |
| | | /** |
| | | * 导å
¥çæ¨¡æ¿æä»¶ä¸åå¨ |
| | | */ |
| | | public static final String IMPORT_TEMPLATE_FILE_NOT_FOUND = "importTemplateFileNotFound"; |
| | | |
| | | /** |
| | | * å¯¼åºæå |
| | | */ |
| | | public static final String EXPORT_SUCCESS = "exportSuccess"; |
| | | |
| | | /** |
| | | * 导åºå¤±è´¥ |
| | | */ |
| | | public static final String EXPORT_FAIL = "exportFail"; |
| | | |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | public static final String UPLOAD_SUCCESS = "uploadSuccess"; |
| | | |
| | | /** |
| | | * ä¸ä¼ 失败 |
| | | */ |
| | | public static final String UPLOAD_FAIL = "uploadFail"; |
| | | |
| | | /** |
| | | * ä¸è½½æå |
| | | */ |
| | | public static final String DOWNLOAD_SUCCESS = "downloadSuccess"; |
| | | |
| | | /** |
| | | * ä¸è½½å¤±è´¥ |
| | | */ |
| | | public static final String DOWNLOAD_FAIL = "downloadFail"; |
| | | |
| | | /** |
| | | * æä»¶ä¸åå¨ |
| | | */ |
| | | public static final String FILE_NOT_EXIST = "fileNotExist"; |
| | | |
| | | /** |
| | | * å®¡æ¹æå |
| | | */ |
| | | public static final String AUDIT_SUCCESS = "auditSuccess"; |
| | | |
| | | /** |
| | | * 审æ¹å¤±è´¥ |
| | | */ |
| | | public static final String AUDIT_FAIL = "auditFail"; |
| | | |
| | | /** |
| | | * ä¸åæå |
| | | */ |
| | | public static final String ISSUED_SUCCESS = "issuedSuccess"; |
| | | |
| | | /** |
| | | * ä¸å失败 |
| | | */ |
| | | public static final String ISSUED_FAIL = "issuedFail"; |
| | | |
| | | /** |
| | | * æ¥æ¶æå |
| | | */ |
| | | public static final String RECEIVE_SUCCESS = "receiveSuccess"; |
| | | |
| | | /** |
| | | * æ¥æ¶å¤±è´¥ |
| | | */ |
| | | public static final String RECEIVE_FAIL = "receiveFail"; |
| | | |
| | | /** |
| | | * 计åçå¶é 便®ä¸åå¨ |
| | | */ |
| | | public static final String PLAN_SOURCE_NOT_EXIST = "planSourceNotExist"; |
| | | |
| | | /** |
| | | * 计åçå¶é ç®æ ä¸åå¨ |
| | | */ |
| | | public static final String PLAN_TARGET_NOT_EXIST = "planTargetNotExist"; |
| | | |
| | | /** |
| | | * æ´¾åæå |
| | | */ |
| | | public static final String DISPATCH_SUCCESS = "dispatchSuccess"; |
| | | |
| | | /** |
| | | * æ´¾å失败 |
| | | */ |
| | | public static final String DISPATCH_FAIL = "dispatchFail"; |
| | | |
| | | /** |
| | | * 该计åä¸ä¸å卿´¾åè¿çä»»å¡ |
| | | */ |
| | | public static final String DISPATCH_TASK_NOT_EXIST_BY_PLAN = "dispatchTaskNotExistByPlan"; |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.starter.web.enumpck; |
| | | |
| | | import com.alibaba.druid.util.StringUtils; |
| | | |
| | | public interface BaseEnum { |
| | | String getValue(); |
| | | |
| | | String getText(); |
| | | |
| | | |
| | | /** |
| | | * ä½¿ç¨æä¸¾çå¼è·åæä¸¾å¯¹è±¡çéç¨æ¹æ³ |
| | | * @param clazz æä¸¾æå±ç±» |
| | | * @param value æä¸¾çå¼ |
| | | * @param <T> ç±»å |
| | | * @return ç»æ |
| | | */ |
| | | public static <T extends BaseEnum> T getEnumByValue(Class<T> clazz,Object value){ |
| | | if(value == null){ |
| | | return null; |
| | | } |
| | | T[] enums = clazz.getEnumConstants(); |
| | | if (enums == null || enums.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | for (T e : enums) { |
| | | if (value instanceof String) { |
| | | if (StringUtils.equalsIgnoreCase((String) value, (String) ((BaseEnum) e).getValue())) { |
| | | return e; |
| | | } |
| | | } else { |
| | | if (value.equals(e.getValue())) { |
| | | return e; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨æä¸¾çå¼è·åæ¾ç¤ºææ¬çæ¹æ³ |
| | | * @param clazz æä¸¾æå±çç±» |
| | | * @param value æä¸¾çå¼ |
| | | * @param <T> ç±»å |
| | | * @return ç»æ |
| | | */ |
| | | public static <T extends BaseEnum> String getTextByValue(Class<T> clazz,String value){ |
| | | T e = getEnumByValue(clazz, value); |
| | | if (e == null) { |
| | | return ""; |
| | | } |
| | | return ((BaseEnum) e).getText(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.starter.web.enumpck; |
| | | |
| | | |
| | | public enum DataSecretEnum implements BaseEnumInt { |
| | | NONE(10, "éå¯"), |
| | | INNER(15, "å
é¨"), |
| | | SECRET(20, "ç§å¯"), |
| | | PRIVACY(30, "æºå¯"); |
| | | |
| | | private int value; |
| | | private String text; |
| | | |
| | | public int getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getText() { |
| | | return this.text; |
| | | } |
| | | |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | private DataSecretEnum(int secret, String secretText) { |
| | | this.value = secret; |
| | | this.text = secretText; |
| | | } |
| | | |
| | | public static String getSecretText(int secret) { |
| | | DataSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | DataSecretEnum eu = var1[var3]; |
| | | if (eu.value == secret) { |
| | | return eu.text; |
| | | } |
| | | } |
| | | |
| | | return NONE.text; |
| | | } |
| | | |
| | | public static int getSecretValueByText(String text) { |
| | | DataSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | DataSecretEnum eu = var1[var3]; |
| | | if (eu.text.equalsIgnoreCase(text)) { |
| | | return eu.value; |
| | | } |
| | | } |
| | | |
| | | return NONE.value; |
| | | } |
| | | |
| | | public static boolean isValid(int secret) { |
| | | DataSecretEnum[] var1 = values(); |
| | | int var2 = var1.length; |
| | | |
| | | for(int var3 = 0; var3 < var2; ++var3) { |
| | | DataSecretEnum eu = var1[var3]; |
| | | if (eu.value == secret) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | * ç¼ç è§åï¼æå¡å¯å¨å |
| | | */ |
| | | APPLICATION_NAME_CODE(AppConstant.APPLICATION_NAME_CODE,"ä¸»æ°æ®"), |
| | | APPLICATION_FLOW_NAME(AppConstant.APPLICATION_FLOW_NAME,"ubcs-flow"), |
| | | ; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.starter.web.enumpck; |
| | | |
| | | |
| | | /** |
| | | * æµç¨æ¨¡æ¿åºç¨æé®ç±»å |
| | | * @author wang1 |
| | | */ |
| | | public enum ProcessTemplateTypeEnum implements BaseEnum { |
| | | |
| | | /** |
| | | * åå¸ |
| | | */ |
| | | PUBLIC("PUBLIC","åå¸"), |
| | | |
| | | /** |
| | | * åæ´ |
| | | */ |
| | | EDIT("EDIT","åæ´"), |
| | | |
| | | /** |
| | | * åç¨ |
| | | */ |
| | | ENABLE("ENABLE","åç¨"), |
| | | |
| | | /** |
| | | * å¯ç¨ |
| | | */ |
| | | DISABLE("DISABLE","å¯ç¨"); |
| | | |
| | | /** |
| | | * æä¸¾çå¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æä¸¾æ¾ç¤ºææ¬ |
| | | */ |
| | | private String text; |
| | | |
| | | /** |
| | | * è·åæä¸¾å¼ |
| | | * |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | @Override |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * 设置æä¸¾å¼ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | */ |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾æ¾ç¤ºææ¬ |
| | | * |
| | | * @return æ¾ç¤ºææ¬ |
| | | */ |
| | | @Override |
| | | public String getText() { |
| | | return text; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¾ç¤ºææ¬ |
| | | * |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | public void setText(String text) { |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æé 彿° |
| | | * |
| | | * @param value å¼ |
| | | * @param text æ¾ç¤ºææ¬ |
| | | */ |
| | | private ProcessTemplateTypeEnum(String value, String text) { |
| | | this.value = value; |
| | | this.text = text; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·å对åºçæä¸¾å¼ |
| | | * |
| | | * @param text åç§° |
| | | * @return æä¸¾å¼ |
| | | */ |
| | | public static String getValueByText(String text) { |
| | | for (ProcessTemplateTypeEnum wenum : ProcessTemplateTypeEnum.values()) { |
| | | if (wenum.getText().equalsIgnoreCase(text)) { |
| | | return wenum.getValue(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·ååç§° |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return åç§° |
| | | */ |
| | | public static String getTextByValue(String value) { |
| | | for (ProcessTemplateTypeEnum wenum : ProcessTemplateTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum.getText(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä¸¾å¼è·åæä¸¾å¯¹è±¡ |
| | | * |
| | | * @param value æä¸¾å¼ |
| | | * @return æä¸¾å¯¹è±¡ï¼ä¸å卿¶åè¿ånull |
| | | */ |
| | | public static ProcessTemplateTypeEnum forValue(String value) { |
| | | for (ProcessTemplateTypeEnum wenum : ProcessTemplateTypeEnum.values()) { |
| | | if (wenum.getValue().equalsIgnoreCase(value)) { |
| | | return wenum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> list) { |
| | | return switchCollectionForOracleIn(list, 500); |
| | | } |
| | | |
| | | /** |
| | | * oracle in æ¥è¯¢ä¸è½è¶
è¿1000ï¼è½¬æ¢ä¸ä¸éå |
| | | * ç±äºSQLè¯å¥1000个å¯è½å¾é¿ï¼è¶
è¿oracle10gï¼æä»¥çºç²æ§è½åé
为500个æ°ç» |
| | | * @param list éè¦è½¬æ¢çå表å
容 |
| | | * @return åç»åçlist |
| | | */ |
| | | public static <T> List<List<T>> switchListForOracleIn(List<T> list) { |
| | | List<List<T>> listHasList = new ArrayList<List<T>>(); |
| | | if(list == null){ |
| | | return listHasList; |
| | | } |
| | | List<T> newList = new ArrayList<T>(); |
| | | for(Object obj : list){ |
| | | //为äºè®©listè¿å¯ä»¥æ·»å å
容ï¼å 为使ç¨subliståï¼listä¸è½åAddäº |
| | | newList.add((T)obj); |
| | | } |
| | | int muti = 1; |
| | | if(newList.size() >500){ |
| | | int balance = newList.size()%500; |
| | | muti = (newList.size() - balance)/500 + (balance == 0?0:1); |
| | | } |
| | | for(int i = 0 ; i < muti; i ++){ |
| | | int start = i*500; |
| | | int end = start + 500; |
| | | if(i == muti-1 || end >newList.size() ){ |
| | | end = newList.size(); |
| | | } |
| | | List subList = newList.subList(start,end); |
| | | listHasList.add(subList); |
| | | } |
| | | return listHasList; |
| | | } |
| | | public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> collection, int preSize) { |
| | | Collection<Collection<T>> listHasList = new ArrayList(); |
| | | if (collection == null) { |
| | |
| | | } |
| | | return listHasList; |
| | | } |
| | | /** |
| | | * æ¯å¦é»è®¤ç屿§ |
| | | * @param fieldNames 屿§çåå |
| | | * @return true为é»è®¤ |
| | | */ |
| | | public static boolean isDefaultField(String fieldNames){ |
| | | if(VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(fieldNames) || VciQueryWrapperForDO.LIFECYCLE_MANAGE_FIELD_MAP.containsKey(fieldNames) |
| | | || VciQueryWrapperForDO.REVISION_MANAGE_FIELD_MAP.containsKey(fieldNames) ) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.workflow.constant; |
| | | |
| | | public class FlowConstant { |
| | | |
| | | public static final String MAPPER_SCAN = "com.dragon.*.dao.*"; |
| | | |
| | | /** |
| | | * æäº¤äººçåéåç§° |
| | | */ |
| | | public static final String FLOW_SUBMITTER_VAR = "initiator"; |
| | | /** |
| | | * æäº¤äººèç¹åç§° |
| | | */ |
| | | public static final String FLOW_SUBMITTER = "æäº¤äºº"; |
| | | /** |
| | | * èªå¨è·³è¿èç¹è®¾ç½®å±æ§ |
| | | */ |
| | | public static final String FLOWABLE_SKIP_EXPRESSION_ENABLED = "_FLOWABLE_SKIP_EXPRESSION_ENABLED"; |
| | | /** |
| | | * æèµ·ç¶æ |
| | | */ |
| | | public static final int SUSPENSION_STATE = 2; |
| | | /** |
| | | * æ¿æ´»ç¶æ |
| | | */ |
| | | public static final int ACTIVATE_STATE = 1; |
| | | //åå ç¾ |
| | | public static final String AFTER_ADDSIGN = "after"; |
| | | //åå ç¾ |
| | | public static final String BEFORE_ADDSIGN = "before"; |
| | | |
| | | } |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.starter.annotation.VciBusinessLog; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import com.vci.ubcs.starter.web.pagemodel.*; |
| | | import com.vci.ubcs.starter.web.util.ControllerUtil; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | |
| | | // return engineService.updateBatchByBaseModel("wupin", models); |
| | | // return engineService.getUIInfoByClassifyOid(codeClassifyOid,functionId); |
| | | } |
| | | |
| | | /** |
| | | * é»è®¤çåç
§å表 |
| | | * @param referConfigVO åç
§çé
ç½®ä¿¡æ¯ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @GetMapping("/defaultReferDataGrid") |
| | | public DataGrid defaultReferDataGrid(UIFormReferVO referConfigVO, PageHelper pageHelper){ |
| | | return engineService.referDataGrid(referConfigVO,pageHelper); |
| | | } |
| | | |
| | | /** |
| | | * é»è®¤çæ å½¢åç
§å表 |
| | | * @param referConfigVO åç
§çé
ç½®ä¿¡æ¯ |
| | | * @return æ§è¡çç»æ |
| | | */ |
| | | @GetMapping("/defaultReferTree") |
| | | public List<Tree> defaultReferTree(UIFormReferVO referConfigVO, TreeQueryObject queryObject){ |
| | | return engineService.referTree(referConfigVO,queryObject); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | List<String> selectById(@Param("inSql") String inSql); |
| | | |
| | | |
| | | int queryCountBySql(@Param("inSql") String inSql); |
| | | |
| | | List<Map> selectBySql(@Param("inSql") String inSql); |
| | | |
| | | List<Map<String,String>> queryByOnlySqlForMap(@Param("inSql") String inSql); |
| | |
| | | */ |
| | | List<CodeClassify> selectByWrapper(Wrapper wrapper); |
| | | |
| | | |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥è¯¢å°è£
卿¥æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | List<String> select1(Wrapper wrapper); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.*; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | |
| | | */ |
| | | R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels); |
| | | |
| | | /** |
| | | * é»è®¤å表 |
| | | * @param referConfigVO |
| | | * @param pageHelper |
| | | * @return |
| | | */ |
| | | DataGrid referDataGrid(UIFormReferVO referConfigVO, PageHelper pageHelper); |
| | | |
| | | |
| | | /** |
| | | * è·åæ å½¢çåç
§ |
| | | * @param referConfigVO åç
§çé
ç½® |
| | | * @return æ å½¢çæ°æ® |
| | | */ |
| | | List<Tree> referTree(UIFormReferVO referConfigVO, TreeQueryObject queryObject); |
| | | } |
| | |
| | | return codeClassifyMapper.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ |
| | | * @param wrapper æ¥è¯¢å°è£
å¨ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> select1(Wrapper wrapper) { |
| | | |
| | | return codeClassifyMapper.selectObjs(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<CodeClassifyVO> selectPlCodeClassifyPage(IPage<CodeClassifyVO> page, CodeClassifyVO plCodeClassify) { |
| | | return page.setRecords(codeClassifyMapper.selectPlCodeClassifyPage(page, plCodeClassify)); |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.UITablePageVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.omd.feign.IAttributeClient; |
| | | import com.vci.ubcs.omd.feign.IBtmTypeClient; |
| | | import com.vci.ubcs.omd.feign.IEnumClient; |
| | | import com.vci.ubcs.omd.feign.IRevisionRuleClient; |
| | | import com.vci.ubcs.omd.constant.BtmTypeLcStatusConstant; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.feign.*; |
| | | import com.vci.ubcs.omd.utils.VciOmdUtil; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.EnumVO; |
| | | import com.vci.ubcs.omd.vo.RevisionRuleVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; |
| | | import com.vci.ubcs.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.starter.web.constant.QueryOptionConstant; |
| | |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import oracle.sql.TIMESTAMP; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.beans.BeanInfo; |
| | | import java.beans.IntrospectionException; |
| | | import java.beans.Introspector; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.math.BigDecimal; |
| | | import java.sql.SQLException; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Supplier; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; |
| | |
| | | @Resource |
| | | private CodeClstemplateServiceImpl templateService; |
| | | |
| | | @Resource |
| | | private IAttributeClient attributeClient; |
| | | |
| | | /** |
| | | * çæç¼ç çæå¡ |
| | |
| | | */ |
| | | @Resource |
| | | ISysClient iSysClient; |
| | | /** |
| | | * ç³»ç»çæå¡ |
| | | */ |
| | | @Resource |
| | | private IWebSecretClient secretService; |
| | | /** |
| | | * ç¨æ·æå¡ |
| | | */ |
| | |
| | | } |
| | | return comboboxKVs; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¶æ |
| | | * |
| | |
| | | } |
| | | |
| | | int secret = VciBaseUtil.getInt(String.valueOf(cbo.getSecretGrade())); |
| | | //åç»çå¯çº§æå¡æ¯å¦å¯ç¨ |
| | | // if (secret == 0 || !secretService.checkDataSecret(secret)) { |
| | | if (secret == 0 ) { |
| | | if (secret == 0 || !secretService.checkDataSecret(secret).getData()) { |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | // cbo.setAttributeValue(SECRET_FIELD, String.valueOf((userSecret == null || userSecret == 0) ? UserSecretEnum.NONE.getValue() : userSecret)); |
| | | cbo.setSecretGrade(userSecret == null || userSecret == 0 ? UserSecretEnum.NONE.getValue() : userSecret); |
| | |
| | | fieldVO.setComboxKey(fieldVO.getField() + "_data"); |
| | | } |
| | | }else { |
| | | // List<KeyValue> osEnumItemVOList= enumService.getEnum(attrVO.getEnumId()); |
| | | // fieldVO.setData(osEnumItemVOList); |
| | | List<KeyValue> osEnumItemVOList= VciOmdUtil.enumsToListKeyVale(EnumCache.getList(attrVO.getEnumId())); |
| | | fieldVO.setData(osEnumItemVOList); |
| | | } |
| | | } |
| | | //çæ¯å¦æåç
§ |
| | |
| | | if (attrVOMap.keySet().contains("secretgrade")) { |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | if (userSecret == null || userSecret == 0) { |
| | | // userSecret = secretService.getMinUserSecret(); |
| | | userSecret = secretService.getMinUserSecret().getData(); |
| | | } |
| | | whereSql += " and ( t.secretGrade <= " + userSecret + ") "; |
| | | } |
| | |
| | | // } |
| | | // batchSaveSelectChar(templateVO, charList); |
| | | // return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | |
| | | |
| | | |
| | | |
| | | //ä¿®æ¹çæ¶åï¼ç¼ç æ¯ä¸åç |
| | |
| | | @Override |
| | | public MdmUIInfoVO getUIInfoByClassifyOid(String codeClassifyOid, String functionId) { |
| | | VciBaseUtil.alertNotNull(codeClassifyOid, "主é¢åºå类主é®"); |
| | | |
| | | MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid)); |
| | | uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0); |
| | | if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) { |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(uiInfoVO.getTemplateVO().getBtmTypeId()).getData(); |
| | | |
| | | //åè½æé®æå¡è¿æªå®ç°ï¼çå®ç°äºï¼å¨è¿è¡è°ç¨ |
| | | // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // if (operationVOS == null) { |
| | | // operationVOS = new ArrayList<>(); |
| | |
| | | |
| | | return R.success("æ´æ°æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * è·ååç
§çä¿¡æ¯ |
| | | * |
| | | * @param referConfigVO åç
§çé
ç½® |
| | | * @param pageHelper å页çå·¥å
· |
| | | * @return åè¡¨æ°æ® |
| | | */ |
| | | @Override |
| | | public DataGrid referDataGrid(UIFormReferVO referConfigVO, PageHelper pageHelper) { |
| | | // checkReferConfig(referConfigVO); |
| | | //使ç¨ä¸å¡ç±»åæ¥è¯¢ |
| | | R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(referConfigVO.getReferType()); |
| | | BtmTypeVO btmTypeVO = allAttributeByBtmId.getData(); |
| | | if (referConfigVO.getWhere() == null) { |
| | | referConfigVO.setWhere(new HashMap<>()); |
| | | } |
| | | /** |
| | | * å 䏿¥è¯¢ææ°ç次 |
| | | */ |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("lastr", "1"); |
| | | conditionMap.put("lastv", "1"); |
| | | referConfigVO.getWhere().putAll(conditionMap); |
| | | if (VciBaseUtil.containsKeyUnCaseForMap(referConfigVO.getWhere(), VciQueryWrapperForDO.LC_STATUS_FIELD) && |
| | | BtmTypeLcStatusConstant.FRAME_WORK_LIFE_CYCLE_NAME.equalsIgnoreCase(btmTypeVO.getLifeCycleId())) { |
| | | referConfigVO.getWhere().put(VciQueryWrapperForDO.LC_STATUS_FIELD, FrameworkDataLCStatus.ENABLED.getValue()); |
| | | } |
| | | if (VciBaseUtil.containsKeyUnCaseForMap(referConfigVO.getWhere(), VciQueryWrapperForDO.LC_STATUS_FIELD) && |
| | | BtmTypeLcStatusConstant.RELEASE_LIFE_CYCLE.equalsIgnoreCase(btmTypeVO.getLifeCycleId())) { |
| | | referConfigVO.getWhere().put(VciQueryWrapperForDO.LC_STATUS_FIELD, CodeDefaultLC.RELEASED.getValue()); |
| | | } |
| | | BaseQueryObject baseQueryObject = new BaseQueryObject(); |
| | | Map<String, String> where = referConfigVO.getWhere(); |
| | | where.put("domain", AppConstant.APPLICATION_NAME_CODE); |
| | | baseQueryObject.setConditionMap(where); |
| | | baseQueryObject.setPage(pageHelper.getPage()); |
| | | baseQueryObject.setSort(pageHelper.getSort()); |
| | | baseQueryObject.setLimit(pageHelper.getLimit()); |
| | | baseQueryObject.setOrder(pageHelper.getOrder()); |
| | | R<List<BtmTypeVO>> ref = btmTypeClient.getRef(baseQueryObject); |
| | | DataGrid<BtmTypeVO> btmTypeVODataGrid = new DataGrid<>(); |
| | | List<BtmTypeVO> data = ref.getData(); |
| | | btmTypeVODataGrid.setData(data); |
| | | btmTypeVODataGrid.setCode(ref.getCode()); |
| | | btmTypeVODataGrid.setLimit(pageHelper.getLimit()); |
| | | btmTypeVODataGrid.setMsg(ref.getMsg()); |
| | | btmTypeVODataGrid.setSort(pageHelper.getSort()); |
| | | btmTypeVODataGrid.setOrder(pageHelper.getOrder()); |
| | | btmTypeVODataGrid.setPage(pageHelper.getPage()); |
| | | return btmTypeVODataGrid; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ å½¢çåç
§ |
| | | * |
| | | * @param referConfigVO åç
§çé
ç½® |
| | | * @return æ å½¢çæ°æ® |
| | | */ |
| | | @Override |
| | | public List<Tree> referTree(UIFormReferVO referConfigVO, TreeQueryObject queryObject) { |
| | | if (queryObject.getConditionMap() == null) { |
| | | queryObject.setConditionMap(new HashMap<>()); |
| | | } |
| | | |
| | | if (queryObject.getParentOid()==null){ |
| | | LambdaQueryWrapper<CodeClassify> lqw = new LambdaQueryWrapper<>(); |
| | | String parentValue = referConfigVO.getParentValue().substring(3); |
| | | lqw.inSql(CodeClassify::getOid,parentValue); |
| | | List<String> codeClassifies = classifyService.select1(lqw); |
| | | String oid = codeClassifies.get(0); |
| | | queryObject.setParentOid(oid); |
| | | } |
| | | String oidFieldName = StringUtils.isNotBlank(referConfigVO.getParentUsedField()) ? referConfigVO.getParentUsedField() : referConfigVO.getValueField(); |
| | | if (queryObject.isQueryAllLevel()) { |
| | | String parentOidSql = ""; |
| | | if (StringUtils.isNotBlank(referConfigVO.getParentValue())) { |
| | | String temp = referConfigVO.getParentValue(); |
| | | if (temp.startsWith(QueryOptionConstant.IN)) { |
| | | temp = temp.substring((QueryOptionConstant.IN).length()).trim(); |
| | | parentOidSql = " in " + ((temp.startsWith("(") && temp.endsWith(")")) ? temp : "(" + temp + ")"); |
| | | } else if (temp.startsWith(QueryOptionConstant.NOTIN)) { |
| | | parentOidSql = " not in " + ((temp.startsWith("(") && temp.endsWith(")")) ? temp : "(" + temp + ")"); |
| | | } else if (temp.startsWith(QueryOptionConstant.NOTEQUAL)) { |
| | | temp = temp.substring((QueryOptionConstant.NOTEQUAL).length()).trim(); |
| | | parentOidSql = QueryOptionConstant.NOTEQUAL + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } else if (temp.startsWith(QueryOptionConstant.MORETHAN)) { |
| | | temp = temp.substring((QueryOptionConstant.MORETHAN).length()).trim(); |
| | | parentOidSql = QueryOptionConstant.MORETHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } else if (temp.startsWith(QueryOptionConstant.MORE)) { |
| | | temp = temp.substring((QueryOptionConstant.MORE).length()).trim(); |
| | | parentOidSql = QueryOptionConstant.MORE + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } else if (temp.startsWith(QueryOptionConstant.LESSTHAN)) { |
| | | temp = temp.substring((QueryOptionConstant.LESSTHAN).length()).trim(); |
| | | parentOidSql = QueryOptionConstant.LESSTHAN + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } else if (temp.startsWith(QueryOptionConstant.LESS)) { |
| | | temp = temp.substring((QueryOptionConstant.LESS).length()).trim(); |
| | | parentOidSql = QueryOptionConstant.LESS + " " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } else if (temp.startsWith(QueryOptionConstant.ISNOTNULL)) { |
| | | parentOidSql = " is not null"; |
| | | } else if (temp.startsWith(QueryOptionConstant.ISNULL)) { |
| | | parentOidSql = " is null"; |
| | | } else if (temp.contains("*")) { |
| | | parentOidSql = " like " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'").replace("*", "%"); |
| | | } else { |
| | | parentOidSql = " = " + ((temp.startsWith("'") && temp.endsWith("'")) ? temp : "'" + temp + "'"); |
| | | } |
| | | |
| | | } |
| | | //æ¥è¯¢å
¨é¨çä¿¡æ¯ |
| | | queryObject.getConditionMap().put("oid", QueryOptionConstant.IN + "(select oid from " + |
| | | getTableName(referConfigVO.getReferType())+ |
| | | " START WITH " + referConfigVO.getParentFieldName() + " " + |
| | | parentOidSql + |
| | | " CONNECT BY PRIOR " + oidFieldName + " = " + referConfigVO.getParentFieldName() + ")"); |
| | | } else { |
| | | if (StringUtils.isNotBlank(referConfigVO.getParentFieldName()) && StringUtils.isNotBlank(queryObject.getParentOid())) { |
| | | queryObject.getConditionMap().put(referConfigVO.getParentFieldName(), queryObject.getParentOid()); |
| | | } |
| | | } |
| | | LambdaQueryWrapper<CodeClassify> lqw = new LambdaQueryWrapper<>(); |
| | | String sql = queryObject.getConditionMap().get("oid").substring(3); |
| | | lqw.inSql(CodeClassify::getOid,sql); |
| | | List<CodeClassify> codeClassifies = classifyService.selectByWrapper(lqw); |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(referConfigVO.getParentFieldName()); |
| | | treeWrapperOptions.setOidFieldName(oidFieldName); |
| | | treeWrapperOptions.setTextFieldName(referConfigVO.getTextField()); |
| | | treeWrapperOptions.setMultipleSelect(referConfigVO.isMuti()); |
| | | treeWrapperOptions.setParentOid(queryObject.getParentOid()); |
| | | return revisionModelUtil.doList2Trees(codeClassifies, treeWrapperOptions, null); |
| | | } |
| | | |
| | | private String getTableName(String refertype){ |
| | | if ("codeclassify".equals(refertype)){ |
| | | return "pl_code_classify"; |
| | | } |
| | | if ("table".equals(refertype)){ |
| | | return "pl_code_test_table"; |
| | | } |
| | | if ("testBtmType".equals(refertype)){ |
| | | return "PLBT_code_testBtmType"; |
| | | } |
| | | |
| | | return "pl_code_"+refertype.trim().toLowerCase(); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.vci.ubcs.code.bo.AttributeValue; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import com.vci.ubcs.code.service.MdmEngineService; |
| | | import com.vci.ubcs.code.service.MdmIOService; |
| | | import com.vci.ubcs.code.enumpack.CodeDefaultLC; |
| | | import com.vci.ubcs.code.enumpack.CodeLevelTypeEnum; |
| | | import com.vci.ubcs.code.mapper.CommonsMapper; |
| | | import com.vci.ubcs.code.service.*; |
| | | import com.vci.ubcs.code.util.ClientBusinessObject; |
| | | import com.vci.ubcs.code.vo.CodeKeyAttrRepeatVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.attrmap.DataObjectVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.attrmap.RowDatas; |
| | |
| | | import com.vci.ubcs.starter.poi.bo.SheetRowData; |
| | | import com.vci.ubcs.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.ubcs.starter.poi.util.ExcelUtil; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciDateUtil; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.starter.web.pagemodel.UIFormReferVO; |
| | | import com.vci.ubcs.starter.web.toolmodel.DateConverter; |
| | | import com.vci.ubcs.starter.web.util.*; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.hssf.usermodel.HSSFRichTextString; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.CopyOnWriteArraySet; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.druid.util.FnvHash.Constants.LIMIT; |
| | | import static com.vci.ubcs.code.constant.MdmEngineConstant.*; |
| | | import static com.vci.ubcs.starter.poi.util.ExcelUtil.KEY_ATTR_CHAR; |
| | | import static com.vci.ubcs.starter.poi.util.ExcelUtil.REQUIRED_CHAR; |
| | | import static com.vci.ubcs.starter.poi.util.ExcelUtil.*; |
| | | |
| | | @AllArgsConstructor |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | @Slf4j |
| | | public class MdmIOServiceImpl implements MdmIOService { |
| | | |
| | | |
| | | @Value("${batchadd.redis.time:6000000}") |
| | | public int BATCHADD_REDIS_TIME; |
| | | /** |
| | | * 主é¢åºåç±»çæå¡ |
| | | */ |
| | | @Resource |
| | | private ICodeClassifyService classifyService; |
| | | |
| | | /** |
| | | * éç¨æ¥è¯¢ |
| | | */ |
| | | @Resource |
| | | CommonsMapper commonsMapper; |
| | | |
| | | /** |
| | | * 模æ¿çæå¡ |
| | |
| | | */ |
| | | @Resource |
| | | private MdmEngineService engineService; |
| | | |
| | | /*** |
| | | * resdisç¼åæå¡ |
| | | */ |
| | | private final BladeRedis bladeRedis; |
| | | /** |
| | | * çæç¼ç çæå¡ |
| | | */ |
| | | @Resource |
| | | private MdmProductCodeService productCodeService; |
| | | /** |
| | | * å
³é®å±æ§çé
ç½® |
| | | */ |
| | | @Autowired |
| | | private ICodeKeyAttrRepeatService keyRuleService; |
| | | |
| | | /** |
| | | * å
¬å¼çæå¡ |
| | | */ |
| | | @Autowired |
| | | private FormulaServiceImpl formulaService; |
| | | /** |
| | | * çæå¯¼å
¥çæä»¶ |
| | | * |
| | |
| | | */ |
| | | private String batchImportCodes(CodeOrderDTO orderDTO,CodeClassifyTemplateVO templateVO,SheetDataSet dataSet,Map<String,String> errorMap,boolean isEnumType){ |
| | | List<String> codeList=new ArrayList<>(); |
| | | // CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | //è§åç主é®éè¦å»è·å |
| | | // CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo); |
| | | // //1.夿è§åä¸é¤äºæµæ°´ç æ®µï¼æ¯å¦æå
¶ä»ç 段 |
| | | // engineService.checkSecValueOnOrder(ruleVO,orderDTO); |
| | | // List<SheetRowData> rowDataList = dataSet.getRowData(); |
| | | // |
| | | // //é¤å»é»è®¤ç屿§.è¿æåªæè¡¨åæ¾ç¤ºçåæ®µæå¯¼å
¥ |
| | | // List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> |
| | | // !DEFAULT_ATTR_LIST.contains(s.getId()) && VciBaseUtil.getBoolean(s.getFormdisplayflag()) |
| | | // ).collect(Collectors.toList()); |
| | | // Map<Integer/**åå·**/,String/**åæ®µçåç§°**/> fieldIndexMap = new HashMap<>(); |
| | | // List<String> titleRowData = dataSet.getColName(); |
| | | // Map<String/**䏿åç§°**/, String/**è±æåç§°**/> attrNameIdMap = attrVOS.stream().collect(Collectors.toMap(s -> s.getName(), t -> t.getId().toLowerCase(Locale.ROOT),(o1, o2)->o2)); |
| | | // getFieldIndexMap(titleRowData,attrNameIdMap,fieldIndexMap); |
| | | // |
| | | // //éè¦å¤ææ¯å¦ææç屿§é½å¨æ¨¡æ¿ä¸äº |
| | | // List<CodeClassifyTemplateAttrVO> unExistAttrVOs = attrVOS.stream().filter(s -> !fieldIndexMap.containsValue(s.getId().toLowerCase(Locale.ROOT)) |
| | | // && StringUtils.isBlank(s.getComponentrule()) && StringUtils.isBlank(s.getClassifyinvokeattr())//ç»åè§ååå类注å
¥ç¡®å®æ²¡ç»ç¨æ·å¯¼åºå» |
| | | // ).collect(Collectors.toList()); |
| | | // if(!CollectionUtils.isEmpty(unExistAttrVOs)){ |
| | | // throw new VciBaseException("ã" + unExistAttrVOs.stream().map(CodeClassifyTemplateAttrVO::getName) + "ãè¿äºå±æ§å¨åè¡¨ä¸æ²¡ææ¾å°"); |
| | | // } |
| | | // List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | // String fullPath = getFullPath(classifyFullInfo); |
| | | // excelToCbo(classifyFullInfo,fieldIndexMap,rowDataList,templateVO,cboList,fullPath,true); |
| | | // |
| | | // //é½è½¬æ¢å®äºãéè¦æ¹éæ£æ¥ |
| | | // //妿åºéäºï¼æä»¬ä¾ç¶æ§è¡ææçæ°æ®ï¼æ æçæ°æ®ååå°excelä¸ |
| | | // //2.夿å¿
è¾é¡¹ããéè¦å
¨é¨ç屿§ï¼å¦ææ¯å¿
è¾ï¼ä½æ¯è¡¨åéé¢ä¸æ¾ç¤ºçï¼åªè½æ¯å类注å
¥æè
ç»åè§å |
| | | // batchCheckRequiredAttrOnOrder(templateVO,cboList,errorMap); |
| | | // //3.夿å
³é®å±æ§ |
| | | // CodeImportResultVO keyResultVO = batchCheckKeyAttrOnOrder(classifyFullInfo, templateVO, cboList); |
| | | // Set<String> selfRepeatRowIndexList = keyResultVO.getSelfRepeatRowIndexList(); |
| | | // Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList(); |
| | | // if(!CollectionUtils.isEmpty(selfRepeatRowIndexList)){ |
| | | // selfRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | // errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å¨å½åå¤ççæ°æ®æä»¶ä¸å
³é®å±æ§éå¤" ); |
| | | // }); |
| | | // } |
| | | // if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){ |
| | | // keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | // errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å
³é®å±æ§ä¸ç³»ç»ä¸çéå¤" ); |
| | | // }); |
| | | // } |
| | | // //å类注å
¥ |
| | | // batchSwitchClassifyAttrOnOrder(attrVOS,cboList,classifyFullInfo,false); |
| | | // //boolean |
| | | // reSwitchBooleanAttrOnOrder(attrVOS,cboList); |
| | | // //4.æ ¡éªè§å |
| | | // batchCheckVerifyOnOrder(attrVOS, cboList,errorMap); |
| | | // if(isEnumType) {//æ¯å¦éè¦æ ¡éªæä¸¾/åç
§ |
| | | // //5.æ ¡éªæä¸¾æ¯å¦æ£ç¡® |
| | | // batchSwitchEnumAttrOnOrder(attrVOS, cboList, errorMap); |
| | | // //7.å¤çåç
§çæ
åµ |
| | | // batchSwitchReferAttrOnOrder(attrVOS,cboList,errorMap); |
| | | // } |
| | | // //6.æ¶é´æ ¼å¼çéªè¯ |
| | | // //6.æ¶é´çï¼å¿
é¡»ç»ä¸ä¸ºyyyy-MM-dd HH:mm:ss |
| | | // batchSwitchDateAttrOnOrder(attrVOS,cboList,errorMap); |
| | | // //æåå¼ç»åè§å |
| | | // batchSwitchComponentAttrOnOrder(attrVOS,cboList); |
| | | // String uuid=redisService.getUUIDEveryDay(); |
| | | // Map<String, ClientBusinessObject> rowIndexCboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t)); |
| | | // |
| | | // if(errorMap.size()>0) { |
| | | // createRedisDatas(uuid + "-error",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, errorMap,false); |
| | | // } |
| | | // boolean isCreateUUid=false; |
| | | // List<ClientBusinessObject> needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !errorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // //ç¸ä¼¼æ ¡éª |
| | | // Map<String,String>resembleMap=new HashMap<>(); |
| | | // List<DataResembleVO> dataResembleVOS=new ArrayList<>(); |
| | | // String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | // bathcResembleQuery(orderDTO.getCodeClassifyOid(),templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS); |
| | | // if(resembleMap.size()>0) { |
| | | // isCreateUUid=true; |
| | | // if(!CollectionUtils.isEmpty(dataResembleVOS)) { |
| | | // redisService.setCacheList(uuid + "-resemble-data", dataResembleVOS); |
| | | // createRedisDatas(uuid + "-resemble",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, resembleMap, false); |
| | | // } |
| | | // } |
| | | // //æé¤é误çï¼å©ä¸æ£ç¡®ç |
| | | // Map<String,String> newErrorMap=new HashMap<>(); |
| | | // newErrorMap.putAll(resembleMap); |
| | | // newErrorMap.putAll(errorMap); |
| | | // needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !newErrorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // if((errorMap.size()>0&&needSaveCboList.size()>0)||resembleMap.size()>0){ |
| | | // isCreateUUid=true; |
| | | // } |
| | | // createRedisByCodeClassify(uuid + "-class",templateVO,dataSet,fieldIndexMap,false); |
| | | // if(newErrorMap.size()>0) { |
| | | // createRedisDatas(uuid + "-ok",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, newErrorMap,true); |
| | | // }else { |
| | | // uuid=""; |
| | | // //è¦æä»¥ä¸çé误ç齿åºåï¼åç»§ç»å¤çæ¶é´åç»åè§å |
| | | // needSaveCboList = cboList.stream().filter(cbo -> { |
| | | // String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | // return !newErrorMap.containsKey(rowIndex); |
| | | // }).collect(Collectors.toList()); |
| | | // if (!CollectionUtils.isEmpty(needSaveCboList)) { |
| | | // //9.æä»¬å¤çä¸å¡æ°æ® |
| | | // //çæç¼ç çå
容 |
| | | // codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), needSaveCboList); |
| | | // //妿æ¯ç¼ç çæå¤±è´¥ï¼åç´æ¥å°±å¤±è´¥äºï¼å
¶ä»çå¤æåºæ¥æé误çæä»¬é½ç»ä¸è¿åå°exceléé¢ |
| | | // engineService.batchSaveSelectChar(templateVO, needSaveCboList); |
| | | // } |
| | | // } |
| | | // if(!isCreateUUid){ |
| | | // return uuid=""; |
| | | // } |
| | | // return uuid; |
| | | return null; |
| | | CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo); |
| | | //1.夿è§åä¸é¤äºæµæ°´ç æ®µï¼æ¯å¦æå
¶ä»ç 段 |
| | | engineService.checkSecValueOnOrder(ruleVO,orderDTO); |
| | | List<SheetRowData> rowDataList = dataSet.getRowData(); |
| | | |
| | | //é¤å»é»è®¤ç屿§.è¿æåªæè¡¨åæ¾ç¤ºçåæ®µæå¯¼å
¥ |
| | | List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> |
| | | !DEFAULT_ATTR_LIST.contains(s.getId()) && VciBaseUtil.getBoolean(s.getFormDisplayFlag()) |
| | | ).collect(Collectors.toList()); |
| | | Map<Integer/**åå·**/,String/**åæ®µçåç§°**/> fieldIndexMap = new HashMap<>(); |
| | | List<String> titleRowData = dataSet.getColName(); |
| | | Map<String/**䏿åç§°**/, String/**è±æåç§°**/> attrNameIdMap = attrVOS.stream().collect(Collectors.toMap(s -> s.getName(), t -> t.getId().toLowerCase(Locale.ROOT),(o1, o2)->o2)); |
| | | getFieldIndexMap(titleRowData,attrNameIdMap,fieldIndexMap); |
| | | |
| | | //éè¦å¤ææ¯å¦ææç屿§é½å¨æ¨¡æ¿ä¸äº |
| | | List<CodeClassifyTemplateAttrVO> unExistAttrVOs = attrVOS.stream().filter(s -> !fieldIndexMap.containsValue(s.getId().toLowerCase(Locale.ROOT)) |
| | | && StringUtils.isBlank(s.getComponentRule()) && StringUtils.isBlank(s.getClassifyInvokeAttr())//ç»åè§ååå类注å
¥ç¡®å®æ²¡ç»ç¨æ·å¯¼åºå» |
| | | ).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(unExistAttrVOs)){ |
| | | throw new VciBaseException("ã" + unExistAttrVOs.stream().map(CodeClassifyTemplateAttrVO::getName) + "ãè¿äºå±æ§å¨åè¡¨ä¸æ²¡ææ¾å°"); |
| | | } |
| | | List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | String fullPath = getFullPath(classifyFullInfo); |
| | | excelToCbo(classifyFullInfo,fieldIndexMap,rowDataList,templateVO,cboList,fullPath,true); |
| | | |
| | | //é½è½¬æ¢å®äºãéè¦æ¹éæ£æ¥ |
| | | //妿åºéäºï¼æä»¬ä¾ç¶æ§è¡ææçæ°æ®ï¼æ æçæ°æ®ååå°excelä¸ |
| | | //2.夿å¿
è¾é¡¹ããéè¦å
¨é¨ç屿§ï¼å¦ææ¯å¿
è¾ï¼ä½æ¯è¡¨åéé¢ä¸æ¾ç¤ºçï¼åªè½æ¯å类注å
¥æè
ç»åè§å |
| | | batchCheckRequiredAttrOnOrder(templateVO,cboList,errorMap); |
| | | //3.夿å
³é®å±æ§ |
| | | CodeImportResultVO keyResultVO = batchCheckKeyAttrOnOrder(classifyFullInfo, templateVO, cboList); |
| | | Set<String> selfRepeatRowIndexList = keyResultVO.getSelfRepeatRowIndexList(); |
| | | Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList(); |
| | | if(!CollectionUtils.isEmpty(selfRepeatRowIndexList)){ |
| | | selfRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å¨å½åå¤ççæ°æ®æä»¶ä¸å
³é®å±æ§éå¤" ); |
| | | }); |
| | | } |
| | | if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){ |
| | | keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{ |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";å
³é®å±æ§ä¸ç³»ç»ä¸çéå¤" ); |
| | | }); |
| | | } |
| | | //å类注å
¥ |
| | | batchSwitchClassifyAttrOnOrder(attrVOS,cboList,classifyFullInfo,false); |
| | | //boolean |
| | | reSwitchBooleanAttrOnOrder(attrVOS,cboList); |
| | | //4.æ ¡éªè§å |
| | | batchCheckVerifyOnOrder(attrVOS, cboList,errorMap); |
| | | if(isEnumType) {//æ¯å¦éè¦æ ¡éªæä¸¾/åç
§ |
| | | //5.æ ¡éªæä¸¾æ¯å¦æ£ç¡® |
| | | batchSwitchEnumAttrOnOrder(attrVOS, cboList, errorMap); |
| | | //7.å¤çåç
§çæ
åµ |
| | | batchSwitchReferAttrOnOrder(attrVOS,cboList,errorMap); |
| | | } |
| | | //6.æ¶é´æ ¼å¼çéªè¯ |
| | | //6.æ¶é´çï¼å¿
é¡»ç»ä¸ä¸ºyyyy-MM-dd HH:mm:ss |
| | | batchSwitchDateAttrOnOrder(attrVOS,cboList,errorMap); |
| | | //æåå¼ç»åè§å |
| | | batchSwitchComponentAttrOnOrder(attrVOS,cboList); |
| | | String uuid=VciBaseUtil.getPk(); |
| | | Map<String, ClientBusinessObject> rowIndexCboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t)); |
| | | |
| | | if(errorMap.size()>0) { |
| | | createRedisDatas(uuid + "-error",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, errorMap,false); |
| | | } |
| | | boolean isCreateUUid=false; |
| | | List<ClientBusinessObject> needSaveCboList = cboList.stream().filter(cbo -> { |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | return !errorMap.containsKey(rowIndex); |
| | | }).collect(Collectors.toList()); |
| | | //ç¸ä¼¼æ ¡éª |
| | | Map<String,String>resembleMap=new HashMap<>(); |
| | | List<DataResembleVO> dataResembleVOS=new ArrayList<>(); |
| | | String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmtypeid(); |
| | | bathcResembleQuery(orderDTO.getCodeClassifyOid(),templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS); |
| | | if(resembleMap.size()>0) { |
| | | isCreateUUid=true; |
| | | if(!CollectionUtils.isEmpty(dataResembleVOS)) { |
| | | bladeRedis.set(uuid + "-resemble-data", dataResembleVOS); |
| | | createRedisDatas(uuid + "-resemble",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, resembleMap, false); |
| | | } |
| | | } |
| | | //æé¤é误çï¼å©ä¸æ£ç¡®ç |
| | | Map<String,String> newErrorMap=new HashMap<>(); |
| | | newErrorMap.putAll(resembleMap); |
| | | newErrorMap.putAll(errorMap); |
| | | needSaveCboList = cboList.stream().filter(cbo -> { |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | return !newErrorMap.containsKey(rowIndex); |
| | | }).collect(Collectors.toList()); |
| | | if((errorMap.size()>0&&needSaveCboList.size()>0)||resembleMap.size()>0){ |
| | | isCreateUUid=true; |
| | | } |
| | | createRedisByCodeClassify(uuid + "-class",templateVO,dataSet,fieldIndexMap,false); |
| | | if(newErrorMap.size()>0) { |
| | | createRedisDatas(uuid + "-ok",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, newErrorMap,true); |
| | | }else { |
| | | uuid=""; |
| | | |
| | | //è¦æä»¥ä¸çé误ç齿åºåï¼åç»§ç»å¤çæ¶é´åç»åè§å |
| | | /*dataCBOList = cboList.stream().filter(cbo -> { |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | return !newErrorMap.containsKey(rowIndex); |
| | | }).collect(Collectors.toList()); |
| | | */ List<String> dataCBOIdList=new ArrayList<>(); |
| | | List<BaseModel> dataCBOList=new ArrayList<>(); |
| | | cboList.stream().forEach(clientBusinessObject -> { |
| | | BaseModel baseModel=new BaseModel(); |
| | | BeanUtil.convert(clientBusinessObject,baseModel); |
| | | baseModel.setData(VciBaseUtil.objectToMapString(clientBusinessObject)); |
| | | dataCBOList.add(baseModel); |
| | | dataCBOIdList.add(baseModel.getOid()); |
| | | }); |
| | | |
| | | if (!CollectionUtils.isEmpty(needSaveCboList)) { |
| | | //9.æä»¬å¤çä¸å¡æ°æ® |
| | | //çæç¼ç çå
容 |
| | | try { |
| | | codeList = productCodeService.productCodeAndSaveData(classifyFullInfo,templateVO,ruleVO, orderDTO.getSecDTOList(),dataCBOList); |
| | | //妿æ¯ç¼ç çæå¤±è´¥ï¼åç´æ¥å°±å¤±è´¥äºï¼å
¶ä»çå¤æåºæ¥æé误çæä»¬é½ç»ä¸è¿åå°exceléé¢ |
| | | engineService.batchSaveSelectChar(templateVO, dataCBOIdList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("æ¹äºç³è¯·æ¶å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | | if(!isCreateUUid){ |
| | | return uuid=""; |
| | | } |
| | | return uuid; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * excel转æ¢ä¸ºcboç对象 |
| | | * @param classifyFullInfo åç±»çå
¨é¨ä¿¡æ¯ |
| | | * @param fieldIndexMap åæ®µçä½ç½® |
| | | * @param rowDataList exceléçè¡æ°æ® |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ |
| | | * @param cboList æ°æ®çå表 |
| | | * @param fullPath å
¨è·¯å¾ |
| | | * @param newCode æ¯å¦ä¸ºæ¹éç³è¯· |
| | | */ |
| | | private void excelToCbo(CodeClassifyFullInfoBO classifyFullInfo,Map<Integer,String> fieldIndexMap,List<SheetRowData> rowDataList, |
| | | CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList, |
| | | String fullPath,boolean newCode){ |
| | | rowDataList.stream().forEach(rowData -> { |
| | | ClientBusinessObject cbo=new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | rowData.getData().forEach((index,value)->{ |
| | | String field = fieldIndexMap.get(index); |
| | | if (StringUtils.isBlank(field)) { |
| | | throw new VciBaseException("第" + (index + 1) + "åçæ é¢å¨ç³»ç»ä¸ä¸åå¨"); |
| | | } |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck(field, value); |
| | | if (WebUtil.isDefaultField(field)) { |
| | | WebUtil.setValueToField(field, cbo, value); |
| | | } |
| | | } catch (VciBaseException e) { |
| | | log.error("è®¾ç½®å±æ§çå¼é误", e); |
| | | } |
| | | }); |
| | | try { |
| | | cbo.setAttributeValue(CODE_TEMPLATE_OID_FIELD,templateVO.getOid()); |
| | | cbo.setAttributeValue(IMPORT_ROW_INDEX,rowData.getRowIndex()); |
| | | if(newCode){ |
| | | cbo.setAttributeValue(CODE_CLASSIFY_OID_FIELD,classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | cbo.setAttributeValue(CODE_FULL_PATH_FILED,fullPath); |
| | | //cbo.setLcStatus(CodeDefaultLC.EDITING.getValue()); |
| | | int secret = VciBaseUtil.getInt(cbo.getAttributeValue(SECRET_FIELD)); |
| | | /*if(secret == 0 || !secretService.checkDataSecret(secret) ){ |
| | | Integer userSecret = VciBaseUtil.getCurrentUserSecret(); |
| | | cbo.setAttributeValue(SECRET_FIELD,String.valueOf((userSecret==null || userSecret ==0)? UserSecretEnum.NONE.getValue():userSecret)); |
| | | }*/ |
| | | }else{ |
| | | //æ¤æ¶è¿æ²¡æè½¬æ¢è·¯å¾ |
| | | //cbo.setAttributeValue(CODE_FULL_PATH_FILED, childOidPathMap.getOrDefault(rowData.getData().getOrDefault(CODE_CLASSIFY_OID_FIELD,""),fullPath)); |
| | | cbo.setLcStatus(CodeDefaultLC.RELEASED.getValue()); |
| | | } |
| | | |
| | | }catch (Throwable e){ |
| | | log.error("设置é»è®¤ç屿§çå¼é误",e); |
| | | } |
| | | cboList.add(cbo); |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æ ¡éªè§å没æéè¿çå
容 |
| | | * @param attrVOS éè¦æ ¡éªç屿§ |
| | | * @param dataList æ°æ®çå表 |
| | | * @param errorMap é误çä¿¡æ¯æ å° |
| | | * @return æ ¡éªä¸éè¿çè¡æ° |
| | | */ |
| | | private void batchCheckVerifyOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS, List<ClientBusinessObject> dataList,Map<String,String> errorMap) { |
| | | Map<String, CodeClassifyTemplateAttrVO> verifyAttrVOMap = attrVOS.stream().filter(s -> StringUtils.isNotBlank(s.getVerifyRule()) && StringUtils.isBlank(s.getComponentRule()) |
| | | &&StringUtils.isBlank(s.getClassifyInvokeAttr()) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if(!CollectionUtils.isEmpty(verifyAttrVOMap)){ |
| | | Map<String/**è¡å·**/,List<String>/**æ ¡éªä¸éè¿ç屿§**/> unPassCheckMap = new HashMap<>(); |
| | | verifyAttrVOMap.forEach((attrId,attrVO)->{ |
| | | dataList.stream().forEach(cbo -> { |
| | | String value = cbo.getAttributeValue(attrId); |
| | | if(StringUtils.isNotBlank(value) && !value.matches(attrVO.getVerifyRule())){ |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | List<String> unPassAttrs = unPassCheckMap.getOrDefault(rowIndex, new ArrayList<>()); |
| | | unPassAttrs.add(attrVO.getName()); |
| | | unPassCheckMap.put(rowIndex,unPassAttrs); |
| | | } |
| | | }); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(unPassCheckMap)){ |
| | | unPassCheckMap.forEach((rowIndex,unPassAttrs)->{ |
| | | errorMap.put(rowIndex,";屿§[" + unPassAttrs.stream().collect(Collectors.joining(",")) + "]å
容ä¸ç¬¦åæ ¡éªè§åçè¦æ±"); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * æ¹éè½¬æ¢æ¶é´é½ä¸ºæå®çæ ¼å¼ |
| | | * @param attrVOS 模æ¿å±æ§ |
| | | * @param cboList æ°æ®çå表 |
| | | * @param errorMap é误çä¿¡æ¯ |
| | | */ |
| | | private void batchSwitchDateAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> cboList,Map<String,String> errorMap){ |
| | | Map<String, CodeClassifyTemplateAttrVO> dateAttrVOMap =attrVOS.stream().filter(s -> |
| | | StringUtils.isNotBlank(s.getCodeDateFormat()) && VciBaseUtil.getBoolean(s.getCodeDateFormat()) && StringUtils.isBlank(s.getComponentRule()) |
| | | && StringUtils.isBlank(s.getClassifyInvokeAttr()) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if(!CollectionUtils.isEmpty(dateAttrVOMap)) { |
| | | dateAttrVOMap.forEach((attrId, attrVO) -> { |
| | | cboList.stream().forEach(cbo -> { |
| | | String value = cbo.getAttributeValue(attrId); |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | if (StringUtils.isNotBlank(value)) { |
| | | boolean formated = false; |
| | | if(StringUtils.isNotBlank(attrVO.getCodeDateFormat())){ |
| | | try { |
| | | Date date = VciDateUtil.str2Date(value, attrVO.getCodeDateFormat()); |
| | | if(date!=null){ |
| | | cbo.setAttributeValue(attrId,value); |
| | | formated = true; |
| | | } |
| | | } catch (Exception e) { |
| | | //说æä¸æ¯è¿ä¸ªæ ¼å¼ |
| | | } |
| | | } |
| | | if(!formated) { |
| | | try { |
| | | DateConverter dateConverter = new DateConverter(); |
| | | dateConverter.setAsText(value); |
| | | value = VciDateUtil.date2Str(dateConverter.getValue(), VciDateUtil.DateTimeMillFormat); |
| | | cbo.setAttributeValue(attrId,value); |
| | | }catch (Throwable e){ |
| | | //转æ¢ä¸äº |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";屿§[" + attrVO.getName() + "]æ¶é´æ ¼å¼ä¸æ£ç¡®" ); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | /** |
| | | * 转移booleanåç屿§ |
| | | * @param attrVOS 屿§ç对象 |
| | | * @param dataList æ°æ® |
| | | */ |
| | | private void reSwitchBooleanAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList){ |
| | | Map<String, CodeClassifyTemplateAttrVO> booleanAttrMap = attrVOS.stream().filter( |
| | | s -> VciFieldTypeEnum.VTBoolean.name().equalsIgnoreCase(s.getAttributeDataType()) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(booleanAttrMap)) { |
| | | booleanAttrMap.forEach((attrId, attrVO) -> { |
| | | dataList.stream().forEach(cbo -> { |
| | | String text = cbo.getAttributeValue(attrId); |
| | | try { |
| | | if (BooleanEnum.TRUE.getValue().equalsIgnoreCase(text) || "æ¯".equalsIgnoreCase(text)) { |
| | | cbo.setAttributeValue(attrId, BooleanEnum.TRUE.getValue()); |
| | | } else { |
| | | cbo.setAttributeValue(attrId, BooleanEnum.FASLE.getValue()); |
| | | } |
| | | }catch (Throwable e){ |
| | | |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤çç»åè§å |
| | | * @param attrVOS 模æ¿å±æ§ |
| | | * @param dataList excelçæ°æ®å
容 |
| | | */ |
| | | private void batchSwitchComponentAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList) { |
| | | Map<String, CodeClassifyTemplateAttrVO> dateAttrVOMap = attrVOS.stream().filter(s -> StringUtils.isNotBlank(s.getComponentRule())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if(!CollectionUtils.isEmpty(dateAttrVOMap)) { |
| | | dateAttrVOMap.forEach((attrId, attrVO) -> { |
| | | dataList.stream().forEach(cbo -> { |
| | | //ä»excel䏿屿§è½¬æ¢ä¸ºmap |
| | | Map<String,String> thisRowDataMap = new HashMap<>(); |
| | | copyValueToMapFromCbos(cbo,thisRowDataMap); |
| | | //ç»åå
容 |
| | | String value = formulaService.getValueByFormula(thisRowDataMap,attrVO.getComponentRule()); |
| | | if(value == null){ |
| | | value = ""; |
| | | } |
| | | try { |
| | | cbo.setAttributeValue(attrId, value); |
| | | }catch (Throwable e){ |
| | | log.error("è®¾ç½®å±æ§çé误",e); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢åç
§çå¼ |
| | | * @param attrVOS 屿§çæ¾ç¤ºå¯¹è±¡ |
| | | * @param dataList æ°æ®å表 |
| | | * @param errorMap é误çä¿¡æ¯ |
| | | */ |
| | | private void batchSwitchReferAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList,Map<String,String> errorMap){ |
| | | Map<String, CodeClassifyTemplateAttrVO> referAttrVOMap = attrVOS.stream().filter( |
| | | s -> (StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if(!CollectionUtils.isEmpty(referAttrVOMap)){ |
| | | Map<String/**è¡¨æ ¼åå¼ç屿§**/,Map<String/**æ¾ç¤ºå±æ§çå¼**/,List<String>/**è¡¨æ ¼éçå¼**/>> linkValueMap = new HashMap<>(); |
| | | referAttrVOMap.forEach((attrId,attrVO)->{ |
| | | dataList.stream().forEach(cbo -> { |
| | | String text = cbo.getAttributeValue(attrId); |
| | | if(StringUtils.isNotBlank(text)){ |
| | | UIFormReferVO referVO = getReferVO(attrVO); |
| | | String valueField = getValueField(referVO); |
| | | String showText = getTextField(referVO); |
| | | String tableAndAttr = VciBaseUtil.getTableName(referVO.getReferType()) + "#" + valueField; |
| | | Map<String, List<String>> showTextMap = linkValueMap.getOrDefault(tableAndAttr, new HashMap<>()); |
| | | List<String> textList = showTextMap.getOrDefault(showText, new ArrayList<>()); |
| | | if(!textList.contains(text)) { |
| | | textList.add(text); |
| | | } |
| | | showTextMap.put(showText,textList); |
| | | linkValueMap.put(tableAndAttr,showTextMap); |
| | | } |
| | | }); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(linkValueMap)){ |
| | | //éè¦é个表çå¼å段ï¼é个æ¥è¯¢ |
| | | Map<String/**è¡¨æ ¼åå¼å±æ§**/,Map<String/**æ¾ç¤ºå±æ§**/, Map<String/**å¼**/,String/**æ¾ç¤ºçå¼**/>>> linkCboMap = new HashMap<>(); |
| | | linkValueMap.forEach((tableAndAttr,showValueMap)->{ |
| | | String[] split = tableAndAttr.split("#"); |
| | | String table = split[0]; |
| | | String valueField = split[1].toLowerCase(Locale.ROOT); |
| | | Map<String,Map<String,String>> dataMap = new HashMap<>(); |
| | | showValueMap.forEach((showText,valueList)->{ |
| | | Map<String,String> valueOidTextMap = new HashMap<>(); |
| | | List<List<String>> valueCollections = VciBaseUtil.switchListForOracleIn(valueList); |
| | | String sql = "select " + valueField + "," + showText.toLowerCase(Locale.ROOT) +" from " + table + " where " + showText + " in (%s)"; |
| | | valueCollections.stream().forEach(values->{ |
| | | List<Map<String,String>> dataMapList = commonsMapper.queryByOnlySqlForMap(String.format(sql, VciBaseUtil.toInSql(values.toArray(new String[0])))); |
| | | List<ClientBusinessObject> cbos= ChangeMapTOClientBusinessObjects(dataMapList); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | valueOidTextMap.putAll(cbos.stream().collect(Collectors.toMap(s->s.getAttributeValue(valueField),t->t.getAttributeValue(showText)))); |
| | | } |
| | | }); |
| | | dataMap.put(showText,valueOidTextMap); |
| | | }); |
| | | linkCboMap.put(tableAndAttr,dataMap); |
| | | }); |
| | | referAttrVOMap.forEach((attrId,attrVO)->{ |
| | | dataList.stream().forEach(cbo -> { |
| | | String text = cbo.getAttributeValue(attrId); |
| | | if (StringUtils.isNotBlank(text)) { |
| | | UIFormReferVO referVO = getReferVO(attrVO); |
| | | String valueField = getValueField(referVO); |
| | | String showText = getTextField(referVO); |
| | | String tableAndAttr = VciBaseUtil.getTableName(referVO.getReferType()) + "#" + valueField; |
| | | if(!linkCboMap.containsKey(tableAndAttr)){ |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";忰屿§[" + attrVO.getName() + "]çå¼å¨ç³»ç»ä¸ä¸åå¨" ); |
| | | |
| | | }else{ |
| | | Map<String, Map<String, String>> dataMap = linkCboMap.get(tableAndAttr); |
| | | if(!dataMap.containsKey(showText)){ |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";忰屿§[" + attrVO.getName() + "]çå¼å¨ç³»ç»ä¸ä¸åå¨" ); |
| | | }else{ |
| | | Map<String, String> data = dataMap.get(showText); |
| | | final boolean[] fined = {false}; |
| | | data.forEach((key,value)->{ |
| | | if(value.equalsIgnoreCase(text)){ |
| | | fined[0] = true; |
| | | try { |
| | | cbo.setAttributeValue(attrId, key); |
| | | }catch (Throwable e){ |
| | | |
| | | } |
| | | } |
| | | }); |
| | | if(!fined[0]){ |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";忰屿§[" + attrVO.getName() + "]çå¼å¨ç³»ç»ä¸ä¸åå¨" ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä»å±æ§ä¸è·ååç
§çå
容 |
| | | * @param attrVO 屿§çä¿¡æ¯ |
| | | * @return åç
§çå
容 |
| | | */ |
| | | private UIFormReferVO getReferVO(CodeClassifyTemplateAttrVO attrVO){ |
| | | UIFormReferVO referVO = null; |
| | | if(StringUtils.isNotBlank(attrVO.getReferConfig())){ |
| | | referVO = JSONObject.parseObject(attrVO.getReferConfig(),UIFormReferVO.class); |
| | | }else{ |
| | | referVO = new UIFormReferVO(); |
| | | referVO.setReferType(attrVO.getReferBtmId()); |
| | | referVO.setValueField(VciQueryWrapperForDO.OID_FIELD); |
| | | referVO.setTextField("name"); |
| | | } |
| | | return referVO; |
| | | } |
| | | |
| | | /** |
| | | * è·ååç
§ä¸çå¼çåæ®µ |
| | | * @param referVO åç
§ç对象 |
| | | * @return é»è®¤ä¸ºOidï¼æå¤ä¸ªçæ¶åï¼è·å第ä¸ä¸ª |
| | | */ |
| | | private String getValueField(UIFormReferVO referVO){ |
| | | String showText = referVO.getValueField(); |
| | | if(StringUtils.isBlank(showText)){ |
| | | return "oid"; |
| | | } |
| | | if(showText.contains(",")){ |
| | | //鲿¢ä¸ä¸æå¤ä¸ªï¼ççææ²¡æoid |
| | | List<String> strings = VciBaseUtil.str2List(showText); |
| | | if(strings.contains("oid")){ |
| | | showText = "oid"; |
| | | }else{ |
| | | showText = strings.get(0); |
| | | } |
| | | } |
| | | return showText; |
| | | } |
| | | |
| | | /** |
| | | * è·ååç
§ä¸çæ¾ç¤ºå
容çåæ®µ |
| | | * @param referVO åç
§ç对象 |
| | | * @return é»è®¤ä¸ºnameï¼æå¤ä¸ªçæ¶åï¼è·å第ä¸ä¸ª |
| | | */ |
| | | private String getTextField(UIFormReferVO referVO){ |
| | | String showText = referVO.getTextField(); |
| | | if(StringUtils.isBlank(showText)){ |
| | | return "name"; |
| | | } |
| | | if(showText.contains(",")){ |
| | | //鲿¢ä¸ä¸æå¤ä¸ªï¼ççææ²¡æname |
| | | List<String> strings = VciBaseUtil.str2List(showText); |
| | | if(strings.contains("name")){ |
| | | showText = "name"; |
| | | }else{ |
| | | showText = strings.get(0); |
| | | } |
| | | } |
| | | return showText; |
| | | } |
| | | /** |
| | | * å¤çæä¸¾çæ¾ç¤ºå¯¹è±¡ |
| | | * @param attrVOS 模æ¿å±æ§ |
| | | * @param dataList excelçæ°æ®å
容 |
| | | * @param errorMap é误信æ¯çæ å° |
| | | */ |
| | | private void batchSwitchEnumAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList, |
| | | Map<String,String> errorMap ) { |
| | | Map<String, CodeClassifyTemplateAttrVO> dateAttrVOMap = attrVOS.stream().filter( |
| | | s -> (StringUtils.isNotBlank(s.getEnumString()) || StringUtils.isNotBlank(s.getEnumId())) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | if (!CollectionUtils.isEmpty(dateAttrVOMap)) { |
| | | dateAttrVOMap.forEach((attrId, attrVO) -> { |
| | | dataList.stream().forEach(cbo -> { |
| | | String text = cbo.getAttributeValue(attrId); |
| | | if(StringUtils.isNotBlank(text)){ |
| | | List<KeyValue> valueList = engineService.listComboboxItems(attrVO); |
| | | boolean fined = false; |
| | | for (int i = 0; i < valueList.size(); i++) { |
| | | KeyValue keyValue = valueList.get(i); |
| | | //if(keyValue.getValue().equalsIgnoreCase(text)){ |
| | | if(keyValue.getValue().equalsIgnoreCase(text)||keyValue.getKey().equalsIgnoreCase(text)){ |
| | | try { |
| | | cbo.setAttributeValue(attrId, keyValue.getKey()); |
| | | }catch (Throwable e){ |
| | | log.error("è®¾ç½®å±æ§åºé"); |
| | | } |
| | | fined = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!fined){ |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";屿§[" + attrVO.getName() + "]çå¼ä¸ç¬¦å䏿çè¦æ±"); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ ¡éªæ°æ®çä¿¡æ¯ |
| | | * @param templateVO 模æ¿çæ¾ç¤ºå¯¹è±¡ |
| | | * @param cboList æ°æ®çå
容 |
| | | */ |
| | | private void batchCheckRequiredAttrOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String,String> errorMap){ |
| | | Map<String, CodeClassifyTemplateAttrVO> requiredAttrMap = templateVO.getAttributes().stream().filter(s -> |
| | | VciBaseUtil.getBoolean(s.getRequireFlag()) && StringUtils.isBlank(s.getComponentRule()) && StringUtils.isBlank(s.getClassifyInvokeLevel())//ä¸è½æ¯ç»åçåå类注å
¥ç |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | //ä¸MdmEngineServiceImpléé¢çcheckRequiredAttrOnOrder é»è¾åºè¯¥ç¸ä¼¼ |
| | | if(!CollectionUtils.isEmpty(requiredAttrMap)) { |
| | | Set<String> nullRowIndex = cboList.stream().filter(cbo -> requiredAttrMap.keySet().stream().anyMatch(attrId -> StringUtils.isBlank(cbo.getAttributeValue(attrId)))).map(cbo -> cbo.getAttributeValue(IMPORT_ROW_INDEX)).collect(Collectors.toSet()); |
| | | if(!CollectionUtils.isEmpty(nullRowIndex)){ |
| | | String checkAttr = requiredAttrMap.values().stream().map(CodeClassifyTemplateAttrVO::getName).collect(Collectors.joining(",")); |
| | | nullRowIndex.stream().forEach(rowIndex->{ |
| | | errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";æ ¡éªè§åä¸éè¿ï¼ææ ¡éªç屿§ä¸º" + checkAttr); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * å¤çå类注å
¥ |
| | | * @param attrVOS 模æ¿å±æ§ |
| | | * @param dataList excelçæ°æ®å
容 |
| | | * @param classifyFullInfo åç±»çå
¨è·¯å¾ |
| | | */ |
| | | private void batchSwitchClassifyAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList, |
| | | CodeClassifyFullInfoBO classifyFullInfo,boolean isImPort) { |
| | | Map<String, CodeClassifyTemplateAttrVO> dateAttrVOMap = attrVOS.stream().filter( |
| | | s -> StringUtils.isNotBlank(s.getClassifyInvokeAttr()) && StringUtils.isNotBlank(s.getClassifyInvokeAttr()) |
| | | ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | Map<String,CodeClassifyFullInfoBO> classifyFullInfoMap=new HashMap<>(); |
| | | classifyFullInfoMap.put(classifyFullInfo.getCurrentClassifyVO().getOid(),classifyFullInfo); |
| | | if (!CollectionUtils.isEmpty(dateAttrVOMap)) { |
| | | dataList.stream().forEach(cbo -> { |
| | | dateAttrVOMap.forEach((attrId, attrVO) -> { |
| | | //å类注å
¥çç¼å·æè
åç§°ï¼ |
| | | //å±çº§å
嫿å®å±åæå°å± |
| | | CodeClassifyVO classifyVO = null; |
| | | if(!CodeLevelTypeEnum.MIN.getValue().equalsIgnoreCase(attrVO.getClassifyInvokeLevel()) && !"min".equalsIgnoreCase(attrVO.getClassifyInvokeLevel())) { |
| | | //æå®äºå±çº§ç |
| | | //注æï¼å 为æ¥è¯¢ä¸çº§åç±»åºæ¥çå±çº§æ¯ååºçï¼å³é¡¶å±èç¹æ¯æå¤§çå¼ |
| | | if(isImPort){ |
| | | if(!classifyFullInfoMap.containsKey(cbo.getAttributeValue(CODE_CLASSIFY_OID_FIELD))) { |
| | | CodeClassifyFullInfoBO currentClassifyFullInfo = classifyService.getClassifyFullInfo(cbo.getAttributeValue(CODE_CLASSIFY_OID_FIELD)); |
| | | classifyFullInfoMap.put(currentClassifyFullInfo.getCurrentClassifyVO().getOid(), currentClassifyFullInfo); |
| | | } |
| | | } |
| | | CodeClassifyFullInfoBO newClassifyFullInfo= classifyFullInfoMap.get(cbo.getAttributeValue(CODE_CLASSIFY_OID_FIELD)); |
| | | List<CodeClassifyVO> classifyVOS = newClassifyFullInfo.getParentClassifyVOs().stream().sorted(((o1, o2) -> o2.getDataLevel().compareTo(o1.getDataLevel()))).collect(Collectors.toList()); |
| | | int level = VciBaseUtil.getInt(attrVO.getClassifyInvokeLevel()); |
| | | if (classifyVOS.size()>=level && level > 0 ) { |
| | | classifyVO = classifyVOS.get(level-1); |
| | | } |
| | | }else{ |
| | | //å½åçåç±» |
| | | classifyVO = classifyFullInfo.getCurrentClassifyVO(); |
| | | } |
| | | try { |
| | | if (classifyVO == null) { |
| | | //说æå±çº§æè¯¯ |
| | | cbo.setAttributeValue(attrId, "åç±»æ 䏿²¡æå±çº§[" + attrVO.getClassifyInvokeLevel() + "]"); |
| | | } else { |
| | | Map<String, String> classifyDataMap = VciBaseUtil.objectToMapString(classifyVO); |
| | | String value = classifyDataMap.getOrDefault(attrVO.getClassifyInvokeAttr(), ""); |
| | | cbo.setAttributeValue(attrId, value); |
| | | } |
| | | } catch (Throwable e) { |
| | | log.error("è®¾ç½®å±æ§é误", e); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | /** |
| | | * æ ¡éªå
³é®å±æ§ |
| | | * @param classifyFullInfo åç±»çå
¨é¨ä¿¡æ¯ |
| | | * @param templateVO 模æ¿çå
容ï¼å¿
é¡»å
嫿¨¡æ¿å±æ§ |
| | | * @param cboList æ¹éçæ°æ® |
| | | */ |
| | | private CodeImportResultVO batchCheckKeyAttrOnOrder(CodeClassifyFullInfoBO classifyFullInfo, CodeClassifyTemplateVO templateVO, |
| | | List<ClientBusinessObject> cboList) { |
| | | //ä¸MdmEngineServiceImpléçcheckKeyAttrOnOrderç¸ä¼¼ |
| | | //å
è·åå
³é®å±æ§çè§åï¼ä¹å©ç¨ç»§æ¿çæ¹å¼ |
| | | CodeKeyAttrRepeatVO keyRuleVO = keyRuleService.getRuleByClassifyFullInfo(classifyFullInfo); |
| | | //注æçæ¯keyRuleVOå¯è½ä¸ºç©ºï¼è¡¨ç¤ºä¸ä½¿ç¨è§åæ§å¶ |
| | | //è·åææçå
³é®å±æ§ |
| | | Map<String/**屿§çç¼å·**/, CodeClassifyTemplateAttrVO> ketAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyAttrFlag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | |
| | | boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag()); |
| | | //å
¨é¨å»ç©ºçä¼å
级大äºå»ç©º |
| | | boolean trim =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag()); |
| | | boolean ignoreCase = keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag()); |
| | | boolean ignoreWidth = keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag()); |
| | | |
| | | //1. æä»¬éè¦å
夿excel导å
¥çå
容æ¯å¦æ£ç¡® |
| | | CodeImportResultVO resultVO = new CodeImportResultVO(); |
| | | resultVO.setKeyAttrRuleInfo(String.format(keyRuleVO ==null?"":"æ¥è¯¢è§åï¼å»é¤ç©ºæ ¼--{0},忽ç¥å¤§å°å--{1},忽ç¥å
¨åè§--{2},忽ç¥å
¨é¨ç©ºæ ¼--{3}", |
| | | new String[]{trim?"æ¯":"å¦",ignoreCase?"æ¯":"å¦",ignoreWidth?"æ¯":"å¦",trimAll?"æ¯":"å¦"})); |
| | | resultVO.setSelfRepeatRowIndexList(getSelfRepeatRowIndex(ketAttrMap,cboList,keyRuleVO)); |
| | | if(!CollectionUtils.isEmpty(resultVO.getSelfRepeatRowIndexList())){ |
| | | //æä»¬ç§»é¤æ¬èº«éå¤çæ°æ® |
| | | cboList = cboList.stream().filter(s->!resultVO.getSelfRepeatRowIndexList().contains(s.getAttributeValue(IMPORT_ROW_INDEX))).collect(Collectors.toList()); |
| | | } |
| | | //2.夿å
³é®å±æ§å¨ç³»ç»éæ¯å¦éå¤ |
| | | //å ä¸ºæ°æ®éå¾å¤§ï¼æä»¥å¾æ³åæ³å¹¶è¡ |
| | | //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | Map<String,List<ClientBusinessObject>> indexTODataMap=new HashMap<>(); |
| | | List<ClientBusinessObject> repeatDataMap = cboList.parallelStream().filter(cbo -> { |
| | | //æ¯è¡é½å¾æ¥è¯¢.妿å
¶ä¸åºç°äºéè¯¯ï¼æä»¬å°±ç´æ¥æåºå¼å¸¸ï¼å
¶ä½çæ¾ç¤º |
| | | //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | ketAttrMap.forEach((attrId, attrVO) -> { |
| | | String value =cbo.getAttributeValue(attrId.toLowerCase(Locale.ROOT)); |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | value= value.replace(REQUIRED_CHAR,SPECIAL_CHAR); |
| | | engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap); |
| | | }); |
| | | if (!CollectionUtils.isEmpty(ketAttrMap)) { |
| | | CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), templateVO, conditionMap, null); |
| | | boolean isKeyCheck= commonsMapper.queryCountBySql(sqlBO.getSqlCount()) > 0; |
| | | if(isKeyCheck){ |
| | | List<Map<String,String>> newDataList= commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlUnPage()); |
| | | List<ClientBusinessObject> newCboList= ChangeMapTOClientBusinessObjects(newDataList); |
| | | indexTODataMap.put(cbo.getAttributeValue(IMPORT_ROW_INDEX),newCboList); |
| | | } |
| | | return isKeyCheck; |
| | | }else{ |
| | | return false; |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(repeatDataMap)){ |
| | | resultVO.setKeyAttrRepeatRowIndexList(repeatDataMap.stream().map(s->s.getAttributeValue(IMPORT_ROW_INDEX)).collect(Collectors.toSet())); |
| | | } |
| | | //resultVO.setIndexTODataMap(indexTODataMap); |
| | | //resultVO.setSuccess(true); |
| | | return resultVO; |
| | | } |
| | | /** |
| | | * è·å导å
¥çå
容ä¸å
³é®å±æ§éå¤çè¡å· |
| | | * @param ketAttrMap å
³é®å±æ§çæ å° |
| | | * @param dataList 导å
¥çæ°æ® |
| | | * @param keyRuleVO å
³é®å±æ§æ§å¶è§å |
| | | * @return éå¤çè¡å· |
| | | */ |
| | | private Set<String> getSelfRepeatRowIndex(Map<String/**屿§çç¼å·**/, CodeClassifyTemplateAttrVO> ketAttrMap, |
| | | List<ClientBusinessObject> dataList,CodeKeyAttrRepeatVO keyRuleVO){ |
| | | Set<String> selfRepeatRowIndexList = new CopyOnWriteArraySet<>(); |
| | | boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag()); |
| | | //å
¨é¨å»ç©ºçä¼å
级大äºå»ç©º |
| | | boolean trim =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag()); |
| | | boolean ignoreCase = keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag()); |
| | | boolean ignoreWidth = keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag()); |
| | | //å¿
é¡»å°å±æ§æç
§é¡ºåºæåºå¥½ |
| | | List<CodeClassifyTemplateAttrVO> attrVOList = ketAttrMap.values().stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList()); |
| | | Map<String/**è¡å·**/,String/**å
³é®å±æ§çç»åå
容**/> rowIndexKeyStringMap = new HashMap<>(); |
| | | dataList.parallelStream().forEach(cbo-> { |
| | | String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0; i < attrVOList.size(); i++) { |
| | | CodeClassifyTemplateAttrVO attrVO = attrVOList.get(i); |
| | | String attrId = attrVO.getId().toLowerCase(Locale.ROOT); |
| | | String value = cbo.getAttributeValue( attrId); |
| | | if (value == null) { |
| | | value = ""; |
| | | } |
| | | if(trim){ |
| | | value = value.trim(); |
| | | } |
| | | if(trimAll){ |
| | | value = value.replace(" ",""); |
| | | } |
| | | if(ignoreCase){ |
| | | value = value.toLowerCase(Locale.ROOT); |
| | | } |
| | | if(ignoreWidth){ |
| | | value = VciBaseUtil.toDBC(value); |
| | | } |
| | | sb.append(value).append("${ks}"); |
| | | } |
| | | String keyString = sb.toString(); |
| | | if(rowIndexKeyStringMap.containsValue(keyString) && StringUtils.isNotBlank(keyString)){ |
| | | selfRepeatRowIndexList.add(rowIndex); |
| | | }else { |
| | | rowIndexKeyStringMap.put(rowIndex, sb.toString()); |
| | | } |
| | | }); |
| | | //å ä¸ºåªæ¯å
³é®å±æ§éå¤ï¼æä»¥æä»¬ä¸è½éå¤ç夿¡é䏿¡æ¥æ¥é |
| | | return selfRepeatRowIndexList; |
| | | } |
| | | /** |
| | | * excelçæ é¢ä¸è·ååæ®µæå¨çä½ç½® |
| | | * @param titleRowData æ é¢çå
容 |
| | | * @param attrNameIdMap 模æ¿ä¸å±æ§åç§°åè±æçæ å° |
| | |
| | | } |
| | | } |
| | | } |
| | | private List<ClientBusinessObject> ChangeMapTOClientBusinessObjects(List<Map<String,String>> oldDataMap){ |
| | | List<ClientBusinessObject> clientBusinessObjectList=new CopyOnWriteArrayList<>(); |
| | | oldDataMap.parallelStream().forEach(dataMap->{ |
| | | ClientBusinessObject clientBusinessObject=new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject); |
| | | dataMap.forEach((key,value)->{ |
| | | clientBusinessObject.setAttributeValue(key,value); |
| | | }); |
| | | }); |
| | | return clientBusinessObjectList; |
| | | } |
| | | |
| | | /*** |
| | | * æ£ç¡®éè¯¯æ°æ®redisç¼å |
| | | * @param uuid |
| | | * @param templateVO |
| | | * @param rowIndexCbo |
| | | * @param dataSet |
| | | * @param fieldIndexMap |
| | | * @param errorMap |
| | | * @param isok |
| | | */ |
| | | private void createRedisDatas(String uuid,CodeClassifyTemplateVO templateVO,Map<String,ClientBusinessObject> rowIndexCbo, SheetDataSet dataSet, Map<Integer/**åå·**/,String/**åæ®µçåç§°**/> fieldIndexMap,Map<String,String> errorMap,boolean isok){ |
| | | List<SheetRowData> needsheetRowDataList =new ArrayList<>(); |
| | | if(errorMap.size()>0) { |
| | | //è¦æä»¥ä¸çé误ç齿åºåï¼åç»§ç»å¤çæ¶é´åç»åè§å |
| | | needsheetRowDataList = dataSet.getRowData().stream().filter(cbo -> { |
| | | String rowIndex=cbo.getRowIndex(); |
| | | return isok? !errorMap.containsKey(rowIndex):errorMap.containsKey(rowIndex); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | }else{ |
| | | needsheetRowDataList= dataSet.getRowData(); |
| | | } |
| | | Map<String/**䏿åç§°**/, SheetRowData/**è±æåç§°**/> rowIdexDataMap = needsheetRowDataList.stream().collect(Collectors.toMap(s -> s.getRowIndex(), t -> t,(o1, o2)->o2)); |
| | | Map<String,CodeImprotDataVO> clsfDataMap=new HashMap<>(); |
| | | rowIndexCbo .forEach((rowIndex, cbo) -> { |
| | | CodeImprotDataVO codeImprotDataVO = new CodeImprotDataVO(); |
| | | codeImprotDataVO.setTemplateOid(templateVO.getOid()); |
| | | List<Map<String, String>> dataList = new ArrayList<>(); |
| | | if(rowIdexDataMap.containsKey(rowIndex)){ |
| | | SheetRowData sheetRowData=rowIdexDataMap.get(rowIndex); |
| | | Map<String, String> dataMap = new HashMap<>(); |
| | | Map<Integer, String> data = sheetRowData.getData(); |
| | | fieldIndexMap.forEach((integer, s) -> { |
| | | String field = fieldIndexMap.get(integer); |
| | | if (data.containsKey(integer)) { |
| | | String vlues = data.get(integer); |
| | | dataMap.put(field, vlues); |
| | | } |
| | | }); |
| | | dataMap.put("oid",cbo.getOid()); |
| | | dataList.add(dataMap); |
| | | } |
| | | if(clsfDataMap.containsKey(templateVO.getOid())){ |
| | | codeImprotDataVO=clsfDataMap.get(templateVO.getOid()); |
| | | dataList.addAll(codeImprotDataVO.getDatas()); |
| | | } |
| | | codeImprotDataVO.setColNames(dataSet.getColName()); |
| | | codeImprotDataVO.setDatas(dataList); |
| | | clsfDataMap.put(templateVO.getOid(),codeImprotDataVO); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(clsfDataMap)) { |
| | | Collection codeImprotDataVOS=clsfDataMap.values(); |
| | | List<CodeImprotDataVO> codeImprotDataVOList=new ArrayList<>(); |
| | | codeImprotDataVOList.addAll(codeImprotDataVOS); |
| | | bladeRedis.set(uuid+"-"+templateVO.getOid(), codeImprotDataVOList); |
| | | bladeRedis.expire(uuid+"-"+templateVO.getOid(),BATCHADD_REDIS_TIME);//redisè¿ææ¶é´ |
| | | } |
| | | } |
| | | |
| | | /**** |
| | | * æ°æ®ç¸ä¼¼é¡¹æ°æ®æ ¡éªredisç¼å |
| | | * @param codeClassifyOid |
| | | * @param templateVO |
| | | * @param cboList |
| | | * @param resembleMap |
| | | * @param btmtypeid |
| | | * @param dataResembleVOS |
| | | */ |
| | | private void bathcResembleQuery(String codeClassifyOid, CodeClassifyTemplateVO templateVO, List<ClientBusinessObject> cboList,Map<String,String>resembleMap,String btmtypeid,List<DataResembleVO> dataResembleVOS){ |
| | | CodeClassifyFullInfoBO fullInfoBO = classifyService.getClassifyFullInfo(codeClassifyOid); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | CodeResembleRuleVO resembleRuleVO = Optional.ofNullable(engineService.getUseResembleRule(fullInfoBO, fullInfoBO.getCurrentClassifyVO())).orElseGet(() -> new CodeResembleRuleVO()); |
| | | //éè¦è·åæ¯å¦æç¸ä¼¼æ¥è¯¢å±æ§ |
| | | Map<String, CodeClassifyTemplateAttrVO> attrVOs = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getSameRepeatAttrFlag())).collect(Collectors.toMap(s -> s.getId(), t -> t)); |
| | | if (CollectionUtils.isEmpty(attrVOs)) { |
| | | return; |
| | | } |
| | | Map<String,CodeImprotResembleVO> codeImprotResembleVOMap=new HashMap<>(); |
| | | List<CodeImprotResembleVO> codeImprotResembleVOList=new ArrayList<>(); |
| | | Map<String,String> rowIndePathMap=new HashMap<>(); |
| | | cboList.stream().forEach(clientBusinessObject -> { |
| | | CodeImprotResembleVO codeImprotResembleVO=new CodeImprotResembleVO(); |
| | | final String[] path = {""}; |
| | | List<String> fieldList=new ArrayList<>(); |
| | | List<String> rowIndeList=new ArrayList<>(); |
| | | String rowIndex = clientBusinessObject.getAttributeValue(IMPORT_ROW_INDEX); |
| | | attrVOs.forEach((attrId, attrVO) -> { |
| | | String value=""; |
| | | /*if (VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(attrId)) { |
| | | value = WebUtil.getStringValueFromObject(WebUtil.getValueFromField(WebUtil.getFieldForObject(attrId, orderDTO.getClass()).getName(), orderDTO)); |
| | | }else {*/ |
| | | value= clientBusinessObject.getAttributeValue(attrId); |
| | | // } |
| | | fieldList.add(attrId); |
| | | value=StringUtils.isBlank(value)?"":value; |
| | | path[0] +=value+"#"; |
| | | engineService.wrapperResembleConditionMap(value, resembleRuleVO, attrId, conditionMap); |
| | | }); |
| | | List<Map<String,String>> dataMap=new ArrayList<>(); |
| | | if(codeImprotResembleVOMap.containsKey(path[0])) { |
| | | codeImprotResembleVO=codeImprotResembleVOMap.get(path[0]); |
| | | rowIndeList=codeImprotResembleVO.getRownIndex(); |
| | | dataMap= codeImprotResembleVO.getDataList(); |
| | | resembleMap.put(rowIndex, "åå¨ç¸ä¼¼æ°æ®"); |
| | | }else{ |
| | | if (!CollectionUtils.isEmpty(conditionMap)) { |
| | | Map<String, String> andConditionMap = new HashMap<>(); |
| | | andConditionMap.put("islastr", "1"); |
| | | andConditionMap.put("islastv", "1"); |
| | | conditionMap.putAll(andConditionMap); |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.addDefaultDesc("id"); |
| | | CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(btmtypeid, templateVO, conditionMap, pageHelper); |
| | | List<Map<String,String>> dataMapList=commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlUnPage()); |
| | | List<ClientBusinessObject> resembleCboList= ChangeMapTOClientBusinessObjects(dataMapList); |
| | | if(!CollectionUtils.isEmpty(resembleCboList)) { |
| | | List<Map<String, String>> finalDataMap = dataMap; |
| | | resembleCboList.stream().forEach(cbo->{ |
| | | Map<String,String> resembDataMap=new HashMap<>(); |
| | | fieldList.stream().forEach(field->{ |
| | | String value=cbo.getAttributeValue(field); |
| | | value=StringUtils.isBlank(value)?"":value; |
| | | resembDataMap.put(field,value); |
| | | }); |
| | | resembDataMap.put("codetemplateoid",templateVO.getOid()); |
| | | resembDataMap.put("id",StringUtils.isBlank(cbo.getAttributeValue("id"))?"":cbo.getAttributeValue("id")); |
| | | resembDataMap.put("rowIndex",""); |
| | | resembDataMap.put("oid",cbo.getOid()); |
| | | finalDataMap.add(resembDataMap); |
| | | }); |
| | | resembleMap.put(rowIndex, "åå¨ç¸ä¼¼æ°æ®"); |
| | | |
| | | } |
| | | } |
| | | } |
| | | rowIndePathMap.put(rowIndex,path[0]); |
| | | rowIndeList.add(rowIndex); |
| | | codeImprotResembleVO.setPath(path[0]); |
| | | codeImprotResembleVO.setRownIndex(rowIndeList); |
| | | codeImprotResembleVO.setConditionMap(conditionMap); |
| | | codeImprotResembleVO.setFields(fieldList); |
| | | codeImprotResembleVO.setDataList(dataMap); |
| | | codeImprotResembleVOMap.put(path[0],codeImprotResembleVO); |
| | | }); |
| | | Map<String, ClientBusinessObject> cboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t)); |
| | | if(!CollectionUtils.isEmpty(rowIndePathMap)){ |
| | | rowIndePathMap.forEach((rowIndex, path) -> { |
| | | if(codeImprotResembleVOMap.containsKey(path)){ |
| | | CodeImprotResembleVO codeImprotResembleVO= codeImprotResembleVOMap.get(path); |
| | | List<String> fieldList=codeImprotResembleVO.getFields(); |
| | | List<String> rownIndexList= codeImprotResembleVO.getRownIndex(); |
| | | List<String> newRownIndexList = rownIndexList.stream().filter(cbo -> { |
| | | return rowIndex!=cbo; |
| | | }).collect(Collectors.toList()); |
| | | newRownIndexList.stream().forEach(s -> { |
| | | resembleMap.put(s, "åå¨ç¸ä¼¼æ°æ®"); |
| | | }); |
| | | List<Map<String, String>>newDataList=new ArrayList<>(); |
| | | DataResembleVO dataResembleVO=new DataResembleVO(); |
| | | dataResembleVO.setOid(cboMap.get(rowIndex).getOid()); |
| | | List<ClientBusinessObject> needSaveCboList = cboList.stream().filter(cbo -> { |
| | | String newRowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | return rownIndexList.contains(newRowIndex)&&(!newRowIndex.equalsIgnoreCase(rowIndex)); |
| | | }).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(needSaveCboList)) { |
| | | needSaveCboList.stream().forEach(cbo -> { |
| | | String newRowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | Map<String, String> resembDataMap = new HashMap<>(); |
| | | fieldList.stream().forEach(field -> { |
| | | String value = cbo.getAttributeValue(field); |
| | | value = StringUtils.isBlank(value) ? "" : value; |
| | | resembDataMap.put(field, value); |
| | | }); |
| | | resembDataMap.put("codetemplateoid",templateVO.getOid()); |
| | | resembDataMap.put("id",StringUtils.isBlank(cbo.getAttributeValue("id"))?"":cbo.getAttributeValue("id")); |
| | | resembDataMap.put("rowIndex", newRowIndex); |
| | | resembDataMap.put("oid",cbo.getOid()); |
| | | newDataList.add(resembDataMap); |
| | | }); |
| | | } |
| | | List<Map<String, String>>dataList=codeImprotResembleVO.getDataList(); |
| | | newDataList.addAll(dataList); |
| | | dataResembleVO.setDataList(newDataList); |
| | | dataResembleVOS.add(dataResembleVO); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * åå¨å类对象åå
¶åå |
| | | * @param uuid |
| | | * @param templateVOList |
| | | * @param dataSet |
| | | * @param fieldIndexMap |
| | | * @param iscContain |
| | | */ |
| | | private void createRedisByCodeClassify(String uuid,CodeClassifyTemplateVO templateVOList,SheetDataSet dataSet, Map<Integer/**åå·**/,String/**åæ®µçåç§°**/> fieldIndexMap,boolean iscContain){ |
| | | List<ColumnVO> columnVOList = new ArrayList<>(); |
| | | List<String> outNameList = dataSet.getColName(); |
| | | fieldIndexMap.forEach((integer, s) -> { |
| | | ColumnVO columnVOS = new ColumnVO(); |
| | | String field = fieldIndexMap.get(integer); |
| | | String outName = outNameList.get(integer); |
| | | columnVOS.setField(field); |
| | | columnVOS.setTitle(outName); |
| | | columnVOList.add(columnVOS); |
| | | }); |
| | | CodeImportTemplateVO codeImportTemplateVO=new CodeImportTemplateVO(); |
| | | codeImportTemplateVO.setCodeClassifyTemplateVO(templateVOList); |
| | | codeImportTemplateVO.setCloNamesList(columnVOList); |
| | | List<CodeImportTemplateVO> codeImportTemplateVOs= new ArrayList<>(); |
| | | |
| | | codeImportTemplateVOs.add(codeImportTemplateVO); |
| | | if(codeImportTemplateVOs.size()>0) { |
| | | bladeRedis.set(uuid, codeImportTemplateVOs); |
| | | bladeRedis.expire(uuid, BATCHADD_REDIS_TIME);//redisè¿ææ¶é´ |
| | | } |
| | | } |
| | | /** |
| | | * æ·è´ä¸å¡ç±»åå°map |
| | | * @param cbo ä¸å¡æ°æ® |
| | | * @param map map |
| | | */ |
| | | public static void copyValueToMapFromCbos(ClientBusinessObject cbo,Map<String,String> map){ |
| | | if(cbo!=null){ |
| | | copyValueToMapFromBos(cbo,map); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·è´ä¸å¡ç±»åå°map |
| | | * @param bo ä¸å¡æ°æ® |
| | | * @param map map |
| | | */ |
| | | public static void copyValueToMapFromBos(ClientBusinessObject bo,Map<String,String> map){ |
| | | if(bo!=null ){ |
| | | //å
æææçåæ®µæ å°æ¾å° |
| | | AttributeValue[] newAList = bo.newAttrValList; |
| | | AttributeValue[] hisAList = bo.hisAttrValList; |
| | | if(hisAList!=null&&hisAList.length>0){// |
| | | for(int i = 0 ; i < hisAList.length;i++){ |
| | | AttributeValue av = hisAList[i]; |
| | | String attrName = av.attrName.toLowerCase(); |
| | | map.put(attrName, av.attrVal); |
| | | } |
| | | } |
| | | if(newAList!=null&&newAList.length>0){//NEWçä¼å
级é«äº |
| | | for(int i = 0 ; i < newAList.length;i++){ |
| | | AttributeValue av = newAList[i]; |
| | | String attrName = av.attrName.toLowerCase(); |
| | | map.put(attrName, av.attrVal); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.util; |
| | | |
| | | import com.vci.ubcs.omd.feign.IAttributeClient; |
| | | import com.vci.ubcs.omd.util.Tool; |
| | | import com.vci.ubcs.omd.vo.AttributeVO; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | public class AttributeChecker { |
| | | |
| | | @Autowired(required = false) |
| | | private IAttributeClient attributeClient; |
| | | |
| | | public static HashMap<String, AttributeVO> attrItemMap = new HashMap(); |
| | | public static List<AttributeVO> attrItems = new ArrayList<AttributeVO>(); |
| | | |
| | | public void getAllAttribute() { |
| | | if (attrItems == null) { |
| | | R<List<AttributeVO>> R = attributeClient.getAll(); |
| | | attrItems=R.getData(); |
| | | List<AttributeVO> var4; |
| | | int var3 = (var4 = attrItems).size(); |
| | | |
| | | for(int var2 = 0; var2 < var3; ++var2) { |
| | | AttributeVO attrItem = var4.get(var2); |
| | | attrItemMap.put(attrItem.getName(), attrItem); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public int isAttrValValid(String attrName, String attrVal) { |
| | | // if (!BusinessConstants.BO_CONSTANTS.containsKey(attrName.toUpperCase())) { |
| | | if (attrVal != null && !attrVal.trim().equals("")) { |
| | | this.getAllAttribute(); |
| | | AttributeVO attributeVO = (AttributeVO)attrItemMap.get(attrName); |
| | | if (attributeVO == null) { |
| | | return 0; |
| | | } else { |
| | | String attrType = attributeVO.getTypeKey(); |
| | | int rs; |
| | | if (attrType.equals("VTString")) { |
| | | // rs = this.checkVTStringValValid(attributeVO, attrName, attrVal); |
| | | rs = 0; |
| | | } else if (attrType.equals("VTInteger")) { |
| | | // rs = this.checkVTIntegerValValid(attributeVO, attrName, attrVal); |
| | | rs = 0; |
| | | } else if (attrType.equals("VTLong")) { |
| | | // rs = this.checkVTLongValValid(attributeVO, attrName, attrVal); |
| | | rs = 0; |
| | | } else if (attrType.equals("VTDouble")) { |
| | | // rs = this.checkVTDoubleValValid(attributeVO, attrName, attrVal); |
| | | rs = 0; |
| | | } else if (attrType.equals("VTBoolean")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTImage")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTDate")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTTime")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTDateTime")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTNote")) { |
| | | rs = 0; |
| | | } else if (attrType.equals("VTFilePath")) { |
| | | rs = 0; |
| | | } else { |
| | | rs = 0; |
| | | } |
| | | |
| | | return rs; |
| | | } |
| | | } else { |
| | | return 0; |
| | | } |
| | | // } else { |
| | | // return 0; |
| | | // } |
| | | } |
| | | |
| | | /*private int checkVTStringValValid(AttributeVO attributeVO, String attrName, String attrVal) { |
| | | String other =""; |
| | | int maxLength = Integer.valueOf(Tool.getOtherValueByType(other, "length")); |
| | | int length = attrVal.length(); |
| | | return length > maxLength ? 1 : 0; |
| | | } |
| | | |
| | | private int checkVTIntegerValValid(AttributeVO attributeVO, String attrName, String attrVal) { |
| | | VTInteger obj = new VTInteger(Integer.valueOf(attrVal)); |
| | | return !obj.checkRageValueByRage(attributeVO.rage) ? 2 : 0; |
| | | } |
| | | |
| | | private int checkVTLongValValid(AttributeVO attributeVO, String attrName, String attrVal) { |
| | | VTLong obj = new VTLong(Long.valueOf(attrVal)); |
| | | return !obj.checkRageValueByRage(attributeVO.rage) ? 2 : 0; |
| | | } |
| | | |
| | | private int checkVTDoubleValValid(AttributeVO attributeVO, String attrName, String attrVal) { |
| | | VTDouble obj = new VTDouble(Double.valueOf(attrVal)); |
| | | String other = attributeVO.other; |
| | | int maxLength = Integer.valueOf(Tool.getOtherValueByType(other, "length")); |
| | | int length = String.valueOf(attrVal).length() - 1; |
| | | if (length >= maxLength && !obj.checkRageValueByRage(attributeVO.rage)) { |
| | | return 3; |
| | | } else if (!obj.checkRageValueByRage(attributeVO.rage)) { |
| | | return 2; |
| | | } else { |
| | | return length >= maxLength ? 1 : 0; |
| | | } |
| | | }*/ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.util; |
| | | |
| | | import com.vci.ubcs.code.bo.AttributeValue; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | @Data |
| | | public class ClientBusinessObject extends BaseModel { |
| | | |
| | | public AttributeValue[] newAttrValList; |
| | | public AttributeValue[] hisAttrValList; |
| | | |
| | | public void setAttributeValue(String attributeName, String attributeValue) throws VciBaseException { |
| | | this.setAttributeValue(attributeName, attributeValue, false); |
| | | } |
| | | |
| | | public void setAttributeValue(String attributeName, String attributeValue, boolean isCreate) throws VciBaseException { |
| | | int isValid = (new AttributeChecker()).isAttrValValid(attributeName, attributeValue); |
| | | if (isValid == 1) { |
| | | throw getLocalError("P0010SOF-00017", new String[]{attributeName, attributeValue}); |
| | | } else if (isValid == 2) { |
| | | throw this.getLocalError("P0010SOF-00018", new String[]{attributeName, attributeValue}); |
| | | } else if (isValid == 3) { |
| | | throw this.getLocalError("P0010SOF-00019", new String[]{attributeName, attributeValue}); |
| | | } else { |
| | | this.setAttributeValueWithNoCheck(attributeName, attributeValue, isCreate); |
| | | } |
| | | } |
| | | |
| | | public void setAttributeValueWithNoCheck(String attributeName, String attributeValue) throws VciBaseException { |
| | | this.setAttributeValueWithNoCheck(attributeName, attributeValue, false); |
| | | } |
| | | |
| | | public void setAttributeValueWithNoCheck(String attributeName, String attributeValue, boolean isCreate) throws VciBaseException { |
| | | /*if (isCreate) {//&& BusinessConstants.BO_CONSTANTS.containsKey(attributeName.toUpperCase()) |
| | | this.setConstantsAttrVal(attributeName, attributeValue); |
| | | } else {*/ |
| | | AttributeValue[] attrValues = this.newAttrValList; |
| | | ArrayList<AttributeValue> attrValList = new ArrayList(); |
| | | AttributeValue attrVal; |
| | | int i; |
| | | if (attrValues != null && attrValues.length > 0) { |
| | | AttributeValue[] var9 = attrValues; |
| | | i = attrValues.length; |
| | | |
| | | for(int var7 = 0; var7 < i; ++var7) { |
| | | attrVal = var9[var7]; |
| | | attrValList.add(attrVal); |
| | | } |
| | | } |
| | | |
| | | attrVal = null; |
| | | boolean isExist = false; |
| | | |
| | | for(i = 0; i < attrValList.size(); ++i) { |
| | | attrVal = (AttributeValue)attrValList.get(i); |
| | | if (attrVal.attrName.toUpperCase().equals(attributeName.toUpperCase())) { |
| | | attrVal.attrVal = attributeValue; |
| | | isExist = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (!isExist) { |
| | | attrVal = new AttributeValue(); |
| | | attrVal.attrName = attributeName.toUpperCase(); |
| | | attrVal.attrVal = attributeValue; |
| | | attrValList.add(attrVal); |
| | | } |
| | | |
| | | this.newAttrValList = (AttributeValue[])attrValList.toArray(new AttributeValue[attrValList.size()]); |
| | | // } |
| | | } |
| | | |
| | | public String getAttributeValue(String attrName) { |
| | | String res = ""; |
| | | boolean existInNewAttr = false; |
| | | int i; |
| | | if (this.newAttrValList != null) { |
| | | for(i = 0; i < this.newAttrValList.length; ++i) { |
| | | if (this.newAttrValList[i].attrName.toUpperCase().equals(attrName.toUpperCase())) { |
| | | existInNewAttr = true; |
| | | res = this.newAttrValList[i].attrVal; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (existInNewAttr) { |
| | | return res; |
| | | } else if (this.hisAttrValList == null) { |
| | | return ""; |
| | | } else { |
| | | for(i = 0; i < this.hisAttrValList.length; ++i) { |
| | | if (this.hisAttrValList[i].attrName.toUpperCase().equals(attrName.toUpperCase())) { |
| | | res = this.hisAttrValList[i].attrVal; |
| | | } |
| | | } |
| | | |
| | | return res; |
| | | } |
| | | } |
| | | |
| | | public VciBaseException getLocalError(String error_code ,String[] error_messages) { |
| | | return new VciBaseException(error_code, error_messages); |
| | | } |
| | | |
| | | } |
| | |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-user-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param ids 主é®éå |
| | | * @param oid 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "å é¤", notes = "主é®éå") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String oid) { |
| | | CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); |
| | | return R.status(attributeService.removeAttrs(ids)); |
| | | return attributeService.remove(oid); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.controller; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.omd.dto.RevisionRuleDTO; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Description: çæ¬è§åæ§å¶å¨ |
| | |
| | | @GetMapping("page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页æ¥è¯¢çæ¬è§å",notes = "å页æ¥è¯¢çæ¬è§å") |
| | | public R<IPage<RevisionRuleVO>> page(BaseQueryObject baseQueryObject){ |
| | | return R.data(revisionRuleService.pageQueryVO(baseQueryObject)); |
| | | public R<IPage<RevisionRuleVO>> page(@ApiIgnore @RequestParam Map<String, Object> condition, Query query){ |
| | | return R.data(revisionRuleService.pageQueryVO(condition,query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹",notes = "ä¼ å
¥çæ¬è§å页é¢å¯¹è±¡") |
| | | public R<RevisionRuleVO> submit(@RequestBody RevisionRuleDTO ruleDTO){ |
| | | if (StringUtils.isBlank(ruleDTO.getOid())) { |
| | | return R.data(revisionRuleService.addSave(ruleDTO)); |
| | | }else { |
| | | return R.data(revisionRuleService.editSave(ruleDTO)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.controller; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.omd.entity.Status; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @GetMapping("page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页æ¥è¯¢ç¶ææ± ",notes = "å页æ¥è¯¢ç¶ææ± ") |
| | | public R<IPage<StatusVO>> page(BaseQueryObject baseQueryObject){ |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | return R.data(statusService.listStatus(conditionMap,baseQueryObject.getPageHelper())); |
| | | public R<IPage<StatusVO>> page(@ApiIgnore @RequestParam Map<String, Object> condition, Query query){ |
| | | return R.data(statusService.listStatus(condition,query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹",notes = "ä¼ å
¥ç¶ææ± 页é¢å¯¹è±¡") |
| | | public R<StatusVO> submit(@RequestBody StatusVO statusVO){ |
| | | if (StringUtils.isBlank(statusVO.getOid())){ |
| | | return R.data(statusService.addSave(statusVO)); |
| | | }else { |
| | | return R.data(statusService.editSave(statusVO)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.cglib.beans.BeanMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @GetMapping(GET_REF_PAGE) |
| | | @Override |
| | | public R<IPage<RevisionRuleVO>> getRefPage(BaseQueryObject baseQueryObject) { |
| | | return R.data(service.pageQueryVO(baseQueryObject)); |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | Query query = new Query(); |
| | | query.setSize(baseQueryObject.getLimit()); |
| | | query.setCurrent(baseQueryObject.getPage()); |
| | | Map<String,Object> condition = new HashMap<>(); |
| | | BeanUtil.copy(conditionMap,condition); |
| | | return R.data(service.pageQueryVO(condition,query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Query; |
| | | 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.RestController; |
| | |
| | | if (conditionMap == null) { |
| | | conditionMap = new HashMap<>(16); |
| | | } |
| | | return R.data(service.listStatus(conditionMap,baseQueryObject.getPageHelper())); |
| | | Map<String,Object> condition = new HashMap<>(); |
| | | BeanUtil.copy(conditionMap,condition); |
| | | Query query = new Query(); |
| | | query.setCurrent(baseQueryObject.getPage()); |
| | | query.setSize(baseQueryObject.getLimit()); |
| | | return R.data(service.listStatus(condition,query)); |
| | | } |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.vci.ubcs.omd.service.IWebSecretService; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | |
| | | /** |
| | | * æä¸¾å®ä¹ Feignå®ç°ç±» |
| | | * |
| | | * @author yuxc |
| | | * @since 2023-05-08 |
| | | */ |
| | | @ApiIgnore() |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class WebSecretClient implements IWebSecretClient { |
| | | |
| | | IWebSecretService webSecretService; |
| | | |
| | | |
| | | @Override |
| | | public R<Integer> getMinUserSecret() throws VciBaseException { |
| | | return R.data(webSecretService.getMinUserSecret()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getMinDataSecret() throws VciBaseException { |
| | | return R.data(webSecretService.getMinDataSecret()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getMinIpSecret() throws VciBaseException { |
| | | return R.data(webSecretService.getMinIpSecret()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getUserSecret(String userId) throws VciBaseException { |
| | | return R.data(webSecretService.getUserSecret(userId)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getUserSecret(UserVO userVO) throws VciBaseException { |
| | | return R.data(webSecretService.getUserSecret(userVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret) { |
| | | return R.data(webSecretService.checkDataSecret(secret)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, int userSecret) { |
| | | return R.data(webSecretService.checkDataSecret(secret,userSecret)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, String userId) throws VciBaseException { |
| | | return R.data(webSecretService.checkDataSecret(secret,userId)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkDataSecret(int secret, UserVO userVO) { |
| | | return R.data(webSecretService.checkDataSecret(secret,userVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getIpSecret(String ip) throws VciBaseException { |
| | | return R.data(webSecretService.getIpSecret(ip)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(int ipSecret, int userSecret) { |
| | | return R.data(webSecretService.checkIpSecret(ipSecret,userSecret)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(int ipSecret) { |
| | | return R.data(webSecretService.checkIpSecret(ipSecret)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(String ip, String userId) throws VciBaseException { |
| | | return R.data(webSecretService.checkIpSecret(ip,userId)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkIpSecret(String ip, UserVO userVO) { |
| | | return R.data(webSecretService.checkIpSecret(ip,userVO)); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.entity.RevisionRule; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description: çæ¬è§åæ°æ®å± |
| | | * |
| | |
| | | */ |
| | | public interface RevisionRuleMapper extends BaseMapper<RevisionRule> { |
| | | |
| | | /** |
| | | * æç¼å·å¿½ç¥å¤§å°åæ¥è¯¢ |
| | | * @param records è®°å½ |
| | | * @return |
| | | */ |
| | | List<RevisionRule> selectByIdIgnoreCase(Collection<String> records); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.entity.Status; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description: ç¶ææ± æ°æ®å± |
| | | * |
| | |
| | | * @date 2023/5/23 |
| | | */ |
| | | public interface StatusMapper extends BaseMapper<Status> { |
| | | /** |
| | | * 忽ç¥å¤§å°åçæ¥è¯¢ |
| | | * @param records |
| | | * @return |
| | | */ |
| | | List<Status> selectByIdIgnoreCase(Collection<String> records); |
| | | } |
| | |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | * @throws VciBaseException ä¸ç¬¦åæ¶æåºå¼å¸¸ |
| | | */ |
| | | boolean checkAttribute(BtmTypeLinkAttributesDTO attributesDTO) throws VciBaseException; |
| | | |
| | | /** |
| | | * å个å é¤ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | R remove(String oid); |
| | | } |
| | |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * @param baseQueryObject æ¥è¯¢å¯¹è±¡ |
| | | * @param query å页 |
| | | * @param condition æ¥è¯¢æ¡ä»¶ |
| | | * @return æ¥è¯¢ç»æ |
| | | * @throws VciBaseException æ¥è¯¢åºéæ¶æåºå¼å¸¸ |
| | | */ |
| | | IPage<RevisionRuleVO> pageQueryVO(BaseQueryObject baseQueryObject) throws VciBaseException; |
| | | IPage<RevisionRuleVO> pageQueryVO(Map<String, Object> condition, Query query) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ¥çåºç¨èå´ |
| | |
| | | import com.vci.ubcs.omd.entity.Status; |
| | | import com.vci.ubcs.omd.vo.StatusVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | * @return ç¶æå¯¹è±¡å表 |
| | | * @throws VciBaseException æ¥è¯¢åºéæ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | IPage<StatusVO> listStatus(Map<String,String> conditionMap, PageHelper pageHelper) throws VciBaseException; |
| | | IPage<StatusVO> listStatus(Map<String, Object> conditionMap, Query pageHelper) throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åç¶æå表 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.service; |
| | | |
| | | import com.vci.ubcs.code.vo.pagemodel.SmUserVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | |
| | | /** |
| | | * web端çå¯çº§æå¡ |
| | | */ |
| | | public interface IWebSecretService { |
| | | |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§çæå°å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | int getMinUserSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åæ°æ®å¯çº§çé»è®¤å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | int getMinDataSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åIPå¯çº§çé»è®¤å¼ |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | int getMinIpSecret() throws VciBaseException; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * @param userId ç¨æ·ä¸»é® |
| | | * @return ç¨æ·çå¯çº§ |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | int getUserSecret(String userId) throws VciBaseException ; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * @param userVO ç¨æ·çæ¾ç¤ºå¯¹è±¡ |
| | | * @return ç¨æ·çå¯çº§ |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | int getUserSecret(UserVO userVO) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¡éªå½åç¨æ·æ¯å¦ææéè®¿é®æ°æ® |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | boolean checkDataSecret(int secret); |
| | | |
| | | /** |
| | | * æ ¡éªç¨æ·çå¯çº§æ¯å¦æ¯å¦ææéè®¿é®æ°æ® |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userSecret ç¨æ·å¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | boolean checkDataSecret(int secret, int userSecret) ; |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·åæ¥æ ¡éªæ°æ®å¯çº§ |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userId ç¨æ·å |
| | | * @return true表示å
è®¸è®¿é® |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | boolean checkDataSecret(int secret, String userId) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·å¯¹è±¡æ¥æ ¡éªæ°æ®å¯çº§ |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userVO ç¨æ·çæ¾ç¤ºå¯¹è±¡ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | boolean checkDataSecret(int secret, UserVO userVO) ; |
| | | |
| | | /** |
| | | * è·åIPå°åçå¯çº§ |
| | | * @param ip ipå°å |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | int getIpSecret(String ip) throws VciBaseException; |
| | | /** |
| | | * æ£æ¥æºå¨å¯çº§ |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @param userSecret ç¨æ·çå¯çº§ |
| | | * @return å¯çº§çå¼ |
| | | */ |
| | | boolean checkIpSecret(int ipSecret, int userSecret); |
| | | |
| | | /** |
| | | * æ£æ¥å½åç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | boolean checkIpSecret(int ipSecret) ; |
| | | |
| | | /** |
| | | * æ ¡éªæå®ipåç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * @param ip ipå°å |
| | | * @param userId ç¨æ·å |
| | | * @return true表示å
è®¸è®¿é® |
| | | * @throws VciBaseException åæ°é误ï¼ç¨æ·ä¸åå¨ä¼æåºå¼å¸¸ |
| | | */ |
| | | boolean checkIpSecret(String ip, String userId) throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¡éªæå®IPåç¨æ·å¯¹è±¡ç¬¦åæºå¨å¯çº§ |
| | | * @param ip ipå°å |
| | | * @param userVO ç¨æ·å¯¹è±¡ |
| | | * @return true表示å
è®¸è®¿é® |
| | | */ |
| | | boolean checkIpSecret(String ip, UserVO userVO) ; |
| | | } |
| | |
| | | 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.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.vci.ubcs.omd.constant.OmdCacheConstant; |
| | | import com.vci.ubcs.omd.dto.AttributeDTO; |
| | | import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; |
| | | import com.vci.ubcs.omd.entity.Attribute; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.mapper.AttributeMapper; |
| | | import com.vci.ubcs.omd.mapper.BtmTypeMapper; |
| | | import com.vci.ubcs.omd.service.IAttributeService; |
| | | import com.vci.ubcs.omd.vo.AttributeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | |
| | | */ |
| | | @Override |
| | | public boolean submit(AttributeDTO dto) { |
| | | VciBaseUtil.alertNotNull(dto.getId(),"屿§ç¼å·",dto.getName(),"屿§åç§°",dto.getTypeKey(),"屿§ç±»å",dto.getMaxLength(),"屿§é¿åº¦"); |
| | | if (!Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ |
| | | throw new VciBaseException("屿§åç§°{0}åªè½æ¯è±æ",new Object[]{dto.getId()}); |
| | | throw new VciBaseException("屿§ç¼å·{0}åªè½æ¯è±æ",new Object[]{dto.getId()}); |
| | | } |
| | | LambdaQueryWrapper<Attribute> wrapper = Wrappers.<Attribute>query().lambda().eq(Attribute::getId, dto.getId()); |
| | | Long count = baseMapper.selectCount((Func.isEmpty(dto.getOid())) ? wrapper : wrapper.notIn(Attribute::getOid, dto.getOid())); |
| | | if (count > 0L) { |
| | | throw new ServiceException("屿§åå·²åå¨!"); |
| | | throw new ServiceException("屿§ç¼å·å·²åå¨!"); |
| | | } |
| | | Attribute attribute = AttributeWrapper.build().copyBeforeSave(dto); |
| | | CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); |
| | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param ids 主é®éå |
| | | * @param oids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public boolean removeAttrs(String ids) { |
| | | List<Long> idList = Func.toLongList(ids); |
| | | return !deleteLogic(idList) && removeByIds(idList); |
| | | public boolean removeAttrs(String oids) { |
| | | List<String> oidList = Func.toStrList(",", oids); |
| | | List<Attribute> list = list(Wrappers.<Attribute>query().lambda().in(Attribute::getOid, oidList)); |
| | | if (!CollectionUtils.isEmpty(list)){ |
| | | baseMapper.delete(Wrappers.<Attribute>query().lambda().in(Attribute::getOid,list.stream().map(Attribute::getOid).collect(Collectors.toList()))); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return pass; |
| | | } |
| | | |
| | | /** |
| | | * å个å é¤ |
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public R remove(String oid) { |
| | | List<BtmTypeVO> vos = applyRange(oid); |
| | | if (CollectionUtils.isEmpty(vos)){ |
| | | return R.status(removeAttrs(oid)); |
| | | }else { |
| | | return R.fail("è¯¥å±æ§å·²è¢«ä½¿ç¨ï¼ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public List<RevisionRuleVO> listRevisionRuleByIdCollection(Collection<String> revisionRuleIdCollection) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(revisionRuleIdCollection,"è±æåç§°éå"); |
| | | // return RevisionRuleWrapper.build().listVO(list(MybatisParameterUtil.cutInParameter(Wrappers.<RevisionRule>query().lambda(),RevisionRule::getId, Collections.singletonList(revisionRuleIdCollection)))); |
| | | List<RevisionRule> list = baseMapper.selectList(Wrappers.<RevisionRule>query().lambda().in(RevisionRule::getId, revisionRuleIdCollection)); |
| | | List<RevisionRule> list = baseMapper.selectByIdIgnoreCase(revisionRuleIdCollection); |
| | | return RevisionRuleWrapper.build().listVO(list); |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException æ¥è¯¢åºéæ¶æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public IPage<RevisionRuleVO> pageQueryVO(BaseQueryObject baseQueryObject) throws VciBaseException { |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(); |
| | | } |
| | | PageHelper pageHelper = baseQueryObject.getPageHelper(); |
| | | Query query = new Query(); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setAscs(pageHelper.getSort()); |
| | | RevisionRule queryConditionObj = new RevisionRule(); |
| | | BeanMap beanMap = BeanMap.create(queryConditionObj); |
| | | beanMap.putAll(conditionMap); |
| | | return RevisionRuleWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query),Condition.getQueryWrapper(queryConditionObj).lambda().orderByAsc(RevisionRule::getId))); |
| | | public IPage<RevisionRuleVO> pageQueryVO(Map<String, Object> condition, Query query) throws VciBaseException { |
| | | return RevisionRuleWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query),Condition.getQueryWrapper(condition,RevisionRule.class).lambda().orderByAsc(RevisionRule::getId))); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.vci.ubcs.omd.vo.StatusVO; |
| | | import com.vci.ubcs.omd.wrapper.StatusWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.starter.web.util.BeanUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | * @throws VciBaseException æ¥è¯¢åºéæ¶ä¼æåºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public IPage<StatusVO> listStatus(Map<String, String> conditionMap, PageHelper pageHelper) throws VciBaseException { |
| | | Query query = new Query(); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setAscs("id"); |
| | | Status queryVO = new Status(); |
| | | BeanMap.create(queryVO).putAll(conditionMap); |
| | | return StatusWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(queryVO).lambda().orderByAsc(Status::getId))); |
| | | public IPage<StatusVO> listStatus(Map<String, Object> conditionMap, Query pageHelper) throws VciBaseException { |
| | | return StatusWrapper.build().pageVO(baseMapper.selectPage(Condition.getPage(pageHelper), Condition.getQueryWrapper(conditionMap,Status.class).lambda().orderByAsc(Status::getId))); |
| | | } |
| | | |
| | | /** |
| | |
| | | Collection<Collection<String>> idCollections = VciBaseUtil.switchCollectionForOracleIn(idCollection); |
| | | if(!CollectionUtils.isEmpty(idCollections)) { |
| | | idCollections.forEach(s -> { |
| | | List<Status> queryResult = baseMapper.selectList(Wrappers.<Status>query().lambda().in(Status::getId,s)); |
| | | List<Status> queryResult = baseMapper.selectByIdIgnoreCase(s); |
| | | if(!CollectionUtils.isEmpty(queryResult)){ |
| | | statusDOList.addAll(queryResult); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.service.impl; |
| | | |
| | | import com.vci.ubcs.common.utils.CommonUtil; |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.service.IWebSecretService; |
| | | import com.vci.ubcs.omd.utils.VciOmdUtil; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.constant.EnumIdConstant; |
| | | import com.vci.ubcs.starter.web.enumpck.DataSecretEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.UserSecretEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import com.vci.ubcs.system.user.vo.UserVO; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.ubcs.starter.web.constant.FrameWorkBusLangCodeConstant.DATA_ID_NOT_EXIST; |
| | | |
| | | /** |
| | | * å¯çº§çæå¡ |
| | | * @author weidy |
| | | * @date 2021-2-16 |
| | | */ |
| | | @Service |
| | | public class WebSecretServiceImpl implements IWebSecretService { |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·æ¥è¯¢æå¡ |
| | | */ |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åæå¡ |
| | | */ |
| | | // @Autowired |
| | | // private WebBoServiceI boService; |
| | | |
| | | /** |
| | | * 屿§ç对象 |
| | | */ |
| | | // @Autowired |
| | | // private WebProperties properties; |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§çæå°å¼ |
| | | * |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getMinUserSecret() throws VciBaseException { |
| | | List<KeyValue> enumKeyValueList = VciOmdUtil.enumsToListKeyVale(EnumCache.getList(EnumIdConstant.USERSECRET_ENUMNAME)); |
| | | // enumService.getEnum(EnumIdConstant.USERSECRET_ENUMNAME); |
| | | //éæ°è®¾ç½®æä¸¾çå¼ |
| | | if(!CollectionUtils.isEmpty(enumKeyValueList)){ |
| | | List<KeyValue> keyValues = enumKeyValueList.stream().sorted((a, b) -> ((Integer) VciBaseUtil.getInt(a.getKey())).compareTo((Integer) VciBaseUtil.getInt(b.getKey()))).collect(Collectors.toList()); |
| | | for(int i = 0 ; i < keyValues.size() ; i++){ |
| | | KeyValue keyValue = keyValues.get(i); |
| | | if(i ==0){ |
| | | UserSecretEnum.NONE.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | UserSecretEnum.NONE.setText(keyValue.getValue()); |
| | | }else if(i ==1){ |
| | | UserSecretEnum.SECRET.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | UserSecretEnum.SECRET.setText(keyValue.getValue()); |
| | | }else{ |
| | | UserSecretEnum.PRIVACY.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | UserSecretEnum.PRIVACY.setText(keyValue.getValue()); |
| | | } |
| | | } |
| | | } |
| | | return getMinValueInKeyValueList(enumKeyValueList,UserSecretEnum.NONE.getValue()); |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ä¸çæå°å¼ |
| | | * @param enumKeyValueList æä¸¾K-Vå表 |
| | | * @param minValue æå°å¼ |
| | | * @return æå°å¼ |
| | | */ |
| | | private int getMinValueInKeyValueList( List<KeyValue> enumKeyValueList,int minValue){ |
| | | for(KeyValue ec : enumKeyValueList){ |
| | | int value = VciBaseUtil.getInt(ec.getKey()); |
| | | if(minValue> value){ |
| | | minValue = value; |
| | | } |
| | | } |
| | | return minValue; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°æ®å¯çº§çé»è®¤å¼ |
| | | * |
| | | * @return æå°å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getMinDataSecret() throws VciBaseException { |
| | | List<KeyValue> enumKeyValueList = VciOmdUtil.enumsToListKeyVale(EnumCache.getList(EnumIdConstant.DATASECRET_ENUMNAME)); |
| | | //éæ°è®¾ç½®æä¸¾çå¼ |
| | | if(!CollectionUtils.isEmpty(enumKeyValueList)){ |
| | | List<KeyValue> keyValues = enumKeyValueList.stream().sorted((a, b) -> ((Integer) VciBaseUtil.getInt(a.getKey())).compareTo((Integer) VciBaseUtil.getInt(b.getKey()))).collect(Collectors.toList()); |
| | | for(int i = 0 ; i < keyValues.size() ; i++){ |
| | | KeyValue keyValue = keyValues.get(i); |
| | | if(i ==0){ |
| | | DataSecretEnum.NONE.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | DataSecretEnum.NONE.setText(keyValue.getValue()); |
| | | }else if(i ==1){ |
| | | DataSecretEnum.INNER.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | DataSecretEnum.INNER.setText(keyValue.getValue()); |
| | | }else if(i ==2){ |
| | | DataSecretEnum.SECRET.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | DataSecretEnum.SECRET.setText(keyValue.getValue()); |
| | | }else{ |
| | | DataSecretEnum.PRIVACY.setValue(VciBaseUtil.getInt(keyValue.getKey())); |
| | | DataSecretEnum.PRIVACY.setText(keyValue.getValue()); |
| | | } |
| | | } |
| | | } |
| | | return getMinValueInKeyValueList(enumKeyValueList,DataSecretEnum.NONE.getValue()); |
| | | } |
| | | |
| | | /** |
| | | * è·åIPå¯çº§çé»è®¤å¼ |
| | | * |
| | | * @return æå°å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getMinIpSecret() throws VciBaseException { |
| | | List<KeyValue> enumKeyValueList = VciOmdUtil.enumsToListKeyVale(EnumCache.getList(EnumIdConstant.IPSECRET_ENUMNAME)); |
| | | return getMinValueInKeyValueList(enumKeyValueList,10); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * |
| | | * @param userId ç¨æ·å |
| | | * @return ç¨æ·å¯çº§çå¼ï¼å¦ææ²¡æå¯çº§ï¼é»è®¤ä¸ºæå°å¯çº§ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getUserSecret(String userId) throws VciBaseException { |
| | | WebUtil.alertNotNull(userId,"ç¨æ·å"); |
| | | R<User> userR = userClient.userInfoById(Long.valueOf(userId)); |
| | | if(userR.getData() == null){ |
| | | throw new VciBaseException(DATA_ID_NOT_EXIST,new String[]{userId}); |
| | | } |
| | | return userR.getData().getSecretGrade()==null?getMinUserSecret():Integer.parseInt(userR.getData().getSecretGrade()); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·å¯çº§ |
| | | * |
| | | * @param userVO ç¨æ·ç对象 |
| | | * @return å¯çº§ï¼ä¸åå¨çæ¶å为æä½å¯çº§ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getUserSecret(UserVO userVO) throws VciBaseException { |
| | | if(userVO == null){ |
| | | throw new VciBaseException(DATA_ID_NOT_EXIST,new String[0]); |
| | | } |
| | | return userVO.getSecretGrade()==null?getMinUserSecret(): Integer.valueOf(userVO.getSecretGrade()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¡éªå½åç¨æ·æ¯å¦ææéè®¿é®æ°æ® |
| | | * |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @return true表示å¯ä»¥è®¿é® |
| | | */ |
| | | @Override |
| | | public boolean checkDataSecret(int secret) { |
| | | return checkDataSecret(secret,WebUtil.getCurrentUserSecret()==null?getMinUserSecret():WebUtil.getCurrentUserSecret()); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°æ®æé |
| | | * @param secret æ°æ®çå¯çº§çå¼ |
| | | * @return æ°æ®å¯çº§ |
| | | */ |
| | | private DataSecretEnum dataSecretForValue(int secret){ |
| | | for(DataSecretEnum de : DataSecretEnum.values()){ |
| | | if(de.getValue() == secret){ |
| | | return de; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå¯çº§ |
| | | * @param userSecret ç¨æ·çå¯çº§ |
| | | * @return å¯çº§ç对象 |
| | | */ |
| | | private UserSecretEnum userSecretForValue(int userSecret){ |
| | | for(UserSecretEnum ue : UserSecretEnum.values()){ |
| | | if(ue.getValue() == userSecret){ |
| | | return ue; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªç¨æ·çå¯çº§æ¯å¦æ¯å¦ææéè®¿é®æ°æ® |
| | | * |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userSecret ç¨æ·å¯çº§ |
| | | * @return true表示å¯ä»¥è®¿é® |
| | | */ |
| | | @Override |
| | | public boolean checkDataSecret(int secret, int userSecret){ |
| | | //å¯è½è¢«è½¬æ¢äºä¸ |
| | | DataSecretEnum de = dataSecretForValue(secret); |
| | | if(de == null){ |
| | | de = DataSecretEnum.NONE; |
| | | } |
| | | UserSecretEnum ue = userSecretForValue(userSecret); |
| | | if(ue == null){ |
| | | ue = UserSecretEnum.NONE; |
| | | } |
| | | int reaySecret = 0; |
| | | switch (de){ |
| | | case NONE: |
| | | reaySecret=1; |
| | | break; |
| | | case INNER: |
| | | reaySecret = 2; |
| | | break; |
| | | case SECRET: |
| | | reaySecret = 3; |
| | | break; |
| | | default: |
| | | reaySecret = 4; |
| | | break; |
| | | } |
| | | |
| | | int userReaySecret = 0; |
| | | switch (ue){ |
| | | case NONE: |
| | | userReaySecret = 1; |
| | | break; |
| | | case SECRET: |
| | | userReaySecret = 3; |
| | | break; |
| | | default: |
| | | userReaySecret = 4; |
| | | break; |
| | | } |
| | | if(reaySecret> userReaySecret){ |
| | | return false; |
| | | }else{ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·åæ¥æ ¡éªæ°æ®å¯çº§ |
| | | * |
| | | * @param secret æ°æ®çå¯çº§ |
| | | * @param userId ç¨æ·å |
| | | * @return true表示å¯ä»¥è®¿é® |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public boolean checkDataSecret(int secret, String userId) throws VciBaseException { |
| | | return checkDataSecret(secret,getUserSecret(userId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·å¯¹è±¡æ¥æ ¡éªæ°æ®å¯çº§ |
| | | * |
| | | * @param secret æ°æ®å¯çº§ |
| | | * @param userVO ç¨æ·ç对象 |
| | | * @return true表示å¯ä»¥è®¿é® |
| | | */ |
| | | @Override |
| | | public boolean checkDataSecret(int secret, UserVO userVO) { |
| | | return checkDataSecret(secret,getUserSecret(userVO)); |
| | | } |
| | | |
| | | /** |
| | | * è·åIPå°åçå¯çº§ ææ¶è¿æªä½¿ç¨ï¼æ°æ®åºè¡¨ä¹è¿æªç§»æ¤ã |
| | | * |
| | | * @param ip ipå°å |
| | | * @return å¯çº§çå¼ |
| | | * @throws VciBaseException æ¥è¯¢åºéçæ¶å伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public int getIpSecret(String ip) throws VciBaseException { |
| | | if(StringUtils.isBlank(ip)){ |
| | | return getMinIpSecret(); |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("startip",ip.trim()); |
| | | |
| | | // List<ClientBusinessObject> ipCbos = boService.queryCBO(EnumIdConstant.IPSECRET_BTMNAME,conditionMap,null, Arrays.asList(new String[]{"ipsecret"})); |
| | | int ipSecret = 0; |
| | | // if(ipCbos!=null&& ipCbos.size()>0){ |
| | | // ipSecret = WebUtil.getInt(ipCbos.get(0).getAttributeValue("ipsecret")); |
| | | // } |
| | | if(ipSecret == 0){ |
| | | ipSecret = getMinIpSecret(); |
| | | } |
| | | return ipSecret; |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æºå¨å¯çº§ |
| | | * |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @param userSecret ç¨æ·çå¯çº§ |
| | | * @return trueè¡¨ç¤ºè®¸å¯ |
| | | */ |
| | | @Override |
| | | public boolean checkIpSecret(int ipSecret, int userSecret) { |
| | | if(ipSecret> userSecret){ |
| | | return false; |
| | | }else{ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥å½åç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * |
| | | * @param ipSecret æºå¨å¯çº§ |
| | | * @return trueè¡¨ç¤ºè®¸å¯ |
| | | */ |
| | | @Override |
| | | public boolean checkIpSecret(int ipSecret) { |
| | | return checkIpSecret(ipSecret,WebUtil.getCurrentUserSecret()==null?getMinUserSecret():WebUtil.getCurrentUserSecret()); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæå®ipåç¨æ·æ¯å¦ç¬¦åæºå¨å¯çº§ |
| | | * |
| | | * @param ip ipå°å |
| | | * @param userId ç¨æ·å |
| | | * @return trueè¡¨ç¤ºè®¸å¯ |
| | | * @throws VciBaseException æ¥è¯¢åºé伿åºå¼å¸¸ |
| | | */ |
| | | @Override |
| | | public boolean checkIpSecret(String ip, String userId) throws VciBaseException { |
| | | return checkIpSecret(getIpSecret(ip),getUserSecret(userId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªæå®IPåç¨æ·å¯¹è±¡ç¬¦åæºå¨å¯çº§ |
| | | * |
| | | * @param ip ipå°å |
| | | * @param userVO ç¨æ·å¯¹è±¡ |
| | | * @return trueè¡¨ç¤ºè®¸å¯ |
| | | */ |
| | | @Override |
| | | public boolean checkIpSecret(String ip, UserVO userVO) { |
| | | return checkIpSecret(getIpSecret(ip),getUserSecret(userVO)); |
| | | } |
| | | } |
| | |
| | | pl_omd_revision_rule |
| | | </sql> |
| | | |
| | | <select id="selectByIdIgnoreCase" resultMap="BaseResultMap"> |
| | | select <include refid="base_query_column"/> from <include refid="tableName"/> |
| | | where lower(id) in |
| | | <foreach collection="records" item="item" index="arrayindex" open=" ( " close=")" > |
| | | #{item,jdbcType=VARCHAR} |
| | | <if test="(arrayindex != records.size() -1)"> |
| | | , |
| | | </if> |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="id" jdbcType="VARCHAR" property="id" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="description" jdbcType="VARCHAR" property="description" /> |
| | | <result column="btm_name" property="btmname" jdbcType="VARCHAR" /> |
| | | <result column="btm_name" property="btmName" jdbcType="VARCHAR" /> |
| | | <result column="owner" property="owner" jdbcType="VARCHAR" /> |
| | | <result column="creator" jdbcType="VARCHAR" property="creator" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | |
| | | pl_omd_status |
| | | </sql> |
| | | |
| | | <select id="selectByIdIgnoreCase" resultMap="BaseResultMap"> |
| | | select <include refid="base_query_column"/> from <include refid="tableName"/> |
| | | where lower(id) in |
| | | <foreach collection="records" item="item" index="arrayindex" open=" ( " close=")" > |
| | | #{item,jdbcType=VARCHAR} |
| | | <if test="(arrayindex != records.size() -1)"> |
| | | , |
| | | </if> |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·å¯ç çç¥å
³è(UserPwdstrategy)表æ§å¶å± |
| | |
| | | boolean result = RegexUtil.find(regex, newPassword1); |
| | | if(!result){ |
| | | throw new ServiceException("å¯ç ä¸åªè½åå¨ã"+strategy.getCombinationNames()+"ãä¸å
å«çå符ï¼"); |
| | | //throw new ServiceException(resException); |
| | | } |
| | | //ä¿®æ¹å¯ç åæ¶ï¼æ¹åç¨æ·ä¿¡æ¯ä¸çå¯ç ä¿®æ¹ç¶æå段,å¯ç ä¿®æ¹æ¶é´ |
| | | return this.update(Wrappers.<User>update().lambda() |
| | |
| | | List<String> roleName = SysCache.getRoleNames(user.getRoleId()); |
| | | List<String> deptName = SysCache.getDeptNames(user.getDeptId()); |
| | | List<String> postName = SysCache.getPostNames(user.getPostId()); |
| | | userVO.setTenantName(tenant.getTenantName()); |
| | | userVO.setTenantName(tenant==null?"":tenant.getTenantName()); |
| | | userVO.setRoleName(Func.join(roleName)); |
| | | userVO.setDeptName(Func.join(deptName)); |
| | | userVO.setPostName(Func.join(postName)); |