From e9a590e862148092027510b15d33cdd32691a6f5 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 06 十二月 2023 09:43:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/api/statistic/chart.js | 11
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeService.java | 3
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 93 +++--
Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue | 9
Source/UBCS-WEB/src/api/GetItem.js | 10
Source/UBCS-WEB/src/views/system/user.vue | 8
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java | 6
Source/UBCS-WEB/src/views/statistic/statisticPage.vue | 165 +++-----
Source/UBCS-WEB/src/styles/sidebar.scss | 8
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java | 14
Source/UBCS-WEB/src/config/website.js | 4
Source/UBCS-WEB/src/views/modeling/cycle.vue | 2
Source/UBCS-WEB/src/page/index/sidebar/sidebarItem.vue | 220 ++++++------
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 2
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 75 ++--
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/DefaultAttrAssimtUtil.java | 163 ++++++++
Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue | 18 +
Source/UBCS-WEB/src/page/index/sidebar/index.vue | 1
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java | 6
Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 10
Source/UBCS-WEB/src/components/FormTemplate/index.vue | 17
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 89 +++++
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 4
Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue | 2
Source/UBCS-WEB/src/components/BatchImport/index.vue | 50 +-
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java | 11
26 files changed, 642 insertions(+), 359 deletions(-)
diff --git a/Source/UBCS-WEB/src/api/GetItem.js b/Source/UBCS-WEB/src/api/GetItem.js
index f8c50ce..a0cc5fa 100644
--- a/Source/UBCS-WEB/src/api/GetItem.js
+++ b/Source/UBCS-WEB/src/api/GetItem.js
@@ -126,3 +126,13 @@
}
})
}
+
+//闆嗗洟鐮佹ā鏉夸笅杞�
+export const exportGroupCodeExcel = (params) => {
+ return request({
+ url: '/api/ubcs-code/mdmEngineController/exportGroupCodeExcel',
+ method: 'get',
+ params,
+ responseType: 'blob'
+ })
+}
diff --git a/Source/UBCS-WEB/src/api/statistic/chart.js b/Source/UBCS-WEB/src/api/statistic/chart.js
new file mode 100644
index 0000000..9806a7e
--- /dev/null
+++ b/Source/UBCS-WEB/src/api/statistic/chart.js
@@ -0,0 +1,11 @@
+
+import request from '@/router/axios';
+
+//缁熻鍒嗘瀽鏁版嵁
+export const getStatisticAnalysis = (params) => {
+ return request({
+ url: '/api/ubcs-code/mdmEngineController/getStatisticAnalysis',
+ method: 'get',
+ params
+ })
+}
diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue
index 45efd2b..29cfe88 100644
--- a/Source/UBCS-WEB/src/components/BatchImport/index.vue
+++ b/Source/UBCS-WEB/src/components/BatchImport/index.vue
@@ -13,7 +13,7 @@
</li>
</ul>
<div
- v-show="currentTypeObj[type]['upParams'] === 'classifyAttr' && this.type !== 'bulkEdit'"
+ v-show="currentTypeObj[type]['upParams'] === 'classifyAttr' && this.type !== 'bulkEdit'&& this.type !== 'groupCode'"
class="radio_box"
>
<span>鍒嗙被鐨勮矾寰勪娇鐢ㄧ殑灞炴��:</span>
@@ -61,21 +61,23 @@
>
</el-upload>
<template #footer>
- <el-button
- v-if="type !== 'bulkEdit'"
- :loading="downloadLoading"
- size="small"
- type="primary"
- @click="downloadTemplateFun"
- >涓嬭浇瀵煎叆妯℃澘
- </el-button>
- <el-button v-if="type === 'bulkEdit'"
- :loading="downloadLoading"
- size="small"
- type="primary"
- @click="downloadTemplateFun"
- >涓嬭浇缂栬緫妯℃澘
- </el-button>
+ <div v-if="type !== 'groupCode'">
+ <el-button
+ v-if="type !== 'bulkEdit' "
+ :loading="downloadLoading"
+ size="small"
+ type="primary"
+ @click="downloadTemplateFun"
+ >涓嬭浇瀵煎叆妯℃澘
+ </el-button>
+ <el-button v-if="type === 'bulkEdit'"
+ :loading="downloadLoading"
+ size="small"
+ type="primary"
+ @click="downloadTemplateFun"
+ >涓嬭浇缂栬緫妯℃澘
+ </el-button>
+ </div>
<el-button size="small" @click="dialogVisible = false">鍏抽棴</el-button>
</template>
<ShowImportData
@@ -248,6 +250,15 @@
downloadTemplateFun: downloadBatchApplyCodeTemplate,
upParams: "classifyAttr",
},
+ groupCode: {
+ title: "闆嗗洟鐮佸鍏�",
+ tipList: [
+ "1.鏍囬甯︿簲瑙掓槦鐨勮〃绀哄叧閿睘鎬э紝甯︽槦鍙疯〃绀哄繀杈撻」",
+ "2.姣忔浠呰兘鏈�澶氬鍏�5000鏉℃暟鎹�(鍙�氳繃nacos杩涜閰嶇疆锛屾帹鑽�5000/娆″鍏�)锛屽鏋滃嚭閿欎細杩斿洖閿欒鐨勬暟鎹拰鍘熷洜锛屼絾鏄纭暟鎹彲浠ョ户缁繚瀛�",
+ "3.Excel绗竴琛屽拰绗簩琛屼緷娆′负浼佷笟缂栫爜鍜岄泦鍥㈢紪鐮侊紙蹇呭~锛�"
+ ],
+ action: "/api/ubcs-code/mdmEngineController/importGroupCode"
+ }
},
secDTOList: [],
};
@@ -291,16 +302,9 @@
return;
}
if (this.type === 'bulkEdit') {
- this.tableHeadFindData.map(item => item.prop)
- .forEach((prop, index) => {
- this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
- });
downloadExcelBatchEdit({
codeClassifyOid: this.codeClassifyOid,
- 'conditionMap[oid]': this.ids, ...this.exportArrTwo,
- limit: -1
}).then(res => {
- // console.log('res',res)
if (res) {
func.downloadFileByBlobHandler(res);
this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�')
diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
index e75483c..d583d02 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue
@@ -103,9 +103,14 @@
type: String,
default: "",
},
+ selectRow:{
+ type:Array,
+ default:[]
+ }
},
data() {
return {
+ selectValue:"",
//骞翠唬鍙�
dataYearCode: {
type: "",
@@ -206,6 +211,15 @@
handler(newV) {
this.$emit("dataYearCode", newV)
}
+ },
+ selectRow:{
+ handler(newval){
+ console.log(newval);
+ let ids = newval.map(item => item.id);
+ this.selectValue= ids.join(",");
+ },
+ deep:true,
+ immediate:true
}
},
methods: {
@@ -320,7 +334,9 @@
value:formItem.defaultValue || (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) ||
(formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) ||
(formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) ||
- (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null),
+ (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null) ||
+ //鐖剁粍浠跺鏋滄槸鍙傜収鏁版嵁浼氬皢selectRow缃┖,selectRow涓嶄负绌哄氨璇存槑涓嶆槸鍙傜収瑕佸洖濉簮鏍囧噯鍙锋暟鎹�
+ (this.status === "amend" ? (this.selectRow && (formItem.field === "oldcode" ? this.selectValue : null)) : null),
placeholder: formItem.inputTip,
comboxKey: formItem.comboxKey,
tip: formItem.tooltips,
diff --git a/Source/UBCS-WEB/src/components/FormTemplate/index.vue b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
index 561cb91..6d01849 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/index.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -14,6 +14,7 @@
v-if="dialogVisible" key="masterForm"
ref="FormTemplate"
v-bind="$attrs"
+ :selectRow="selectRow"
:TreeValue="TreeValue"
:eventList="eventList"
:rowOid="rowOid"
@@ -41,6 +42,8 @@
:selfColumnConfig="selfColumnConfig"
:selfColumnType="selfColumnType"
:type="type"
+ :status="status"
+ :selectRow="selectRow"
data-key="codeApplyForm"
secDTOListv-bind="$attrs"
@attrList="attrListForm"
@@ -139,6 +142,10 @@
type: Object,
default: () => ({}),
},
+ selectRow:{
+ type:Array,
+ default:[]
+ }
},
data() {
return {
@@ -242,15 +249,11 @@
},
},
watch: {
- codeApplyForm: {
- handler(newval, oldval) {
- // console.log('newval',newval)
- }
- }
+
},
methods: {
openDialog() {
- //鏂板鍜屼慨鏀瑰叡鍚岃皟鐢�
+ //鏂板鍜屼慨鏀瑰叡鍚岃皟鐢�(鏈夋敼鍔� 涓嶉渶瑕佸湪浣跨敤edit锛屾柟娉曟病浠�涔堝奖鍝�)
this.getFormTemplate();
if (this.type === "add" || (this.type !== "add" && this.status === "amend")) {
this.getCodeRule();
@@ -473,7 +476,7 @@
secValue: this.codeApplyForm[item.oid],
};
});
- //鏍囧噯鐗瑰畾
+ //鏍囧噯鐗瑰畾瀛楁鏄犲皠
const mappings = {
codeStandardEditType: 'operationType',
reviseSeries: 'series',
diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
index df6a0b6..a2b1391 100644
--- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
+++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -99,9 +99,9 @@
</FormTemplateDialog>
<!-- 淇-->
<FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid"
- :disabledProp="disabledProp" :rowOid="rowOid" :templateOid="templateOid" :title="'淇敼缂栫爜淇℃伅'"
- :visible.sync="amendvisible" status="amend"
- type="edit" @submit="amendSumbit"></FormTemplateDialog>
+ :disabledProp="disabledProp" :templateOid="templateOid" :title="'鏁版嵁淇'"
+ :visible.sync="amendvisible" status="amend" :selectRow="selectRow"
+ type="add" @submit="amendSumbit"></FormTemplateDialog>
<!-- 鏂板-->
<FormTemplateDialog :TreeValue="TreeValue" :codeClassifyOid="this.codeClassifyOid"
:codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" :templateOid="templateOid"
@@ -113,7 +113,7 @@
<FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid"
:disabledProp="disabledProp" :templateOid="templateOid" :title="'淇敼缂栫爜淇℃伅'"
:visible.sync="editvisible"
- rowOid="rowOid"
+ :rowOid="rowOid"
type="edit" @submit="EditSumbit"></FormTemplateDialog>
<!-- 鎵归噺缂栬緫-->
<!-- <MasterEditBulk :visible.sync="bulkeditvisible" ></MasterEditBulk>-->
@@ -187,7 +187,8 @@
upSaveCode,
applyGroupCode,
receiveEditApply,
- applySaveCode
+ applySaveCode,
+ exportGroupCodeExcel
} from "@/api/GetItem";
import {processTS, changeStatus} from "@/api/template/setPersonnel"
import {listCodeAttributeByClassId} from "@/api/integration/integration.js";
@@ -432,14 +433,13 @@
}
})
this.tableHeadFindDatas = newval;
- // console.log('new',newval)
if (!this.isCodeArrayPushed) {
if (newval.find(item => item.prop === 'id')) {
this.CodeArray.push(newval.find(item => item.prop === 'id'));
} else {
- this.CodeArray.push([]);
+ // this.CodeArray.push([]);
+ this.CodeArray = [];
}
- // console.log('CodeArray', this.CodeArray);
this.isCodeArrayPushed = true;
}
if (!this.islcstatusPushed) {
@@ -485,8 +485,7 @@
this.LinkObject = row;
this.LinkVisible = true;
this.LinkList = Object.keys(row).map(property => property)
- // console.log(result);
- // console.log(this.LinkObject)
+
},
//鐘舵�佹悳绱�
cellSelectHandler(row) {
@@ -554,7 +553,34 @@
if (uniqueFlag === 'CODEAMEND') return this.codeAMENDHandler()
//鎵归噺缂栬緫
if (uniqueFlag === 'bulkEdit') return this.bulkEditHandler("bulkEdit")
+ //闆嗗洟鐮佸鍑�
+ if (uniqueFlag === 'excelGroupCode') return this.excelGroupCode()
+ //闆嗗洟鐮佸鍏�
+ if (uniqueFlag === 'importGroupCode') return this.importGroupCode("groupCode")
});
+ },
+ importGroupCode(type){
+ this.batchImportData.visible = true
+ this.batchImportData.type = type
+ this.batchImportData.codeClassifyOid = this.codeClassifyOid
+ },
+ //闆嗗洟鐮佸鍑�
+ excelGroupCode(){
+ debugger
+ this.isLoading = true;
+ exportGroupCodeExcel({
+ codeClassifyOid: this.codeClassifyOid,
+ }).then(res => {
+ console.log(res.data)
+ if (res) {
+ func.downloadFileByBlobHandler(res);
+ this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�');
+ this.isLoading = false;
+ }
+ }).catch(error=>{
+ this.$message.error(error);
+ this.isLoading = false;
+ })
},
//鏍囧噯鐢宠
codeApplyHandler() {
@@ -589,45 +615,49 @@
//鏍囧噯淇
codeAMENDHandler() {
let foundItem = false;
-
this.tableHeadFindData.forEach(item => {
if (item.field === "oldcode" && Object.keys(item.referConfig).length >= 1) {
foundItem = true;
}
});
-
if (foundItem) {
- this.amendvisible = true;
- this.rowOid = this.selectRow[0].oid;
+ if(this.selectRow.length >= 1){
+ this.$confirm('宸叉湁鍙傜収鏄惁鍙栨秷鍕鹃�夌户缁墽琛岋紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.selectRow = [];
+ //鍙栨秷鍕鹃�夌姸鎬�
+ this.$refs.dataTable.clearSelection();
+ this.amendvisible = true;
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝綋鍓嶆搷浣�'
+ });
+ });
+ }else {
+ this.amendvisible = true;
+ }
} else {
- if (this.selectRow.length !== 1) {
- this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ if (this.selectRow.length <= 0) {
+ this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�");
} else {
this.amendvisible = true;
- this.rowOid = this.selectRow[0].oid;
+
}
}
},
//鎵归噺缂栬緫
bulkEditHandler(type) {
- // console.log(this.nodeClickList)
if (this.nodeClickList.children.length >= 1) {
this.$message.warning('褰撳墠閫夋嫨鐨勫垎绫讳笉鏄彾瀛愯妭鐐癸紝涓嶅厑璁告壒閲忕紪杈戯紒')
return;
}
- if (this.selectRow.length <= 0) {
- this.$message.warning('璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹紒')
- return;
- }
- const Editing = this.selectRow.every(item => item.lcstatus === 'Editing');
-
- if (Editing) {
this.batchImportData.visible = true
this.batchImportData.type = type
this.batchImportData.codeClassifyOid = this.codeClassifyOid
- } else {
- this.$message.warning('閫夋嫨鐨勬暟鎹腑鏈夌紪鐮佺姸鎬佷笉鏄�滅紪杈戜腑鈥濓紝涓嶅彲缂栬緫锛�');
- }
},
addSaveHandler() {
this.$nextTick(() => {
@@ -639,10 +669,6 @@
if (this.selectRow.length <= 0) {
this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹ā鏉匡紒')
} else {
- // const requestData = this.selectRow.forEach(item => {
- // return { oids: item.oid, btmName: item.btmname };
- // });
-
const oids = this.selectRow.map(item => item.oid).join(',');
applyGroupCode({oids, btmName: this.selectRow[0].btmname}).then(res => {
if (res.data.code == 200) {
@@ -657,9 +683,6 @@
if (this.selectRow.length <= 0) {
this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹ā鏉匡紒')
} else {
- // const requestData = this.selectRow.forEach(item => {
- // return { oids: item.oid, btmName: item.btmname };
- // });
const oids = this.selectRow.map(item => item.oid).join(',');
receiveEditApply({oids, btmName: this.selectRow[0].btmname}).then(res => {
if (res.data.code == 200) {
diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue
index 065c234..050e580 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 = ["#91CC75", "#5470C6"];
+ let colors = ['#2eadd6', '#FFA500'];
const seriesData = [];
for (let i = 0; i < newval.length; i++) {
@@ -50,7 +50,7 @@
value: newval[i][j],
itemStyle: {
normal: {
- barBorderRadius: borderRadius, // 璁剧疆鍦嗚
+ // barBorderRadius: borderRadius, // 璁剧疆鍦嗚
color: colors[i],
}
},
@@ -65,7 +65,10 @@
data: curSeriesData,
label: {
show: true,
- position: 'top'
+ position: 'top',
+ formatter: function (params) {
+ return params.value === 0 ? '' : params.value; // 鍊间负 0 涓嶆樉绀猴紝鍏朵粬鎯呭喌鏄剧ず
+ }
},
emphasis: {
focus: "series",
diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue
index c9c5034..600df00 100644
--- a/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue
+++ b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue
@@ -79,7 +79,7 @@
immediate: true,
handler(newval, oldval) {
if (newval) {
- const colors = ["#8fef5b", "#db3c3c"];
+ const colors = ["#2eadd6", "#db3c3c"];
const seriesData = newval.map((data, index) => ({
name: index === 0 ? "鎬婚噺" : "鏂板",
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
index 3ee51de..0f83ebf 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -376,7 +376,7 @@
</el-option>
</el-select>
<el-switch
- v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" v-show="!AddCellFlag"
+ v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true"
inactive-value="false">
</el-switch>
<span v-else>{{ row[item.prop] }}</span>
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 306e91f..72f90ae 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -40,12 +40,12 @@
</div>
</div>
<!-- 宸︿晶鏍�-->
- <div style="height: calc(100vh - 230px);overflow: auto">
+ <div style="height: calc(100vh - 230px);overflow: auto;">
<avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
:defaultExpandAll="false"
:option="Treeoption"
class="classifyTree"
- style="height: calc(100vh - 280px)"
+ style="height: calc(100vh - 280px);"
@node-click="nodeClick"
>
</avue-tree>
diff --git a/Source/UBCS-WEB/src/config/website.js b/Source/UBCS-WEB/src/config/website.js
index b4ecaac..9c6c3db 100644
--- a/Source/UBCS-WEB/src/config/website.js
+++ b/Source/UBCS-WEB/src/config/website.js
@@ -38,7 +38,7 @@
label: 'name',
path: 'path',
icon: 'source',
- children: 'children'
+ children: 'children',
}
},
// 绗笁鏂圭郴缁熸巿鏉冨湴鍧�
@@ -49,4 +49,4 @@
ssoUrl:'http://localhost:37000/ubcs-auth/oauth/authorize?client_id=sword&response_type=111&redirect_uri=',
// 鍗曠偣鐧诲綍鍥炶皟鍦板潃(Saber鏈嶅姟鐨勫湴鍧�)
redirectUri: 'http://localhost:38000',
-}
\ No newline at end of file
+}
diff --git a/Source/UBCS-WEB/src/page/index/sidebar/index.vue b/Source/UBCS-WEB/src/page/index/sidebar/index.vue
index 476af59..587d39a 100644
--- a/Source/UBCS-WEB/src/page/index/sidebar/index.vue
+++ b/Source/UBCS-WEB/src/page/index/sidebar/index.vue
@@ -51,6 +51,5 @@
.title{
color: red;
}
-
</style>
diff --git a/Source/UBCS-WEB/src/page/index/sidebar/sidebarItem.vue b/Source/UBCS-WEB/src/page/index/sidebar/sidebarItem.vue
index 2693e31..5914522 100644
--- a/Source/UBCS-WEB/src/page/index/sidebar/sidebarItem.vue
+++ b/Source/UBCS-WEB/src/page/index/sidebar/sidebarItem.vue
@@ -2,145 +2,151 @@
<div class="menu-wrapper">
<template v-for="item in menu">
<el-menu-item v-if="validatenull(item[childrenKey]) && vaildRoles(item)"
- :index="item[pathKey]"
- @click="open(item)"
:key="item[labelKey]"
- :class="{'is-active':vaildActive(item)}">
+ :class="{'is-active':vaildActive(item)}"
+ :index="item[pathKey]"
+ @click="open(item)">
<i :class="item[iconKey]"></i>
<span slot="title"
- :alt="item[pathKey]">{{generateTitle(item)}}</span>
+ :alt="item[pathKey]">{{ generateTitle(item) }}</span>
</el-menu-item>
<el-submenu v-else-if="!validatenull(item[childrenKey])&&vaildRoles(item)"
- :index="item[pathKey]"
- :key="item[labelKey]">
+ :key="item[labelKey]"
+ :index="item[pathKey]">
<template slot="title">
<i :class="item[iconKey]"></i>
<span slot="title"
- :class="{'el-menu--display':collapse && first}">{{generateTitle(item)}}</span>
+ :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span>
</template>
<template v-for="(child,cindex) in item[childrenKey]">
- <el-menu-item :index="child[pathKey],cindex"
- @click="open(child)"
+ <el-menu-item v-if="validatenull(child[childrenKey])"
+ :key="child[labelKey]"
:class="{'is-active':vaildActive(child)}"
- v-if="validatenull(child[childrenKey])"
- :key="child[labelKey]">
+ :index="child[pathKey],cindex"
+ @click="open(child)">
<i :class="child[iconKey]"></i>
- <span slot="title">{{generateTitle(child)}}</span>
+ <span slot="title">{{ generateTitle(child) }}</span>
</el-menu-item>
<sidebar-item v-else
- :menu="[child]"
:key="cindex"
+ :collapse="collapse"
+ :menu="[child]"
:props="props"
- :screen="screen"
- :collapse="collapse"></sidebar-item>
+ :screen="screen"></sidebar-item>
</template>
</el-submenu>
</template>
</div>
</template>
<script>
- import {mapGetters} from "vuex";
- import {isURL, validatenull} from "@/util/validate";
- import config from "./config.js";
+import {mapGetters} from "vuex";
+import {isURL, validatenull} from "@/util/validate";
+import config from "./config.js";
- export default {
- name: "sidebarItem",
- data() {
- return {
- config: config
- };
+export default {
+ name: "sidebarItem",
+ data() {
+ return {
+ config: config
+ };
+ },
+ props: {
+ menu: {
+ type: Array
+ },
+ screen: {
+ type: Number
+ },
+ first: {
+ type: Boolean,
+ default: false
},
props: {
- menu: {
- type: Array
- },
- screen: {
- type: Number
- },
- first: {
- type: Boolean,
- default: false
- },
- props: {
- type: Object,
- default: () => {
- return {};
- }
- },
- collapse: {
- type: Boolean
+ type: Object,
+ default: () => {
+ return {};
}
},
- created() {
+ collapse: {
+ type: Boolean
+ }
+ },
+ created() {
+ },
+ mounted() {
+ },
+ computed: {
+ ...mapGetters(["roles"]),
+ labelKey() {
+ return this.props.label || this.config.propsDefault.label;
},
- mounted() {
+ pathKey() {
+ return this.props.path || this.config.propsDefault.path;
},
- computed: {
- ...mapGetters(["roles"]),
- labelKey() {
- return this.props.label || this.config.propsDefault.label;
- },
- pathKey() {
- return this.props.path || this.config.propsDefault.path;
- },
- iconKey() {
- return this.props.icon || this.config.propsDefault.icon;
- },
- childrenKey() {
- return this.props.children || this.config.propsDefault.children;
- },
- isOpenKey() {
- return this.props.isOpen || this.config.propsDefault.isOpen;
- },
- nowTagValue() {
- return this.$router.$avueRouter.getValue(this.$route);
+ iconKey() {
+ return this.props.icon || this.config.propsDefault.icon;
+ },
+ childrenKey() {
+ return this.props.children || this.config.propsDefault.children;
+ },
+ isOpenKey() {
+ return this.props.isOpen || this.config.propsDefault.isOpen;
+ },
+ nowTagValue() {
+ return this.$router.$avueRouter.getValue(this.$route);
+ }
+ },
+ methods: {
+ generateTitle(item) {
+ return this.$router.$avueRouter.generateTitle(
+ item[this.labelKey],
+ (item.meta || {}).i18n
+ );
+ },
+ vaildActive(item) {
+ if (this.validIsOpen(item)) {
+ return false;
+ }
+ const groupFlag = (item["group"] || []).some(ele =>
+ this.$route.path.includes(ele)
+ );
+ return this.nowTagValue === item[this.pathKey] || groupFlag;
+ },
+ vaildRoles(item) {
+ item.meta = item.meta || {};
+ return item.meta.roles ? item.meta.roles.includes(this.roles) : true;
+ },
+ validatenull(val) {
+ return validatenull(val);
+ },
+ validIsOpen(item) {
+ if (item[this.isOpenKey] === 2 && isURL(item[this.pathKey])) {
+ return true;
}
},
- methods: {
- generateTitle(item) {
- return this.$router.$avueRouter.generateTitle(
- item[this.labelKey],
- (item.meta || {}).i18n
- );
- },
- vaildActive(item) {
- if (this.validIsOpen(item)) {
- return false;
- }
- const groupFlag = (item["group"] || []).some(ele =>
- this.$route.path.includes(ele)
- );
- return this.nowTagValue === item[this.pathKey] || groupFlag;
- },
- vaildRoles(item) {
- item.meta = item.meta || {};
- return item.meta.roles ? item.meta.roles.includes(this.roles) : true;
- },
- validatenull(val) {
- return validatenull(val);
- },
- validIsOpen(item) {
- if (item[this.isOpenKey] === 2 && isURL(item[this.pathKey])) {
- return true;
- }
- },
- open(item) {
- if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
- if (this.validIsOpen(item)) {
- window.open(item[this.pathKey]);
- } else {
- this.$router.$avueRouter.group = item.group;
- this.$router.$avueRouter.meta = item.meta;
- this.$router.push({
- path: this.$router.$avueRouter.getPath({
- name: item[this.labelKey],
- src: item[this.pathKey]
- }, item.meta),
- query: item.query
- });
- }
+ open(item) {
+ if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
+ if (this.validIsOpen(item)) {
+ window.open(item[this.pathKey]);
+ } else {
+ this.$router.$avueRouter.group = item.group;
+ this.$router.$avueRouter.meta = item.meta;
+ this.$router.push({
+ path: this.$router.$avueRouter.getPath({
+ name: item[this.labelKey],
+ src: item[this.pathKey]
+ }, item.meta),
+ query: item.query
+ });
}
}
- };
+ }
+};
</script>
+<style lang="scss" scoped>
+.el-menu-item:focus, .el-menu-item:hover {
+ outline: 0;
+ background-color: #060708;
+}
+</style>
diff --git a/Source/UBCS-WEB/src/styles/sidebar.scss b/Source/UBCS-WEB/src/styles/sidebar.scss
index f4995d7..3ceec84 100644
--- a/Source/UBCS-WEB/src/styles/sidebar.scss
+++ b/Source/UBCS-WEB/src/styles/sidebar.scss
@@ -27,10 +27,10 @@
}
}
}
-
+
}
.avue-sidebar {
- user-select: none;
+ user-select: none;
position: relative;
padding-top: 60px;
height: 100%;
@@ -87,5 +87,5 @@
}
}
}
-
-}
\ No newline at end of file
+
+}
diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
index b5cc7aa..5cb22bb 100644
--- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -1,4 +1,4 @@
-<template>
+ <template>
<el-dialog
title="涓氬姟绫诲瀷"
:visible.sync="showSubmitDialog"
@@ -11,7 +11,7 @@
<el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm"
:rules="rules" @resetFields="resetForm" status-icon="true">
<el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true" prop="id">
- <el-input v-model="btmType.id" :prefix-icon="icons.key"></el-input>
+ <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="涓枃鍚嶇О" label-width="100px">
<el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
@@ -232,7 +232,8 @@
{
label: '鑻辨枃鍚嶇О',
prop: 'id',
- align: 'center'
+ align: 'center',
+ disabled:true
}, {
label: '涓枃鍚嶇О',
prop: 'name',
@@ -284,6 +285,7 @@
prop: 'id',
align: 'left',
search: true,
+ disabled:true,
width: 230
}, {
label: '涓枃鍚嶇О',
@@ -356,6 +358,7 @@
{
label: '鑻辨枃鍚嶇О',
prop: 'id',
+ disabled:true,
search: true
},
{
@@ -420,6 +423,7 @@
{
label: '鑻辨枃鍚嶇О',
prop: 'id',
+ disabled:true,
search: true
},
{
diff --git a/Source/UBCS-WEB/src/views/modeling/cycle.vue b/Source/UBCS-WEB/src/views/modeling/cycle.vue
index 0fc23e9..6f00942 100644
--- a/Source/UBCS-WEB/src/views/modeling/cycle.vue
+++ b/Source/UBCS-WEB/src/views/modeling/cycle.vue
@@ -229,6 +229,8 @@
const nodes = res.data.data.nodes.map((item) => {
item.label = item.id;
item.index = item.indexNum;
+ item.x = Number(item.x);
+ item.y = Number(item.y);
return item;
});
const edges = res.data.data.edges.map((item) => {
diff --git a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
index 316ba94..9403436 100644
--- a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
+++ b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue
@@ -13,6 +13,7 @@
top="-50px"
>
<el-table
+ ref="table"
:data="tableData"
border
style="width: 100%"
@@ -65,6 +66,8 @@
import pieChart from "../../components/StatisticsComponent/pieChart"
import ColumnarChart from "../../components/StatisticsComponent/ColumnarChart"
import mixCart from "../../components/StatisticsComponent/mixCart"
+import {getStatisticAnalysis} from "@/api/statistic/chart"
+import {getList} from "@/api/system/statistic";
export default {
components: {
@@ -76,6 +79,8 @@
name: "statisticPage",
data() {
return {
+ menuList:[],
+ dataKeyList: [],
addVisible: false,
chartName: "",
lineList: [],
@@ -83,99 +88,19 @@
columnarList: [],
mixList: [],
selectData: [],
- tableData: [
- {
- menuName: "宸ヨ壓鏂囦欢",
- codeType: "1",
- menuData: [
- [222, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "娴嬭瘯sc",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜у搧鍨嬪彿",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鍥哄畾璧勪骇",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鏉庤埅涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "Part",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜哄憳涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "浜哄憳",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鏍囧噯",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鐗╁搧涓绘暟鎹�",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- },
- {
- menuName: "鍨嬪彿",
- codeType: null,
- menuData: [
- [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234],
- [120, 132, 101, 134, 90, 230, 210, 130, 10, 122, 100, 80],
- ]
- }
- ]
+ tableData: []
}
},
+ created() {
+ this.getMasterList()
+ },
methods: {
+ getMasterList() {
+ const userId = localStorage.getItem('userId');
+ getList({userId: userId}).then(res => {
+ this.tableData = res.data.data;
+ })
+ },
//鏂板
addHandler() {
this.addVisible = true;
@@ -190,7 +115,50 @@
this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒');
return;
}
+ let codeStatus = this.selectData.every(key => key.codeType)
+ if (!codeStatus) {
+ this.$message.warning("璇锋鏌ュ凡鍕鹃�夋暟鎹被鍨嬫槸鍚︿负绌猴紒");
+ return;
+ }
+ this.dataKeyList = this.selectData.map(obj => obj.code)
+ const btmName = this.dataKeyList.join(",");
+ if (btmName) {
+ // this.menuList=[
+ // {
+ // menuData: [
+ // [0, 0, 0, 0, 0, 0, 4, 9, 12, 12, 12, 12],
+ // [0, 0, 0, 0, 0, 0, 4, 5, 3, 0, 0, 0]
+ // ],
+ // code:1
+ // },
+ // {
+ // menuData: [
+ // [0, 0, 0, 1, 1, 1, 1, 1, 1, 29, 5315, 5315],
+ // [0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 5286, 0]
+ // ],
+ // code:2
+ // },
+ // {
+ // menuData: [
+ // [0, 58, 60, 61, 75, 84, 145, 162, 166, 177, 186, 186],
+ // [0, 58, 2, 1, 14, 9, 61, 17, 4, 11, 9, 0]
+ // ],
+ // code:3
+ // }
+ // ]
+ // this.nextSave();
+ // this.$message.success('淇濆瓨鎴愬姛')
+ getStatisticAnalysis({btmNames: btmName}).then(res => {
+ this.menuList = res.data.data;
+ this.nextSave();
+ this.$message.success('淇濆瓨鎴愬姛')
+ });
+ }else {
+ this.$message.warning('璇烽�夋嫨鏁版嵁锛�')
+ }
+ },
+ nextSave() {
const typeList = {
"0": "lineList",
"1": "pieList",
@@ -199,32 +167,29 @@
};
let hasValidData = false; // 娣诲姞涓�涓爣蹇楁潵璁板綍鏄惁鏈夋湁鏁堢殑閫夋嫨鏁版嵁
- let codeStatus = this.selectData.every(key => key.codeType)
- if (!codeStatus) {
- this.$message.warning("璇锋鏌ュ凡鍕鹃�夋暟鎹被鍨嬫槸鍚︿负绌猴紒");
- return;
- }
- this.selectData.forEach(item => {
+
+ this.selectData.forEach((item, index) => {
+ item.menuData = this.menuList[index].menuData;
const dataKey = typeList[item.codeType];
if (dataKey) {
this[dataKey].push(item);
- hasValidData = true; // 鏍囪鏈夋湁鏁堟暟鎹娣诲姞
+ hasValidData = true;
}
});
if (hasValidData) {
+ // this.$refs.table.clearSelection();
this.addVisible = false;
}
},
//琛ㄦ牸澶氶��
- selectChange(selection, row) {
- // console.log(selection, row)
+ selectChange(selection) {
this.selectData = selection;
},
}
}
</script>
-<style scoped lang="scss">
+<style lang="scss" scoped>
</style>
diff --git a/Source/UBCS-WEB/src/views/system/user.vue b/Source/UBCS-WEB/src/views/system/user.vue
index 838ec38..02d3363 100644
--- a/Source/UBCS-WEB/src/views/system/user.vue
+++ b/Source/UBCS-WEB/src/views/system/user.vue
@@ -396,6 +396,7 @@
userflag:true,
usernumber:0,
userStatus:false,
+ isUpdateShowInput:false,
};
},
watch: {
@@ -558,6 +559,7 @@
message: "璇疯緭鍏ョ櫥褰曡处鍙�",
trigger: "blur"
}],
+ disabled: this.isUpdateShowInput,
},
{
label: "鐢ㄦ埛骞冲彴",
@@ -711,7 +713,7 @@
multiple: true,
type: "tree",
dicData: [],
- disabled:this.userStatus,
+ disabled: this.isUpdateShowInput,
props: {
label: "title"
},
@@ -1100,9 +1102,9 @@
beforeOpen(done, type) {
// console.log(type)
if(type === "edit"){
- this.userStatus = true;
+ this.isUpdateShowInput = true;
}else {
- this.userStatus = false;
+ this.isUpdateShowInput = false;
}
//console.log(type)
// console.log('this.tenantId',this.tenantId)
diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/DefaultAttrAssimtUtil.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/DefaultAttrAssimtUtil.java
index b479d79..5e9e678 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/DefaultAttrAssimtUtil.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/DefaultAttrAssimtUtil.java
@@ -4,17 +4,13 @@
import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.revision.model.BaseModel;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
-import org.apache.poi.ss.formula.functions.T;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
-
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
-import java.util.Locale;
import java.util.Map;
/**
@@ -33,7 +29,7 @@
* @return
* @throws VciBaseException
*/
- public static <T extends BaseModel> T addDefaultAttrAssimt(T object,String btmName) throws VciBaseException {
+ public static <T extends BaseModel> T addDefaultAttrAssimt(T object, String btmName) throws VciBaseException {
BaseModel baseModel = object;
try {
baseModel.setOid(VciBaseUtil.getPk());
@@ -42,8 +38,6 @@
baseModel.setLastModifyTime(new Date());
baseModel.setTs(new Date());
baseModel.setRevisionOid(VciBaseUtil.getPk());
- // 鐢ㄦ埛id
- // String userId = AuthUtil.getUserId().toString();
baseModel.setBtmname(btmName);
baseModel.setCreator(AuthUtil.getUser().getAccount());
baseModel.setFirstR("1");
@@ -72,6 +66,52 @@
}
/**
+ * 褰撳湪澶氱嚎绋嬫祦涓皟鐢ㄦ椂锛岃幏鍙栦笉鍒拌姹傚ご淇℃伅锛�
+ * 鎵�浠ュ緱鍦ㄥ绾跨▼娴佸闈㈣幏鍙栧埌request
+ * @param object 缁ф壙浜咮aseModel鐨勫疄浣撳璞�
+ * @param <T> 杩斿洖鍊肩殑绫诲瀷
+ * @param btmName 涓氬姟绫诲瀷
+ * @return
+ * @throws VciBaseException
+ */
+ public static <T extends BaseModel> T addDefaultAttrAssimt(T object, String btmName, BladeUser user) throws VciBaseException {
+ BaseModel baseModel = object;
+ try {
+ baseModel.setOid(VciBaseUtil.getPk());
+ baseModel.setCreateTime(new Date());
+ baseModel.setNameOid(VciBaseUtil.getPk());
+ baseModel.setLastModifyTime(new Date());
+ baseModel.setTs(new Date());
+ baseModel.setRevisionOid(VciBaseUtil.getPk());
+ baseModel.setBtmname(btmName);
+ String account = Func.isNotEmpty(user) ? user.getAccount():AuthUtil.getUser().getAccount();
+ baseModel.setCreator(account);
+ baseModel.setFirstR("1");
+ baseModel.setFirstV("1");
+ baseModel.setLastR("1");
+ baseModel.setLastV("1");
+ baseModel.setRevisionSeq(1);
+ // TODO:鐩墠鍙湁缂栫爜瑙勫垯涓湁鐢ㄥ埌锛屽悗鏈熼渶瑕佸幓鎺夎繖娈典唬鐮佺殑璇濓紝灏辨妸浠栧姞鍦ㄧ紪鐮佽鍒欐柊澧炰腑鍘�
+ if(Func.isBlank(baseModel.getOwner())){
+ // 璁剧疆鎵�鏈夎��
+ baseModel.setOwner(Func.isNotEmpty(user) ? user.getUserId().toString():AuthUtil.getUserId().toString());
+ }
+
+ baseModel.setVersionSeq(1);
+ baseModel.setVersionRule("0");
+ baseModel.setVersionValue("1");
+ baseModel.setRevisionOid(VciBaseUtil.getPk());
+ baseModel.setLastModifier(account);
+ baseModel.setRevisionValue("1");
+ baseModel.setRevisionRule("1");
+ baseModel.setTenantId(Func.isNotEmpty(user) ? user.getTenantId():AuthUtil.getTenantId());
+ }catch (VciBaseException e){
+ e.printStackTrace();
+ }
+ return (T)baseModel;
+ }
+
+ /**
* 淇敼鏃跺~鍏呴粯璁ゅ��
* @param object 缁ф壙浜咮aseModel鐨勫疄浣撳璞�
* @param <T> 杩斿洖鍊肩殑绫诲瀷
@@ -86,8 +126,29 @@
// 鐢ㄦ埛id
// String userId = AuthUtil.getUserId().toString();
// 瑕佹眰鏀规垚璐﹀彿
- String account = AuthUtil.getUserAccount();
- baseModel.setLastModifier(account);
+ baseModel.setLastModifier(AuthUtil.getUser().getAccount());
+ }catch (VciBaseException e){
+ e.printStackTrace();
+ }
+ return (T)baseModel;
+ }
+
+ /**
+ * 淇敼鏃跺~鍏呴粯璁ゅ�硷細澶氱嚎绋嬫祦涓皟鐢�
+ * @param object 缁ф壙浜咮aseModel鐨勫疄浣撳璞�
+ * @param <T> 杩斿洖鍊肩殑绫诲瀷
+ * @return
+ * @throws VciBaseException
+ */
+ public static <T extends BaseModel> T updateDefaultAttrAssimt(T object, BladeUser user) throws VciBaseException {
+ BaseModel baseModel = object;
+ try {
+ baseModel.setLastModifyTime(new Date());
+ baseModel.setTs(new Date());
+ // 鐢ㄦ埛id
+ // String userId = AuthUtil.getUserId().toString();
+ // 瑕佹眰鏀规垚璐﹀彿
+ baseModel.setLastModifier(Func.isNotEmpty(user) ? user.getAccount():AuthUtil.getUser().getAccount());
}catch (VciBaseException e){
e.printStackTrace();
}
@@ -113,7 +174,7 @@
Object value=dataMap.get(key);
newDataMap.put(key.toLowerCase(Locale.ROOT),value);
}*/
- /* dataMap.forEach((key,value)->{
+ /* dataMap.forEach((key,value)->{
newDataMap.put(key.toLowerCase(Locale.ROOT),value);
});*/
//baseModel.setData((Map)newDataMap);
@@ -172,6 +233,85 @@
}
}catch (VciBaseException e){
e.printStackTrace();
+ throw e;
+ }
+ return (T)baseModel;
+ }
+
+ /**
+ * 鏂板鏃跺~鍏呴粯璁ゅ�硷細澶氱嚎绋嬫祦涓皟鐢�
+ * @param object 缁ф壙浜咮aseModel鐨勫疄浣撳璞�
+ * @param <T> 杩斿洖鍊肩殑绫诲瀷
+ * @return
+ * @throws VciBaseException
+ */
+ public static <T extends BaseModel> T copplyDefaultAttrAssimt(Map<String,String> dataMap, T object, BladeUser user) throws VciBaseException {
+ BaseModel baseModel = object;
+ try {
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ baseModel.setOid(dataMap.getOrDefault("OID",""));
+ baseModel.setId(dataMap.getOrDefault("ID",""));
+ Map<String,Object> newDataMap=new HashMap<>();
+ /*for (String key:dataMap.keySet()){
+ Object value=dataMap.get(key);
+ newDataMap.put(key.toLowerCase(Locale.ROOT),value);
+ }*/
+ /* dataMap.forEach((key,value)->{
+ newDataMap.put(key.toLowerCase(Locale.ROOT),value);
+ });*/
+ //baseModel.setData((Map)newDataMap);
+ Object createTimeObj=dataMap.getOrDefault("CREATETIME","");
+ if(createTimeObj!=null) {
+ String createTime = createTimeObj.toString();
+ baseModel.setCreateTime(chageStringToDate(createTime));
+ }
+ baseModel.setNameOid(dataMap.getOrDefault("NAMEOID",""));
+
+ Object lastModifyTimeObj=dataMap.getOrDefault("LASTMODIFYTIME","");
+ if(lastModifyTimeObj!=null) {
+ String lastModifyTime = lastModifyTimeObj.toString();
+ baseModel.setLastModifyTime(chageStringToDate(lastModifyTime));
+ }
+ Object tsObj=dataMap.getOrDefault("TS","");
+ if(tsObj!=null) {
+ String ts = tsObj.toString();
+ baseModel.setTs(chageStringToDate(ts));
+ }
+ baseModel.setRevisionOid(dataMap.getOrDefault("REVISIONOID",""));
+ //鐢ㄦ埛id ; 瑕佹眰鏀规垚浜嗚处鍙�
+ // String userId = AuthUtil.getUserId().toString();
+ baseModel.setBtmname(dataMap.getOrDefault("BTMNAME",""));
+ baseModel.setCreator(dataMap.getOrDefault("CREATOR",""));
+ baseModel.setFirstR(dataMap.getOrDefault("FIRSTR",""));
+ baseModel.setFirstV(dataMap.getOrDefault("FIRSTV",""));
+ baseModel.setLastR(dataMap.getOrDefault("LASTR",""));
+ baseModel.setLastV(dataMap.getOrDefault("LASTV",""));
+ Object revisionseq =dataMap.getOrDefault("REVISIONSEQ","");
+ if(revisionseq!=null){
+ baseModel.setRevisionSeq(chageStringToInt(revisionseq.toString()));
+ }
+
+ baseModel.setOwner(dataMap.getOrDefault("OWNER",""));
+ Object versionseq =dataMap.getOrDefault("VERSIONSEQ","");
+ if(versionseq!=null){
+ baseModel.setVersionSeq(chageStringToInt(versionseq.toString()));
+ }
+ baseModel.setVersionRule(dataMap.getOrDefault("VERSIONRULE",""));
+ baseModel.setVersionValue(dataMap.getOrDefault("VERSIONVALUE",""));
+ baseModel.setRevisionOid(dataMap.getOrDefault("REVISIONOID",""));
+ baseModel.setLastModifier(Func.isNotEmpty(user) ? user.getAccount():AuthUtil.getUser().getAccount());
+ baseModel.setLcStatus(dataMap.getOrDefault("LCSTATUS",""));
+ baseModel.setName(dataMap.getOrDefault("NAME",""));
+ baseModel.setTenantId(dataMap.getOrDefault("TENADTID",""));
+ baseModel.setDescription(dataMap.getOrDefault("DESCRIOTION",""));
+ baseModel.setCopyFromVersion(dataMap.getOrDefault("COPYFROMVERSION",""));
+ Object secretgrade=dataMap.get("SECRETGRADE");
+ if(secretgrade!=null){
+ baseModel.setSecretGrade(chageStringToInt(secretgrade.toString()));
+ }
+ }catch (VciBaseException e){
+ e.printStackTrace();
+ throw e;
}
return (T)baseModel;
}
@@ -196,4 +336,5 @@
}
return date;
}
+
}
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
index 061a6b4..afa4e65 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
@@ -893,4 +893,15 @@
}
}
+
+ /**
+ * 鑾峰彇缁熻鍒嗘瀽鏁版嵁
+ * @param btmNames 涓氬姟绫诲瀷
+ * @return
+ */
+ @GetMapping("/getStatisticAnalysis")
+ @VciBusinessLog(operateName = "鑾峰彇缁熻鍒嗘瀽鏁版嵁")
+ public R getStatisticAnalysis(String btmNames) {
+ return engineService.getStatisticAnalysis(btmNames);
+ }
}
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 6e6f7a5..418809c 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
@@ -513,4 +513,10 @@
* @return 鎵ц缁撴灉
*/
String addSaveBZCodeNotauthUser(CodeBZApplyDTO codeBZApplyDTO, boolean authUser) throws Exception;
+ /**
+ * 鑾峰彇缁熻鍒嗘瀽鏁版嵁
+ * @param btmNames 涓氬姟绫诲瀷
+ * @return 鏁版嵁闆�
+ */
+ R getStatisticAnalysis(String btmNames);
}
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeService.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeService.java
index 42517a8..67b6fde 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeService.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeService.java
@@ -5,6 +5,7 @@
import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateVO;
import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO;
import com.vci.ubcs.starter.revision.model.BaseModel;
+import org.springblade.core.secure.BladeUser;
import java.util.Collection;
import java.util.List;
@@ -20,7 +21,7 @@
* @param dataCBOList 涓氬姟鏁版嵁
*/
List<String> productCodeAndSaveData(CodeClassifyFullInfoBO classifyFullInfoBO, CodeClassifyTemplateVO templateVO,
- CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<BaseModel> dataCBOList) throws Exception;
+ CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<BaseModel> dataCBOList, BladeUser user) throws Exception;
/**
* 鍥炴敹鐮佸��
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 7d06620..e187c23 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
@@ -60,6 +60,7 @@
import com.vci.ubcs.system.feign.ISysClient;
import com.vci.ubcs.system.user.entity.User;
import com.vci.ubcs.system.user.feign.IUserClient;
+import io.swagger.models.auth.In;
import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils;
import oracle.sql.TIMESTAMP;
import org.slf4j.Logger;
@@ -67,6 +68,7 @@
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.log.annotation.OperateLog;
import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
@@ -504,6 +506,7 @@
CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid());
CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid());
+ final BladeUser user = AuthUtil.getUser();
//1.鍒ゆ柇瑙勫垯涓櫎浜嗘祦姘寸爜娈碉紝鏄惁鏈夊叾浠栫爜娈�
checkSecValueOnOrder(ruleVO, orderDTO);
//2.鍒ゆ柇蹇呰緭椤�
@@ -534,13 +537,13 @@
//cbo.setCreator(String.valueOf(AuthUtil.getUser().getUserId()));銆�
if(authUser) {
// 瑕佹眰鏄剧ず璐﹀彿锛屾墍浠ュ仛浜嗘洿鏀�
- cbo.setCreator(String.valueOf(AuthUtil.getUser().getAccount()));
- cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount()));
+ cbo.setCreator(String.valueOf(user.getAccount()));
+ cbo.setLastModifier(String.valueOf(user.getAccount()));
}else{
cbo.setCreator(orderDTO.getCreator());
cbo.setLastModifier(orderDTO.getLastModifier());
}
- cbo.setTenantId(AuthUtil.getTenantId());
+ cbo.setTenantId(user.getTenantId());
if(StringUtils.isNotBlank(orderDTO.getLcStatus())||StringUtils.isNotBlank(orderDTO.getData().get("lcStatus"))){
cbo.setLcStatus(StringUtils.isNotBlank(orderDTO.getLcStatus())?orderDTO.getLcStatus():orderDTO.getData().get("lcStatus"));
}
@@ -553,7 +556,7 @@
cbo.setDescription(orderDTO.getDescription());
cboList.add(cbo);
- List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), cboList);
+ List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), cboList,user);
batchSaveSelectChar(templateVO, cboList);
return codeList.size() > 0 ? codeList.get(0) : "";
@@ -1140,6 +1143,75 @@
@Override
public String addSaveBZCodeNotauthUser(CodeBZApplyDTO codeBZApplyDTO, boolean authUser) throws Exception {
return addSaveBZCode(codeBZApplyDTO,authUser);
+ }
+
+ /**
+ * 鑾峰彇缁熻鍒嗘瀽鏁版嵁
+ * @param btmNames 涓氬姟绫诲瀷
+ * @return 鏁版嵁闆�
+ */
+ @Override
+ public R getStatisticAnalysis(String btmNames) {
+ //鏌ヨ涓氬姟绫诲瀷瀵瑰簲鐨勬暟鎹簱琛�
+ R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Arrays.asList(btmNames.split(",")));
+ if (!listR.isSuccess() || listR.getData().size() == 0) {
+ throw new ServiceException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
+ List tableData = new ArrayList();
+ for (BtmTypeVO datum : listR.getData()) {
+ String sql = "select count(*) countNum, to_char(CREATETIME, 'mm') countDate\n" +
+ "from "+ datum.getTableName() +"\n" +
+ "where CREATETIME >= to_date(EXTRACT(YEAR FROM SYSDATE) || '-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND LASTV = '1'\n" +
+ "group by to_char(CREATETIME, 'mm')\n" +
+ "order by to_char(CREATETIME, 'mm')";
+ //鏌ヨ鍑洪渶瑕佸鐞嗙殑鏁版嵁
+ List<Map> maps = commonsMapper.selectBySql(sql);
+ if(maps.size() == 0){
+ throw new ServiceException("浼犲叆绫诲瀷["+ datum.getName() + ":" +
+ datum.getId() +"]鏈煡鍒扮浉鍏崇粺璁℃暟鎹紝璇风‘璁�!!!!");
+ }
+ //褰撳勾姣忔湀鏈堜唤涔嬪墠涔嬪拰
+ List<Integer> monthCount = new ArrayList<>(12);
+ //褰撳勾姣忔湀鐨勬湀浠芥暟鎹�
+ List<Integer> month = new ArrayList<>();
+ //鑾峰彇褰撳墠鏈堢殑鏁板瓧
+ Calendar instance = Calendar.getInstance();
+ int nowmonth = instance.get(Calendar.MONTH) + 1;
+ //浠�1鍒�12鏈堣繘琛屽鐞�
+ for (Integer i = 1; i <= 12; i++) {
+ //褰撳墠鏈堝悗鎵�鏈夋暟鎹缃负0
+ if(i>nowmonth){
+ monthCount.add(0);
+ month.add(0);
+ }
+ //褰撳墠鏈堜唤涔嬪墠涔嬪拰
+ Integer count = 0;
+ //褰撳墠鏈堜唤鏁版嵁
+ Integer sameMonth = 0;
+ //瀵规暟鎹簱鏌ョ殑鏁版嵁杩涜澶勭悊锛屽褰撳墠鏈堜唤杩涜绱姞
+ for (Map map : maps) {
+ Integer mounDate = Integer.parseInt(String.valueOf(map.get("COUNTDATE")));
+ if(mounDate <= i){
+ count += Integer.parseInt(String.valueOf(map.get("COUNTNUM")));
+ }
+ if (mounDate == i) {
+ sameMonth = Integer.parseInt(String.valueOf(map.get("COUNTNUM")));
+ }
+ }
+ monthCount.add(count);
+ month.add(sameMonth);
+ }
+ //瀵规暟鎹繘琛屾暣鍚�
+ HashMap<String,Object> menuData = new HashMap<>();
+ menuData.put("menuName",datum.getName());
+ menuData.put("codeType",null);
+ ArrayList monthData = new ArrayList();
+ monthData.add(monthCount);
+ monthData.add(month);
+ menuData.put("menuData",monthData);
+ tableData.add(menuData);
+ }
+ return R.data(tableData);
}
/**
@@ -3116,6 +3188,15 @@
updateBatchByBaseModel(oldCbo.getBtmname(), Collections.singletonList(oldCbo));
// 鎻掑叆鏂扮殑鏁版嵁
insertBatchByType(cbo.getBtmname(), Collections.singletonList(cbo));
+ //澶勭悊鐮佸�艰〃锛屽鐮佸�艰〃杩涜澶勭悊鏇挎崲鍒涘缓鏁版嵁鐨刼id
+ QueryWrapper<CodeAllCode> wrapper = new QueryWrapper<>();
+ wrapper.eq("CREATECODEOID",orderDTO.getCopyFromVersion());
+ CodeAllCode codeAllCode = codeAllCodeService.getOne(wrapper);
+ codeAllCode.setCreateCodeOid(cbo.getOid());
+ codeAllCode.setLastModifyTime(new Date());
+ codeAllCode.setTs(new Date());
+ codeAllCode.setLastModifier(AuthUtil.getUser().getUserName());
+ codeAllCodeService.updateById(codeAllCode);
// 璁板綍鏁版嵁鏇存敼鏃ュ織
saveLogUtil.operateLog("鏁版嵁鏇存敼",false, StringUtil.format("{}\n淇敼涓�:\n{}",JSON.toJSONString(Collections.singletonList(oldCbo)),JSON.toJSONString(Collections.singletonList(cbo))));
} catch (Exception vciError) {
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 6f0f849..6b79d51 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
@@ -6,13 +6,11 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.protobuf.ServiceException;
-import com.vci.ubcs.code.applyjtcodeservice.entity.DockingPreAttrMapping;
import com.vci.ubcs.code.applyjtcodeservice.feign.IMdmInterJtClient;
import com.vci.ubcs.code.applyjtcodeservice.vo.DockingPreAttrMappingVO;
import com.vci.ubcs.code.bo.AttributeValue;
import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO;
import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO;
-import com.vci.ubcs.code.constant.MdmEngineConstant;
import com.vci.ubcs.code.dto.*;
import com.vci.ubcs.code.entity.CodeAllCode;
import com.vci.ubcs.code.enumpack.CodeDefaultLC;
@@ -62,6 +60,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.aspectj.apache.bcel.classfile.Code;
import org.springblade.core.redis.cache.BladeRedis;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
@@ -73,6 +72,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@@ -90,7 +90,6 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static com.alibaba.druid.util.FnvHash.Constants.LIMIT;
@@ -201,9 +200,9 @@
private SaveLogUtil saveLogUtil;
/**
- * 瀵煎嚭鐨勫崄涓囨潯
+ * 瀹㈡埛鐜板満excel涓鸿�佺増鏈紝瀵煎嚭鐨勬�绘暟闄愬埗涓�65535
*/
- public static final int EXPORT_LIMIT = 100000;
+ public static final int EXPORT_LIMIT = 65535;
/**
* 鎵归噺鐢宠锛氶�夊彇閫変腑鍒嗙被涓嬬殑鎵�鏈夋ā鏉垮叧閿睘鎬э紝鐩镐技灞炴�э紝蹇呭~灞炴�э紝鍐欏叆execl涓�
@@ -614,6 +613,7 @@
ExcelUtil.writeDataToFile(excelName,eo);
return excelName;
}
+
/**
* 鑾峰彇鐮佹瀹藉害
* @param codeClassifyOid
@@ -1209,6 +1209,7 @@
//SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo();
List<ClientBusinessObject> finalNeedSaveCboList = needSaveCboList;
CodeClassifyTemplateVO finalTemplateVO = templateVO;
+ final BladeUser user = AuthUtil.getUser();
ruleRowIndexMap.keySet().parallelStream().forEach(ruleOid -> {
//VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
List<String> rowIndexList = ruleRowIndexMap.get(ruleOid);
@@ -1225,7 +1226,7 @@
if (!CollectionUtils.isEmpty(thisCbos)) {
try {
// TODO 澶氱嚎绋嬫祦闂
- productCodeService.productCodeAndSaveData(classifyFullInfo, finalTemplateVO, ruleVOMap.get(ruleOid), null, dataCBOList);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, finalTemplateVO, ruleVOMap.get(ruleOid), null, dataCBOList,user);
importCount.add(dataCBOList.size());
} catch (Throwable e) {
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
@@ -1276,6 +1277,7 @@
throw e;
}
}
+
/**
* 瀵煎叆鎵归噺缂栬緫鏁版嵁
*
@@ -1284,14 +1286,18 @@
* @param file excel鏂囦欢鐨勪俊鎭�
* @return 鏈夐敊璇俊鎭殑excel
*/
+ @Transactional
@Override
public CodeImProtRusultVO batchImportEdit(String codeClassifyOid, String classifyAttr,File file) throws Throwable{
VciBaseUtil.alertNotNull(codeClassifyOid,"鍒嗙被鐨勪富閿�");
ReadExcelOption reo = new ReadExcelOption();
reo.setReadAllSheet(true);
List<SheetDataSet> sheetDataSetList = ExcelUtil.readDataObjectFromExcel(file,null,reo);
- if (sheetDataSetList.size() > LIMIT + 1) {
- throw new VciBaseException("涓轰簡淇濊瘉绯荤粺鐨勭ǔ瀹氭�э紝璇蜂竴娆′笉瑕佸鍏ヨ秴杩�1涓囨潯鐨勬暟鎹�");
+ if (sheetDataSetList.get(0).getRowData().size() > LIMIT + 1) {
+ throw new ServiceException("涓轰簡淇濊瘉绯荤粺鐨勭ǔ瀹氭�э紝璇蜂竴娆′笉瑕佸鍏ヨ秴杩�1涓囨潯鐨勬暟鎹�");
+ }
+ if (sheetDataSetList.get(0).getRowData().size() == 0) {
+ throw new ServiceException("鏈鍙栧埌excle鐩稿叧鏁版嵁锛岃纭锛侊紒锛�");
}
boolean isExport=false;
Map<String,List<WriteExcelData>> shetNameMap=new HashMap<>();
@@ -1327,7 +1333,7 @@
titleRowData.remove(titleRowData.size()-1);
templateVO= templateVOList.get(0);
}catch (Throwable e){
- throw new VciBaseException(e.getMessage());
+ throw new ServiceException(e.getMessage());
}
CodeClassifyTemplateVO finalTemplateVO = templateVO;
@@ -1354,32 +1360,18 @@
//鎴戜滑浣跨敤鍜屼笟鍔$被鍨嬬殑鏉ユ煡璇�
List<Map> cbosB = commonsMapper.selectBySql(sqlBO.getSqlUnPage());
if(cbosB.size() == 0){
- throw new ServiceException("缂栫爜锛�"+ sheetRowData.getData().get(0) + ",鏈兘鏌ヨ鍒扮浉鍏虫暟鎹��");
+ throw new ServiceException("缂栫爜锛�"+ sheetRowData.getData().get(0) + ",鏈兘鏌ヨ鍒扮浉鍏虫暟鎹��");
}
excelToCboEdit(fieldIndexMap, sheetRowData, orderDTO, cbosB.get(0));
orderDTO.setCopyFromVersion(orderDTO.getOid());
orderDTO.setOid(null);
try {
mdmEngineService.upSaveCode(orderDTO);
- List<Map> newCbos = commonsMapper.selectBySql(sqlBO.getSqlUnPage());
- //瀵圭爜鍊艰〃杩涜澶勭悊鏇挎崲鍒涘缓鏁版嵁鐨刼id
- QueryWrapper<CodeAllCode> wrapper = new QueryWrapper<>();
- wrapper.eq("CREATECODEOID",orderDTO.getCopyFromVersion());
- List<CodeAllCode> codeAllCodes = codeAllCodeService.selectByWrapper(wrapper);
- codeAllCodes.get(0).setCreateCodeOid(newCbos.get(0).get("OID").toString());
- codeAllCodes.get(0).setLastModifyTime(new Date());
- codeAllCodes.get(0).setTs(new Date());
- codeAllCodes.get(0).setLastModifier(AuthUtil.getUser().getUserName());
- codeAllCodeService.updateBatchById(codeAllCodes);
} catch (Throwable e) {
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
-// thisCbos.stream().forEach(cbo -> {
-// String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
errorMap.put(sheetRowData.getRowIndex(), ";绯荤粺閿欒锛屽瓨鍌ㄦ暟鎹殑鏃跺�欏嚭閿欎簡:"+e.getMessage());
-// });
}
}
-
if (errorMap.size() > 0) {
isExport = true;
}
@@ -1686,7 +1678,7 @@
createRedisDatas(uuid + "-ok",templateVO, rowIndexCboMap, dataSet, fieldIndexMap, newErrorMap,true);
}else {
uuid="";
-
+ final BladeUser user = AuthUtil.getUser();
//瑕佹妸浠ヤ笂鐨勯敊璇殑閮芥姏鍑哄悗锛屽啀缁х画澶勭悊鏃堕棿鍜岀粍鍚堣鍒�
needSaveCboList = cboList.stream().filter(cbo -> {
String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
@@ -1706,7 +1698,7 @@
dataCBOIdList.add(baseModel.getOid());
});
try {
- codeList = productCodeService.productCodeAndSaveData(classifyFullInfo,templateVO,ruleVO, orderDTO.getSecDTOList(),dataCBOList);
+ codeList = productCodeService.productCodeAndSaveData(classifyFullInfo,templateVO,ruleVO, orderDTO.getSecDTOList(),dataCBOList,user);
//濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰
engineService.batchSaveSelectChar(templateVO, dataCBOList);
} catch (Exception e) {
@@ -1839,10 +1831,10 @@
tableName = VciBaseUtil.getTableName(btmTypeId);
}
- String countSql = "select count(*) from " + tableName +" where 1=1" +
+ String countSql = "select count(*) from (select * FROM " + tableName +" where 1=1" +
" and lastr = '1'" +
" and lastv='1'" +
- " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%'";
+ " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}";
//鍏堟煡璇㈡�绘暟
int total = 0;
@@ -1856,8 +1848,7 @@
thisPage.setSort(exportAttrDTO.getSort());
thisPage.setOrder(exportAttrDTO.getOrder());
thisPage.addDefaultDesc("createTime");
-
- total += commonsMapper.queryCountBySql(countSql);
+ total += commonsMapper.queryCountBySql(StringUtil.format(countSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;"));
}
}else{
total = commonsMapper.queryCountBySql(countSql);
@@ -2122,7 +2113,9 @@
}).collect(Collectors.toList());
List<ClientBusinessObject> finalNeedSaveCboList = needSaveCboList;
Map<String, CodeRuleVO> finalRuleVOMap = ruleVOMap;
- ruleRowIndexMap.keySet().parallelStream().forEach(ruleOid -> {
+ // TODO锛� 澶氱嚎绋嬫祦濂楀绾跨▼娴侊紝鏈夊潙锛屾垜鎶婅繖鍎挎敼鎴愬崟绾跨▼浜�
+ final BladeUser user = AuthUtil.getUser();
+ ruleRowIndexMap.keySet().stream().forEach(ruleOid -> {
List <BaseModel>dataCBOList=new CopyOnWriteArrayList<>();
List<String> rowIndexList = ruleRowIndexMap.get(ruleOid);
List<ClientBusinessObject> thisCbos = needSaveCboList.stream().filter(cbo -> rowIndexList.contains(cbo.getAttributeValue(IMPORT_ROW_INDEX)) && !errorMap.containsKey(cbo.getAttributeValue(IMPORT_ROW_INDEX))).collect(Collectors.toList());
@@ -2133,7 +2126,7 @@
dataCBOList.add(baseModel);
});
try {
- productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, finalRuleVOMap.get(ruleOid), null, dataCBOList);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, finalRuleVOMap.get(ruleOid), null, dataCBOList, user);
} catch (Throwable e) {
//success=false;
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
@@ -2146,6 +2139,7 @@
engineService.batchSaveSelectChar(codeClassifyTemplateVO, dataCBOList);
});
}else {
+ final BladeUser user = AuthUtil.getUser();
List<BaseModel> dataCBOList=new ArrayList<>();
List<ClientBusinessObject> needSaveCboList = cboList.stream().filter(cbo -> {
String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
@@ -2159,7 +2153,7 @@
dataCBOList.add(baseModel);
});
try {
- productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList,user);
} catch (Exception e) {
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
needSaveCboList.stream().forEach(cbo -> {
@@ -2467,6 +2461,7 @@
List<String>allNeedSaveCboList=new ArrayList<>();
List<BaseModel> dataCBOList=new ArrayList<>();
+ final BladeUser user = AuthUtil.getUser();
needSaveCboList.stream().forEach(clientBusinessObject -> {
BaseModel baseModel=new BaseModel();
BeanUtil.convert(clientBusinessObject,baseModel);
@@ -2476,7 +2471,7 @@
});
try {
List<String>applyGroupCodeIdList=new ArrayList<>();
- productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList,user);
//濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰
engineService.batchSaveSelectChar(templateVO, dataCBOList);
// if(!isProcess){
@@ -2504,7 +2499,6 @@
resultDataObjectDetailDO.setErrorid("0");
}
resultDataObjectDetailDO.setId(sourceOid);
-
resultDataObjectDetailDO.setMsg(msg);
resultDataObjectDetailDOs.add(resultDataObjectDetailDO);
//澶勭悊浼犻�佺殑鏁版嵁涓叧閿睘鎬ч噸澶嶇殑锛岀洿鎺ユ嬁鍒板凡缁忕敵璇峰埌缂栫爜鐨勬暟鎹紪鐮佺洿鎺ュ皢璧嬬粰鍏抽敭灞炴�ч噸澶嶇殑鏁版嵁
@@ -3567,7 +3561,7 @@
if (StringUtils.isBlank(field)) {
throw new VciBaseException("绗�" + (index + 1) + "鍒楃殑鏍囬鍦ㄧ郴缁熶腑涓嶅瓨鍦�");
}
- map.put(field,value);
+ map.put(field.toUpperCase(),value);
});
try {
@@ -4273,6 +4267,7 @@
Map<String,List<BaseModel>> indexTODataMap=new ConcurrentHashMap<>();
// 鏌ヨ涓嶉渶瑕佸弬涓庡叧閿睘鎬ф牎楠岀殑闄よ嚜宸变互澶栫殑鎵�鏈夊垎绫籵id
final String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid());
+ final BladeUser user = AuthUtil.getUser();
List<ClientBusinessObject> repeatDataMap = cboList.parallelStream().filter(cbo -> {
//姣忚閮藉緱鏌ヨ.濡傛灉鍏朵腑鍑虹幇浜嗛敊璇紝鎴戜滑灏辩洿鎺ユ姏鍑哄紓甯革紝鍏朵綑鐨勬樉绀�
//VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
@@ -4304,7 +4299,7 @@
List<BaseModel> newCboList = new ArrayList<>();
newDataList.stream().forEach(stringStringMap -> {
BaseModel baseModel=new BaseModel();
- DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(stringStringMap,baseModel,true);
+ DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(stringStringMap,baseModel,true,user);
baseModel.setData(stringStringMap);
newCboList.add(baseModel);
});
@@ -4530,7 +4525,7 @@
List<ClientBusinessObject> clientBusinessObjectList=new ArrayList<>();
oldDataMap.stream().forEach(dataMap->{
ClientBusinessObject clientBusinessObject=new ClientBusinessObject();
- DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject,true);
+ DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject);
for (String key:dataMap.keySet()){
Object value= dataMap.getOrDefault(key,"");
clientBusinessObject.setAttributeValue(key.toLowerCase(Locale.ROOT),value==null?"":value.toString());
@@ -4993,8 +4988,8 @@
ExecGroupCodePortDataDTO execGroupCodePortDataDTO=new ExecGroupCodePortDataDTO();
createExportGroupCodeMapConfig(templateVO,execGroupCodePortDataDTO);//缁勭粐鏁版嵁
- if(CollectionUtils.isEmpty(execGroupCodePortDataDTO.getCodeAttrMapGroupAttrDTOS())){
- throw new VciBaseException("闆嗗洟灞炴�ф槧灏勬湭閰嶇疆");
+ if(!CollectionUtils.isEmpty(execGroupCodePortDataDTO.getCodeAttrMapGroupAttrDTOS())){
+ throw new ServiceException("闆嗗洟灞炴�ф槧灏勬湭閰嶇疆");
}
fieldList=execGroupCodePortDataDTO.getFieldList();
List<Map<String,String>>dataList=new ArrayList<>();
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
index 42fab2c..24bdc0c 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -36,8 +36,10 @@
import com.vci.ubcs.starter.web.util.VciDateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -45,6 +47,7 @@
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -96,7 +99,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
- public List<String> productCodeAndSaveData(CodeClassifyFullInfoBO classifyFullInfoBO, CodeClassifyTemplateVO templateVO, CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<BaseModel> dataCBOList) throws Exception {
+ public List<String> productCodeAndSaveData(CodeClassifyFullInfoBO classifyFullInfoBO, CodeClassifyTemplateVO templateVO, CodeRuleVO ruleVO, List<CodeOrderSecDTO> secDTOList, List<BaseModel> dataCBOList,BladeUser user) throws Exception {
dataCBOList = dataCBOList.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList());
List<String> codeList = new ArrayList<>();
final CodeRuleVO finalRuleVO = ruleVO;
@@ -201,7 +204,7 @@
});
}
CodeAllCode allCodeDO = new CodeAllCode();
- DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCodeDO, MdmBtmTypeConstant.CODE_ALL_CODE);
+ DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCodeDO, MdmBtmTypeConstant.CODE_ALL_CODE,user);
allCodeDO.setCodeClassifyOid(classifyFullInfoBO.getCurrentClassifyVO().getOid());
allCodeDO.setCodeRuleOid(finalRuleVO.getOid());
allCodeDO.setId(cbo.getId());
@@ -234,13 +237,13 @@
log.info("oldmaxSerial--->"+serialValueDO.getMaxSerial()+"---- newmaxSerial---->"+maxSerial);
if(VciBaseUtil.getDouble(serialValueDO.getMaxSerial())<VciBaseUtil.getDouble(maxSerial)){
serialValueDO.setMaxSerial(String.valueOf(maxSerial));
- DefaultAttrAssimtUtil.updateDefaultAttrAssimt(serialValueDO);
+ DefaultAttrAssimtUtil.updateDefaultAttrAssimt(serialValueDO,user);
editSerialValueList.add(serialValueDO);
}
}else{
//娌℃湁
CodeSerialValue serialValueDO = new CodeSerialValue();
- DefaultAttrAssimtUtil.addDefaultAttrAssimt(serialValueDO, MdmBtmTypeConstant.CODE_SERIAL_VALUE);
+ DefaultAttrAssimtUtil.addDefaultAttrAssimt(serialValueDO, MdmBtmTypeConstant.CODE_SERIAL_VALUE,user);
serialValueDO.setCodeRuleOid(finalRuleVO.getOid());
serialValueDO.setSerialUnit(serialUnit);
serialValueDO.setCodeSecOid(secOid);
@@ -261,7 +264,6 @@
}
//澶勭悊allCode
if(!CollectionUtils.isEmpty(allCodeDOList)){
- // TODO 鍘嗗彶鏁版嵁瀵煎叆鐨勬椂鍊欒繖鍎垮伓灏斾細瑙﹀彂绌烘寚閽堝紓甯�
Map<String,List<CodeAllCode>> ruleGroup = allCodeDOList.stream().collect(Collectors.groupingBy(s -> s.getCodeRuleOid()));
Map<String, CodeAllCode> codeDOMap = allCodeDOList.stream().collect(Collectors.toMap(s -> s.getCodeRuleOid() + "${SEP}" + s.getId(), t -> t));
List<CodeAllCode> addCodeDOs = new CopyOnWriteArrayList<>();
@@ -417,7 +419,7 @@
saveSerialValue( finalRuleVO, lastMaxSerialValueMap, maxSerialValueMap);
allCodeDOList.stream().forEach(
- allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");}
+ allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode",user);allCode.setLctid("codeAllCodeLC");}
);
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
index edcb828..cd92f0f 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -281,9 +281,7 @@
UserVO userVo = interParameterVO.getData().getUser();
//鍏嶅瘑鐧诲綍鐢宠token锛宺equest涓坊鍔犵敤鎴蜂俊鎭�
- //passwordFreeLoginService.pwdFreeLoginByBoolean(userVo.getUserName(),this.getRequest());
passwordFreeLoginService.pwdFreeLoginByBoolean(systemId.toLowerCase(Locale.ROOT),this.getRequest());
- AuthUtil.getUser();
List<ClassfyVO> classVOList = classfysVO.getClassify();
InterParameterVO finalInterParameterVO = interParameterVO;
//杩欐槸璐﹀彿淇℃伅
@@ -2322,7 +2320,7 @@
/***
- * 鏍规嵁绌垮叆鐨勫弬鏁颁俊鎭牎楠岀爜娈佃鍒�
+ * 鏍规嵁浼犲叆鐨勫弬鏁颁俊鎭牎楠岀爜娈佃鍒�
*/
private List<CodeOrderSecDTO> getRuleCodeOrderSecDTOs(List<SectionVO> SectionVOList,CodeRuleVO ruleVO,CodeClassifyFullInfoBO classifyFullInfo) throws Throwable{
List<CodeBasicSecVO> codeBasicSecVOS= ruleVO.getSecVOList();
@@ -2372,7 +2370,7 @@
CodeOrderSecDTO.setSecValue(sectypeValue);
codeOrderSecDTOList.add(CodeOrderSecDTO);
} else {
- message="浼犲叆鐨勭爜娈佃鍒欑己灏�" + name + "鐮佹";
+ message="浼犲叆鐨勭爜娈佃鍒欑己灏�" + name;
errorMap.put("error",errorMap.getOrDefault("error","")+";"+message);
}
}
--
Gitblit v1.9.3