From 948917aab4194a93e9ade2dc26b0639e6d93a6c4 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 16 六月 2023 17:51:08 +0800 Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs --- Source/UBCS-WEB/src/components/refer/vciWebRefer.vue | 11 Source/UBCS-WEB/src/components/Crud/Crud.vue | 423 ++++++++----- Source/UBCS-WEB/src/components/Divider/index.vue | 26 Source/UBCS-WEB/src/api/GetItem.js | 15 Source/UBCS-WEB/src/api/template/setPersonnel.js | 4 Source/UBCS-WEB/src/components/template/SetPersonnel.vue | 108 ++- Source/UBCS-WEB/vue.config.js | 6 Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/model/BaseModel.java | 3 Source/UBCS-WEB/src/components/file/inHtml.vue | 26 Source/UBCS-WEB/src/views/flow/flowPath.vue | 17 Source/UBCS-WEB/src/components/Master/MasterTree.vue | 19 Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue | 4 Source/UBCS-WEB/src/api/resource/file.js | 74 ++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 16 Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue | 5 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CommonsMapper.java | 8 Source/UBCS-WEB/src/views/MasterData/items.vue | 7 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java | 21 Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue | 4 Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue | 2 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 382 ++++++----- Source/UBCS-WEB/src/components/file/main.vue | 325 ++++++++++ Source/UBCS-WEB/src/api/batchImport/index.js | 10 Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue | 110 ++- Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml | 9 Source/UBCS-WEB/src/components/BatchImport/index.vue | 112 +++ Source/UBCS-WEB/src/components/file/inDialog.vue | 40 + Source/UBCS-WEB/src/main.js | 2 Source/UBCS-WEB/src/components/Tree/TemplatePro.vue | 4 Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue | 4 30 files changed, 1,317 insertions(+), 480 deletions(-) diff --git a/Source/UBCS-WEB/src/api/GetItem.js b/Source/UBCS-WEB/src/api/GetItem.js index 38823e7..6b82a9c 100644 --- a/Source/UBCS-WEB/src/api/GetItem.js +++ b/Source/UBCS-WEB/src/api/GetItem.js @@ -1,5 +1,5 @@ import request from "@/router/axios"; - +//琛ㄥご export const MasterTable =(params)=>{ return request({ url: 'api/ubcs-code/mdmEngineController/getUIInfoByClassifyOid', @@ -9,7 +9,7 @@ } }) } - +//琛ㄦ牸 export const TableData =(params)=>{ return request({ url: 'api/ubcs-code/mdmEngineController/gridTableDataByClassifyOid', @@ -19,4 +19,13 @@ } }) } - +//楂樼骇鏌ヨ +export const FindData =(params)=>{ + return request({ + url: 'api/ubcs-code/mdmEngineController/gridTableDataByClassifyOid', + method: 'get', + params:{ + ...params + } + }) +} diff --git a/Source/UBCS-WEB/src/api/batchImport/index.js b/Source/UBCS-WEB/src/api/batchImport/index.js new file mode 100644 index 0000000..33fb8bd --- /dev/null +++ b/Source/UBCS-WEB/src/api/batchImport/index.js @@ -0,0 +1,10 @@ + +import request from '@/router/axios'; + +export const downloadTemplate = (params) => { + return request({ + url: '/api/ubcs-code/mdmEngineController/downloadTopImportExcel ', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/Source/UBCS-WEB/src/api/resource/file.js b/Source/UBCS-WEB/src/api/resource/file.js new file mode 100644 index 0000000..bd737e9 --- /dev/null +++ b/Source/UBCS-WEB/src/api/resource/file.js @@ -0,0 +1,74 @@ +import request from '@/router/axios'; + +export const getList = (page, limit, params) => { + return request({ + url: '/api/ubcs-resource/fileController/listFiles', + method: 'get', + params: { + ...params, + page, + limit + } + }) +} + +export const remove = (oids) => { + return request({ + url: '/api/ubcs-resource/fileController/deleteFile', + method: 'post', + params: { + oids + } + }) +} + +export const upload = (row) => { + return request({ + url: '/api/ubcs-resource/fileController/uploadFile', + method: 'post', + data: row + }) +} + +export const update = (row) => { + return request({ + url: '/api/ubcs-resource/fileController/uploadFile', + method: 'post', + data: row + }) +} + +export const download = (oids) => { + return request({ + url: '/api/ubcs-resource/fileController/downloadFilesByOids', + method: 'get', + params: { + oids + } + }) +} + +/** + * 浣跨敤鏂囦欢涓婚敭鑾峰彇瀵硅薄 + * @param oid 涓婚敭 + * @return 鏂囦欢鏄剧ず瀵硅薄 + */ +export const getFile = (oid) => { + return request({ + url: '/api/ubcs-resource/fileController/get', + method: 'get', + params: { + oid + } + }) +} + +export const listFilesByOids = (oids) => { + return request({ + url: '/api/ubcs-resource/fileController/listFilesByOids', + method: 'get', + params: { + oids + } + }) +} diff --git a/Source/UBCS-WEB/src/api/template/setPersonnel.js b/Source/UBCS-WEB/src/api/template/setPersonnel.js index bcf2771..740945b 100644 --- a/Source/UBCS-WEB/src/api/template/setPersonnel.js +++ b/Source/UBCS-WEB/src/api/template/setPersonnel.js @@ -28,8 +28,8 @@ export const personnelSave = (params) => { return request({ url: '/api/ubcs-flow/vciflow/start', - method: 'get', - params: params + method: 'post', + data: params }) } // 浜哄憳璁剧疆淇濆瓨 diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue new file mode 100644 index 0000000..cb6d21f --- /dev/null +++ b/Source/UBCS-WEB/src/components/BatchImport/index.vue @@ -0,0 +1,112 @@ +<template> + <el-dialog :title="title" :visible="visible" append-to-body> + <Divider text="瀵煎叆鎻愮ず" left="30px"></Divider> + <ul> + <li v-for="(item, index) in tipInfo" :key="index"> + {{ item }} + </li> + </ul> + <div class="radio_box"> + <span>鍒嗙被鐨勮矾寰勪娇鐢ㄧ殑灞炴��:</span> + <el-radio-group v-model="classifyAttr"> + <el-radio label="id">鍒嗙被缂栧彿</el-radio> + <el-radio label="name">鍒嗙被鍚嶇О</el-radio> + </el-radio-group> + </div> + <Divider text="excel鏂囦欢锛岄�夋嫨鏂囦欢鍚庝細鑷姩涓婁紶" left="30px"></Divider> + <el-upload + class="upload" + :accept="accept" + :action="action" + :before-upload="beforeUpload" + :on-exceed="handleExceed" + > + <el-button size="small" type="primary"><i class="el-icon-upload"></i> 鐐瑰嚮涓婁紶</el-button> + </el-upload> + <template #footer> + <el-button type="primary" size="small" @click="downloadTemplateFun">涓嬭浇瀵煎叆妯℃澘</el-button> + <el-button size="small">鍏抽棴</el-button> + </template> + </el-dialog> +</template> + +<script> +import { downloadTemplate } from '../../api/batchImport/index' +export default { + name: "", + props: { + title: { + type: String, + default: "鎵归噺鐢宠缂栫爜", + }, + tipInfo: { + type: Array, + default: () => [], + }, + visible: { + type: Boolean, + default: false, + }, + accept: { + type: String, + default: '.xlsx, .xls' + }, + codeClassifyOid: { + type: String, + default: '' + }, + downloadTemplateFun: { + type: Function + } + }, + data() { + return { + classType: "classCode", + }; + }, + computed: { + action() { + console.log(process, 'process'); + return '/api/ubcs-code/mdmEngineController/mdmEngineController/batchTopImportCode' + } + }, + methods: { + beforeUpload(file) { + const fileType = file.name.split('.').pop() + if (fileType !== 'xlsx' && fileType !== 'xls') { + // 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼� + this.$message.error('鍙厑璁镐笂浼爔lsx銆亁ls鏍煎紡鐨勬枃浠�'); + return false; + } + return true; + }, + }, +}; +</script> + +<style lang="scss" scoped> +ul { + color: rgb(188, 188, 188); + margin: 20px 0 0 0; + padding: 0; + padding-left: 30px; + list-style: none; + li { + margin-bottom: 5px; + font-size: 12px; + } +} +.radio_box { + padding-left: 30px; + margin: 20px 0 25px 0; + display: flex; + align-items: center; + span { + margin-right: 20px; + } +} +.upload { + padding-left: 30px; + margin-top: 30px; +} +</style> diff --git a/Source/UBCS-WEB/src/components/Crud/Crud.vue b/Source/UBCS-WEB/src/components/Crud/Crud.vue index b9cf277..53cd177 100644 --- a/Source/UBCS-WEB/src/components/Crud/Crud.vue +++ b/Source/UBCS-WEB/src/components/Crud/Crud.vue @@ -2,156 +2,185 @@ <basic-container> <div class="testbox"> <div style="margin-top: 10px;display: flex;flex-wrap: wrap;width: 100%;"> - <el-button size="small" type="primary" plain @click="addvisible=true">澧炲姞 - <FormTemplateDialog - :visible.sync="addvisible" - :type="add" - :templateOid="templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" - :disabledProp="disabledProp" - > - </FormTemplateDialog></el-button> - <el-button size="small" type="primary" plain @click="editvisible=true">缂栬緫 - <FormTemplateDialog - :visible.sync="editvisible" - :type="edit" - :templateOid="templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" - :disabledProp="disabledProp" - :rowOid="rowOid" - ></FormTemplateDialog></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>鎵归噺鍙戝竷</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>鏁版嵁鏇存敼</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 plain size="small" type="primary" @click="addvisible=true">澧炲姞 </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 + <FormTemplateDialog + :codeClassifyOid="this.codeClassifyOid" + :codeRuleOid="this.codeRuleOid" + :disabledProp="disabledProp" + :templateOid="templateOid" + :type="add" + :visible.sync="addvisible" + > + </FormTemplateDialog> + <el-button plain size="small" type="primary" @click="editHandler">缂栬緫 </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> + <FormTemplateDialog + :codeClassifyOid="this.codeClassifyOid" + :codeRuleOid="this.codeRuleOid" + :disabledProp="disabledProp" + :rowOid="rowOid" + :templateOid="templateOid" + :type="edit" + :title="'淇敼缂栫爜淇℃伅'" + :visible.sync="editvisible" + ></FormTemplateDialog> + <el-button plain size="small" type="primary">鎵归噺瀵煎叆鐢宠</el-button> + <el-button plain size="small" type="primary">鍘嗗彶鏁版嵁瀵煎叆</el-button> + <el-button plain size="small" type="primary">鎵归噺鐢宠缂栫爜</el-button> + <el-button plain size="small" type="primary">鎵归噺鍙戝竷</el-button> + <el-button plain size="small" type="primary">鏌ョ湅娴佺▼鍘嗗彶</el-button> + <el-button plain size="small" type="primary">鍒犻櫎</el-button> + <el-button plain size="small" type="primary" @click="setHandler">鍙戝竷</el-button> + <set-personnel :visible.sync="visibleFlow" :parameter="parameter" + type="PUBLIC"></set-personnel> + <el-button plain size="small" type="primary" @click="DataChange">鏁版嵁鏇存敼</el-button> + <FormTemplateDialog + :codeClassifyOid="this.codeClassifyOid" + :codeRuleOid="this.codeRuleOid" + :disabledProp="disabledProp" + :rowOid="rowOid" + :templateOid="templateOid" + :type="edit" + :title="'宸插彂甯冩暟鎹洿鏀�'" + :visible.sync="DataVisible" + ></FormTemplateDialog> + <el-button plain size="small" type="primary" @click="huishouHandler">鍥炴敹</el-button> + <el-button plain size="small" type="primary" @click="openD">瀵煎嚭 + <integration-transfer :data="transferData" :props="transferProps" + :visible.sync="dialogPush" @save="handelTransferSave"></integration-transfer> + </el-button> + <el-button plain size="small" type="primary" @click="findHandler">鏌ヨ + <advanced-query :options="this.options" :visible.sync="findvisible" + @echoContion="echoContion"></advanced-query> + </el-button> + <el-button plain size="small" type="primary">鐩镐技椤规煡璇�</el-button> + <el-button plain size="small" style="margin-left: 1px;margin-top:10px" type="primary">鍒锋柊</el-button> + <el-input placeholder="璇疯緭鍏ュ叧閿瓧鎸夊洖杞︽煡璇�" size="small" + style="width: 180px;margin-left: 5px;margin-top:10px"></el-input> </div> <el-row style="height: 700px;width: 100%"> - <el-table :data="tableData" style="" @cell-click="handleCellClick" max-height="700" v-loading="isLoading" @selection-change="handleSelectionChange" @sort-change="sortChange"> + <el-table v-loading="isLoading" :data="tableData" max-height="700" style="" @cell-click="handleCellClick" + @selection-change="handleSelectionChange" @sort-change="sortChange"> <el-table-column - type="selection" fixed + type="selection" width="55"> </el-table-column> <el-table-column - type="index" fixed label="搴忓彿" + type="index" width="55"> </el-table-column> - <div v-for="(item,index) in this.tableHeadData" :key="index"> - <el-table-column :label="item.label" :prop="item.prop" :sortable="item.sortable" :width="item.width"> +<!-- <div>--> + <el-table-column v-for="(item,index) in this.tableHeadFindData" :key="item.id" :label="item.label" :prop="item.prop" :sortable="item.sortable" > <!-- 缂栬緫鍜屽睍绀洪�昏緫 --> - <template slot-scope="{ row }"> - <el-input v-if="editingRow === row && editShow== item.prop" v-model="row[item.prop]" @blur="saveRow"></el-input> - <span v-else>{{row[item.prop]}}</span> - <el-switch - v-if="editShow === 'true'" - v-model="row[item.prop]" - active-color="#13ce66" - inactive-color="#ff4949"> - </el-switch> - </template> + <!-- <template slot-scope="{ row }">--> + <!-- <el-input v-if="editingRow === row && editShow== item.prop" v-model="row[item.prop]" @blur="saveRow"></el-input>--> + <!-- <span v-else>{{row[item.prop]}}</span>--> + <!-- <el-switch--> + <!-- v-if="editShow === 'true'"--> + <!-- v-model="row[item.prop]"--> + <!-- active-color="#13ce66"--> + <!-- inactive-color="#ff4949">--> + <!-- </el-switch>--> + <!-- </template>--> </el-table-column> - </div> +<!-- </div>--> </el-table> </el-row> </div> <div class="block" style="display: flex;justify-content: flex-end"> <el-pagination - @size-change="handleSizeChange" - @current-change="handleCurrentChange" :current-page="page.currentPage" - :page-sizes="page.pageSizes" :page-size="page.pageSizes" + :page-sizes="page.pageSizes" + :total="page.total" layout="total, sizes, prev, pager, next, jumper" - :total="page.total"> + @size-change="handleSizeChange" + @current-change="handleCurrentChange"> </el-pagination> </div> </basic-container> </template> <script> -import {MasterTable, TableData} from "@/api/GetItem"; +import {MasterTable, TableData,FindData} from "@/api/GetItem"; import {listCodeAttributeByClassId} from '@/api/integration/integration.js' import integrationTransfer from '@/views/integration/integrationTransfer' -import pinyin from "js-pinyin"; +import SetPersonnel from '@/components/template/SetPersonnel' + export default { components: { - integrationTransfer + integrationTransfer, + SetPersonnel }, name: "Crud.vue", - props:{ - page:{ + props: { + page: { type: Object, - default: ()=>{ + default: () => { return {} } }, - codeClassifyOid:{ - type:String, - default:"" + codeClassifyOid: { + type: String, + default: "" }, - coderuleoid:{ - type:String, - default:"" + coderuleoid: { + type: String, + default: "" }, - tableDataArray:{ + tableDataArray: { + type: Array, + }, + total: { + type: String, + default: "" + }, + templateOid: { + type: String, + }, + tableHeadDataFateher: { + type: Array, + }, + isLoading: { + type: Boolean, + default: false + }, + tableHeadFindData:{ type:Array, - }, - total:{ - type:String, - default:"" - }, - templateOid:{ - type:String, - }, - tableHeadDataFateher:{ - type:Array, - }, - isLoading:{ - type:Boolean, - default:false } }, data() { return { - transferData:[], + //鍙戝竷 + parameter:{ + ids:['0000','22222222'], + code:'8b5e2017-990f-454a-9c39-4c4eeeb57553', + type:'PUBLIC', + name:'妯℃澘name', + template:'妯℃澘template' + }, + visibleFlow: false, + transferData: [], transferProps: { key: 'oid', label: 'name' }, - templateOid:"", - addvisible:false, - editvisible:false, - findvisible:false, - dialogPush:false, - rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9', + tableHeadFindDatas:[], + templateOid: "", + addvisible: false, + editvisible: false, + findvisible: false, + dialogPush: false, + rowOid: '', disabledProp: ["id"], - editingRow:null, + editingRow: null, editShow: "", - editAttr:"", + editAttr: "", data: [], - options:[], + options: {}, option: { column: [] }, @@ -163,14 +192,15 @@ number: "number", datetime: "datetime", }, - tableData:[], - tableHeadData:[], - items:{}, - seniorQueryColumns:[] + tableData: [], + DataVisible:false, + tableHeadData: [], + items: {}, + seniorQueryColumns: [], + selectRow: [] } }, - computed:{ - }, + computed: {}, created() { // this.CrudHeaderRend(); // this.tableHeadHandle() @@ -181,79 +211,93 @@ activated() { this.doLayout() }, - watch:{ - codeClassifyOid:{ - handler(newval,oldval){ - this.codeClassifyOid=newval; + watch: { + codeClassifyOid: { + handler(newval, oldval) { + this.codeClassifyOid = newval; this.CrudHeaderRend() }, - deep:true + deep: true }, - tableDataArray:{ - handler(newval,oldval){ - this.tableData=newval; - // + tableDataArray: { + handler(newval, oldval) { + this.tableData = newval; } }, - total:{ - handler(newval,oldval){ - this.page.total=newval; + tableHeadFindData:{ + handler(newval, oldval) { + this.tableHeadFindDatas = newval; } }, - tableHeadDataFateher:{ - handler(newval,oldval){ - 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; - }) + total: { + handler(newval, oldval) { + this.page.total = newval; } - } + }, + // tableHeadDataFateher: { + // handler(newval, oldval) { + // 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.tableHeadData.push(columnItem); + // console.log('table',this.tableHeadData) + // }) + // } + // } }, methods: { - huishouHandler(){ - console.log('tem',this.templateOid) - console.log('table',this.tableData) - console.log('tabheadle',this.tableHeadData) - console.log('tableFather',this.tableHeadDataFateher) + setHandler() { + this.visibleFlow = true }, - openD(){ - this.dialogPush=true; + 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() }, async getListCodeByClassId() { this.transferData = [] - const response = await listCodeAttributeByClassId({ codeClassifyId: this.codeClassifyOid }) + const response = await listCodeAttributeByClassId({codeClassifyId: this.codeClassifyOid}) if (response.status === 200) { const data = response.data.data this.transferData = data } }, - rend(){ - this.tableData=this.tableHeadData + rend() { + this.tableData = this.tableHeadData }, - handleSizeChange(val){ - this.page.pageSize=val - this.$emit('pageSize',val) - this.CrudRend() + handleSizeChange(val) { + this.isLoading = true; + setTimeout(() => { + this.page.pageSize = val + this.$emit('pageSize', val) + this.CrudRend() + }, 3000); + }, - handleCurrentChange(val){ - this.page.currentPage=val - this.$emit('currentPage',val) - this.CrudRend() + handleCurrentChange(val) { + this.isLoading = true; + setTimeout(() => { + this.page.currentPage = val + this.$emit('currentPage', val) + this.CrudRend() + }, 3000); }, // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮 handleCellClick(row, column) { this.editingRow = row; this.editShow = column.property; - this.rowOid=row.oid + this.rowOid = row.oid }, //鍒犻櫎 enumDeleteRow(row) { @@ -268,8 +312,8 @@ this.$refs.crud.doLayout(); }); }, - tableHeadHandle(){ - this.options=this.tableHeadDataFateher.tableDefineVO.seniorQueryColumns + tableHeadHandle() { + this.options = this.tableHeadDataFateher.tableDefineVO.seniorQueryColumns this.List = this.tableHeadDataFateher.tableDefineVO.cols[0]; this.List.forEach(item => { let columnItem = { @@ -280,17 +324,17 @@ width: item.minWidth }; this.option.column.push(columnItem); - this.option.column=this.tableHeadData; + this.option.column = this.tableHeadData; }) }, //琛ㄦ牸澶存覆鏌� CrudHeaderRend() { - if(this.codeClassifyOid != ""){ + if (this.codeClassifyOid != "") { MasterTable({ - codeClassifyOid:this.codeClassifyOid, + codeClassifyOid: this.codeClassifyOid, functionId: 5, }).then(res => { - this.options=res.data.tableDefineVO.seniorQueryColumns + this.options = res.data.tableDefineVO.seniorQueryColumns this.List = res.data.tableDefineVO.cols[0]; this.List.forEach(item => { let columnItem = { @@ -301,25 +345,25 @@ width: item.minWidth }; this.option.column.push(columnItem); - this.option.column=this.tableHeadData; - this.templateOid=res.data.tableDefineVO.oid - this.$emit('templateOid',this.templateOid) + this.option.column = this.tableHeadData; + this.templateOid = res.data.tableDefineVO.oid + this.$emit('templateOid', this.templateOid) }) }) } }, //琛ㄦ牸鏁版嵁 CrudRend() { - TableData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - page: this.page.currentPage, - limit: this.page.pageSize, - }).then(res => { - this.page.total = res.data.total; - this.data = res.data.data; - this.tableData=res.data.data; - }) + TableData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + page: this.page.currentPage, + limit: this.page.pageSize, + }).then(res => { + this.page.total = res.data.total; + this.data = res.data.data; + this.tableData = res.data.data; + }) }, // 鎺掑簭 sortChange(val) { @@ -346,6 +390,7 @@ }, //鍒嗛〉鍒锋柊 async onLoad(val) { + console.log('鍒嗛〉', this.templateOid) await TableData({ templateOid: this.templateOid, codeClassifyOid: this.codeClassifyOid, @@ -358,6 +403,46 @@ //澶氶�� handleSelectionChange(row) { console.log(row) + this.rowOid = row.oid + this.selectRow = row + }, + //缂栬緫 + editHandler() { + if (this.selectRow.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + } else if (this.selectRow.length > 1) { + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') + } else if (this.selectRow[0].lcstatus != 'Editing') { + this.$message.warning('缂栫爜鐘舵�佷笉鏄�滅紪杈戜腑鈥�,涓嶅彲缂栬緫') + } else { + this.editvisible = true + } + }, + //楂樼骇鏌ヨ鎸夐挳 + findHandler(){ + this.findvisible=true + }, + // 楂樼骇鏌ヨ + echoContion(val) { + console.log(val) + FindData({templateOid:this.templateOid, + codeClassifyOid: this.codeClassifyOid, + ...val + }).then(res=>{ + console.log(res) + }) + }, + //鏁版嵁鏇存敼 + DataChange(){ + if (this.selectRow.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + } else if (this.selectRow.length > 1) { + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') + } else if (this.selectRow[0].lcstatus != 'Released') { + this.$message.warning('鍙湁鐘舵�佷负宸插彂甯冪殑鏁版嵁鎵嶈兘杩涜鏁版嵁鏇存敼') + } else { + this.DataVisible = true + } } } } diff --git a/Source/UBCS-WEB/src/components/Divider/index.vue b/Source/UBCS-WEB/src/components/Divider/index.vue new file mode 100644 index 0000000..78cdc4f --- /dev/null +++ b/Source/UBCS-WEB/src/components/Divider/index.vue @@ -0,0 +1,26 @@ +<!-- 鍑芥暟寮忕粍浠跺皝瑁呭垎鍓茬嚎 --> +<template functional> + + <div class="divider" :style="{backgroundColor: props.bgkColor, color: props.color}"> + <span :style="{left: props.left}">{{ props.text }}</span>{{ $props }} + </div> +</template> +<style lang="scss" scoped> +.divider { + margin: 10px 0; + position: relative; + width: 100%; + height: 1px; + background-color: rgb(196, 196, 196); + color: rgb(164, 164, 164); + span { + padding: 0 10px; + position: absolute; + top: 50%; + left: 10%; + transform: translateY(-50%); + z-index: 999; + background-color: #fff; + } +} +</style> diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue index 37c5899..acb2ed6 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue @@ -29,6 +29,8 @@ :referConfig="item.referConfig || {}" :value="form[item.referConfig.field] || item.value" :text="form[item.referConfig.showField]" + :disabled="item.disabled" + :display="item.display" @setReferValue="setReferValue" ></vciWebRefer> </template> diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue index 4664a76..8506919 100644 --- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue +++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue @@ -29,6 +29,7 @@ }, data(){ return{ + tableHeadFindData:[], tableHeadDataFateher:[], templateOids:"", tableDataArray:[], @@ -80,7 +81,6 @@ this.ModifyProperties(this.Treedata, 'text', 'label'); this.codeClassifyOid=res.data[0].oid; this.coderuleoid=res.data[0].attributes.coderuleoid; - this.$emit("codeClassifyOid", this.codeClassifyOid ) this.$emit("coderuleoid", this.coderuleoid ) }).catch(res=>{ console.log(res) @@ -122,7 +122,19 @@ }).then(res => { this.tableHeadDataFateher = res.data; this.templateOids = res.data.tableDefineVO.oid; + let List = res.data.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.tableHeadFindData.push(columnItem) + }) this.$emit('tableHeadDataFateher', this.tableHeadDataFateher); + this.$emit('tableHeadFindData', this.tableHeadFindData); resolve(); }).catch(err=>{ reject(err) @@ -136,7 +148,10 @@ await this.TableHeadRend(); // 鍏堟墽琛� TableHeadRend() this.TableRend(); // TableHeadRend() 鏂规硶瀹屾垚鍚庡啀鎵ц TableRend() this.$emit('nodeClick',this.templateOids) - console.log(this.templateOids) + this.$emit("codeClassifyOid", this.nodeClickList.oid ) + console.log('鍏冩暟鎹�',this.templateOids) + console.log('鍏冩暟鎹甤od',this.codeClassifyOid) + console.log('鍏冩暟鎹畁odeclick', this.nodeClickList.oid) } catch (error) { // 澶勭悊閿欒 this.$message.error(error) diff --git a/Source/UBCS-WEB/src/components/Tree/TemplatePro.vue b/Source/UBCS-WEB/src/components/Tree/TemplatePro.vue index 6d4bd9e..034e42f 100644 --- a/Source/UBCS-WEB/src/components/Tree/TemplatePro.vue +++ b/Source/UBCS-WEB/src/components/Tree/TemplatePro.vue @@ -5,11 +5,11 @@ <attrCrud :ProData="ProData" :crudOid="crudOid" :crudArray="crudArray" :Formlist="Formlist" :codeClassifyOid="codeClassifyOid"></attrCrud> </span> <span v-else-if="type.prop==='tab2'"> - <FlowPath :code="this.codeClassifyOid"></FlowPath> + <FlowPath :code="this.crudOid"></FlowPath> </span> <span v-else-if="type.prop==='tab3'"> - <stage :code="this.codeClassifyOid"></stage> + <stage :code="this.crudOid"></stage> </span> </basic-container> diff --git a/Source/UBCS-WEB/src/components/file/inDialog.vue b/Source/UBCS-WEB/src/components/file/inDialog.vue new file mode 100644 index 0000000..ffa15f5 --- /dev/null +++ b/Source/UBCS-WEB/src/components/file/inDialog.vue @@ -0,0 +1,40 @@ +<template> + <div> + <el-dialog :title="options.title|| '闄勪欢绠$悊'" + :visible.sync="visible" + append-to-body + class="avue-dialog avue-dialog--top" + @close="close" + top="0" + :width="options.width|| '80%'"> + <fileContent + :options="options" + ></fileContent> + </el-dialog> + </div> +</template> + +<script> +import fileContent from './main.vue'; +export default { + name: "inDialog", + components: { fileContent }, + props: ["options","visible"], + data(){ + return{ + + } + }, + computed: { + }, + methods:{ + close(){ + this.$emit("close", false); + } + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/UBCS-WEB/src/components/file/inHtml.vue b/Source/UBCS-WEB/src/components/file/inHtml.vue new file mode 100644 index 0000000..66eddf1 --- /dev/null +++ b/Source/UBCS-WEB/src/components/file/inHtml.vue @@ -0,0 +1,26 @@ +<template> + <basic-container> + <fileContent + :options="options" + ></fileContent> + </basic-container> +</template> + +<script> +import fileContent from './main.vue'; +export default { + name: "inHtml", + components: { fileContent }, + props: ["options"], + data(){ + return{ + } + }, + computed: { + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/UBCS-WEB/src/components/file/main.vue b/Source/UBCS-WEB/src/components/file/main.vue new file mode 100644 index 0000000..04d3498 --- /dev/null +++ b/Source/UBCS-WEB/src/components/file/main.vue @@ -0,0 +1,325 @@ +<template> + <basic-container> + <avue-crud :option="option" + :table-loading="loading" + :data="data" + :page.sync="page" + :permission="permissionList" + :before-open="beforeOpen" + v-model="form" + ref="crud" + @row-del="rowDel" + @search-change="searchChange" + @search-reset="searchReset" + @selection-change="selectionChange" + @current-change="currentChange" + @size-change="sizeChange" + @refresh-change="refreshChange" + @on-load="onLoad"> + <template slot="menuLeft"> + <el-button type="primary" + size="small" + plain + icon="el-icon-upload2" + @click="handleUpload">涓� 浼� + </el-button> + <el-button type="primary" + size="small" + plain + icon="el-icon-edit" + @click="handleEdit">淇� 鏀� + </el-button> + <el-button type="danger" + size="small" + icon="el-icon-delete" + plain + @click="handleDelete">鍒� 闄� + </el-button> + </template> + <template slot-scope="scope" slot="menu"> + <el-button type="text" + icon="el-icon-download" + size="small" + @click="handleDownload(scope.row)">涓嬭浇 + </el-button> + </template> + </avue-crud> + <el-dialog title="涓婁紶闄勪欢鍒楄〃" + append-to-body + :visible.sync="attachBox" + width="555px"> + <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-before="uploadBefore" :upload-after="uploadAfter" :upload-error="uploadError"> + </avue-form> + </el-dialog> + </basic-container> +</template> + +<script> +import {getList, getFile,upload,update, remove,download} from "@/api/resource/file"; +import {mapGetters} from "vuex"; +import {dateFormat} from "@/util/date"; + +export default { + props: ["options","visible"], + data() { + return { + form: {}, + query: {}, + params:{}, + loading: false, + page: { + pageSize: 10, + currentPage: 1, + total: 0 + }, + attachBox: false, + selectionList: [], + option: { + height: 'auto', + calcHeight: 30, + tip: false, + searchShow: true, + searchMenuSpan: 6, + border: true, + index: true, + viewBtn: true, + selection: true, + dialogClickModal: false, + column: [ + { + label: "鏂囦欢鍚嶇О", + prop: "name", + search: true, + /*formatter:function(d){ + if(this.options.hasDownloadRight != false){ + //璇存槑鏈変笅杞芥枃浠剁殑鏉冮檺锛岄偅涔堟垜浠氨娣诲姞涓�涓秴閾炬帴 + return ''//'<a name="filenamedownloadlink " class="layui-btn layui-btn-intable" lay-event="PREVIEW" fileoid="' + d.oid +'">' + (d.id?d.id:d.name) + '</a>'; + }else{ + return d.id || d.name; + } + }*/ + }, + { + label: "鏂囦欢澶у皬", + prop: "fileSize", + formatter:function(d){ + if(!d.fileSize || d.fileSize == null || d.fileSize*1 == 0 || isNaN(d.fileSize*1) ){ + return "鏈煡澶у皬"; + }else{ + //鍘熷澶у皬鏄疊 + var filesize = d.fileSize*1; + if(filesize>1024*1024*1024*1024){ + return parseInt(filesize/(1024*1024*1024*1024)) + "TB"; + }else if(filesize> 1024*1024*1024){ + return parseInt(filesize/(1024*1024*1024)) + "GB"; + }else if(filesize> 1024*1024){ + return parseInt(filesize/(1024*1024)) + "MB"; + }else if(filesize> 1024){ + return parseInt(filesize/1024) + "KB"; + }else { + return filesize + "B"; + } + } + } + }, + /*{ + label: "瀵嗙骇", + prop: "secretGradeText" + }, + { + label: "鏂囨。绫诲埆", + prop: "fileDocClassifyName" + },*/ + { + label: "鍒涘缓鑰�", + prop: "creator" + }, + { + label: "鍒涘缓鏃堕棿", + prop: "createTime" + }, + ] + }, + data: [{ + btmname: "fileobject", + createTime: "2023-06-14 16:08:50.002", + creator: "1", + fileDocClassify: "undefined", + fileDocClassifyName: null, + fileExtension: "png", + filePath: "VolumnFactoryService:/f87a4c92-ce6e-458b-aad0-0c76bd5eeb35\\54120082-76aa-4092-abbf-b13cb40606c5", + fileSize: 858, + id: "assignRole", + name: "assignRole", + nameOid: "9FF4C05D-4EFA-F00B-0080-5ABB50257D4E", + oid: "54120082-76aa-4092-abbf-b13cb40606c5", + ownBtmname: "wupin", + ownbizOid: "6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9", + owner: "1", + secretGrade: null, + secretGradeText: null + }], + attachForm: {}, + attachOption: { + submitBtn: true, + emptyBtn: true, + column: [ + { + label: '闄勪欢涓婁紶', + prop: 'attachFile', + type: 'upload', + dragFile: true, + loadText: '鏂囦欢涓婁紶涓紝璇风◢绛�', + span: 24, + propsHttp: { + res: 'data' + }, + action: "/api/ubcs-resource/fileController/uploadFile" + } + ] + } + }; + }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + addBtn: false, + editBtn: false, + viewBtn: false, + delBtn: this.vaildData(this.permission.attach_delete, false) + }; + }, + ids() { + let ids = []; + this.selectionList.forEach(ele => { + ids.push(ele.id); + }); + return ids.join(","); + } + }, + methods: { + setParams(){ + var params={ + ownbizOid:options.ownbizOid || '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9', + ownbizBtm:options.ownbizBtm || 'wupin', + fileDocClassify:options.fileDocClassify || '!=processAuditSuggest' + } + this.params=params; + }, + handleUpload() { + this.attachBox = true; + }, + handleEdit() { + this.attachBox = true; + }, + uploadBefore(file, done, loading,column) { + console.log(file,column) + //濡傛灉浣犳兂淇敼file鏂囦欢,鐢变簬涓婁紶鐨刦ile鏄彧璇绘枃浠讹紝蹇呴』澶嶅埗鏂扮殑file鎵嶅彲浠ヤ慨鏀瑰悕瀛楋紝瀹屽悗璧嬪�煎埌done鍑芥暟閲�,濡傛灉涓嶄慨鏀圭殑璇濈洿鎺ュ啓done()鍗冲彲 + var newFile = new File([file], '1234', { type: file.type }); + done(newFile) + this.$message.success('涓婁紶鍓嶇殑鏂规硶') + }, + uploadAfter(res, done, loading, column) { + window.console.log(column); + this.attachBox = false; + this.refreshChange(); + done(); + }, + uploadError(error, column) { + this.$message.success('涓婁紶澶辫触鍥炶皟') + console.log(error, column) + }, + handleDownload(row) { + window.open(`${row.link}`); + }, + rowDel(row) { + this.$confirm("纭畾灏嗛�夋嫨鏂囦欢鍒犻櫎?", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + }); + }, + handleDelete() { + if (this.selectionList.length === 0) { + this.$message.warning("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�"); + return; + } + this.$confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + return remove(this.ids); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + this.$refs.crud.toggleSelection(); + }); + }, + beforeOpen(done, type) { + if (["edit", "view"].includes(type)) { + getDetail(this.form.id).then(res => { + this.form = res.data.data; + }); + } + done(); + }, + searchReset() { + this.query = {}; + this.onLoad(this.page); + }, + searchChange(params, done) { + this.query = params; + this.page.currentPage = 1; + this.onLoad(this.page, params); + done(); + }, + selectionChange(list) { + this.selectionList = list; + }, + selectionClear() { + this.selectionList = []; + this.$refs.crud.toggleSelection(); + }, + currentChange(currentPage) { + this.page.currentPage = currentPage; + }, + sizeChange(pageSize) { + this.page.pageSize = pageSize; + }, + refreshChange() { + this.onLoad(this.page, this.query); + }, + onLoad(page, params) { + //this.loading = true; + params=this.params || {} + /*getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { + const data = res.data.data; + this.page.total = data.total; + this.data = data.records; + this.loading = false; + this.selectionClear(); + });*/ + } + } +}; +</script> + +<style> +</style> diff --git a/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue b/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue index 9b6c62e..22c03ce 100644 --- a/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue +++ b/Source/UBCS-WEB/src/components/flow-cycle/flowchartEditor.vue @@ -1,3 +1,5 @@ +<!-- eslint-disable vue/valid-v-for --> +<!-- eslint-disable vue/require-v-for-key --> <template> <vue-flowchart-editor class="vue-flowchart-editor" ref="flowChart"> <div class="vfe-chart"> @@ -15,7 +17,7 @@ <flow :data="flowChartData" :onAfterChange="onAfterChange" /> <div class="tooltip"> <template v-for="item in tooltipData"> - <p :key="item.name">{{ item.name }}: {{ item.value }}</p> + <p>{{ item.name }}: {{ item.value }}</p> </template> </div> </div> diff --git a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue index 5596490..3f53986 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue @@ -1,7 +1,10 @@ <template> - <vciWebReferTree v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :referConfig="referConfig"></vciWebReferTree> - <vciWebReferTable v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :referConfig="referConfig"></vciWebReferTable> - <vciWebReferDefalut v-else @setValue="setValue" :value="value" :text="text" :title="title" :referConfig="referConfig"></vciWebReferDefalut> + <div v-if="display"> + <vciWebReferTree v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> + <vciWebReferTable v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> + <vciWebReferDefalut v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> + + </div> </template> <script> @@ -10,7 +13,7 @@ import vciWebReferDefalut from "./vciWebReferDefalut.vue"; export default { name: "vciWebRefer", - props: ["referConfig","value","text"], + props: ["referConfig","value","text","disabled","display"], components: {vciWebReferTree, vciWebReferTable, vciWebReferDefalut}, data() { return { diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue index 9558693..1017fc7 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue @@ -27,7 +27,7 @@ </div> </el-dialog> - <avue-input v-model="text" :placeholder="title" @click="visible=true"></avue-input> + <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> <!--<avue-input-table ref="referTable" :props="props" :column="column" :on-load="onLoad" v-model="value" :placeholder="title" ></avue-input-table> --> </div> @@ -38,7 +38,7 @@ import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; export default { name: "vciWebReferDefalut", - props:["referConfig","value","text","title"], + props:["referConfig","value","text","title","disabled"], data() { return { visible: false, @@ -180,6 +180,7 @@ ...item, label: item.title, prop: item.field, + formatter:item.template, search: true } } diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue index f71cc78..b16a962 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue @@ -30,7 +30,7 @@ </div> </el-dialog> - <avue-input v-model="text" :placeholder="title" @click="visible=true"></avue-input> + <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> <!--<avue-input-table ref="referTable" :props="props" :column="column" :on-load="onLoad" v-model="value" :placeholder="title" ></avue-input-table> --> </div> @@ -41,7 +41,7 @@ import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; export default { name: "vciWebReferTable", - props:["referConfig","value","text","title"], + props:["referConfig","value","text","title","disabled"], data() { return { visible: false, diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue index e69ddc8..dcbb537 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue @@ -1,5 +1,5 @@ <template> - <avue-input-tree ref="referTree" :props="props" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> + <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> </template> <script> @@ -8,7 +8,7 @@ export default { name: "vciWebReferTree", - props:["referConfig","value","text","title"], + props:["referConfig","value","text","title","disabled"], data() { return { options: this.referConfig.options, diff --git a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue index 279b8d1..3bd4e93 100644 --- a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue +++ b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue @@ -1,20 +1,30 @@ <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-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true" width="30%"> + <el-tag v-for="tag in tags" :key="tag" closable disable-transitions effect="Plain" size="medium" + @click="handleClickTag(tag)" @close="handleCloseTag(tag)"> + <span> {{ tag.name }}</span> + </el-tag> <el-divider v-if="tags.length !== 0"></el-divider> + <el-form :model="saveParam" class="demo-form-inline" label-position="left" label-width="auto" :rules="rules"> + <el-form-item label="娴佺▼妯℃澘"> + <el-input placeholder="娴佺▼妯℃澘" v-model="saveParam.modelName" disabled ></el-input> + </el-form-item> + <el-form-item label="娴佺▼鍚嶇О" prop="processName"> + <el-input placeholder="娴佺▼鍚嶇О" v-model="saveParam.processName" > + </el-input> + </el-form-item> + <el-form-item label="娴佺▼鎻忚堪"> + <el-input placeholder="娴佺▼鎻忚堪" type="textarea" :rows="4" v-model="saveParam.processDesc" > + </el-input> + </el-form-item> + </el-form> + <el-divider></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> --> + <el-button icon="el-icon-star-off" circle @click="handleCollect"></el-button> </div> - <el-form :model="saveParam" class="demo-form-inline" label-position="left"> + <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto"> <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']" + <el-select style="width: 80%;" filterable v-model="collectParam.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> @@ -40,18 +50,26 @@ // 鏍囬 title: { typeof: String, - default: '浜哄憳璁剧疆' + default: '娴佺▼瀹℃壒' }, - // 妯℃澘id - code: { - typeof: String, - default: '' + // 鍙傛暟锛氶�夋嫨鐨刬d锛屽涓互鏁扮粍鏂瑰紡浼犻�掞細['id','id']锛屾ā鏉縤d锛屾ā鏉跨敤閫旓紝娴佺▼鍚嶅瓧锛屾祦绋嬫ā鏉� + parameter: { + typeof: Object, + default: () => { } }, - // 妯℃澘鐢ㄩ�� - type: { - typeof: String, - default: '' + parameterKeys: { + typeof: Object, + default: () => { + return { + ids: 'ids', + flowName: 'flowName', + flowTemplate: 'flowTemplate', + code: 'code', + type: 'type' + } + } } + }, watch: { visible(n) { @@ -64,28 +82,45 @@ data() { return { dialogVisible: this.visible, + isCollent: false, initFrom: [], tags: [], typeName: [], - saveParam: {}, + collectParam: {}, + saveParam: this.saveParam(), users: [], - + rules: { + processName: [ + { required: true, message: '妯℃澘鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }, + { min: 1, max: 20, message: '闀垮害鍦� 3 鍒� 20 涓瓧绗�', trigger: 'blur' } + ] + } } }, + mounted() { this.apiInit() this.apiDict() }, methods: { + saveParam() { + return { + modelName: this.parameter[this.parameterKeys.flowName], + processName: this.parameter[this.parameterKeys.flowTemplate], + topName: this.title, + ids: this.parameter[this.parameterKeys.ids], + } + }, async apiInit() { - const response = await personnelInit({ type: this.type, templateId: this.code }) + const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code] }) if (response.status === 200) { console.log(response) this.initFrom = response.data.data.user 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.collectParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers } + this.saveParam = { ...this.saveParam, modelKey, templateId } this.handleClickTag(this.tags[0]) } }, @@ -108,10 +143,10 @@ 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) + this.collectParam.flowTaskUsers = this.users + this.collectParam = { ...this.collectParam, name: value } + console.log(this.collectParam) + const response = await personnelCollect(this.collectParam) if (response.status === 200) { this.$nextTick(() => { this.apiInit() @@ -127,6 +162,7 @@ if (response.status === 200) { console.log(response) this.apiInit() + this.isCollent = true this.$message({ type: 'success', message: response.data.msg @@ -135,14 +171,13 @@ }, async apiSave() { try { - const { modelKey, templateId } = this.saveParam - const response = await personnelSave({ modelKey, templateId }) + const response = await personnelSave(this.saveParam) if (response.status === 200) { console.log(response) this.$message({ - type: 'success', - message: response.data.msg - }); + type: 'success', + message: response.data.msg + }); this.done() } } catch { @@ -152,7 +187,7 @@ handleClickTag(event) { console.log(event) const flowTaskUsers = event.flowTaskUsers - this.saveParam.flowTaskUsers = flowTaskUsers.map(item => { + this.collectParam.flowTaskUsers = flowTaskUsers.map(item => { const { taskId, taskName, userId, userName } = item return { taskId, taskName, userId, userName } }) @@ -164,7 +199,7 @@ handleSelect(event, index) { const res = this.typeName.find(item => item.userId === event) const { userName } = res - let users = { ... this.saveParam.flowTaskUsers[index], userName } + let users = { ... this.collectParam.flowTaskUsers[index], userName } console.log(users) this.users[index] = users }, @@ -175,7 +210,6 @@ this.done() }, handleConfirm() { - console.log(this.users) console.log(this.saveParam) this.apiSave() } diff --git a/Source/UBCS-WEB/src/main.js b/Source/UBCS-WEB/src/main.js index c87fec9..3f3b231 100644 --- a/Source/UBCS-WEB/src/main.js +++ b/Source/UBCS-WEB/src/main.js @@ -23,6 +23,7 @@ import avueUeditor from 'avue-plugin-ueditor'; import website from '@/config/website'; import crudCommon from '@/mixins/crud'; +import Divider from './components/Divider'; // 涓氬姟缁勪欢 import tenantPackage from './views/system/tenantpackage'; import enupackage from "@/views/modeling/enupackage"; @@ -102,6 +103,7 @@ Vue.component('MasterTree',MasterTree) Vue.component('FlowPath',FlowPath) Vue.component('Stage',Stage) +Vue.component('Divider', Divider) // 鍔犺浇鐩稿叧url鍦板潃 Object.keys(urls).forEach(key => { diff --git a/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue b/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue index a0521bf..d140c92 100644 --- a/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue +++ b/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue @@ -1,50 +1,60 @@ -<template> - <div> - <el-button @click="visible = true">娴嬭瘯</el-button> - <el-button @click="visible1 = true">鐩镐技椤规煡璇�</el-button> - <FormTemplateDialog - :visible.sync="visible" - :type="this.type" - :templateOid="this.templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" - :disabledProp="disabledProp" - :rowOid="rowOid" - @submit="submit" - ></FormTemplateDialog> - <ResembleQueryDialog - :visible.sync="visible1" - :type="this.type" - :templateOid="this.templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" - ></ResembleQueryDialog> - </div> -</template> - -<script> -import ResembleQueryDialog from '@/components/FormTemplate/ResembleQueryDialog.vue'; -export default { - name: "FormTempalteTest", - components: { ResembleQueryDialog }, - data() { - return { - visible: false, - visible1: false, - // 榛樿绂佺敤鐨勮〃鍏冪礌 - disabledProp: ["id", 'lcstatus'], - // 琛ㄥ崟绫诲瀷 - type: "add", - templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F", - codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", - codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96", - rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9' - }; - }, - methods: { - submit(data) { - console.log(data); - } - } -}; -</script> +<template> + <div> + <el-button @click="visible = true">娴嬭瘯</el-button> + <el-button @click="visible1 = true">鐩镐技椤规煡璇�</el-button> + <el-button @click="visible2 = true">闄勪欢绠$悊dialog</el-button> + <FormTemplateDialog + :visible.sync="visible" + :type="this.type" + :templateOid="this.templateOid" + :codeClassifyOid="this.codeClassifyOid" + :codeRuleOid="this.codeRuleOid" + :disabledProp="disabledProp" + :rowOid="rowOid" + @submit="submit" + ></FormTemplateDialog> + <ResembleQueryDialog + :visible.sync="visible1" + :type="this.type" + :templateOid="this.templateOid" + :codeClassifyOid="this.codeClassifyOid" + :codeRuleOid="this.codeRuleOid" + ></ResembleQueryDialog> + <fileInHtml :options="{}"></fileInHtml> + <fileinDialog + :visible="visible2" + :options="{}" + @close="visible2=false" + ></fileinDialog> + </div> +</template> + +<script> +import ResembleQueryDialog from '@/components/FormTemplate/ResembleQueryDialog.vue'; +import fileInHtml from '@/components/file/inHtml.vue'; +import fileinDialog from '@/components/file/inDialog.vue'; +export default { + name: "FormTempalteTest", + components: { ResembleQueryDialog ,fileInHtml ,fileinDialog}, + data() { + return { + visible: false, + visible1: false, + visible2: false, + // 榛樿绂佺敤鐨勮〃鍏冪礌 + disabledProp: ["id", 'lcstatus'], + // 琛ㄥ崟绫诲瀷 + type: "add", + templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A", + codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96", + codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96", + rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9' + }; + }, + methods: { + submit(data) { + console.log(data); + } + } +}; +</script> diff --git a/Source/UBCS-WEB/src/views/MasterData/items.vue b/Source/UBCS-WEB/src/views/MasterData/items.vue index 850693c..079496f 100644 --- a/Source/UBCS-WEB/src/views/MasterData/items.vue +++ b/Source/UBCS-WEB/src/views/MasterData/items.vue @@ -11,6 +11,7 @@ @tableHeadDataFateher="tableHeadDatas" @total="totals" @nodeClick="nodeClick" + @tableHeadFindData="tableHeadFindDatas" ></master-tree> </basic-container> </el-aside> @@ -26,6 +27,7 @@ :tableHeadDataFateher="this.tableHeadDataFateher" :isLoading="isLoading" :templateOid="templateOid" + :tableHeadFindData="tableHeadFindData" ></TableCrud> </el-main> </el-container> @@ -52,7 +54,7 @@ tableHeadDataFateher:[], total:"", isLoading: false, - + tableHeadFindData:{} } }, created() { @@ -80,6 +82,9 @@ tableHeadDatas(val){ this.tableHeadDataFateher=val }, + tableHeadFindDatas(val){ + this.tableHeadFindData=val + }, nodeClick(val){ this.templateOid=val; console.log('val',val) diff --git a/Source/UBCS-WEB/src/views/flow/flowPath.vue b/Source/UBCS-WEB/src/views/flow/flowPath.vue index f1402d5..341a247 100644 --- a/Source/UBCS-WEB/src/views/flow/flowPath.vue +++ b/Source/UBCS-WEB/src/views/flow/flowPath.vue @@ -3,7 +3,7 @@ <el-button @click="outerVisible = true">娴佺▼娴嬭瘯</el-button> <el-button @click="handleTable">浜哄憳璁剧疆</el-button> <flow-business :visible.sync="outerVisible"></flow-business> - <set-personnel :visible.sync="visibleFlow" code="8b5e2017-990f-454a-9c39-4c4eeeb57553" type="PUBLIC"></set-personnel> + <set-personnel :visible.sync="visibleFlow" :parameter="parameter" :parameter-keys="props" ></set-personnel> </div> </template> @@ -19,7 +19,20 @@ return { outerVisible: false, visibleFlow: false, - + parameter:{ + ids:['0000','22222222'], + code:'8b5e2017-990f-454a-9c39-4c4eeeb57553', + type:'PUBLIC', + name:'妯℃澘name', + template:'妯℃澘template' + }, + props:{ + flowName:'name', + flowTemplate:'template', + type:'type', + ids:'ids', + code:'code' + } } }, methods: { diff --git a/Source/UBCS-WEB/vue.config.js b/Source/UBCS-WEB/vue.config.js index b4dc1a2..736fed3 100644 --- a/Source/UBCS-WEB/vue.config.js +++ b/Source/UBCS-WEB/vue.config.js @@ -26,13 +26,13 @@ proxy: { '/api': { //鏈湴鏈嶅姟鎺ュ彛鍦板潃 - target: 'http://localhost:37000', + // target: 'http://localhost:37000', // target: 'http://localhost:37000', // target: 'http://192.168.1.51:37000', - // target: 'http://192.168.1.46: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', diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/model/BaseModel.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/model/BaseModel.java index c8c9754..a1cac1a 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/model/BaseModel.java +++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/model/BaseModel.java @@ -14,6 +14,7 @@ import java.io.Serializable; import java.util.Date; +import java.util.HashMap; import java.util.Map; public class BaseModel implements Serializable { @JsonSerialize( @@ -108,7 +109,7 @@ private String secretGradeText; @TableField(exist = false) - private Map<String, String> data; + private Map<String, String> data = new HashMap<>(); public BaseModel() { } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CommonsMapper.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CommonsMapper.java index d72adcd..4db0ed5 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CommonsMapper.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CommonsMapper.java @@ -51,4 +51,12 @@ */ Integer deleteByTaleAndOid(String tableName,String oids); + /** + * 浼犲叆琛ㄥ悕锛宯ameoid鑾峰彇鏂扮殑鐗堟湰鍙风瓑 + * @param tableName + * @param nameoid + * @return + */ + Map<String,Object> getNextRevision(@Param("tableName")String tableName,@Param("nameoid") String nameoid); + } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java index 7374475..43a405f 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java @@ -103,7 +103,7 @@ * @param cboList 鏁版嵁鐨勫唴瀹� */ void batchSaveSelectChar(CodeClassifyTemplateVO templateVO, /*List<ClientBusinessObject> cboList*/ - List<String> cboList); + List<BaseModel> cboList); /** * 浣跨敤妯℃澘鐨勪富閿幏鍙栬〃鍗曠殑淇℃伅 @@ -418,14 +418,15 @@ * @param attrName 灞炴�х殑鍚嶅瓧 * @return true 琛ㄧず搴旇蹇界暐 */ - default boolean checkUnAttrUnEdit(String attrName){ - return (VciQueryWrapperForDO.OID_FIELD.equalsIgnoreCase(attrName) - ||"ts".equalsIgnoreCase(attrName) - || "lastmodifier".equalsIgnoreCase(attrName) - || "lastmodifytime".equalsIgnoreCase(attrName) - || "createtime".equalsIgnoreCase(attrName) - || "checkintime".equalsIgnoreCase(attrName) - ||"checkouttime".equalsIgnoreCase(attrName)); - } + boolean checkUnAttrUnEdit(String attrName); +// { +// return (VciQueryWrapperForDO.OID_FIELD.equalsIgnoreCase(attrName) +// ||"ts".equalsIgnoreCase(attrName) +// || "lastmodifier".equalsIgnoreCase(attrName) +// || "lastmodifytime".equalsIgnoreCase(attrName) +// || "createtime".equalsIgnoreCase(attrName) +// || "checkintime".equalsIgnoreCase(attrName) +// ||"checkouttime".equalsIgnoreCase(attrName)); +// } } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java index c4d9f6d..20e0ae0 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.fasterxml.jackson.databind.ObjectMapper; +import com.sun.corba.se.impl.orbutil.ObjectUtility; import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO; import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant; @@ -59,7 +60,6 @@ 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.DateUtil; @@ -73,15 +73,21 @@ 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; @@ -122,7 +128,7 @@ @Resource ISysClient iSysClient; /** - * 绯荤粺鐨勬湇鍔� + * 瀵嗙骇鏈嶅姟 */ @Resource private IWebSecretClient secretService; @@ -341,14 +347,6 @@ public void changeStatus(BaseModelDTO baseModelDTO) { VciBaseUtil.alertNotNull(baseModelDTO, "鏁版嵁淇℃伅", baseModelDTO.getOid(), "涓婚敭", baseModelDTO.getBtmname(), "涓氬姟绫诲瀷", baseModelDTO.getLcStatus(), "鐩爣鐘舵��"); List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid()); -// List<ClientBusinessObject> cboList = boService.selectCBOByOidCollection(oids, baseModelDTO.getBtmname()); - // TODO 鎻掍釜鐐� 涓氬姟绫诲瀷瀹屾垚鍚庨渶瑕佷慨鏀� - QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>(); - wrapper.eq("BTMNAME",baseModelDTO.getBtmname()); - wrapper.in("OID",oids); - // TODO 寰呭畬鍠� - //鎻掍釜鐐� 涓氬姟绫诲瀷瀹屾垚鍚庨渶瑕佷慨鏀� -// QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>(); List<BaseModel> baseModels = new ArrayList<>(); baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid()); if(baseModels.size() == 0){ @@ -368,15 +366,7 @@ // 鍥炴敹闇�瑕佷笟鍔℃暟鎹垹闄� if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) { R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname())); -// String referTable = listR.getData().get(0).getTableName(); commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(),VciBaseUtil.toInSql(baseModelDTO.getOid())); - // BatchCBO batchCBO = new BatchCBO(); - // batchCBO.getDeleteCbos().addAll(cboList); - - // TODO 寰呭畬鍠� - //btmTypeClient.deleteBatchIds(cboList); - - //boService.persistenceBatch(batchCBO); } else { for (BaseModel baseModel : baseModels) { baseModel.setLcStatus(baseModelDTO.getLcStatus()); @@ -439,11 +429,11 @@ List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(),cboList); - List<String> charList = new ArrayList<>(); - for (BaseModel baseModel : cboList) { - charList.add(baseModel.getId()); - } - batchSaveSelectChar(templateVO, charList); +// List<String> charList = new ArrayList<>(); +// for (BaseModel baseModel : cboList) { +// charList.add(baseModel.getId()); +// } + batchSaveSelectChar(templateVO, cboList); return codeList.size() > 0 ? codeList.get(0) : ""; // return null; } @@ -667,7 +657,7 @@ } else if (StringUtils.isNotBlank(orderDTO.getCopyFromVersion())) { sql[0] += " and oid != '" + orderDTO.getCopyFromVersion() + "'"; } - sql[0] += " and islastR = '1' and islastV = '1' "; + sql[0] += " and lastR = '1' and lastV = '1' "; // if (boService.queryCountBySql(sql[0], new HashMap<>()) > 0) { if (Integer.parseInt(commonsMapper.selectById(sql[0]).get(0)) > 0) { String ruleInfoMsg = keyRuleVO == null ? "" : "鏌ヨ瑙勫垯锛氬幓闄ょ┖鏍�--{0},蹇界暐澶у皬鍐�--{1},蹇界暐鍏ㄥ崐瑙�--{2},蹇界暐鍏ㄩ儴绌烘牸--{3}"; @@ -879,7 +869,6 @@ } try { String keyPrefix = BTM_INIT_CACHE.concat(StringPool.COLON).concat(AuthUtil.getTenantId()).concat(StringPool.COLON); -// String finalBtmName = btmName; Cache.ValueWrapper valueWrapper = CacheUtil.getCache(keyPrefix).get(keyPrefix.concat(String.valueOf(btmName))); if(valueWrapper == null){ CacheUtil.getCache(keyPrefix).put(keyPrefix.concat(String.valueOf(btmName)), createBaseModel(btmName)); @@ -890,52 +879,6 @@ logger.error("鍒涘缓涓氬姟绫诲瀷瀵硅薄",e); throw new VciBaseException("initBtmError",new String[]{btmName}); } -// String userName = AuthUtil.getUser().getUserName(); -// CodeWupin wupinEntity = new CodeWupin(); -// wupinEntity.setOid(VciBaseUtil.getPk()); -//// bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); -//// bo.setNameoid((new ObjectUtility()).getNewObjectID36()); -// wupinEntity.setBtmname(btmName); -// wupinEntity.setLastR(String.valueOf(1)); -// wupinEntity.setFirstR(String.valueOf(1)); -// wupinEntity.setFirstV(String.valueOf(1)); -// wupinEntity.setLastV(String.valueOf(1)); -// wupinEntity.setCreator(userName); -// wupinEntity.setCreateTime(new Date()); -// wupinEntity.setLastModifier(userName); -// wupinEntity.setLastModifyTime(new Date()); -// wupinEntity.setRevisionRule("numberversionrule"); -// wupinEntity.setVersionRule("0"); -//// if(StringUtils.isNotBlank(btmTypeVO.getRevisionruleid())){ -// // -//// OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionruleid()); -// wupinEntity.setRevisionValue("1"); -//// } -// -// wupinEntity.setRevisionSeq(1); -// wupinEntity.setVersionSeq(1); -// //鎻掍釜鐐癸紝闇�瑕侀棶鍕囧摜鐗堟湰闂锛屽睍绀洪粯璁や负1 -// wupinEntity.setVersionValue("1"); -// wupinEntity.setLctid("wupinLC"); -// wupinEntity.setLcStatus("Editing"); -// wupinEntity.setId(""); -// wupinEntity.setName(""); -// wupinEntity.setDescription(""); -// wupinEntity.setOwner(userName); -// wupinEntity.setCheckinby(userName); -// wupinEntity.setCopyFromVersion(""); -// wupinEntity.setMaterialtype(1001); -// wupinEntity.setCaigouwl("true"); -// wupinEntity.setShifoupihaoguanli("true"); -// wupinEntity.setKucunwl("true"); -// wupinEntity.setXiaoshouwl("false"); -// wupinEntity.setPassing("true"); - -// this.initTypeAttributeValue(wupinEntity,btmTypeVO); -// return wupinEntity; - - -// return cbo; } /** @@ -962,7 +905,7 @@ */ @Override public void batchSaveSelectChar(CodeClassifyTemplateVO templateVO, /*List<ClientBusinessObject> cboList*/ - List<String> cboList) { + List<BaseModel> cboList) { if (templateVO != null && !CollectionUtils.isEmpty(cboList)) { //鏄紓姝ョ殑锛屾墍浠ョ洿鎺ュ惊鐜� List<CodeClassifyTemplateAttrVO> selectAttrVOs = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getLibraryIdentification())).collect(Collectors.toList()); @@ -970,13 +913,26 @@ if (!CollectionUtils.isEmpty(selectAttrVOs)) { // SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); selectAttrVOs.parallelStream().forEach(attrVO -> { - List<String> valuesList = cboList; -// cboList.parallelStream().forEach(cbo -> { + List<String> valuesList = new ArrayList<>(); + cboList.parallelStream().forEach(cbo -> { // String value = cbo.get.getAttributeValue(attrVO.getId()); -// if (StringUtils.isNotBlank(value)) { -// valuesList.add(value); -// } -// }); + + //灏哹ean杞负map,mybatis缁熶竴澶勭悊 + Map<String,String> map = null; + +// baseModels.stream().forEach(model-> { + try { + map = VciBaseUtil.convertBean2Map(cbo); + } catch (Exception e) { + throw new VciBaseException("绫诲瀷杞崲閿欒锛�" + e.getMessage()); + } +// }); + + String value = map.get(attrVO.getId()); + if (StringUtils.isNotBlank(value)) { + valuesList.add(value); + } + }); if (!CollectionUtils.isEmpty(valuesList)) { for (String s : valuesList) { DictBiz dictBiz = new DictBiz(); @@ -2069,12 +2025,15 @@ // CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); //鎵句笟鍔$被鍨嬶紝鐒跺悗浣跨敤涓婚敭鍘昏幏鍙栨暟鎹簱閲岀殑鏁版嵁 -// List<ClientBusinessObject> cbos = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), WebUtil.getOidQuery(orderDTO.getOid())); + List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), orderDTO.getOid()); - QueryWrapper<CodeWupin> btmWrapper = new QueryWrapper<>(); - btmWrapper.eq("OID",orderDTO.getOid()); - CodeWupin cbo = codeWupinMapper.selectOne(btmWrapper); - + if (CollectionUtils.isEmpty(cbos)) { + throw new VciBaseException(DATA_OID_NOT_EXIST); + } +// QueryWrapper<CodeWupin> btmWrapper = new QueryWrapper<>(); +// btmWrapper.eq("OID",orderDTO.getOid()); +// CodeWupin cbo = codeWupinMapper.selectOne(btmWrapper); + BaseModel cbo = cbos.get(0); // CodeClstemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); // CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid()); @@ -2112,7 +2071,7 @@ cbo.setDescription(orderDTO.getDescription()); cbo.setName(orderDTO.getName()); try { - cbo.setDescription(orderDTO.getDescription()); + cbo.setDescription( StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); cbo.setName(orderDTO.getName()); //// cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription()); // cbo.setAttributeValue("name", orderDTO.getName()); @@ -2120,8 +2079,9 @@ e.printStackTrace(); } cbo.setLastModifyTime(new Date()); - cbo.setLastModifier(AuthUtil.getUser().getUserName()); - codeWupinMapper.updateById(cbo); + cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); + updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), Collections.singletonList(cbo)); +// codeWupinMapper.updateById(cbo); // // List<CodeWupinEntity> cboList = new ArrayList<>(); // @@ -2147,7 +2107,8 @@ // List<ClientBusinessObject> cboList = new ArrayList<>(); // cboList.add(cbo); // boService.persistenceBatch(batchCBO); - batchSaveSelectChar(templateVO, Arrays.asList(cbo.getId())); + batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); +// batchSaveSelectChar(templateVO, Arrays.asList(cbo.getId())); } /** @@ -2315,67 +2276,77 @@ */ @Override public R batchUpdateCode(List<CodeOrderDTO> orderDTOList) { -// VciBaseUtil.alertNotNull(orderDTOList,"缂栫爜鐢宠鐩稿叧鐨勫睘鎬у唴瀹�"); -// orderDTOList.forEach(orderDTO -> { -// VciBaseUtil.alertNotNull(orderDTO, "缂栫爜鐢宠鐩稿叧鐨勫睘鎬х殑鍐呭閮戒负绌�", orderDTO.getOid(), "鏁版嵁涓婚敭", -// orderDTO.getCodeClassifyOid(), "涓婚搴撳垎绫荤殑涓婚敭"); -// }); -// Map<String, CodeOrderDTO> orderDTOMap = orderDTOList.stream().filter(orderDTO -> orderDTO != null && StringUtils.isNotBlank(orderDTO.getOid())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); -// List<ClientBusinessObject> updateList = new ArrayList<>(); -// // 搴旇閮芥槸涓�涓垎绫讳笅鐨勪笟鍔℃暟鎹紝鎵剧涓�鏉$殑灏辫 -// CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTOList.get(0).getCodeClassifyOid()); + VciBaseUtil.alertNotNull(orderDTOList,"缂栫爜鐢宠鐩稿叧鐨勫睘鎬у唴瀹�"); + orderDTOList.forEach(orderDTO -> { + VciBaseUtil.alertNotNull(orderDTO, "缂栫爜鐢宠鐩稿叧鐨勫睘鎬х殑鍐呭閮戒负绌�", orderDTO.getOid(), "鏁版嵁涓婚敭", + orderDTO.getCodeClassifyOid(), "涓婚搴撳垎绫荤殑涓婚敭"); + }); + Map<String, CodeOrderDTO> orderDTOMap = orderDTOList.stream().filter(orderDTO -> orderDTO != null && StringUtils.isNotBlank(orderDTO.getOid())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); + List<BaseModel> updateList = new ArrayList<>(); + // 搴旇閮芥槸涓�涓垎绫讳笅鐨勪笟鍔℃暟鎹紝鎵剧涓�鏉$殑灏辫 + CodeClassifyFullInfoBO topClassifyFullInfo = classifyService.getClassifyFullInfo(orderDTOList.get(0).getCodeClassifyOid()); // Map<String,String> cboOidMap = new HashMap<>(); -// if (CollectionUtils.isEmpty(orderDTOMap.keySet())){ -// throw new VciBaseException(DATA_OID_NOT_EXIST); -// } + if (CollectionUtils.isEmpty(orderDTOMap.keySet())){ + throw new VciBaseException(DATA_OID_NOT_EXIST); + } + + List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0]))); // cboOidMap.put("oid",QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(orderDTOMap.keySet().toArray(new String[0])) + ")"); // List<ClientBusinessObject> cboList = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), cboOidMap); -// if (CollectionUtils.isEmpty(cboList)){ -// throw new VciBaseException(DATA_OID_NOT_EXIST); -// } + if (CollectionUtils.isEmpty(cboList)){ + throw new VciBaseException(DATA_OID_NOT_EXIST); + } // BatchCBO batchCBO = new BatchCBO(); // CodeClassifyTemplateVO firstTemplateVO = templateService.getObjectHasAttrByOid(orderDTOMap.values().stream().findFirst().get().getTemplateOid()); -// Map<String, ClientBusinessObject> cboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); -// orderDTOMap.keySet().stream().forEach(oid -> { -// CodeOrderDTO orderDTO = orderDTOMap.get(oid); -// ClientBusinessObject cbo = cboMap.get(oid); -// if (!cbo.getTs().contains(VciDateUtil.date2Str(orderDTO.getTs(), VciDateUtil.DateTimeFormat))) { -// throw new VciBaseException("鏁版嵁涓嶆槸鏈�鏂扮殑锛屽彲鑳戒粬浜哄凡缁忎慨鏀癸紝璇峰埛鏂板悗鍐嶈瘯"); -// } -// if (!CodeDefaultLC.EDITING.getValue().equalsIgnoreCase(cbo.getLcStatus()) && !orderDTO.isEditInProcess()) { -// throw new VciBaseException("鏁版嵁涓嶆槸{0}鐨勭姸鎬侊紝涓嶅厑璁镐慨鏀�", new String[]{CodeDefaultLC.EDITING.getText()}); -// } -// //1. 鍒ゆ柇蹇呰緭椤� -// CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); -// checkRequiredAttrOnOrder(templateVO, orderDTO); -// //2.鍏堟敞鍏ワ紝鍐嶇粍鍚堬紝鏈�鍚庢牎楠� -// switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); -// //3.澶勭悊缁勫悎瑙勫垯銆傜粍鍚堣鍒欎笉鑳戒娇鐢ㄧ紪鐮佺殑灞炴�э紝鍥犱负缂栫爜鐨勭敓鎴愬彲鑳芥槸闇�瑕佸睘鎬х殑 -// switchComponentAttrOnOrder(templateVO, orderDTO); -// //4.鏍¢獙瑙勫垯 -// checkVerifyOnOrder(templateVO, orderDTO); -// //5.鍒ゆ柇鍏抽敭灞炴�� -// checkKeyAttrOnOrder(classifyFullInfo, templateVO, orderDTO); -// //6.鏍¢獙鏋氫妇鐨勫唴瀹规槸鍚︽纭� -// checkEnumOnOrder(templateVO, orderDTO); -// //7.澶勭悊鏃堕棿鏍煎紡锛屽湪鏁版嵁搴撻噷闈笉璁烘槸瀛楃涓茶繕鏄棩鏈熸牸寮忥紝閮戒娇鐢ㄧ浉鍚岀殑鏍煎紡瀛樺偍 -// switchDateAttrOnOrder(templateVO, orderDTO); -// //榛樿鐨勫唴瀹逛笉鑳藉彉锛屾墍浠ュ彧闇�瑕佹嫹璐濊嚜瀹氫箟鐨勭浉鍏冲睘鎬у嵆鍙� -// copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true); -// //浼佷笟鐮佸拰闆嗗洟鐮佺殑涓嶄慨鏀� -// cbo.setDescription(orderDTO.getDescription()); -// cbo.setName(orderDTO.getName()); + Map<String, BaseModel> cboMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); + orderDTOMap.keySet().stream().forEach(oid -> { + CodeOrderDTO orderDTO = orderDTOMap.get(oid); + CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); + CodeClassifyTemplateVO firstTemplateVO = templateService.getObjectHasAttrByOid(orderDTOMap.values().stream().findFirst().get().getTemplateOid()); + BaseModel cbo = cboMap.get(oid); + String code=cbo.getId(); + if (!cbo.getTs().toString().contains(orderDTO.getTs().toString())) { + throw new VciBaseException("鏁版嵁涓嶆槸鏈�鏂扮殑锛屽彲鑳戒粬浜哄凡缁忎慨鏀癸紝璇峰埛鏂板悗鍐嶈瘯"); + } + if (!CodeDefaultLC.EDITING.getValue().equalsIgnoreCase(cbo.getLcStatus()) && !orderDTO.isEditInProcess()) { + throw new VciBaseException("鏁版嵁涓嶆槸{0}鐨勭姸鎬侊紝涓嶅厑璁镐慨鏀�", new String[]{CodeDefaultLC.EDITING.getText()}); + } + //1. 鍒ゆ柇蹇呰緭椤� + CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); + checkRequiredAttrOnOrder(templateVO, orderDTO); + //2.鍏堟敞鍏ワ紝鍐嶇粍鍚堬紝鏈�鍚庢牎楠� + switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); + //3.澶勭悊缁勫悎瑙勫垯銆傜粍鍚堣鍒欎笉鑳戒娇鐢ㄧ紪鐮佺殑灞炴�э紝鍥犱负缂栫爜鐨勭敓鎴愬彲鑳芥槸闇�瑕佸睘鎬х殑 + switchComponentAttrOnOrder(templateVO, orderDTO); + //4.鏍¢獙瑙勫垯 + checkVerifyOnOrder(templateVO, orderDTO); + //5.鍒ゆ柇鍏抽敭灞炴�� + checkKeyAttrOnOrder(classifyFullInfo, templateVO, orderDTO); + //6.鏍¢獙鏋氫妇鐨勫唴瀹规槸鍚︽纭� + checkEnumOnOrder(templateVO, orderDTO); + //7.澶勭悊鏃堕棿鏍煎紡锛屽湪鏁版嵁搴撻噷闈笉璁烘槸瀛楃涓茶繕鏄棩鏈熸牸寮忥紝閮戒娇鐢ㄧ浉鍚岀殑鏍煎紡瀛樺偍 + switchDateAttrOnOrder(templateVO, orderDTO); + //榛樿鐨勫唴瀹逛笉鑳藉彉锛屾墍浠ュ彧闇�瑕佹嫹璐濊嚜瀹氫箟鐨勭浉鍏冲睘鎬у嵆鍙� + copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true); + //浼佷笟鐮佸拰闆嗗洟鐮佺殑涓嶄慨鏀� + cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); + cbo.setName(orderDTO.getName()); // try { -// cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription()); +// cbo.setAttributeValue("id",code); + cbo.setId(code); + cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); +// cbo.setAttributeValueWithNoCheck("description", StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); // cbo.setAttributeValue("name", orderDTO.getName()); + cbo.setName(orderDTO.getName()); // } catch (VCIError e) { // e.printStackTrace(); // } // batchCBO.getUpdateCbos().add(cbo); -// updateList.add(cbo); -// }); + updateList.add(cbo); + batchSaveSelectChar(firstTemplateVO, cboList); + }); // boService.persistenceBatch(batchCBO); -// batchSaveSelectChar(firstTemplateVO, cboList); + updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(),updateList); return R.success("鎿嶄綔鎴愬姛锛�"); } @@ -2458,64 +2429,76 @@ */ @Override public void upSaveCode(CodeOrderDTO orderDTO) { + VciBaseUtil.alertNotNull(orderDTO, "缂栫爜鏁版嵁鎵�鍦ㄤ笟鍔$被鍚嶇О", orderDTO.getBtmname()); + String btmName=orderDTO.getBtmname(); + //鎵句笟鍔$被鍨嬶紝鐒跺悗浣跨敤涓婚敭鍘昏幏鍙栨暟鎹簱閲岀殑鏁版嵁 + List<BaseModel> cbos = selectByTypeAndOid(btmName, orderDTO.getCopyFromVersion()); + if (CollectionUtils.isEmpty(cbos)) { + throw new VciBaseException(DATA_OID_NOT_EXIST); + } + BaseModel oldCbo = cbos.get(0); + + if (!CodeDefaultLC.RELEASED.getValue().equalsIgnoreCase(oldCbo.getLcStatus())) { + throw new VciBaseException("鏁版嵁涓嶆槸{0}鐨勭姸鎬侊紝涓嶅厑璁告暟鎹洿鏀�", new String[]{CodeDefaultLC.RELEASED.getText()}); + } + + //鏍规嵁鏁版嵁鑾峰彇鍒嗙被oid + String codeClassifyOid=oldCbo.getData().get(CODE_CLASSIFY_OID_FIELD.toUpperCase()); + orderDTO.setCodeClassifyOid(codeClassifyOid); + CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); + CodeClassifyTemplateVO templateVO= this.getUsedTemplateByClassifyOid(orderDTO.getCodeClassifyOid()); + orderDTO.setTemplateOid(templateVO.getOid()); VciBaseUtil.alertNotNull(orderDTO, "缂栫爜鐢宠鐩稿叧鐨勫睘鎬х殑鍐呭涓虹┖", orderDTO.getCopyFromVersion(), "鍘熷鏁版嵁鐨勪富閿�", orderDTO.getCodeClassifyOid(), "涓婚搴撳垎绫荤殑涓婚敭"); - CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); - //鎵句笟鍔$被鍨嬶紝鐒跺悗浣跨敤涓婚敭鍘昏幏鍙栨暟鎹簱閲岀殑鏁版嵁 -// List<ClientBusinessObject> cbos = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), WebUtil.getOidQuery(orderDTO.getCopyFromVersion())); -// if (CollectionUtils.isEmpty(cbos)) { -// throw new VciBaseException(DATA_OID_NOT_EXIST); -// } -// ClientBusinessObject oldCbo = cbos.get(0); -// if (!CodeDefaultLC.RELEASED.getValue().equalsIgnoreCase(oldCbo.getLcStatus())) { -// throw new VciBaseException("鏁版嵁涓嶆槸{0}鐨勭姸鎬侊紝涓嶅厑璁告暟鎹洿鏀�", new String[]{CodeDefaultLC.RELEASED.getText()}); -// } -// //闇�瑕佸崌鐗� + + //闇�瑕佸崌鐗� // ClientBusinessObjectOperation cboOperation = new ClientBusinessObjectOperation(); -// ClientBusinessObject cbo = null; + BaseModel cbo = null; // try { // //cbo = cboOperation.createBusinessObjectVersion(oldCbo,VciBaseUtil.getCurrentUserId()); -// cbo = cboOperation.reviseBusinessObject(oldCbo, ""); + cbo = reviseBusinessObject(oldCbo); // } catch (VCIError e) { // throw new VciBaseException("鍒濆鍖栫浉鍏崇殑鍐呭鍑虹幇浜嗛敊璇�", new String[0], e); // } -// //1. 鍒ゆ柇蹇呰緭椤� -// CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); -// checkRequiredAttrOnOrder(templateVO, orderDTO); -// //2.鍏堟敞鍏ワ紝鍐嶇粍鍚堬紝鏈�鍚庢牎楠� -// switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); -// //3.澶勭悊缁勫悎瑙勫垯銆傜粍鍚堣鍒欎笉鑳戒娇鐢ㄧ紪鐮佺殑灞炴�э紝鍥犱负缂栫爜鐨勭敓鎴愬彲鑳芥槸闇�瑕佸睘鎬х殑 -// switchComponentAttrOnOrder(templateVO, orderDTO); -// //4.鏍¢獙瑙勫垯 -// checkVerifyOnOrder(templateVO, orderDTO); -// //5.鍒ゆ柇鍏抽敭灞炴�� -// checkKeyAttrOnOrder(classifyFullInfo, templateVO, orderDTO); -// //6.鏍¢獙鏋氫妇鐨勫唴瀹规槸鍚︽纭� -// checkEnumOnOrder(templateVO, orderDTO); -// //7.澶勭悊鏃堕棿鏍煎紡锛屽湪鏁版嵁搴撻噷闈笉璁烘槸瀛楃涓茶繕鏄棩鏈熸牸寮忥紝閮戒娇鐢ㄧ浉鍚岀殑鏍煎紡瀛樺偍 -// switchDateAttrOnOrder(templateVO, orderDTO); -// //榛樿鐨勫唴瀹逛笉鑳藉彉锛屾墍浠ュ彧闇�瑕佹嫹璐濊嚜瀹氫箟鐨勭浉鍏冲睘鎬у嵆鍙� -// copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true); -// //浼佷笟鐮佸拰闆嗗洟鐮佺殑涓嶄慨鏀� -// cbo.setDescription(orderDTO.getDescription()); -// cbo.setName(orderDTO.getName()); + //1. 鍒ゆ柇蹇呰緭椤� + //CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); + checkRequiredAttrOnOrder(templateVO, orderDTO); + //2.鍏堟敞鍏ワ紝鍐嶇粍鍚堬紝鏈�鍚庢牎楠� + switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); + //3.澶勭悊缁勫悎瑙勫垯銆傜粍鍚堣鍒欎笉鑳戒娇鐢ㄧ紪鐮佺殑灞炴�э紝鍥犱负缂栫爜鐨勭敓鎴愬彲鑳芥槸闇�瑕佸睘鎬х殑 + switchComponentAttrOnOrder(templateVO, orderDTO); + //4.鏍¢獙瑙勫垯 + checkVerifyOnOrder(templateVO, orderDTO); + //5.鍒ゆ柇鍏抽敭灞炴�� + checkKeyAttrOnOrder(classifyFullInfo, templateVO, orderDTO); + //6.鏍¢獙鏋氫妇鐨勫唴瀹规槸鍚︽纭� + checkEnumOnOrder(templateVO, orderDTO); + //7.澶勭悊鏃堕棿鏍煎紡锛屽湪鏁版嵁搴撻噷闈笉璁烘槸瀛楃涓茶繕鏄棩鏈熸牸寮忥紝閮戒娇鐢ㄧ浉鍚岀殑鏍煎紡瀛樺偍 + switchDateAttrOnOrder(templateVO, orderDTO); + //榛樿鐨勫唴瀹逛笉鑳藉彉锛屾墍浠ュ彧闇�瑕佹嫹璐濊嚜瀹氫箟鐨勭浉鍏冲睘鎬у嵆鍙� + copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true); + //浼佷笟鐮佸拰闆嗗洟鐮佺殑涓嶄慨鏀� + cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); + cbo.setName(orderDTO.getName()); // try { -// cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription()); -// cbo.setAttributeValue("name", orderDTO.getName()); + cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); +// cbo.setAttributeValueWithNoCheck("description", StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); + cbo.setName(orderDTO.getName()); // } catch (VCIError e) { // e.printStackTrace(); // } -// //鏁版嵁鐨勬椂鍊欙紝缂栫爜鏄笉鍙樼殑 -// cbo.setCreateTime(DateUtils.convert2String(new Date(Long.parseLong(cbo.getCreateTime())), "yyyy-MM-dd HH:mm:ss")); -// cbo.setLastModifyTime(DateUtils.convert2String(new Date(Long.parseLong(cbo.getLastModifyTime())), "yyyy-MM-dd HH:mm:ss")); + //鏁版嵁鐨勬椂鍊欙紝缂栫爜鏄笉鍙樼殑 + cbo.setCreateTime(cbo.getCreateTime()); + cbo.setLastModifyTime(cbo.getLastModifyTime()); // List<ClientBusinessObject> cboList = new ArrayList<>(); // cboList.add(cbo); -// try { + try { // cboOperation.saveRevisionBuinessObject(cbo); -// } catch (VCIError vciError) { -// throw new VciBaseException("鏁版嵁鏇存敼淇濆瓨鍑洪敊浜�", new String[0], vciError); -// } -// batchSaveSelectChar(templateVO, cboList); + insertBatchByType(cbo.getBtmname(), Collections.singletonList(cbo)); + } catch (Exception vciError) { + throw new VciBaseException("鏁版嵁鏇存敼淇濆瓨鍑洪敊浜�", new String[0], vciError); + } + batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); } /** @@ -3438,4 +3421,45 @@ return "pl_code_"+refertype.trim().toLowerCase(); } + + public BaseModel reviseBusinessObject(BaseModel fromBo) { + BaseModel toBo = new BaseModel(); +// Map<String,String> data = new HashMap<>(); +// toBo.getData().put(data); + toBo.setOid(VciBaseUtil.getPk()); + toBo.setRevisionOid(VciBaseUtil.getPk()); + toBo.setNameOid(fromBo.getNameOid()); + toBo.setBtmname(fromBo.getBtmname()); + toBo.setLastR(String.valueOf(1)); + toBo.setFirstR(String.valueOf(0)); + toBo.setFirstV(String.valueOf(1)); + toBo.setLastV(String.valueOf(1)); + toBo.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); + toBo.setCreateTime(new Date()); + toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); + toBo.setLastModifyTime(new Date()); + toBo.setRevisionRule(fromBo.getRevisionRule()); + toBo.setVersionRule(fromBo.getVersionRule()); +// RevisionValueObject rvObj = this.getNextRevision(fromBo.getBtmName(), fromBo.getNameoid(), item.revRuleName, item.revInput, revisionVal); + R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); + Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); + toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString())); + toBo.setRevisionValue(nextRevision.get("REVISIONVAL").toString()); +// VersionValueObject versionObj = this.getVersionValue(item.verRuleName); + toBo.setVersionSeq(Integer.valueOf(nextRevision.get("VERSIONSEQ").toString())); + toBo.setVersionValue(nextRevision.get("VERSIONVAL").toString()); + toBo.setLctid(fromBo.getLctid()); + toBo.setLcStatus("Editing"); + toBo.setId(fromBo.getId()); + toBo.setName(fromBo.getName()); + toBo.setDescription(fromBo.getDescription()); + toBo.setOwner(String.valueOf(AuthUtil.getUser().getUserId())); +// toBo.setCheckinBy(String.valueOf(AuthUtil.getUser().getUserId())); + toBo.setCopyFromVersion(fromBo.getOid()); + toBo.getData().putAll(fromBo.getData()); + toBo.getData().put("CHECKINBY",String.valueOf(AuthUtil.getUser().getUserId())); +// this.initRevisionTypeAttributeValue(fromBo, toBo); + return toBo; + + } } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java index aa4955c..f4c28c0 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java @@ -997,7 +997,7 @@ if (isExport||newErrorMap.size() > 0) { createRedisDatas(uuid + "-ok", templateVO, rowIndexCboMap, dataSet, fieldIndexMap, newErrorMap, true); } else { - List<String> dataCBOIdList=new ArrayList<>(); + List<BaseModel> dataCBOIdList=new ArrayList<>(); //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); List<ClientBusinessObject> finalNeedSaveCboList = needSaveCboList; CodeClassifyTemplateVO finalTemplateVO = templateVO; @@ -1011,7 +1011,7 @@ BeanUtil.convert(clientBusinessObject,baseModel); baseModel.setData(VciBaseUtil.objectToMapString(clientBusinessObject)); dataCBOList.add(baseModel); - dataCBOIdList.add(baseModel.getOid()); + dataCBOIdList.add(baseModel); }); if (!CollectionUtils.isEmpty(thisCbos)) { @@ -1338,7 +1338,7 @@ try { codeList = productCodeService.productCodeAndSaveData(classifyFullInfo,templateVO,ruleVO, orderDTO.getSecDTOList(),dataCBOList); //濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰 - engineService.batchSaveSelectChar(templateVO, dataCBOIdList); + engineService.batchSaveSelectChar(templateVO, dataCBOList); } catch (Exception e) { e.printStackTrace(); log.error("鎵逛簡鐢宠鏃跺け璐�"); @@ -1427,7 +1427,7 @@ @Override public R batchImportData(List<CodeImprotSaveDatVO> codeImprotSaveDatVOList, String classifyAttr, boolean isImprot) { - List<String> allNeedSaveCboList=new ArrayList<>(); + List<BaseModel> dataCBOList=new ArrayList<>(); codeImprotSaveDatVOList.stream().forEach(codeImprotSaveDatVO -> { List<SheetRowData> rowDataList = new ArrayList<>(); List<ClientBusinessObject>cboList=new ArrayList<>(); @@ -1517,13 +1517,13 @@ log.info("鍒嗙被锛�"+classifyFullInfo.getCurrentClassifyVO().getName()+"鏁版嵁:"+needSaveCboList.size()); if (!CollectionUtils.isEmpty(needSaveCboList)) { - List<BaseModel> dataCBOList=new ArrayList<>(); +// List<BaseModel> dataCBOList=new ArrayList<>(); needSaveCboList.stream().forEach(clientBusinessObject -> { BaseModel baseModel=new BaseModel(); BeanUtil.convert(clientBusinessObject,baseModel); baseModel.setData(VciBaseUtil.objectToMapString(clientBusinessObject)); dataCBOList.add(baseModel); - allNeedSaveCboList.add(baseModel.getOid()); +// allNeedSaveCboList.add(baseModel); }); try { //9.鎴戜滑澶勭悊涓氬姟鏁版嵁 @@ -1537,7 +1537,7 @@ } } //濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰 - engineService.batchSaveSelectChar(codeClassifyTemplateVO, allNeedSaveCboList); + engineService.batchSaveSelectChar(codeClassifyTemplateVO, dataCBOList); }); return R.success(isImprot?"鎵归噺鍘嗗彶瀵煎叆鎴愬姛":"鎵归噺鐢宠鎴愬姛"); } @@ -1802,7 +1802,7 @@ try { productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList); //濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰 - engineService.batchSaveSelectChar(templateVO, allNeedSaveCboList); + engineService.batchSaveSelectChar(templateVO, dataCBOList); // if(!isProcess){ needSaveCboList.stream().forEach(needSaveCbo->{ XMLResultDataObjectDetailDO resultDataObjectDetailDO=new XMLResultDataObjectDetailDO(); diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml index eadd7d1..90ad857 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml @@ -63,4 +63,13 @@ END; </update > + <select id="getNextRevision" resultType="map" > + select max(revisionSeq) + 1 revisionSeq, + max(RevisionValue) + 1 revisionVal, + max(VersionSeq) + 1 VersionSeq, + max(VersionValue) + 1 VersionVal + from ${tableName} + where nameoid = #{nameoid} + </select> + </mapper> -- Gitblit v1.9.3