From 43603c1cb538ae4d8c2f6ce4710121c8c95677bd Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 14 十二月 2023 16:43:30 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/views/modeling/LinkType.vue | 556 ++++++++++++++------------- Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 129 +++-- Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java | 104 +++++ Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue | 4 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java | 12 Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java | 16 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java | 36 + Source/UBCS-WEB/src/views/statistic/statisticPage.vue | 2 Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml | 7 Source/UBCS-WEB/src/components/Master/MasterTransfer.vue | 34 + Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java | 58 ++ Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 9 Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue | 73 +- Source/UBCS-WEB/src/views/modeling/Business.vue | 91 ++-- Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java | 66 +++ 15 files changed, 776 insertions(+), 421 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue index 08d4d34..639cf39 100644 --- a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue +++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue @@ -10,11 +10,11 @@ <el-radio :label="1">鍏ㄩ儴</el-radio> <el-radio :label="2">椤电爜</el-radio> </el-radio-group> - <span v-if="radio === 2" style="margin-left: 20px;"><el-input v-model="pageExport" - style="width: 150px"></el-input> 锛堣緭鍏ラ〉鐮佹垨鑰呴〉闈㈣寖鍥达紝濡傦細1-10锛�</span> + <span v-if="radio === 2" style="margin-left: 20px;color: #F56C6C; "> + <el-input v-model="pageExport" style="width: 150px"></el-input> 锛堣緭鍏ラ〉鐮佹垨鑰呴〉闈㈣寖鍥达紝濡傦細1-10锛�</span> </div> </div> - <div style="text-align: center"> + <div v-loading="isLoading" style="text-align: center"> <el-transfer v-model="value" :data="data" @@ -44,6 +44,7 @@ pageExport: "", data: [], value: [], + isLoading: false, filterMethod(query, item) { return item.label.indexOf(query) > -1; }, @@ -156,6 +157,7 @@ if (this.selectRow.length <= 0) { this.$message.warning('璇烽�夋嫨瑕佸鍑虹殑妯℃澘') } else { + this.isLoading = true; //宸查�夋嫨澶氶�� const selectList = [] //宸查�夋嫨灞炴�� @@ -178,6 +180,9 @@ }).then(res => { this.handlerFile(res); this.escHandler(); + this.isLoading = false; + }).catch(error => { + this.isLoading = false; }) } else { @@ -188,12 +193,15 @@ // console.log('res',res) this.handlerFile(res); this.escHandler(); - + this.isLoading = false; + }).catch(error => { + this.isLoading = false; }) } } } else if (this.radio === 1) { + this.isLoading = true; if (this.value <= 0) { this.tableHeadData.map(item => item.prop) .forEach((prop, index) => { @@ -203,12 +211,18 @@ if (res) { func.downloadFileByBlobHandler(res); this.escHandler(); + this.isLoading = false; } + }).catch(error => { + this.isLoading = false; }) } else { exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => { this.handlerFile(res); this.escHandler(); + this.isLoading = false; + }).catch(error => { + this.isLoading = false; }) } } else if (this.radio === 2) { @@ -237,6 +251,7 @@ } } if (this.value >= 1) { + this.isLoading = true; exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, @@ -246,9 +261,12 @@ // console.log('res',res) this.handlerFile(res); this.escHandler(); - + this.isLoading = false; + }).catch(error => { + this.isLoading = false; }); } else { + this.isLoading = true; this.tableHeadData.map(item => item.prop) .forEach((prop, index) => { this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; @@ -259,10 +277,12 @@ page: start, endPage: end }).then(res => { - // console.log('res', res) + this.isLoading = false; this.handlerFile(res); this.escHandler(); - }) + }).catch(error => { + this.isLoading = false; + }); } } }, diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue index 76fc6c0..82d1ebe 100644 --- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue @@ -46,15 +46,15 @@ <el-table-column v-if="tableData.length != 0" fixed label="搴忓彿" type="index" width="55"> </el-table-column> <!-- 鐢熷懡鍛ㄦ湡--> -<!-- <el-table-column v-for="(item,index) in lcstatusArray"--> -<!-- v-if=" lcstatusArray.length >= 0 && !item.hidden"--> -<!-- key="index" :show-overflow-tooltip="true" :sortable="item.sortable"--> -<!-- :width="item.width" align="center" label="鐢熷懡鍛ㄦ湡鍊�"--> -<!-- prop="lcstatus">--> -<!-- <template slot-scope="scope">--> -<!-- <span>{{ scope.row.lcstatus_text }}</span>--> -<!-- </template>--> -<!-- </el-table-column>--> + <!-- <el-table-column v-for="(item,index) in lcstatusArray"--> + <!-- v-if=" lcstatusArray.length >= 0 && !item.hidden"--> + <!-- key="index" :show-overflow-tooltip="true" :sortable="item.sortable"--> + <!-- :width="item.width" align="center" label="鐢熷懡鍛ㄦ湡鍊�"--> + <!-- prop="lcstatus">--> + <!-- <template slot-scope="scope">--> + <!-- <span>{{ scope.row.lcstatus_text }}</span>--> + <!-- </template>--> + <!-- </el-table-column>--> <!-- 缂栧彿--> <el-table-column v-for="(item, index) in CodeArray" v-if="CodeArray.length !== 0 && !item.hidden" key="index" :label="item.label" :prop="item.prop" @@ -345,7 +345,7 @@ }, // 涓绘暟鎹寜閽� masterVrBtnList: [], - fileOptions:{}, + fileOptions: {}, result: '', elapsedTime: '', }; @@ -397,7 +397,7 @@ this.tableData = newval; this.searchResults = newval this.doLayout(); - this.fileOptions= { + this.fileOptions = { ownbizOid: "0", ownbizBtm: "0", fileDocClassify: '!=processAuditSuggest', @@ -467,6 +467,7 @@ templateOid: { handler(newval, oldval) { this.fileOptions.ownbizOid = "0"; + this.statusSelect = 'all' }, deep: true, }, @@ -590,7 +591,7 @@ func.downloadFileByBlobHandler(res); this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�'); this.isLoading = false; - }).catch(error=>{ + }).catch(error => { this.$message.error(error); }); }, @@ -927,40 +928,46 @@ }) }, // 鎺掑簭 - sortChange(val) { - // console.log(val) - this.isLoading = true; - let order = ""; - if (val.order == "ascending") { - order = "asc"; - } else { - order = "desc"; + async sortChange(val) { + try { + this.isLoading = true; + const order = val.order == 'ascending' ? 'asc' : 'desc'; + const {data} = await TableData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + order: order, + sort: val.prop, + page: this.page.currentPage, + limit: this.page.pageSize, + }); + this.data = data.data; + } finally { + this.isLoading = false; } - TableData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - order: order, - sort: val.prop, - page: this.page.currentPage, - limit: this.page.pageSize, - }).then((res) => { - setTimeout(() => { - this.data = res.data.data; - this.isLoading = false; - }, 100); - }); }, //鍒嗛〉鍒锋柊 async onLoad(val) { - await TableData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - page: this.page.currentPage, - limit: this.page.pageSize, - }).then((res) => { + this.isLoading = true; + + try { + let conditionMap = {}; + if (this.statusSelect !== 'all') { + conditionMap.lcstatus = this.statusSelect; + } + const res = await TableData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + page: this.page.currentPage, + limit: this.page.pageSize, + conditionMap + }); this.tableData = res.data.data; - this.doLayout() - }); + this.doLayout(); + } catch (error) { + this.$message.error(error) + } finally { + this.isLoading = false; + } }, //澶氶�� handleSelectionChange(list) { @@ -993,15 +1000,18 @@ this.findvisible = true; }, // 楂樼骇鏌ヨ - echoContion(val) { - FindData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - ...val, - }).then((res) => { + async echoContion(val) { + try { + const res = await FindData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + ...val, + }); this.tableData = res.data.data; this.page.total = res.data.total - }); + } catch (error) { + + } }, //鐩镐技椤规煡璇� similarHandler() { @@ -1071,17 +1081,20 @@ //杈撳叆鍥炶溅鎼滅储 tableFindInp() { this.isLoading = true; - TableData({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - page: this.page.currentPage, - limit: this.page.pageSize, - ['conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*' - }).then(res => { - this.tableData = res.data.data; - this.page.total = res.data.total; + try { + TableData({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + page: this.page.currentPage, + limit: this.page.pageSize, + ['conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*' + }).then(res => { + this.tableData = res.data.data; + this.page.total = res.data.total; + }) + } finally { this.isLoading = false; - }) + } } } diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue index 741b537..3824b23 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue @@ -36,7 +36,7 @@ ); }); - let colors = ['#2eadd6', '#FFA500']; + let colors = ['#84C9E5', '#F68686']; const seriesData = []; for (let i = 0; i < newval.length; i++) { @@ -92,7 +92,7 @@ data() { return { chartOptions: { - color:["#91CC75", "#5470C6"], + color:['#84C9E5', '#F68686'], title: { text: "", }, diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue index 600df00..222f97a 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue @@ -5,16 +5,14 @@ </template> <script> -import 'echarts' +import echarts from'echarts' import 'echarts/lib/chart/line' -import 'echarts/lib/chart/pie' -import 'echarts/lib/chart/bar' import 'echarts/lib/component/tooltip' import 'echarts/lib/component/title' import 'echarts/lib/component/legend' export default { - name: "mixCart", + name: "stackedAreaChart", props: { mixData: { type: Array, @@ -28,8 +26,9 @@ data() { return { chartOptions: { + color: ['#84C9E5', '#F68686'], title: { - text: "", + text: '', }, grid: { left: "3%", @@ -40,18 +39,15 @@ tooltip: { trigger: "axis", axisPointer: { - type: "shadow", - }, + type: "cross" + } }, legend: { - data: ["鎬婚噺", "鏂板"], - left: "center", - textStyle: { - fontSize: 14 // 璋冩暣瀛椾綋澶у皬 - } + data: ['鎬婚噺', '鏂板'] }, xAxis: { type: "category", + boundaryGap: false, data: [ "涓�鏈�", "浜屾湀", @@ -70,8 +66,10 @@ yAxis: { type: "value", }, - series: [], - }, + series: [ + + ] + } }; }, watch: { @@ -79,40 +77,39 @@ immediate: true, handler(newval, oldval) { if (newval) { - const colors = ["#2eadd6", "#db3c3c"]; - - const seriesData = newval.map((data, index) => ({ - name: index === 0 ? "鎬婚噺" : "鏂板", - type: index === 0 ? "bar" : "line", - stack: index === 0 ? "鎬婚噺" : null, - data: data.map(value => ({value})), - barWidth: 68, - label: { - show: true, - position: "top" - }, - itemStyle: { - color: colors[index] + const series = newval.map((data, index) => ({ + name: index === 0 ? '鎬婚噺' : '鏂板', + type: 'line', + showSymbol: false,//鏄惁鏄剧ず鎶樼嚎涓婄殑鏍囪鐐� + smooth: true,//骞虫粦搴� + areaStyle: { + opacity: 1, //閫忔槑搴� }, emphasis: { - focus: "series" - } + focus: 'series' + }, + stack: index === 0 ? '鎬婚噺' : '鏂板', // 鏍规嵁 index 鍖哄垎鎬婚噺鍜屾柊澧炵殑鍫嗗彔鎯呭喌 + data: data.map(value => ({value})), + label: { + show: true, + position: 'top' + }, })); - this.chartOptions.series = seriesData; + this.chartOptions.series = series; } - }, + } }, - chartName:{ - handler(newval,oldval){ - if(newval){ + chartName: { + handler(newval, oldval) { + if (newval) { this.chartOptions.title.text = newval + "鏁版嵁缁熻" } }, - immediate:true, - deep:true + immediate: true, + deep: true } - }, + } }; </script> diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue index 549d206..40de37c 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue @@ -46,6 +46,15 @@ style="height: calc(100vh - 290px)" @node-click="nodeClick" > + <template slot-scope="{ node, data }" class="el-tree-node__label"> + <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" + open-delay="500" + placement="right-start"> + <span style="font-size: 14px;"> + {{ (node || {}).label }} + </span> + </el-tooltip> + </template> </avue-tree> </div> diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index 775856c..df22c8a 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -1,30 +1,37 @@ <template> <el-container> -<!-- <el-header class="businessHeader" style="height: 40px;padding:0 8px">--> + <!-- <el-header class="businessHeader" style="height: 40px;padding:0 8px">--> -<!-- </el-header>--> + <!-- </el-header>--> <el-container> <el-aside style="width: 20%"> <basic-container class="businessTreeContainer"> <div class="app"> <div style="display: flex;margin-bottom: 10px;justify-content: space-around;"> - <el-button v-if="permissionList.addBtn" size="mini" type="primary" @click="businessAdd" plain style="width: 60px"> + <el-button v-if="permissionList.addBtn" plain size="mini" style="width: 60px" type="primary" + @click="businessAdd"> 鏂板 </el-button> - <el-button v-if="permissionList.editBtn" size="mini" type="primary" @click="businessEdit" plain style="width: 60px"> + <el-button v-if="permissionList.editBtn" plain size="mini" style="width: 60px" type="primary" + @click="businessEdit"> 淇敼 </el-button> - <el-button v-if="permissionList.table" size="mini" type="primary" - @click="selectFromTable" plain> 浠庡凡鏈変腑鑾峰彇 + <el-button v-if="permissionList.table" plain size="mini" + type="primary" @click="selectFromTable"> 浠庡凡鏈変腑鑾峰彇 </el-button> </div> - <avue-tree :data="treeData" :option="treeOption" class="businessTree" @node-click="nodeClick" style="width: fit-content;"> - <template slot-scope="{ node, data }" class="el-tree-node__label"> - <span> + <avue-tree :data="treeData" :option="treeOption" class="businessTree" style="height: 70.3vh" + @node-click="nodeClick"> + <template slot-scope="{ node, data }" class="el-tree-node__label"> + <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" + open-delay="250" + placement="right-start"> + <span> <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i> {{ (node || {}).label }} </span> - </template> + </el-tooltip> + </template> </avue-tree> </div> @@ -87,17 +94,17 @@ </template> {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }} </el-descriptions-item> -<!-- <el-descriptions-item :contentStyle="descriptionOption.contentStyle"--> -<!-- :labelStyle="descriptionOption.labelStyle">--> -<!-- <template slot="label">--> -<!-- <i :class="icons.view"></i>--> -<!-- 瑙嗗浘--> -<!-- </template>--> -<!-- <el-tag v-if="obj.viewText" size="small">--> -<!-- {{ obj.viewText }}--> -<!-- </el-tag>--> -<!-- <span v-else></span>--> -<!-- </el-descriptions-item>--> + <!-- <el-descriptions-item :contentStyle="descriptionOption.contentStyle"--> + <!-- :labelStyle="descriptionOption.labelStyle">--> + <!-- <template slot="label">--> + <!-- <i :class="icons.view"></i>--> + <!-- 瑙嗗浘--> + <!-- </template>--> + <!-- <el-tag v-if="obj.viewText" size="small">--> + <!-- {{ obj.viewText }}--> + <!-- </el-tag>--> + <!-- <span v-else></span>--> + <!-- </el-descriptions-item>--> <!-- <el-descriptions-item> <template slot="label"> <i class="el-icon-arrow-down"></i> @@ -125,7 +132,8 @@ </avue-crud> </basic-container> </el-main> - <el-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" width="700px" @close="dialoghandelfalse" top="9vh"> + <el-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" top="9vh" width="700px" + @close="dialoghandelfalse"> 閫夋嫨棰嗗煙锛� <el-select v-model="domain" placeholder="璇烽�夋嫨" size="small" @change="refOnLoad"> <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value"> @@ -163,7 +171,7 @@ name: "Business", data() { return { - type:"", + type: "", //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙姸鎬� packageLifeBox: false, //鐗堟湰瑙勫垯鐘舵�� @@ -187,7 +195,7 @@ btmType: {}, }, loadOption: { - height:'auto', + height: 'auto', border: true, editBtn: false, addBtn: false, @@ -396,26 +404,27 @@ .app { - overflow: auto; + overflow-y: auto; height: 84.3vh; } -.app::-webkit-scrollbar { - height: 15px; // 绾靛悜婊氬姩鏉� 蹇呭啓 - background: white; - border: white; - width: 10px; - -} - -// 婊氬姩鏉$殑婊戝潡 -.app::-webkit-scrollbar-thumb { - width: 10px; - height: 10px; - background-color: #ececec; - border-radius: 20px; - border: #ececec; -} +// +//.app::-webkit-scrollbar { +// height: 15px; // 绾靛悜婊氬姩鏉� 蹇呭啓 +// background: white; +// border: white; +// width: 10px; +// +//} +// +//// 婊氬姩鏉$殑婊戝潡 +//.app::-webkit-scrollbar-thumb { +// width: 10px; +// height: 10px; +// background-color: #ececec; +// border-radius: 20px; +// border: #ececec; +//} </style> diff --git a/Source/UBCS-WEB/src/views/modeling/LinkType.vue b/Source/UBCS-WEB/src/views/modeling/LinkType.vue index e0f13fd..13e9fed 100644 --- a/Source/UBCS-WEB/src/views/modeling/LinkType.vue +++ b/Source/UBCS-WEB/src/views/modeling/LinkType.vue @@ -1,298 +1,306 @@ <template> - <el-container> - <!-- 椤剁鎸夐挳 --> + <el-container> + <!-- 椤剁鎸夐挳 --> - <!-- 渚ц竟鏍忔爲 --> - <el-container> - <el-aside style="width: 20%;"> - <basic-container class="businessTreeContainer"> - <div class="app"> - <div style="display: flex;margin-bottom: 10px;"> - <el-button type="primary" @click="linkTypeAdd" size="mini" v-if="permissionList.addBtn" plain> - 鏂板 - </el-button> - <el-button type="primary" @click="linkTypeEdit" size="mini" v-if="permissionList.editBtn" plain> - 淇敼 - </el-button> - </div> - <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick" - class="businessTree"> - <template class="el-tree-node__label" slot-scope="{ node, data }"> - <span> + <!-- 渚ц竟鏍忔爲 --> + <el-container> + <el-aside style="width: 20%;"> + <basic-container class="businessTreeContainer"> + <div class="app"> + <div style="display: flex;margin-bottom: 10px;"> + <el-button v-if="permissionList.addBtn" plain size="mini" type="primary" @click="linkTypeAdd"> + 鏂板 + </el-button> + <el-button v-if="permissionList.editBtn" plain size="mini" type="primary" @click="linkTypeEdit"> + 淇敼 + </el-button> + </div> + <avue-tree :data="treeData" :option="treeOption" class="businessTree" + @node-click="nodeClick"> + <template slot-scope="{ node, data }" class="el-tree-node__label"> + + <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" + open-delay="250" + placement="bottom"> + <span> <i class="el-icon-star-on"></i> {{ (node || {}).label }} </span> + </el-tooltip> + </template> + </avue-tree> + </div> + </basic-container> + </el-aside> + <el-container> + <el-main> + <basic-container> + <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p> + <el-descriptions :column="2" border class="margin-top" size="medium"> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.id"></i> + 鑻辨枃鍚嶇О + </template> + {{ obj.id }} + </el-descriptions-item> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.name"></i> + 涓枃鍚嶇О + </template> + {{ obj.name }} + </el-descriptions-item> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.tableName"></i> + 鏁版嵁搴撹〃鍚� + </template> + {{ obj.tableName }} + </el-descriptions-item> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.domain"></i> + 鎵�灞為鍩� + </template> + <el-tag v-if="obj.domainText" size="small"> + {{ obj.domainText }} + </el-tag> + </el-descriptions-item> + </el-descriptions> + <el-descriptions :column="2" border class="margin-top" direction="vertical"> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.from"></i> + From绔被鍨� + </template> + <span v-for="item in obj.fromBtmTypes" style="margin-left:2px;"> + <el-tag effect="plain" size="small" style="margin-top: 2px;"> + {{ item.id + '锛�' + item.name + '锛�' }} + </el-tag> + </span> + </el-descriptions-item> + <el-descriptions-item :contentStyle="descriptionOption.contentStyle" + :labelStyle="descriptionOption.labelStyle"> + <template slot="label"> + <i :class="icons.to"></i> + To娈电被鍨� + </template> + <span v-for="item in obj.toBtmTypes" style="margin-left:2px"> + <el-tag effect="plain" size="small" style="margin-top: 2px;"> + {{ item.id + '锛�' + item.name + '锛�' }} + </el-tag> + </span> + </el-descriptions-item> + </el-descriptions> + + <el-descriptions :column="2" border class="margin-top" size="medium"> + <!-- + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" + :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.main"></i> + 涓荤被鍨� </template> - </avue-tree> - </div> - </basic-container> - </el-aside> - <el-container> - <el-main> - <basic-container> - <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p> - <el-descriptions class="margin-top" :column="2" size="medium" border> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.id"></i> - 鑻辨枃鍚嶇О - </template> - {{ obj.id }} - </el-descriptions-item> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.name"></i> - 涓枃鍚嶇О - </template> - {{ obj.name }} - </el-descriptions-item> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.tableName"></i> - 鏁版嵁搴撹〃鍚� - </template> - {{ obj.tableName }} - </el-descriptions-item> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.domain"></i> - 鎵�灞為鍩� - </template> - <el-tag v-if="obj.domainText" size="small"> - {{ obj.domainText }} - </el-tag> - </el-descriptions-item> - </el-descriptions> - <el-descriptions class="margin-top" direction="vertical" :column="2" border> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.from"></i> - From绔被鍨� - </template> - <span v-for="item in obj.fromBtmTypes" style="margin-left:2px;"> - <el-tag size="small" effect="plain" style="margin-top: 2px;"> - {{ item.id + '锛�' + item.name + '锛�' }} - </el-tag> - </span> - </el-descriptions-item> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.to"></i> - To娈电被鍨� - </template> - <span v-for="item in obj.toBtmTypes" style="margin-left:2px"> - <el-tag size="small" effect="plain" style="margin-top: 2px;"> - {{ item.id + '锛�' + item.name + '锛�' }} - </el-tag> - </span> - </el-descriptions-item> - </el-descriptions> - - <el-descriptions class="margin-top" :column="2" size="medium" border> - <!-- - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.main"></i> - 涓荤被鍨� - </template> - {{ obj.fromBtmTypeName }} - </el-descriptions-item> - <el-descriptions-item :labelStyle="descriptionOption.labelStyle" - :contentStyle="descriptionOption.contentStyle"> - <template slot="label"> - <i :class="icons.main"></i> - 涓荤被鍨� - </template> - {{ obj.toBtmTypeName }} - </el-descriptions-item> - --> - <el-descriptions-item span='2' labelStyle="text-align:center;width:120px"> - <template slot="label"> - <i :class="icons.desc"></i> - 鎻忚堪 - </template> - {{ obj.description }} - </el-descriptions-item> - </el-descriptions> - </basic-container> - <!-- 灞炴�у垪琛�--> - <basic-container> - <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p> - <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"> - <template slot="attrDataTypeText" slot-scope="{row}"> - <el-tag>{{ row.attrDataTypeText }}</el-tag> - </template> - </avue-crud> - </basic-container> - </el-main> - </el-container> - </el-container> - <link-type-add ref="linkAdd" :linkType="addOption.linkType" :domainOption="domainOptions" :icons="icons" :linkStatus="linkStatus" - @refreshTable="initTreeOnLoad"> - </link-type-add> - + {{ obj.fromBtmTypeName }} + </el-descriptions-item> + <el-descriptions-item :labelStyle="descriptionOption.labelStyle" + :contentStyle="descriptionOption.contentStyle"> + <template slot="label"> + <i :class="icons.main"></i> + 涓荤被鍨� + </template> + {{ obj.toBtmTypeName }} + </el-descriptions-item> + --> + <el-descriptions-item labelStyle="text-align:center;width:120px" span='2'> + <template slot="label"> + <i :class="icons.desc"></i> + 鎻忚堪 + </template> + {{ obj.description }} + </el-descriptions-item> + </el-descriptions> + </basic-container> + <!-- 灞炴�у垪琛�--> + <basic-container> + <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p> + <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" class="attributeCrud"> + <template slot="attrDataTypeText" slot-scope="{row}"> + <el-tag>{{ row.attrDataTypeText }}</el-tag> + </template> + </avue-crud> + </basic-container> + </el-main> + </el-container> </el-container> + <link-type-add ref="linkAdd" :domainOption="domainOptions" :icons="icons" :linkStatus="linkStatus" + :linkType="addOption.linkType" + @refreshTable="initTreeOnLoad"> + </link-type-add> + + </el-container> </template> <script> import { - initTree, - refOnLoad, - getDomain, - saveFromTable, - getDetail + initTree, + refOnLoad, + getDomain, + saveFromTable, + getDetail } from "@/api/omd/linkType" import {mapGetters} from "vuex"; + export default { - name: "LinkType", - data() { - return { - linkStatus:'', - addOption: { - linkType: { - attributes:[] - }, - }, - domain: null, - domainOptions: [], - icons: { - id: 'el-icon-finished', - name: 'el-icon-tickets', - tableName: 'el-icon-date', - domain: 'el-icon-folder-opened', - from: 'el-icon-sort-down', - to: 'el-icon-sort-up', - main: 'el-icon-warning-outline', - desc: 'el-icon-chat-line-square' - }, - treeData: [], - descriptionOption: { - labelStyle: 'text-align:center;width:120px', - contentStyle: 'width:240px;text-align:center;word-break;break-all;' - }, - loadOption: { - border: true, - height: 'auto', - editBtn: false, - addBtn: false, - menu: false, - highlightCurrentRow: true, - refreshBtn: false, - columnBtn: false, - column: [ - { - label: '鑻辨枃鍚嶇О', - prop: 'id', - align: 'center' - }, { - label: '涓枃鍚嶇О', - prop: 'name', - align: 'center' - }, - { - label: '绫诲瀷', - prop: 'attrDataTypeText', - align: 'center', - slot: true - }, - { - label: '榛樿鍊�', - prop: 'defaultValue', - align: 'center' - }, - { - label: '璇存槑', - prop: 'description', - align: 'center' - } - ] - }, - obj: {}, - treeOption: { - height:'auto', - defaultExpandAll: true, - title: '閾炬帴绫诲瀷鏍�', - addBtn: false, - props: { - labelText: '', - label: 'label', - value: 'oid', - children: 'childList', - } - }, + name: "LinkType", + data() { + return { + linkStatus: '', + addOption: { + linkType: { + attributes: [] + }, + }, + domain: null, + domainOptions: [], + icons: { + id: 'el-icon-finished', + name: 'el-icon-tickets', + tableName: 'el-icon-date', + domain: 'el-icon-folder-opened', + from: 'el-icon-sort-down', + to: 'el-icon-sort-up', + main: 'el-icon-warning-outline', + desc: 'el-icon-chat-line-square' + }, + treeData: [], + descriptionOption: { + labelStyle: 'text-align:center;width:120px', + contentStyle: 'width:240px;text-align:center;word-break;break-all;' + }, + loadOption: { + border: true, + height: 'auto', + editBtn: false, + addBtn: false, + menu: false, + highlightCurrentRow: true, + refreshBtn: false, + columnBtn: false, + column: [ + { + label: '鑻辨枃鍚嶇О', + prop: 'id', + align: 'center' + }, { + label: '涓枃鍚嶇О', + prop: 'name', + align: 'center' + }, + { + label: '绫诲瀷', + prop: 'attrDataTypeText', + align: 'center', + slot: true + }, + { + label: '榛樿鍊�', + prop: 'defaultValue', + align: 'center' + }, + { + label: '璇存槑', + prop: 'description', + align: 'center' + } + ] + }, + obj: {}, + treeOption: { + height: 'auto', + defaultExpandAll: true, + title: '閾炬帴绫诲瀷鏍�', + addBtn: false, + props: { + labelText: '', + label: 'label', + value: 'oid', + children: 'childList', } - }, - computed:{ - ...mapGetters(["permission"]), - permissionList() { - return { - addBtn: this.vaildData(this.permission.modeling_LinkType.LinkType_add, false), - editBtn: this.vaildData(this.permission.modeling_LinkType.LinkType_edit, false), - } - } - }, - created() { - this.initTreeOnLoad(); - this.initDomainOption(); - }, - - methods: { - // 鏍戠偣鍑� - nodeClick(data) { - getDetail(data.oid).then(res => { - this.obj = res.data.data; - }) - }, - // 娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 - linkTypeAdd() { - this.$refs.linkAdd.linkType = {}; - this.linkStatus = 'add'; - this.$refs.linkAdd.showSubmitDialog = true; - }, - // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢 - linkTypeEdit() { - var linktype = this.obj; - linktype.fromBtmValues = this.obj.fromBtmTypes; - linktype.toBtmValues = this.obj.toBtmTypes; - linktype.attributes = this.obj.attributes; - var json = JSON.stringify(linktype); - this.addOption.linkType = JSON.parse(json); - this.$refs.linkAdd.linkType = this.addOption.linkType; - this.linkStatus = 'edit'; - this.$refs.linkAdd.showSubmitDialog = true; - }, - // 浠庡凡鏈変腑鑾峰彇鎸夐挳鐐瑰嚮浜嬩欢 - selectFromTable() { - - }, - // 鍔犺浇鏈嶅姟鏍� - initTreeOnLoad() { - initTree().then(res => { - this.treeData = res.data.data; - }); - }, - // 鍔犺浇鏈嶅姟涓嬫媺妗� - initDomainOption() { - getDomain().then(res => { - this.domainOptions = res.data.data; - }) - }, - + }, } + }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + addBtn: this.vaildData(this.permission.modeling_LinkType.LinkType_add, false), + editBtn: this.vaildData(this.permission.modeling_LinkType.LinkType_edit, false), + } + } + }, + created() { + this.initTreeOnLoad(); + this.initDomainOption(); + }, + + methods: { + // 鏍戠偣鍑� + nodeClick(data) { + getDetail(data.oid).then(res => { + this.obj = res.data.data; + }) + }, + // 娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 + linkTypeAdd() { + this.$refs.linkAdd.linkType = {}; + this.linkStatus = 'add'; + this.$refs.linkAdd.showSubmitDialog = true; + }, + // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢 + linkTypeEdit() { + var linktype = this.obj; + linktype.fromBtmValues = this.obj.fromBtmTypes; + linktype.toBtmValues = this.obj.toBtmTypes; + linktype.attributes = this.obj.attributes; + var json = JSON.stringify(linktype); + this.addOption.linkType = JSON.parse(json); + this.$refs.linkAdd.linkType = this.addOption.linkType; + this.linkStatus = 'edit'; + this.$refs.linkAdd.showSubmitDialog = true; + }, + // 浠庡凡鏈変腑鑾峰彇鎸夐挳鐐瑰嚮浜嬩欢 + selectFromTable() { + + }, + // 鍔犺浇鏈嶅姟鏍� + initTreeOnLoad() { + initTree().then(res => { + this.treeData = res.data.data; + }); + }, + // 鍔犺浇鏈嶅姟涓嬫媺妗� + initDomainOption() { + getDomain().then(res => { + this.domainOptions = res.data.data; + }) + }, + + } } </script> <style lang="scss" scoped> -.attributeCrud>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { - display: none !important; +.attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu { + display: none !important; } + .app { overflow: auto; height: 84.3vh; diff --git a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue index da3bcf1..093ef55 100644 --- a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue +++ b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue @@ -37,7 +37,7 @@ <el-option label="鎶樼嚎鍥�" value="0"></el-option> <el-option label="楗肩姸鍥�" value="1"></el-option> <el-option label="鏌辩姸鍥�" value="2"></el-option> - <el-option label="鏌辩姸鎶樼嚎鍥�" value="3"></el-option> + <el-option label="鍫嗗彔鎶樼嚎鍥�" value="3"></el-option> </el-select> </template> </el-table-column> diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java new file mode 100644 index 0000000..f20aa9c --- /dev/null +++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java @@ -0,0 +1,66 @@ +package com.vci.ubcs.system.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 涓绘暟鎹粺璁″璞� + * @author yuxc + * @date 2023/12/13 11:13 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName("PL_SYS_STATISTIC_CONFIG") +public class StatisticConfig implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 涓婚敭 + */ + @TableId + private Long id; + + /** + * 鐢ㄦ埛id + */ + private Long userId; + + /** + * 涓氬姟绫诲瀷 + */ + private String btmname; + + /** + * 鍥惧舰ids + */ + private String chartIds; + + /** + * 鍒涘缓鏃堕棿 + */ + private Date createtime; + /** + * 鍒涘缓浜� + */ + private String creator; + /** + * 淇敼鏃堕棿 + */ + private Date lastmodifytime; + /** + * 淇敼浜� + */ + private String lastmodifier; + /** + * + */ + private Date ts; +} diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java new file mode 100644 index 0000000..36ee16b --- /dev/null +++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java @@ -0,0 +1,16 @@ +package com.vci.ubcs.system.vo; + +import com.vci.ubcs.system.entity.MdmCountConfig; +import com.vci.ubcs.system.entity.StatisticConfig; +import lombok.Data; + +import java.util.List; + +/** + * @author ludc + * @date 2023/10/18 8:56 + */ +@Data +public class StatisticConfigVO extends StatisticConfig { + +} diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java new file mode 100644 index 0000000..a4d1453 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java @@ -0,0 +1,58 @@ +package com.vci.ubcs.system.controller; + +import com.vci.ubcs.system.entity.StatisticConfig; +import com.vci.ubcs.system.service.IMdmCountConfigService; +import com.vci.ubcs.system.service.IStatisticConfigService; +import com.vci.ubcs.system.vo.MdmCountConfigVO; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author yuxc + * @date 2023/12/13 15:47 + */ +@NonDS +@RestController +@AllArgsConstructor +@RequestMapping("/statisticConfig") +//@Api(value = "瀛楀吀", tags = "瀛楀吀") +public class StatisticConfigController { + + private final IStatisticConfigService statisticConfigService; + + /** + * 缁熻鍒嗘瀽淇濆瓨 + * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄 + * @return 鏁版嵁杩斿洖 + */ + @PostMapping("/saveStatisticAnalysis") + public R saveStatisticAnalysis(@RequestBody List<StatisticConfig> statisticConfigs){ + return statisticConfigService.saveStatisticConfig(statisticConfigs); + } + + /** + * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰 + * @param btmname 涓氬姟绫诲瀷 + * @param chartId 鍥惧舰ID + * @return 鎴愬姛涓庡惁 + */ + @PostMapping("/deleteChartId") + public R deleteChartId(String btmname,String chartId){ + return statisticConfigService.deleteChartId(btmname,chartId); + } + + /** + * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰� + * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D + */ + @GetMapping("/getBtmAndChartIds") + public R getBtmAndChartIds(){ + return statisticConfigService.getBtmAndChartIds(); + } + +} diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java new file mode 100644 index 0000000..01fdf6c --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java @@ -0,0 +1,12 @@ +package com.vci.ubcs.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.vci.ubcs.system.entity.StatisticConfig; + +/** + * @author ludc + * @date 2023/10/17 14:53 + */ +public interface StatisticConfigMapper extends BaseMapper<StatisticConfig> { + +} diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java new file mode 100644 index 0000000..352f766 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java @@ -0,0 +1,36 @@ +package com.vci.ubcs.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.vci.ubcs.system.entity.StatisticConfig; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 涓绘暟鎹粺璁¢椤甸厤缃湇鍔� + * @author ludc + * @date 2023/10/17 14:44 + */ +public interface IStatisticConfigService extends IService<StatisticConfig> { + + /** + * 缁熻鍒嗘瀽淇濆瓨 + * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄 + * @return 鏁版嵁杩斿洖 + */ + R saveStatisticConfig(List<StatisticConfig> statisticConfigs); + + /** + * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰 + * @param btmname 涓氬姟绫诲瀷 + * @param chartId 鍥惧舰ID + * @return 鎴愬姛涓庡惁 + */ + R deleteChartId(String btmname, String chartId); + + /** + * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰� + * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D + */ + R getBtmAndChartIds(); +} diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java new file mode 100644 index 0000000..1168900 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java @@ -0,0 +1,104 @@ +package com.vci.ubcs.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.vci.ubcs.system.entity.MdmCountConfig; +import com.vci.ubcs.system.entity.StatisticConfig; +import com.vci.ubcs.system.mapper.MdmCountConfigMapper; +import com.vci.ubcs.system.mapper.StatisticConfigMapper; +import com.vci.ubcs.system.service.IMdmCountConfigService; +import com.vci.ubcs.system.service.IStatisticConfigService; +import com.vci.ubcs.system.vo.MdmCountConfigVO; +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.Func; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 涓绘暟鎹粺璁¢椤甸厤缃湇鍔� + * @author ludc + * @date 2023/10/17 14:45 + */ +@Service +public class StatisticConfigServiceImpl extends ServiceImpl<StatisticConfigMapper, StatisticConfig> implements IStatisticConfigService { + /** + * 缁熻鍒嗘瀽淇濆瓨 + * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄 + * @return 鏁版嵁杩斿洖 + */ + @Override + public R saveStatisticConfig(List<StatisticConfig> statisticConfigs) { + + QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>(); + wrapper.eq("user_id", AuthUtil.getUser().getUserId()); + wrapper.in("btmname", statisticConfigs.stream().map(StatisticConfig::getBtmname).collect(Collectors.toList())); + List<StatisticConfig> list = this.list(wrapper); + statisticConfigs.stream().map(e ->{ + list.stream().filter(lis -> e.getBtmname().equals(lis.getBtmname())).forEach(lis->{ + e.setId(lis.getId()); + e.setTs(new Date()); + e.setCreator(lis.getCreator()); + e.setCreatetime(lis.getCreatetime()); + e.setLastmodifier(String.valueOf(AuthUtil.getUser().getUserId())); + e.setLastmodifytime(new Date()); + }); + if(e.getId() == null){ + e.setUserId(AuthUtil.getUser().getUserId()); + e.setTs(new Date()); + e.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); + e.setCreatetime(new Date()); + e.setLastmodifier(String.valueOf(AuthUtil.getUser().getUserId())); + e.setLastmodifytime(new Date()); + } + return e; + }).collect(Collectors.toList()); + + this.saveOrUpdateBatch(statisticConfigs); + + return R.success("鎿嶄綔鎴愬姛锛�"); + } + + /** + * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰 + * @param btmname 涓氬姟绫诲瀷 + * @param chartId 鍥惧舰ID + * @return 鎴愬姛涓庡惁 + */ + @Override + public R deleteChartId(String btmname, String chartId) { + + QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>(); + wrapper.eq("user_id", AuthUtil.getUser().getUserId()); + wrapper.in("btmname",btmname); + StatisticConfig statisticConfig = this.getOne(wrapper); + if(StringUtil.isBlank(statisticConfig.getChartIds())){ + throw new ServiceException("鏈煡鍒板巻鍙茬浉鍏冲浘褰㈡暟鎹紝璇峰厛淇濆瓨锛侊紒"); + } + List<String> chartIds = new ArrayList(Arrays.asList(statisticConfig.getChartIds().split(","))); + chartIds.remove(chartId); + statisticConfig.setChartIds(chartIds.stream().collect(Collectors.joining(","))); + this.updateById(statisticConfig); + return R.success("鎿嶄綔鎴愬姛锛侊紒"); + } + + /** + * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰� + * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D + */ + @Override + public R getBtmAndChartIds() { + QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>(); + wrapper.eq("user_id", AuthUtil.getUser().getUserId()); + List<StatisticConfig> list = this.list(wrapper); + Map<String, String> collect = list.stream().collect(Collectors.toMap(StatisticConfig::getBtmname, StatisticConfig::getChartIds)); + return R.data(collect); + } + +} diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml new file mode 100644 index 0000000..384de10 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.vci.ubcs.system.mapper.StatisticConfigMapper"> + + + +</mapper> -- Gitblit v1.9.3