Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | // 人åè®¾ç½®åæ¶æ¶è |
| | | export const cancelCollect = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/du', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | // 人å设置ä¿å |
| | | export const personnelSave = (params) => { |
| | | return request({ |
| | | url: '/api/', |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | |
| | | <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" width="30%"> |
| | | <el-tag v-for="tag in tags" :key="tag" closable effect="dark" @click="handleClickTag(tag)" |
| | | @close="handleCloseTag(tag)"> |
| | | <span> {{ tag }}</span> |
| | | </el-tag> |
| | | <el-divider></el-divider> |
| | | <el-form :model="formInline" class="demo-form-inline" label-position="left"> |
| | | <el-form-item :label="item.taskName" v-for="(item,index) in initFrom" :key="index"> |
| | | <el-select v-model="formInline[index].userId" :placeholder="item.taskName"> |
| | | <el-option label="åºåä¸" value="shanghai"></el-option> |
| | | <el-option label="åºåäº" value="beijing"></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 } from '@/api/template/setPersonnel.js' |
| | | export default { |
| | | name: 'SetPersonnel', |
| | | props: { |
| | | // æ¯å¦æå¼ |
| | | visible: { |
| | | typeof: Boolean, |
| | | default: false |
| | | }, |
| | | title: { |
| | | typeof: String, |
| | | default: '人å设置' |
| | | }, |
| | | code:{ |
| | | typeof: String, |
| | | default: '' |
| | | } |
| | | }, |
| | | watch: { |
| | | visible(n) { |
| | | this.dialogVisible = n; |
| | | }, |
| | | dialogVisible(n) { |
| | | this.$emit('update:visible', n) |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: this.visible, |
| | | initFrom: [], |
| | | tags: ['æ ç¾1', 'æ ç¾2', 'æ ç¾3', 'æ ç¾4'], |
| | | formInline: [] |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.apiInit() |
| | | }, |
| | | methods: { |
| | | async apiInit() { |
| | | const response = await personnelInit({type:'PUBLIC',templateId:'8b5e2017-990f-454a-9c39-4c4eeeb57553'}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.initFrom = response.data.data.user |
| | | this.formInline = response.data.data.user |
| | | } |
| | | }, |
| | | async apiCollect() { |
| | | const response = await personnelCollect() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | } |
| | | }, |
| | | async canCollect(id) { |
| | | const response = await cancelCollect() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | } |
| | | }, |
| | | async apiSave() { |
| | | const response = await personnelSave() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | } |
| | | }, |
| | | handleClickTag(event) { |
| | | console.log(event) |
| | | }, |
| | | handleCloseTag(event) { |
| | | console.log(event) |
| | | this.canCollect(event) |
| | | }, |
| | | done() { |
| | | this.dialogVisible = false |
| | | }, |
| | | handleCancel() { |
| | | this.done() |
| | | }, |
| | | handleConfirm() { |
| | | // this.done() |
| | | console.log(this.formInline) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .el-tag+.el-tag { |
| | | margin-left: 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; |
| | | } |
| | | </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, |
| | |
| | | }, |
| | | } |
| | | }, |
| | | 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> |
| | |
| | | <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"></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> |
| | |
| | | }) |
| | | //è¦ä¼ éç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() { |
| | |
| | | proxy: { |
| | | '/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.1.51:37000/', |
| | | // target: 'http://localhost:37000', |
| | | target: 'http://192.168.1.104:37000', |
| | | // target: 'http://192.168.1.63:37000', |
| | | //target: 'http://192.168.3.7:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | |
| | | <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> |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | * ç¼ç è§åï¼æå¡å¯å¨å |
| | | */ |
| | | 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; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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<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.constant.BtmTypeLcStatusConstant; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | 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.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 org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.beans.BeanInfo; |
| | |
| | | } |
| | | return comboboxKVs; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¶æ |
| | | * |
| | |
| | | // return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | |
| | | |
| | | |
| | | |
| | | //ä¿®æ¹çæ¶åï¼ç¼ç æ¯ä¸åç |
| | | // BatchCBO batchCBO = new BatchCBO(); |
| | | // batchCBO.getUpdateCbos().add(cbo); |
| | |
| | | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·å¯ç çç¥å
³è(UserPwdstrategy)表æ§å¶å± |
| | |
| | | regex = "^"+regex+"{"+strategy.getRequiredType()+",}$"; |
| | | boolean result = RegexUtil.find(regex, newPassword1); |
| | | if(!result){ |
| | | throw new ServiceException(resException); |
| | | //throw new ServiceException(resException); |
| | | } |
| | | //ä¿®æ¹å¯ç åæ¶ï¼æ¹åç¨æ·ä¿¡æ¯ä¸çå¯ç ä¿®æ¹ç¶æå段,å¯ç ä¿®æ¹æ¶é´ |
| | | return this.update(Wrappers.<User>update().lambda() |