From c4d687aacfb4e7b6ee5ce67df93cf2f8d8df80c1 Mon Sep 17 00:00:00 2001 From: xiejun <xj@2023> Date: 星期日, 26 十一月 2023 14:05:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/mapper/LogOperateMapper.java | 16 Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/DockingPreAttrMappingServiceImpl.java | 2 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java | 2 Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/entity/Attach.java | 11 Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 116 +- Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue | 191 ++-- Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogLocalService.java | 39 Source/UBCS-WEB/src/views/monitor/log/operateLog.vue | 0 Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogOperateController.java | 23 Source/UBCS-WEB/vue.config.js | 4 Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogErrorController.java | 5 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java | 8 Source/UBCS-WEB/src/views/monitor/log/authLog.vue | 0 Source/UBCS-WEB/src/views/statistic/statisticPage.vue | 190 ++++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSyncUniversalController.java | 2 Source/UBCS-WEB/src/views/monitor/log/localLog.vue | 207 +++++ Source/UBCS-WEB/src/views/monitor/log/loginLog.vue | 139 +++ Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/feign/LogClient.java | 3 Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/utils/FileDownloadUtil.java | 114 ++ Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LocalLog.java | 16 Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/SmsMapper.xml | 2 Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/utils/HttpUtil.java | 2 Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LogOperate.java | 80 ++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 2 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MdmCountConfigController.java | 1 Source/UBCS-WEB/src/components/StatisticsComponent/lineChart.vue | 98 + Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/LogApplication.java | 2 Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/application-prod.yml | 4 Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/AttachMapper.xml | 2 Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue | 3 Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/vo/LocalLogVO.java | 31 Source/UBCS-WEB/src/components/StatisticsComponent/pieChart.vue | 21 /dev/null | 165 ---- Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java | 310 +++++++ Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogOperateService.java | 31 Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogOperateServiceImpl.java | 59 + Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeApplyWebManagementServiceImpl.java | 2 Source/UBCS/ubcs-ops/ubcs-resource/src/main/java/com/vci/ubcs/resource/controller/FileController.java | 230 ++-- Source/UBCS-WEB/src/api/logs.js | 22 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 6 Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/GroupMdmInterServiceImpl.java | 4 Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue | 124 +++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeButtonWrapper.java | 2 Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogLocalController.java | 78 + 44 files changed, 1,837 insertions(+), 532 deletions(-) diff --git a/Source/UBCS-WEB/src/api/logs.js b/Source/UBCS-WEB/src/api/logs.js index 7538730..6655657 100644 --- a/Source/UBCS-WEB/src/api/logs.js +++ b/Source/UBCS-WEB/src/api/logs.js @@ -62,3 +62,25 @@ }) } +export const getLazyList = (data) => { + return request({ + url: '/api/ubcs-log/localLog/lazy-list', + method: 'post', + data: data, + }) +} +export const downLoadLog = (data) => { + return request({ + url: '/api/ubcs-log/localLog/downLoadLog', + method: 'post', + data:data, + }) +} +export const deleteLocalLog = (data) => { + return request({ + url: '/api/ubcs-log/localLog/deleteLogFile', + method: 'delete', + data: data + }) +} + diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue index 0c0d40a..1c49669 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue @@ -201,7 +201,7 @@ let dictKeys = []; let slotColumnList = []; formItemList.forEach((formItem) => { - // console.log('formItem',formItem) + console.log('formItem',formItem) formItem = this.resetFormConfig(formItem); if (formItem.secType === "codeattrsec") { this.attrList.push(formItem); @@ -341,7 +341,6 @@ let that = this; items.forEach((item) => { let formItem = this.resetFormConfig(item); - if (formItem.field == "lcstatus") { formItem.field = formItem.field + "_text"; formItem.readOnly = true; diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue index 483d080..396b601 100644 --- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue @@ -6,15 +6,15 @@ <div> </div> <el-row style="width: 100%;margin-bottom: 10px"> - <div style="margin-bottom: 10px" > - <el-button v-for="(item, index) in masterVrBtnList" - v-if="!['PREVIEW', 'DELETEFILE', 'revisefile', 'DOWNLOADFILE', 'UPLOADFILE'].includes(item.uniqueFlag)" - :key="index" plain size="small" - type="primary" - @click="handleBtnClick(item)">{{ - item.name - }} - </el-button> + <div style="margin-bottom: 10px"> + <el-button v-for="(item, index) in masterVrBtnList" + v-if="!['PREVIEW', 'DELETEFILE', 'revisefile', 'DOWNLOADFILE', 'UPLOADFILE'].includes(item.uniqueFlag)" + :key="index" plain size="small" + type="primary" + @click="handleBtnClick(item)">{{ + item.name + }} + </el-button> <span v-if="tableHeadFindData.length > 0"> <el-select slot="prepend" v-model="keyWordFind" placeholder="璇烽�夋嫨" size="small"> <el-option v-for="item in tableHeadFindData" :key="item.id" :label="item.label" @@ -36,8 +36,8 @@ </el-select></span> </div> <div class="custom-table"> - <el-table class="cus-table" ref="dataTable" v-loading="isLoading" :data="tableData" - :height="tableHeight" border + <el-table ref="dataTable" v-loading="isLoading" :data="tableData" :height="tableHeight" + border class="cus-table" @select="handleSelection" @cell-click="handleCellClick" @row-click="handleRowClick" @select-all="handleSelectionAll" @selection-change="handleSelectionChange" @sort-change="sortChange"> @@ -45,24 +45,27 @@ <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" key="index" v-if=" lcstatusArray.length !== 0 && !item.hidden" label="鐢熷懡鍛ㄦ湡鍊�" prop="lcstatus" - :show-overflow-tooltip="true" :sortable="item.sortable" :width="item.width" - align="center"> + <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" key="index" v-if="CodeArray.length !== 0 && !item.hidden" :label="item.label" :prop="item.prop" - :show-overflow-tooltip="true" :sortable="item.sortable" :width="item.width" - align="center"> + <el-table-column v-for="(item, index) in CodeArray" v-if="CodeArray.length !== 0 && !item.hidden" + key="index" :label="item.label" :prop="item.prop" + :show-overflow-tooltip="true" :sortable="item.sortable" :width="item.width" + align="center"> <template slot-scope="scope"> <el-link type="primary" @click="CodeLinkHandler(scope.row)"> {{ scope.row[item.prop] }} </el-link> </template> </el-table-column> - <el-table-column v-for="item in this.tableHeadFindData" v-if="!item.hidden && item.prop !== 'id' && item.prop !== 'lcstatus' && Object.keys(item.referConfig).length <= 0" + <el-table-column v-for="item in this.tableHeadFindData" + v-if="!item.hidden && item.prop !== 'id' && item.prop !== 'lcstatus' && Object.keys(item.referConfig).length <= 0" :key="item.id" :formatter="item.formatter" :label="item.label" :prop="item.prop" @@ -72,9 +75,11 @@ align="center"> </el-table-column> <!-- 鍙傜収鏁版嵁--> - <el-table-column v-for="(item,index) in referArray" :key="index" v-if="item.referConfig && Object.keys(item.referConfig).length > 0 && !item.hidden" :label="item.title" prop="jiliangdw" - :show-overflow-tooltip="true" :sortable="item.sortable" :width="item.width" - align="center"> + <el-table-column v-for="(item,index) in referArray" v-if="item.referConfig && Object.keys(item.referConfig).length > 0 && !item.hidden" + :key="index" + :label="item.title" :show-overflow-tooltip="true" + :sortable="item.sortable" :width="item.width" align="center" + prop="jiliangdw"> <template slot-scope="scope"> <span>{{ scope.row.jiliangdwname }}</span> </template> @@ -107,10 +112,10 @@ :visible.sync="editvisible" type="edit" @submit="EditSumbit"></FormTemplateDialog> <!-- 鎵归噺缂栬緫--> -<!-- <MasterEditBulk :visible.sync="bulkeditvisible" ></MasterEditBulk>--> + <!-- <MasterEditBulk :visible.sync="bulkeditvisible" ></MasterEditBulk>--> <!-- 鏁版嵁璇︽儏--> <FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" - :rowOid="this.LinkObject.oid" :templateOid="templateOid" + :rowOid="this.LinkObject.oid" :templateOid="templateOid" :title="'鏁版嵁璇︽儏'" :visible.sync="LinkVisible" type="detail"></FormTemplateDialog> @@ -142,7 +147,8 @@ :visible.sync="dialogPush"></MasterTransfer> <!-- 瀵煎叆--> <BatchImport v-if="batchImportData.visible" v-bind="batchImportData" :resetTable="CrudRend" - :visible.sync="batchImportData.visible" :tableHeadData="tableHeadFindData" :selectRow="selectRow"> + :selectRow="selectRow" :tableHeadData="tableHeadFindData" + :visible.sync="batchImportData.visible"> </BatchImport> <!-- 鐩镐技椤�--> <ResembleQueryDialog :codeClassifyOid="codeClassifyOid" :codeRuleOid="this.codeRuleOid" :rowOid="rowOid" @@ -247,26 +253,26 @@ Treedata: { type: Array }, - nodeClickList:{ - type:Array, - default:[] + nodeClickList: { + type: Array, + default: [] } }, data() { return { //鎵归噺缂栬緫瀵硅瘽妗� - bulkeditvisible:false, + bulkeditvisible: false, LinkVisible: false, LinkObject: {}, // 缂栫爜鏁版嵁 LinkList: [], isCodeArrayPushed: false, // 缂栫爜鏁扮粍娣诲姞鏍囪瘑鍙橀噺 CodeArray: [], //鐢熷懡鍛ㄦ湡鏁扮粍 - lcstatusArray:[], + lcstatusArray: [], //鍙傜収鏁版嵁鏁扮粍 - referArray:[], - islcstatusPushed:false, - isReferPushed:false, + referArray: [], + islcstatusPushed: false, + isReferPushed: false, // 鐘舵�佹悳绱� statusSelect: "all", // 鍏抽敭瀛楁煡璇� @@ -305,8 +311,8 @@ label: "name", }, tableHeadFindDatas: [], - applyvisible:false, - amendvisible:false, + applyvisible: false, + amendvisible: false, addvisible: false, editvisible: false, findvisible: false, @@ -354,7 +360,7 @@ height: 110 }, result: '', - elapsedTime:'', + elapsedTime: '', }; }, computed: { @@ -441,16 +447,16 @@ // console.log('lcstatusArray', this.lcstatusArray); this.islcstatusPushed = true; } - if(!this.isReferPushed){ + if (!this.isReferPushed) { if (newval.find(item => Object.keys(item.referConfig).length > 0)) { this.referArray.push(newval.find(item => Object.keys(item.referConfig).length > 0)); - }else { + } else { this.referArray.push([]) } } - this.isReferPushed=true; - console.log('new',this.referArray) - console.log('ss',newval.find(item => Object.keys(item.referConfig).length > 0)) + this.isReferPushed = true; + console.log('new', this.referArray) + console.log('ss', newval.find(item => Object.keys(item.referConfig).length > 0)) this.WupinFindValue = '' }, }, @@ -467,7 +473,7 @@ }, tableHeadBtnData: { handler(newval) { - this.masterVrBtnList = newval + this.masterVrBtnList = newval }, deep: true }, @@ -549,14 +555,14 @@ }); }, //鏍囧噯鐢宠 - codeApplyHandler(){ + codeApplyHandler() { this.$nextTick(() => { this.applyvisible = true; }); }, - applySumbit(val){ + applySumbit(val) { // console.log('val',val) - if(func.notEmpty(val.ts)) { + if (func.notEmpty(val.ts)) { val.ts = func.formattedDateTime(val.ts); //console.log(val.ts); } @@ -568,7 +574,7 @@ }) }) }, - amendSumbit(val){ + amendSumbit(val) { applySaveCode(val).then(res => { this.$nextTick(() => { this.amendvisible = false; @@ -579,24 +585,22 @@ }, //鏍囧噯淇 - codeAMENDHandler(){ + codeAMENDHandler() { if (this.selectRow.length !== 1) { this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�"); - } else if (this.selectRow[0].lcstatus !== "Editing") { - this.$message.warning("缂栫爜鐘舵�佷笉鏄�滅紪杈戜腑鈥濓紝涓嶅彲缂栬緫"); } else { this.amendvisible = true; this.rowOid = this.selectRow[0].oid; } }, //鎵归噺缂栬緫 - bulkEditHandler(type){ + bulkEditHandler(type) { console.log(this.nodeClickList) - if(this.nodeClickList.children.length >= 1){ + if (this.nodeClickList.children.length >= 1) { this.$message.warning('褰撳墠閫夋嫨鐨勫垎绫讳笉鏄彾瀛愯妭鐐癸紝涓嶅厑璁告壒閲忕紪杈戯紒') return; } - if(this.selectRow.length <= 0){ + if (this.selectRow.length <= 0) { this.$message.warning('璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹紒') return; } @@ -610,7 +614,7 @@ this.$message.warning('閫夋嫨鐨勬暟鎹腑鏈夌紪鐮佺姸鎬佷笉鏄�滅紪杈戜腑鈥濓紝涓嶅彲缂栬緫锛�'); } }, - addSaveHandler(){ + addSaveHandler() { this.$nextTick(() => { this.addvisible = true; }); @@ -975,7 +979,7 @@ //澧炲姞淇濆瓨 AddSumbit(val) { // console.log('val',val) - if(func.notEmpty(val.ts)) { + if (func.notEmpty(val.ts)) { val.ts = func.formattedDateTime(val.ts); //console.log(val.ts); } @@ -1039,8 +1043,9 @@ <style lang="scss" scoped> //鍥哄畾鍒楅珮搴� /deep/ .el-table__fixed { - height: calc(100vh - 370px)!important; + height: calc(100vh - 370px) !important; } + // 婊氬姩鏉℃牱寮忎慨鏀� // 婊氬姩鏉$殑瀹藉害 /deep/ .el-table__body-wrapper::-webkit-scrollbar { @@ -1050,6 +1055,7 @@ width: 10px; } + // 婊氬姩鏉$殑婊戝潡 /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { background-color: #ececec; @@ -1082,7 +1088,7 @@ margin-top: 10px; } - .el-table__body-wrapper{ +.el-table__body-wrapper { height: calc(100% - 44px) !important; } </style> diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue index 2d84725..065c234 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue @@ -2,120 +2,149 @@ <basic-container> <v-chart id="chart" :auto-resize="true" :options="chartOptions"></v-chart> </basic-container> - </template> <script> import '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' -var data = [ - [120, 132, 101, 134, 90, 230, 210, 130, 0, 122, 100, 80], - [220, 232, 301, 334, 290, 330, 410, 330, 212, 322, 200, 234], -]; - -// 鎵惧埌姣忎竴椤规暟鎹腑鐨勬渶澶у�煎苟淇濆瓨鍒版暟缁� -var maxValues = data[0].map(function (_, i) { - return Math.max.apply(null, data.map(function (item) { - return item[i]; - })); -}); - -var colors = ['#91CC75', '#5470C6']; -// 鐢熸垚鏌辩姸鍥剧殑 series 鏁版嵁 -var seriesData = []; -for (var i = 0; i < data.length; i++) { - var curSeriesData = []; - // 璁$畻鏁版嵁涓殑姣忕粍鏁版嵁鐨勬渶澶у�� - for (var j = 0; j < data[i].length; j++) { - var borderRadius = [0, 0, 0, 0]; // 榛樿涓嶈缃渾瑙� - if (data[i][j] === maxValues[j]) { // 濡傛灉褰撳墠鏌卞瓙鐨勫�肩瓑浜庡搴斿垪鐨勬渶澶у�硷紝璁剧疆鍦嗚 - borderRadius = [50, 50, 0, 0]; // 璁剧疆鍥涗釜瑙掗兘涓哄渾瑙� +export default { + name: "ColumnarChart", + props:{ + columnarData:{ + type:Array, + default:[] + }, + chartName:{ + type:String, + default: "" } - curSeriesData.push({ - value: data[i][j], - itemStyle: { - normal: { - barBorderRadius: borderRadius, // 璁剧疆鍦嗚 - color: colors[i], - show: function (params) { - // 鏍规嵁鏁版嵁鍊肩殑澶у皬鏉ュ垽鏂槸鍚︽樉绀� label - return params.value > 30; + }, + watch:{ + columnarData:{ + immediate:true, + handler(newval,oldval){ + if(newval && newval.length > 0){ + const minValues = newval[0].map(function (_, i) { + return Math.min.apply( + null, + newval.map(function (item) { + return item[i]; + }) + ); + }); + + let colors = ["#91CC75", "#5470C6"]; + + const seriesData = []; + for (let i = 0; i < newval.length; i++) { + let curSeriesData = []; + for (let j = 0; j < newval[i].length; j++) { + let borderRadius = [0, 0, 0, 0]; + if (newval[i][j] === minValues[j]) { + borderRadius = [50, 50, 0, 0]; + } + curSeriesData.push({ + value: newval[i][j], + itemStyle: { + normal: { + barBorderRadius: borderRadius, // 璁剧疆鍦嗚 + color: colors[i], + } + }, + }); + } + let seriesName = (i === 0 ? "鎬婚噺" : "鏂板") + seriesData.push({ + name: seriesName, + type: "bar", + stack: "鎬婚噺", + barWidth: 60, + data: curSeriesData, + label: { + show: true, + position: 'top' + }, + emphasis: { + focus: "series", + }, + }); + this.chartOptions.series=seriesData } } } - }); - } - var seriesName = ''; - if (i === 0) { - seriesName = '鎬婚噺'; - } else if (i === 1) { - seriesName = '鏂板'; - } - seriesData.push({ - name: seriesName, - type: 'bar', - stack: '鎬婚噺', - data: curSeriesData, - label: { - show: true, - position: 'top' }, - itemStyle: { - color: colors[i] // 璁剧疆鏌卞瓙鐨勯鑹� - }, - emphasis: { - focus: 'series' + chartName:{ + handler(newval,oldval){ + if(newval){ + console.log(newval) + this.chartOptions.title.text = newval + "鏁版嵁缁熻" + } + }, + immediate:true, + deep:true } - }); -} - -export default { - name: "ColumnarChart", + }, data() { return { chartOptions: { + color:["#91CC75", "#5470C6"], title: { - text: '浜哄憳涓绘暟鎹粺璁�' + text: "", }, grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true + left: "3%", + right: "4%", + bottom: "3%", + containLabel: true, }, tooltip: { - trigger: 'axis', + trigger: "axis", axisPointer: { - type: 'shadow' - } + type: "shadow", + }, }, legend: { - data: ['鎬婚噺', '鏂板'], - left: 'center' + data: ["鎬婚噺", "鏂板"], + left: "center", + textStyle: { + fontSize: 14 // 璋冩暣瀛椾綋澶у皬 + } }, xAxis: { - type: 'category', - data: ['涓�鏈�', '浜屾湀', '涓夋湀', '鍥涙湀', '浜旀湀', '鍏湀', '涓冩湀', '鍏湀', '涔濇湀', '鍗佹湀', '鍗佷竴鏈�', '鍗佷簩鏈�'] + type: "category", + data: [ + "涓�鏈�", + "浜屾湀", + "涓夋湀", + "鍥涙湀", + "浜旀湀", + "鍏湀", + "涓冩湀", + "鍏湀", + "涔濇湀", + "鍗佹湀", + "鍗佷竴鏈�", + "鍗佷簩鏈�", + ], }, yAxis: { - type: 'value' + type: "value", }, - series: seriesData, - } - } - } -} + series: [], + }, + }; + }, + created() { + }, +}; </script> <style scoped lang="scss"> #chart { - width: 1280px; - height: 800px; + width: 100%; + height: 560px; } </style> diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/lineChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/lineChart.vue index d51df80..7c180bc 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/lineChart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/lineChart.vue @@ -9,70 +9,92 @@ <script> import '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: "lineChart", + props: { + lineData: { + type: Array, + default: [] + }, + chartName: { + type: String, + default: "" + } + }, + watch: { + lineData: { + immediate: true, + handler(newval, oldval) { + if (newval) { + const series = newval.map((data, index) => ({ + name: index === 0 ? "鎬婚噺" : "鏂板", + type: "line", + smooth: true, + stack: "Total", + label: { + show: true, + position: "top", + textStyle: { + fontSize: 14 // 璋冩暣瀛椾綋澶у皬 + } + }, + data: data.map(value => ({value})) + })); + + this.chartOptions.series = series; + } + } + }, + chartName:{ + handler(newval,oldval){ + if(newval){ + this.chartOptions.title.text = newval + "鏁版嵁缁熻" + } + }, + immediate:true, + deep:true + } + }, data() { return { chartOptions: { - color:['#2eadd6 ','#FFA500 '], + color: ['#2eadd6', '#FFA500'], title: { - text: '鐗╁搧涓绘暟鎹粺璁�' + text: '' }, tooltip: { trigger: 'axis' }, legend: { - data: ['鎬婚噺', '鏂板'] + data: ['鎬婚噺', '鏂板'], + textStyle: { + fontSize: 14 // 璋冩暣瀛椾綋澶у皬 + } }, xAxis: { - boundaryGap: true, // 鎺у埗鍧愭爣杞翠袱渚х暀鐧� + boundaryGap: true, type: 'category', - data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�'] + data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�'], }, yAxis: { - type: 'value' + type: 'value', }, - series: [ - { - name: '鎬婚噺', - type: 'line', - smooth: true, - stack: 'Total', - label: { - show: true, - position: 'top' - }, - data: [5000, 2000, 3600, 1000, 1000, 2000, 500, 2000, 500, 2000, 500, 2000] - }, - { - name: '鏂板', - type: 'line', - smooth: true, - stack: 'Total', - label: { - show: true, - position: 'top' - }, - data: [1510, 1010, 2610, 2010, 3010, 1010, 1510, 3010, 1010, 1510, 3010, 2000] - } - ] - }, + series: [] + } }; }, - mounted() { - }, -} + created() { + } +}; </script> <style lang="scss" scoped> #chart { - width: 1280px; + width: 100%; + height: 400px; } - </style> diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue new file mode 100644 index 0000000..c9c5034 --- /dev/null +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/mixCart.vue @@ -0,0 +1,124 @@ +<template> + <basic-container> + <v-chart id="chart" :auto-resize="true" :options="chartOptions"></v-chart> + </basic-container> +</template> + +<script> +import '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", + props: { + mixData: { + type: Array, + default: [] + }, + chartName: { + type: String, + default: "" + } + }, + data() { + return { + chartOptions: { + title: { + text: "", + }, + grid: { + left: "3%", + right: "4%", + bottom: "3%", + containLabel: true, + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: { + data: ["鎬婚噺", "鏂板"], + left: "center", + textStyle: { + fontSize: 14 // 璋冩暣瀛椾綋澶у皬 + } + }, + xAxis: { + type: "category", + data: [ + "涓�鏈�", + "浜屾湀", + "涓夋湀", + "鍥涙湀", + "浜旀湀", + "鍏湀", + "涓冩湀", + "鍏湀", + "涔濇湀", + "鍗佹湀", + "鍗佷竴鏈�", + "鍗佷簩鏈�", + ], + }, + yAxis: { + type: "value", + }, + series: [], + }, + }; + }, + watch: { + mixData: { + immediate: true, + handler(newval, oldval) { + if (newval) { + const colors = ["#8fef5b", "#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] + }, + emphasis: { + focus: "series" + } + })); + + this.chartOptions.series = seriesData; + } + }, + }, + chartName:{ + handler(newval,oldval){ + if(newval){ + this.chartOptions.title.text = newval + "鏁版嵁缁熻" + } + }, + immediate:true, + deep:true + } + }, +}; +</script> + +<style scoped lang="scss"> +#chart { + width: 100%; + height: 560px; +} +</style> diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/pieChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/pieChart.vue index 9b757c3..94d451c 100644 --- a/Source/UBCS-WEB/src/components/StatisticsComponent/pieChart.vue +++ b/Source/UBCS-WEB/src/components/StatisticsComponent/pieChart.vue @@ -1,5 +1,5 @@ <template> - <basic-container> + <basic-container style="width: 100%"> <v-chart :options="chartOptions" :auto-resize="true" id="chart"></v-chart> </basic-container> </template> @@ -11,6 +11,16 @@ import 'echarts/lib/component/legend' export default { name: "pieChart", + props:{ + pieData:{ + type:Array, + default:[] + }, + chartName:{ + type:String, + default: "" + } + }, data() { return { chartOptions: { @@ -21,7 +31,7 @@ tooltip: { trigger: 'item', formatter: function (params) { - var result = ''; + let result = ''; if (params.componentType === 'series') { result += params.name + '<br/>'; result += '鏂板锛�' + params.data.newValue + '<br/>'; @@ -50,7 +60,7 @@ itemStyle: { color: function(params) { // 鏍规嵁鍏蜂綋闇�姹傝缃鑹� - var colorList = ['#5470C6', '#91CC75', '#fac858', '#EE6666', '#3BA272', '#FC8452', '#9A60B4', '#e34d4d', '#b3e9b9', '#eaaaed', '#1bc6e4', '#c6b3e9']; + const colorList = ['#5470C6', '#91CC75', '#fac858', '#EE6666', '#3BA272', '#FC8452', '#9A60B4', '#e34d4d', '#b3e9b9', '#eaaaed', '#1bc6e4', '#c6b3e9']; return colorList[params.dataIndex % colorList.length]; } }, @@ -78,7 +88,8 @@ <style scoped lang="scss"> #chart { - width: 800px; - height: 600px; + width: 90%; + height: 530px; } + </style> diff --git a/Source/UBCS-WEB/src/views/monitor/log/authLog.vue b/Source/UBCS-WEB/src/views/monitor/log/authLog.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/UBCS-WEB/src/views/monitor/log/authLog.vue diff --git a/Source/UBCS-WEB/src/views/monitor/log/localLog.vue b/Source/UBCS-WEB/src/views/monitor/log/localLog.vue new file mode 100644 index 0000000..90d9130 --- /dev/null +++ b/Source/UBCS-WEB/src/views/monitor/log/localLog.vue @@ -0,0 +1,207 @@ +<template> + <basic-container> + <avue-crud ref="crud" + v-model="form" + :before-close="beforeClose" + :before-open="beforeOpen" + :data="data" + :option="option" + :permission="permissionList" + :table-loading="loading" + @row-del="rowDel" + @search-change="searchChange" + @search-reset="searchReset" + @selection-change="selectionChange" + @row-click="clickRowChange" + @current-change="currentChange" + @size-change="sizeChange" + @refresh-change="refreshChange" + @on-load="onLoad" + @tree-load="treeLoad"> + <template slot="menu" slot-scope="scope"> + <el-button + icon="el-icon-download el-icon--right" + size="small" + type="text" + :loading="downloadLoading" + @click="downLoadLogFile(scope.row)" + v-if="permissionList.downLoadBtn" + >涓嬭浇 + </el-button> + </template> + </avue-crud> + </basic-container> +</template> + +<script> + import {getLazyList, deleteLocalLog,downLoadLog} from "@/api/logs"; + import func from "@/util/func"; + import {mapGetters} from "vuex"; + + export default { + data() { + return { + form: {}, + selectionList: [], + query: {}, + logPath: "", + loading: true, + page: { + pageSize: 10, + currentPage: 1, + total: 0 + }, + option: { + height: "auto", + lazy: true, + columnBtn: false, + tip: false, + searchShow: true, + searchMenuSpan: 6, + tree: true, + border: true, + index: true, + selection: true, + editBtn: false, + delBtn: true, + addBtn: false, + viewBtn: false, + // menuWidth: 300, + dialogClickModal: false, + highlightCurrentRow: true, //琛岄�変腑鏃堕珮浜� + rowKey: "logName", //琛屾暟鎹殑 Key锛岀敤鏉ヤ紭鍖� Table 鐨勬覆鏌� + column: [ + { + label: "鏈嶅姟鍚嶇О", + prop: "serviceName", + width:'120', + search: true + }, + { + label: "鏈嶅姟ID", + prop: "serviceId", + search: true + }, + { + label: "鏃ュ織璺緞", + prop: "logPath", + width:'160' + }, + { + label: "鏃ュ織鍚嶇О", + prop: "logName", + width:'80', + }, + { + label: "鏃ュ織绫诲瀷", + prop: "logType" + }, + { + label: "鍒涘缓鏃堕棿", + prop: "createTime", + width:'180' + }, + { + label: "鏈�鍚庝慨鏀规椂闂�", + prop: "lastModifier", + width:'180' + } + ] + }, + data: [], + downloadLoading: false, + }; + }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + delBtn: this.vaildData(this.permission.localLog.localLog_delete, false), + downLoadBtn: this.vaildData(this.permission.localLog.localLog_dwonload, false) + }; + } + }, + methods: { + + downLoadLogFile(row){ + this.downloadLoading = true; + let logPath = row.hasChildren ? row.logPath:row.logPath+"\\"+row.logName; + downLoadLog(Object.assign({},row,{logFullPaths:logPath})).then(res=>{ + func.downloadFileByBlobHandler(res); + this.downloadLoading = false; + }).catch((res)=>{ + //this.$message.warning(res) + this.downloadLoading = false; + }) + }, + // 琛屽垹闄� + rowDel(row, index, done) { + this.$confirm("纭畾灏嗛�夋嫨鐨勬棩蹇楁枃浠跺垹闄�?", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }) + .then(() => { + let logPath = row.hasChildren ? row.logPath:row.logPath+"\\"+row.logName; + return deleteLocalLog(Object.assign({},row,{logFullPaths:logPath})); + }) + .then(() => { + this.$message({ + type: "success", + message: "鎿嶄綔鎴愬姛!" + }); + // 鏁版嵁鍥炶皟杩涜鍒锋柊 + done(row); + //this.onLoad(); + }); + }, + searchReset() { + this.query = {}; + this.parentId = 0; + this.onLoad(this.page); + }, + searchChange(params, done) { + this.query = params; + this.parentId = ''; + this.page.currentPage = 1; + this.onLoad(this.page, params); + done(); + }, + clickRowChange(row) { + this.$refs.crud.toggleSelection(); + this.selectionList = row; + this.$refs.crud.setCurrentRow(row); + this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛� + }, + selectionChange(list) { + this.selectionList = list; + this.$refs.crud.setCurrentRow(this.selectionList[list.length - 1]); + }, + selectionClear() { + this.selectionList = []; + this.$refs.crud.toggleSelection(); + }, + refreshChange() { + this.onLoad(this.page, this.query); + }, + onLoad(page, params = {}) { + this.loading = true; + //Object.assign(params, this.query) + getLazyList({"logPath": this.logPath}).then(res => { + this.data = res.data.data; + this.loading = false; + this.selectionClear(); + }); + }, + treeLoad(tree, treeNode, resolve) { + const logPath = tree.logPath; + getLazyList({"logPath": logPath}).then(res => { + resolve(res.data.data); + }); + } + } + }; +</script> + +<style> +</style> diff --git a/Source/UBCS-WEB/src/views/monitor/log/loginLog.vue b/Source/UBCS-WEB/src/views/monitor/log/loginLog.vue new file mode 100644 index 0000000..1298f88 --- /dev/null +++ b/Source/UBCS-WEB/src/views/monitor/log/loginLog.vue @@ -0,0 +1,139 @@ +<template> + <basic-container> + <avue-crud :option="option" + :table-loading="loading" + :data="data" + ref="crud" + v-model="form" + :permission="permissionList" + :page.sync="page" + :before-open="beforeOpen" + @search-change="searchChange" + @search-reset="searchReset" + @current-change="currentChange" + @size-change="sizeChange" + @refresh-change="refreshChange" + @on-load="onLoad"> + </avue-crud> + </basic-container> +</template> + +<script> + import {getUsualList, getUsualLogs} from "@/api/logs"; + import {mapGetters} from "vuex"; + + export default { + data() { + return { + form: {}, + selectionList: [], + query: {}, + loading: true, + page: { + pageSize: 10, + currentPage: 1, + total: 0 + }, + option: { + height: 'auto', + calcHeight: 30, + columnBtn:false, + tip: false, + searchShow: true, + searchMenuSpan: 6, + border: true, + index: true, + viewBtn: true, + editBtn: false, + addBtn: false, + delBtn: false, + menuWidth: 120, + dialogType: 'drawer', + column: [ + { + label: "鐢ㄦ埛鍚�", + prop: "serviceId", + search: true + }, + { + label: "濮撳悕", + prop: "serverHost", + search: true + }, + { + label: "鐢ㄦ埛id", + prop: "serverIp" + }, + { + label: "妯″潡", + prop: "env", + width:'80' + }, + { + label: "鏃堕棿", + prop: "logLevel" + }, + { + label: "鎿嶄綔缁撴灉", + prop: "logId" + }, + { + label: "鎻忚堪", + prop: "requestUri" + }, + ] + }, + data: [] + }; + }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + viewBtn: this.vaildData(this.permission.log_usual.log_usual_view, false) + }; + } + }, + methods: { + searchReset() { + this.query = {}; + this.onLoad(this.page); + }, + searchChange(params, done) { + this.query = params; + this.page.currentPage = 1; + this.onLoad(this.page, params); + done(); + }, + beforeOpen(done, type) { + if (["edit", "view"].includes(type)) { + getUsualLogs(this.form.id).then(res => { + this.form = res.data.data; + }); + } + done(); + }, + currentChange(currentPage){ + this.page.currentPage = currentPage; + }, + sizeChange(pageSize){ + this.page.pageSize = pageSize; + }, + refreshChange() { + this.onLoad(this.page, this.query); + }, + onLoad(page, params = {}) { + this.loading = true; + getUsualList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { + const data = res.data.data; + this.page.total = data.total; + this.data = data.records; + this.loading = false; + }); + } + } + }; +</script> + +<style> +</style> diff --git a/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue b/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue diff --git a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue index 415865a..d5b0556 100644 --- a/Source/UBCS-WEB/src/views/statistic/statisticPage.vue +++ b/Source/UBCS-WEB/src/views/statistic/statisticPage.vue @@ -8,14 +8,53 @@ <el-dialog :visible.sync="addVisible" append-to-body + class="avue-dialog avue-dialog--top" title="鏂板鏁版嵁缁熻鍒嗘瀽" + top="-50px" > + <el-table + :data="tableData" + border + style="width: 100%" + @selection-change="selectChange" + > + <el-table-column + type="selection" + width="55"> + </el-table-column> + <el-table-column + align="center" + label="涓绘暟鎹簱鍚�" + prop="menuName"> + </el-table-column> + <el-table-column + align="center" + label="绫诲瀷" + prop="codeType"> + <template slot-scope="{ row }"> + <el-select v-model="row.codeType" placeholder="璇烽�夋嫨鍥捐〃绫诲瀷"> + <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-select> + </template> + </el-table-column> + </el-table> + <span slot="footer" class="dialog-footer"> + <el-button @click="escHandler">鍙� 娑�</el-button> + <el-button type="primary" @click="addSaveHandler">淇濆瓨</el-button> + </span> </el-dialog> <!-- echarts缁勪欢--> <div> - <lineChart></lineChart> - <pieChart></pieChart> - <ColumnarChart></ColumnarChart> + <lineChart v-for="(item,index) in lineList" :key="index" :chartName="item.menuName" + :lineData="item.menuData"></lineChart> + <!-- <pieChart :pieData="pieData" :chartName="chartName"></pieChart>--> + <ColumnarChart v-for="(item,index) in columnarList" :key="index" :chartName="item.menuName" + :columnarData="item.menuData"></ColumnarChart> + <mixCart v-for="(item,index) in mixList" :key="index" :chartName="item.menuName" + :mixData="item.menuData"></mixCart> </div> </div> </template> @@ -24,23 +63,164 @@ import lineChart from "../../components/StatisticsComponent/lineChart" import pieChart from "../../components/StatisticsComponent/pieChart" import ColumnarChart from "../../components/StatisticsComponent/ColumnarChart" +import mixCart from "../../components/StatisticsComponent/mixCart" export default { components: { lineChart, pieChart, - ColumnarChart + ColumnarChart, + mixCart }, name: "statisticPage", data() { return { addVisible: false, + chartName: "", + lineList: [], + pieList: [], + 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: "2", + 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: "0", + 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], + ] + } + ] } }, methods: { + //鏂板 addHandler() { this.addVisible = true; - } + }, + //鍙栨秷 + escHandler() { + this.addVisible = false; + }, + //淇濆瓨 + addSaveHandler() { + debugger + if (this.selectData.length <= 0) { + this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒'); + return; + } + + const typeList = { + "0": "lineList", + "1": "pieList", + "2": "columnarList", + "3": "mixList" + }; + + let hasValidData = false; // 娣诲姞涓�涓爣蹇楁潵璁板綍鏄惁鏈夋湁鏁堢殑閫夋嫨鏁版嵁 + let codeStatus = this.selectData.every(key => key.codeType) + if (!codeStatus) { + this.$message.warning("璇锋鏌ュ凡鍕鹃�夋暟鎹被鍨嬫槸鍚︿负绌猴紒"); + return; + } + this.selectData.forEach(item => { + const dataKey = typeList[item.codeType]; + if (dataKey) { + this[dataKey].push(item); + hasValidData = true; // 鏍囪鏈夋湁鏁堟暟鎹娣诲姞 + } + }); + + if (hasValidData) { + this.addVisible = false; + } + }, + //琛ㄦ牸澶氶�� + selectChange(selection, row) { + // console.log(selection, row) + this.selectData = selection; + }, } } </script> diff --git a/Source/UBCS-WEB/vue.config.js b/Source/UBCS-WEB/vue.config.js index fcfbd7d..264ceae 100644 --- a/Source/UBCS-WEB/vue.config.js +++ b/Source/UBCS-WEB/vue.config.js @@ -26,9 +26,9 @@ proxy: { '/api': { //鏈湴鏈嶅姟鎺ュ彛鍦板潃 - // target: 'http://127.0.0.1:37000', + target: 'http://127.0.0.1:37000', // target: 'http://192.168.1.51:37000', - target: 'http://dev.vci-tech.com:37000', + // target: 'http://dev.vci-tech.com:37000', //yxc // target: 'http:// 192.168.0.104:37000', // target: 'http://192.168.0.105:37000', diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/utils/HttpUtil.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/utils/HttpUtil.java index 3ff0ef7..3806f25 100644 --- a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/utils/HttpUtil.java +++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/utils/HttpUtil.java @@ -346,7 +346,7 @@ return result; } }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); } return result; } diff --git a/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/SystemLog.java b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LocalLog.java similarity index 69% rename from Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/SystemLog.java rename to Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LocalLog.java index 0b9022e..6fe8cfa 100644 --- a/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/SystemLog.java +++ b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LocalLog.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import java.util.Date; +import java.io.Serializable; /** * @author ludc @@ -13,7 +13,12 @@ @Data @AllArgsConstructor @NoArgsConstructor -public class SystemLog { +public class LocalLog implements Serializable { + + /** + * 搴忓垪鍖� + */ + private static final long serialVersionUID = 2217599544701726181L; /** * 鏃ュ織鎵�灞炴湇鍔″悕绉� @@ -48,6 +53,11 @@ /** * 鏃ュ織鐨勬渶鍚庝慨鏀规椂闂� */ - private String lastmodifier; + private String lastModifier; + + /** + * 鏄惁鍖呭惈瀛樺湪瀛愭枃浠� + */ + private Boolean hasChildren; } diff --git a/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LogOperate.java b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LogOperate.java new file mode 100644 index 0000000..f7d063e --- /dev/null +++ b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/LogOperate.java @@ -0,0 +1,80 @@ +package com.vci.ubcs.log.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +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 ludc + * @date 2023/11/24 10:58 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName("PL_LOG_OPERATE") +public class LogOperate implements Serializable { + + /** + * 搴忓垪鍖� + */ + private static final long serialVersionUID = 2217599544701724211L; + + /** + * 涓婚敭 + */ + @TableId("OID") + private String oid; + + /** + * 鐢ㄦ埛鍚� + */ + private String userName; + + /** + * 濮撳悕 + */ + private String realName; + + /** + * ip鍦板潃 + */ + private String ip; + + /** + * 妯″潡 + */ + private String model; + + /** + * 鎿嶄綔 + */ + private String operate; + + /** + * 鏃堕棿 + */ + private Date time; + + /** + * 鎿嶄綔缁撴灉 + */ + private String operateResult; + + /** + * 鎻忚堪 + */ + private String description; + + /** + * 鏃ュ織绫诲瀷 + */ + private String logType; + +} diff --git a/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/vo/LocalLogVO.java b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/vo/LocalLogVO.java new file mode 100644 index 0000000..0daf80e --- /dev/null +++ b/Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/vo/LocalLogVO.java @@ -0,0 +1,31 @@ +package com.vci.ubcs.log.vo; + +import com.vci.ubcs.log.entity.LocalLog; +import javafx.scene.Parent; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author ludc + * @date 2023/11/23 11:17 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LocalLogVO extends LocalLog implements Serializable { + + /** + * 搴忓垪鍖� + */ + private static final long serialVersionUID = 2217599544701726981L; + + /** + * 鏃ュ織鍏ㄨ矾寰勯泦鍚� + */ + private String logFullPaths; + +} diff --git a/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/entity/Attach.java b/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/entity/Attach.java index 24ae52e..544e274 100644 --- a/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/entity/Attach.java +++ b/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/entity/Attach.java @@ -16,11 +16,13 @@ */ package com.vci.ubcs.resource.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.tenant.mp.TenantEntity; /** @@ -32,7 +34,7 @@ @TableName("pl_attach") @EqualsAndHashCode(callSuper = true) @ApiModel(value = "Attach瀵硅薄", description = "闄勪欢琛�") -public class Attach extends TenantEntity { +public class Attach extends BaseEntity { private static final long serialVersionUID = 1L; @@ -66,6 +68,11 @@ */ @ApiModelProperty(value = "闄勪欢澶у皬") private Long attachSize; - + /** + * 绉熸埛ID + */ + @ApiModelProperty(value = "绉熸埛ID") + @TableField("TENANT_ID") + private String tenantId; } diff --git a/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/utils/FileDownloadUtil.java b/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/utils/FileDownloadUtil.java index 89450ec..8df5b21 100644 --- a/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/utils/FileDownloadUtil.java +++ b/Source/UBCS/ubcs-ops-api/ubcs-resource-api/src/main/java/com/vci/ubcs/resource/utils/FileDownloadUtil.java @@ -21,39 +21,39 @@ @Slf4j public class FileDownloadUtil { - /** - * 涓嬭浇鏂囦欢 - * @param response 鍝嶅簲瀵硅薄 - * @param fileObjectBO 鏂囦欢鐨勪俊鎭紝鍖呭惈鏂囦欢鐨勮緭鍏ユ祦 - * @throws IOException 涓嬭浇寮傚父浼氭姏鍑� - */ - public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO) throws IOException { - downloadFile(response,fileObjectBO,true); - } + /** + * 涓嬭浇鏂囦欢 + * @param response 鍝嶅簲瀵硅薄 + * @param fileObjectBO 鏂囦欢鐨勪俊鎭紝鍖呭惈鏂囦欢鐨勮緭鍏ユ祦 + * @throws IOException 涓嬭浇寮傚父浼氭姏鍑� + */ + public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO) throws IOException { + downloadFile(response,fileObjectBO,true); + } - /** - * 涓嬭浇鏂囦欢 - * @param response 鍝嶅簲瀵硅薄 - * @param fileObjectBO 鏂囦欢鐨勪俊鎭紝鍖呭惈鏂囦欢鐨勮緭鍏ユ祦 - * @param closeInputStream 鏄惁鍏抽棴娴� - * @throws IOException 涓嬭浇鍑洪敊鐨勬椂鍊欐姏鍑哄紓甯� - */ - public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO,boolean closeInputStream) throws IOException { - MediaType mediaType = MediaTypeFactory.getMediaType(fileObjectBO.getBucketName() + "." + fileObjectBO.getFileExtension()).orElse(MediaType.APPLICATION_OCTET_STREAM); - // 璁剧疆寮哄埗涓嬭浇涓嶆墦寮� - response.setContentType(mediaType.toString()+";application/force-download;charset=UTF-8"); - try{ - String fileName = URLEncoder.encode(fileObjectBO.getName() + "." + fileObjectBO.getFileExtension(), "UTF8"); - response.addHeader("Content-Disposition", "attachment;filename="+ fileName+ ";filename*=utf-8''"); - }catch(Exception e){ - if(log.isErrorEnabled()){ - log.error("璁剧疆鏂囦欢鐨勫悕绉板埌鍝嶅簲娴佺殑鏃跺�欏嚭閿�",e); - } - } - response.setCharacterEncoding("UTF-8"); - Cookie cookie = new Cookie("fileDownload", "true"); - cookie.setPath("/"); - response.addCookie(cookie); + /** + * 涓嬭浇鏂囦欢 + * @param response 鍝嶅簲瀵硅薄 + * @param fileObjectBO 鏂囦欢鐨勪俊鎭紝鍖呭惈鏂囦欢鐨勮緭鍏ユ祦 + * @param closeInputStream 鏄惁鍏抽棴娴� + * @throws IOException 涓嬭浇鍑洪敊鐨勬椂鍊欐姏鍑哄紓甯� + */ + public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO,boolean closeInputStream) throws IOException { + MediaType mediaType = MediaTypeFactory.getMediaType(fileObjectBO.getBucketName() + "." + fileObjectBO.getFileExtension()).orElse(MediaType.APPLICATION_OCTET_STREAM); + // 璁剧疆寮哄埗涓嬭浇涓嶆墦寮� + response.setContentType(mediaType.toString()+";application/force-download;charset=UTF-8"); + try{ + String fileName = URLEncoder.encode(fileObjectBO.getName() + "." + fileObjectBO.getFileExtension(), "UTF8"); + response.addHeader("Content-Disposition", "attachment;filename="+ fileName+ ";filename*=utf-8''"); + }catch(Exception e){ + if(log.isErrorEnabled()){ + log.error("璁剧疆鏂囦欢鐨勫悕绉板埌鍝嶅簲娴佺殑鏃跺�欏嚭閿�",e); + } + } + response.setCharacterEncoding("UTF-8"); + Cookie cookie = new Cookie("fileDownload", "true"); + cookie.setPath("/"); + response.addCookie(cookie); if(closeInputStream) { try (InputStream ins = (fileObjectBO.getInputStream() != null ? fileObjectBO.getInputStream() : new FileInputStream(fileObjectBO.getFileLocalPath()))) { IOUtils.copy(ins, response.getOutputStream()); @@ -76,5 +76,53 @@ throw e; } } - } + } + + /** + * 涓嬭浇鏂囦欢 + * @param response 鍝嶅簲瀵硅薄 + * @param fileObjectBO 鏂囦欢鐨勪俊鎭紝鍖呭惈鏂囦欢鐨勮緭鍏ユ祦 + * @param closeInputStream 鏄惁鍏抽棴娴� + * @throws IOException 涓嬭浇鍑洪敊鐨勬椂鍊欐姏鍑哄紓甯� + */ + public static void downloadFileLocal(HttpServletResponse response, FileObjectBO fileObjectBO,boolean closeInputStream) throws IOException { + MediaType mediaType = MediaTypeFactory.getMediaType(fileObjectBO.getFileExtension()).orElse(MediaType.APPLICATION_OCTET_STREAM); + // 璁剧疆寮哄埗涓嬭浇涓嶆墦寮� + response.setContentType(mediaType.toString()+";application/force-download;charset=UTF-8"); + try{ + String fileName = URLEncoder.encode(fileObjectBO.getName(), "UTF8"); + response.addHeader("Content-Disposition", "attachment;filename="+ fileName+ ";filename*=utf-8''"); + }catch(Exception e){ + if(log.isErrorEnabled()){ + log.error("璁剧疆鏂囦欢鐨勫悕绉板埌鍝嶅簲娴佺殑鏃跺�欏嚭閿�",e); + } + } + response.setCharacterEncoding("UTF-8"); + Cookie cookie = new Cookie("fileDownload", "true"); + cookie.setPath("/"); + response.addCookie(cookie); + if(closeInputStream) { + try (InputStream ins = (fileObjectBO.getInputStream() != null ? fileObjectBO.getInputStream() : new FileInputStream(fileObjectBO.getFileLocalPath()))) { + IOUtils.copy(ins, response.getOutputStream()); + } catch (IOException e) { + //鏈夊彲鑳藉鎴风鐨勯摼鎺� + if (log.isErrorEnabled()) { + log.error("鍐欏叆鏂囦欢鍒板搷搴旀祦鍑洪敊", e); + } + throw e; + } + }else{ + try { + InputStream ins = (fileObjectBO.getInputStream() != null ? fileObjectBO.getInputStream() : new FileInputStream(fileObjectBO.getFileLocalPath())); + IOUtils.copy(ins, response.getOutputStream()); + } catch (IOException e) { + //鏈夊彲鑳藉鎴风鐨勯摼鎺� + if (log.isErrorEnabled()) { + log.error("鍐欏叆鏂囦欢鍒板搷搴旀祦鍑洪敊", e); + } + throw e; + } + } + } + } diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/LogApplication.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/LogApplication.java index 3cb1c31..ea8f6dd 100644 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/LogApplication.java +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/LogApplication.java @@ -29,7 +29,7 @@ * @author Chill */ @EnableDiscoveryClient -@EnableFeignClients("org.springblade") +@EnableFeignClients(basePackages = {"com.vci.ubcs", "org.springblade"}) @SpringBootApplication public class LogApplication { diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogErrorController.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogErrorController.java index d040838..e43b0f3 100644 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogErrorController.java +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogErrorController.java @@ -25,10 +25,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.Map; diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogLocalController.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogLocalController.java new file mode 100644 index 0000000..30e70e8 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogLocalController.java @@ -0,0 +1,78 @@ +package com.vci.ubcs.log.controller; + +import com.alibaba.nacos.common.utils.StringUtils; +import com.vci.ubcs.log.vo.LocalLogVO; +import com.vci.ubcs.log.service.ILogLocalService; +import com.vci.ubcs.log.entity.LocalLog; +import com.vci.ubcs.resource.utils.FileDownloadUtil; +import com.vci.ubcs.starter.web.util.ControllerUtil; +import com.vci.ubcs.starter.web.util.LangBaseUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.rmi.ServerException; +import java.util.List; + +/** + * 鏈湴绯荤粺鏃ュ織 + * @author ludc + * @date 2023/10/31 15:37 + */ +@NonDS +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/localLog") +public class LogLocalController { + + private final ILogLocalService logLocalService; + + /** + * 鑾峰彇鏃ュ織鏂囦欢鍒楄〃 + * @param localLog + * @return + */ + @PostMapping("/lazy-list") + public R<List<LocalLog>> getSystemLogList(@RequestBody LocalLog localLog){ + return R.data(logLocalService.getSystemLogList(localLog.getLogPath())); + } + + /** + * 涓嬭浇鏃ュ織鏂囦欢 + * @param localLogVO 涓嬭浇鏃ュ織鐨勫叏璺緞闆嗗悎 + * @param response + * @return + */ + @RequestMapping(value = "/downLoadLog",method = {RequestMethod.GET,RequestMethod.POST}) + public void downloadLogByServiceName(@RequestBody LocalLogVO localLogVO, HttpServletResponse response) throws IOException { + try { + //ControllerUtil.writeFileToResponse(response,excelName); + FileDownloadUtil.downloadFileLocal(response, logLocalService.downloadLogByServiceNameAndFileName(localLogVO),true); + } catch (Throwable e) { + //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext + String msg = LangBaseUtil.getErrorMsg(e); + if(StringUtils.isBlank(msg)){ + msg = "鏈煡閿欒"; + } + ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null); + } + } + + /** + * 鍒犻櫎鏃ュ織鏂囦欢 + * @param localLogVO + * @return + * @throws ServerException + */ + @DeleteMapping("/deleteLogFile") + public R deleteLogFile(@RequestBody LocalLogVO localLogVO) throws ServerException { + return logLocalService.deleteLogFile(localLogVO); + } + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogOperateController.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogOperateController.java new file mode 100644 index 0000000..3263ddd --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogOperateController.java @@ -0,0 +1,23 @@ +package com.vci.ubcs.log.controller; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tenant.annotation.NonDS; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 鎿嶄綔鏃ュ織绠$悊:(鍖呮嫭鐧诲綍鏃ュ織銆佹搷浣滄棩蹇椼�佹巿鏉冩棩蹇楋紝浠ュ強绠$悊鍛樼殑浠ヤ笂涓夌鏃ュ織) + * @author ludc + * @date 2023/11/24 10:43 + */ +@NonDS +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/operateLog") +public class LogOperateController { + + + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogSystemController.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogSystemController.java deleted file mode 100644 index 49c0e57..0000000 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/controller/LogSystemController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vci.ubcs.log.controller; - -import com.vci.ubcs.log.service.ILogErrorService; -import com.vci.ubcs.log.service.ILogSystemService; -import com.vci.ubcs.log.entity.SystemLog; -import lombok.AllArgsConstructor; -import org.springblade.core.tenant.annotation.NonDS; -import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * 鏈湴绯荤粺鏃ュ織 - * @author ludc - * @date 2023/10/31 15:37 - */ -@NonDS -@RestController -@AllArgsConstructor -@RequestMapping("/systemLog") -public class LogSystemController { - - private final ILogSystemService logSystemService; - - @GetMapping("/lazy-list") - private R<List<SystemLog>> getSystemLogList(@RequestParam String serviceName){ - return R.data(logSystemService.getSystemLogList(serviceName)); - } - - - - -} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/feign/LogClient.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/feign/LogClient.java index 616af88..4b613ec 100644 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/feign/LogClient.java +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/feign/LogClient.java @@ -67,4 +67,7 @@ log.setParams(log.getParams().replace("&", "&")); return R.data(errorLogService.save(log)); } + + + } diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/mapper/LogOperateMapper.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/mapper/LogOperateMapper.java new file mode 100644 index 0000000..8526497 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/mapper/LogOperateMapper.java @@ -0,0 +1,16 @@ +package com.vci.ubcs.log.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.vci.ubcs.log.entity.LogOperate; +import org.apache.ibatis.annotations.Mapper; + +/** + * 鎿嶄綔鏃ュ織绠$悊:(鍖呮嫭鐧诲綍鏃ュ織銆佹搷浣滄棩蹇椼�佹巿鏉冩棩蹇楋紝浠ュ強绠$悊鍛樼殑浠ヤ笂涓夌鏃ュ織) + * @author ludc + * @date 2023/11/24 10:50 + */ +@Mapper +public interface LogOperateMapper extends BaseMapper<LogOperate> { + + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogLocalService.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogLocalService.java new file mode 100644 index 0000000..7180567 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogLocalService.java @@ -0,0 +1,39 @@ +package com.vci.ubcs.log.service; + +import com.vci.ubcs.log.vo.LocalLogVO; +import com.vci.ubcs.log.entity.LocalLog; +import com.vci.ubcs.resource.bo.FileObjectBO; +import org.springblade.core.tool.api.R; + +import java.rmi.ServerException; +import java.util.List; + +/** + * 鏈湴绯荤粺鏃ュ織 + * @author ludc + * @date 2023/10/31 15:38 + */ +public interface ILogLocalService { + + /** + * 鏌ョ湅锛屾湰鍦扮郴缁熸棩蹇楀垪琛� + * @param logParentPath + * @return + */ + List<LocalLog> getSystemLogList(String logParentPath); + + /** + * 涓嬭浇锛屾牴鎹湇鍔″悕鎵�鍦ㄦ枃浠跺悕鍜屾枃浠跺悕涓嬭浇鏂囦欢 + * @param localLogVO 涓嬭浇鏃ュ織鐨勫璞� + * @return 鏂囦欢鐨勪俊鎭� + */ + FileObjectBO downloadLogByServiceNameAndFileName(LocalLogVO localLogVO) throws ServerException; + + /** + * 鍒犻櫎锛屾牴鎹湇鍔℃墍鍦ㄦ枃浠跺悕锛屽拰鏃ュ織鏂囦欢鍚嶇О鍒犻櫎 + * @param localLogVO + * @return 鎵ц缁撴灉 + */ + R deleteLogFile(LocalLogVO localLogVO) throws ServerException; + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogOperateService.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogOperateService.java new file mode 100644 index 0000000..e10e6c0 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogOperateService.java @@ -0,0 +1,31 @@ +package com.vci.ubcs.log.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.vci.ubcs.log.entity.LogOperate; +import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; +import org.springblade.core.log.exception.ServiceException; + +import java.util.List; + +/** + * 鎿嶄綔鏃ュ織绠$悊:(鍖呮嫭鐧诲綍鏃ュ織銆佹搷浣滄棩蹇椼�佹巿鏉冩棩蹇楋紝浠ュ強绠$悊鍛樼殑浠ヤ笂涓夌鏃ュ織) + * @author ludc + * @date 2023/11/24 10:50 + */ +public interface ILogOperateService extends IService<LogOperate> { + + /** + * 淇濆瓨鎿嶄綔鏃ュ織 + * @param logOperate + * @return + */ + boolean saveLogOperate(LogOperate logOperate) throws ServiceException; + + /** + * 鏉′欢鏌ヨ鑾峰彇鏃ュ織鍒楄〃 + * @param bladeQueryObject + * @return + */ + List<LogOperate> listByCondition(BladeQueryObject bladeQueryObject) throws ServiceException; + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogSystemService.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogSystemService.java deleted file mode 100644 index 30d3e30..0000000 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/ILogSystemService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vci.ubcs.log.service; - -import com.vci.ubcs.log.entity.SystemLog; -import com.vci.ubcs.resource.bo.FileObjectBO; - -import java.rmi.ServerException; -import java.util.List; -import java.util.Map; - -/** - * 鏈湴绯荤粺鏃ュ織 - * @author ludc - * @date 2023/10/31 15:38 - */ -public interface ILogSystemService { - - /** - * 鏌ョ湅锛屾湰鍦扮郴缁熸棩蹇楀垪琛� - * @param logParentPath - * @return - */ - List<SystemLog> getSystemLogList(String logParentPath); - - /** - * 涓嬭浇锛屾牴鎹湇鍔″悕鎵�鍦ㄦ枃浠跺悕鍜屾枃浠跺悕涓嬭浇鏂囦欢 - * @param condition 鏌ヨ鏉′欢map - * @return 鏂囦欢鐨勪俊鎭� - */ - FileObjectBO downloadLogByServiceNameAndFileName(Map<String,String> condition) throws ServerException; - - /** - * 鍒犻櫎锛屾牴鎹湇鍔℃墍鍦ㄦ枃浠跺悕锛屽拰鏃ュ織鏂囦欢鍚嶇О鍒犻櫎 - * @param condition 涓婚敭闆嗗悎 - * @return 鎵ц缁撴灉 - */ - void deleteLogFile(Map<String,String> condition) throws ServerException; - -} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java new file mode 100644 index 0000000..fb50d00 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java @@ -0,0 +1,310 @@ +package com.vci.ubcs.log.service.impl; + +import com.vci.ubcs.log.vo.LocalLogVO; +import com.vci.ubcs.log.service.ILogLocalService; +import com.vci.ubcs.log.entity.LocalLog; +import com.vci.ubcs.resource.utils.FileUtil; +import com.vci.ubcs.resource.utils.ZipUtil; +import com.vci.ubcs.starter.exception.VciBaseException; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.springblade.core.log.exception.ServiceException; +import com.vci.ubcs.omd.cache.EnumCache; +import com.vci.ubcs.omd.enums.EnumEnum; +import com.vci.ubcs.resource.bo.FileObjectBO; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.*; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.rmi.ServerException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 鏈湴绯荤粺鏃ュ織 + * @author ludc + * @date 2023/10/31 15:39 + */ +@Service +@Slf4j +public class LogLocalServiceImpl implements ILogLocalService{ + + /** + * 鍚勪釜鏈嶅姟瀛樻斁鐨勭殑鐖惰矾寰� + */ + @Value("${local-log.parent-path:/data1/ubcs/ubcs-server}") + private String PARENTPATH; + + /** + * 鏃ュ織鏂囦欢鐨勫叿浣撲綅缃� + */ + @Value("${local-log.log-path:/target/log}") + private String LOGPATH; + + /** + * 褰撳墠鎿嶄綔绯荤粺锛屾槸鍚︿负windows绯荤粺 + */ + private Boolean isWindows = true; + + { + String os = System.getProperty("os.name").toLowerCase(); + //榛樿灏遍厤缃负windows鐨勶紝濡傛灉涓嶆槸褰撳墠绯荤粺涓嶆槸windows灏遍渶瑕佸鍏惰浆鎹负linux鐨勬枃浠惰矾寰勬牸寮� + if (!os.contains("win")) { + this.PARENTPATH = this.PARENTPATH.substring(this.PARENTPATH.lastIndexOf(":") + 1).replace("\\", "/"); + this.LOGPATH = this.LOGPATH.replace("\\", "/"); + this.isWindows = false; + } + } + + /** + * 鍘嬬缉鏂囦欢鐨勫伐鍏风被 + */ + @Resource + private ZipUtil zipUtil; + + /** + * 鑾峰彇鏈湴鏃ュ織鍒楄〃 + * @param logParentPath + * @return + */ + //@Override + public List<LocalLog> getSystemLogList(String logParentPath) { + List<LocalLog> localLogs = new ArrayList<>(); + // 涓嶄负绌鸿鏄庢槸鍔犺浇褰撳墠杩欎釜鏈嶅姟璺緞涓嬬殑鏃ュ織鏂囦欢 + if(Func.isNotEmpty(logParentPath)){ + File file = new File(logParentPath); + if (file.isDirectory()) { + File[] files = file.listFiles(); + Arrays.stream(files).forEach(item->{ + // 缁勫缓鏃ュ織鏂囦欢瀵硅薄 + LocalLog localLog = new LocalLog(); + localLog.setLogName(item.getName()); + localLog.setLogType(getLogType(item.getName())); + localLog.setCreateTime(getLastModifiedOrCreatTime(false,logParentPath)); + localLog.setLastModifier(getLastModifiedOrCreatTime(true,logParentPath)); + localLog.setLogPath(logParentPath); + String serviceId = getServiceId(logParentPath); + localLog.setServiceId(serviceId); + localLog.setServiceName(getServiceName(serviceId)); + localLog.setHasChildren(false); + localLogs.add(localLog); + }); + } + }else { + File fileDir = new File(PARENTPATH); + File[] childDir = fileDir.listFiles(); + Arrays.stream(childDir).forEach(dir->{ + if(dir.getName().contains("ubcs_")){ + String fullPath = dir.getPath() + LOGPATH; + File file = new File(fullPath); + LocalLog localLog = new LocalLog(); + localLog.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); + localLog.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); + localLog.setLogPath(fullPath); + String serviceId = getServiceId(file.getPath()); + localLog.setServiceId(serviceId); + String serviceName = getServiceName(serviceId); + localLog.setServiceName(serviceName); + localLog.setLogType(serviceName+"鏃ュ織鐖剁洰褰�"); + localLog.setLogName(serviceName+"鏃ュ織鐖剁洰褰�"); + localLog.setHasChildren(true); + localLogs.add(localLog); + } + }); + } + return localLogs; + } + + /** + * 鑾峰彇鏂囦欢鏈�鍚庝慨鏀规垨鑰呭垱寤烘椂闂� + * @param isModifier + * @return + */ + private String getLastModifiedOrCreatTime(boolean isModifier,String pathStr) { + Path path = FileSystems.getDefault().getPath(pathStr); + String date = ""; + try { + BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 鏄幏鍙栨渶鍚庝慨鏀规椂闂� + if(isModifier){ + date = dateFormat.format(new Date(attr.lastModifiedTime().toMillis())); + }else { + date = dateFormat.format(new Date(attr.creationTime().toMillis())); + } + } catch (IOException e) { + throw new ServiceException("Error reading file date attributes: " + e.getMessage()); + } + return date; + } + + /** + * 鑾峰彇鏃ュ織绫诲瀷 + * @param fileName + * @return + */ + private String getLogType(String fileName){ + //鍒ゆ柇鏃ュ織鐨勭殑绫诲瀷 + if (fileName.contains("error")) { + return "Error"; + } else if (fileName.contains("info")) { + return "Info"; + } else if (fileName.contains("warning")) { + return "Warning"; + } else { + return "Unknown"; + } + } + + /** + * 鑾峰彇鏈嶅姟ID + * @param servciePath + * @return + */ + private String getServiceId(String servciePath){ + // 鏍规嵁褰撳墠鎿嶄綔绯荤粺鏉ュ喅瀹氭槸閫氳繃浠�涔堝瓧绗︽潵鎴彇 + String[] parts = servciePath.split(this.isWindows ? "\\\\":"/"); + String extractedString = ""; + if(parts.length > 3){ + extractedString = parts[parts.length - 3]; + } + return extractedString; + } + + /** + * 鑾峰彇鏈嶅姟鍚嶇О + * @param serViceId + * @return + */ + private String getServiceName(String serViceId){ + return EnumCache.getValue(EnumEnum.SERCIVE_NAME_ROLE, serViceId); + } + + /** + * 鎴彇璺緞涓殑鏃ュ織鏂囦欢鍚嶇О + * @param logFullPath + * @return + */ + private String getLogFileName(String logFullPath){ + // 鏍规嵁褰撳墠鎿嶄綔绯荤粺鏉ュ喅瀹氭槸閫氳繃浠�涔堝瓧绗︽潵鎴彇 + String[] parts = logFullPath.split(this.isWindows ? "\\\\":"/"); + String logFileName = ""; + if(parts.length > 3){ + logFileName = parts[parts.length - 1]; + } + return logFileName; + } + + /** + * 涓嬭浇鏃ュ織鏂囦欢 + * @param localLogVO 涓嬭浇鏃ュ織瀵硅薄 + * @return + * @throws ServerException + */ + @Override + public FileObjectBO downloadLogByServiceNameAndFileName(LocalLogVO localLogVO) throws ServerException { + if(Func.isEmpty(localLogVO) || Func.isEmpty(localLogVO.getLogPath())){ + throw new ServerException("鏈幏鍙栧埌璇ユ棩蹇楄矾寰勶紒"); + } + FileObjectBO fileObjectBO = new FileObjectBO(); + String logFullPaths = localLogVO.getLogFullPaths(); + // 鍒ゆ柇鏄惁鏄埗鐩綍 + if(!localLogVO.getHasChildren()){ + //鍙笅杞戒竴涓棩蹇楁枃浠� + File file = new File(logFullPaths); + if(!file.isFile() || !file.exists()){ + throw new ServerException("鏈湴鏃ュ織鏂囦欢璺緞"+ logFullPaths +"涓湭鎵惧埌鏃ュ織"); + } + try { + fileObjectBO.setName(file.getName()); + fileObjectBO.setInputStream(new FileInputStream(file)); + fileObjectBO.setFileLocalPath(logFullPaths); + fileObjectBO.setFileExtension(".log"); + }catch (Throwable e){ + throw new VciBaseException("鑾峰彇鏂囦欢鐨勬祦鏈夐棶棰�",new String[]{logFullPaths},e); + } + }else{ + // 鏄埗鐩綍锛屾墍浠ラ渶瑕佽幏鍙栧埌涓嬮潰鐨勬墍鏈夊瓙鐩綍 + // 鏈夊涓紝闇�瑕佷娇鐢▃ip杩涜鍘嬬缉 + String tempFolder = FileUtil.getDefaultTempFolder(); + File[] file1 = new File(logFullPaths).listFiles(); + if(file1.length > 0){ + Arrays.stream(file1).forEach(item->{ + String fileName = tempFolder + File.separator + System.currentTimeMillis() + ".log"; + File file = new File(fileName); + try { + if(!file.exists()) { + file.createNewFile(); + } + }catch (Throwable e){ + throw new VciBaseException("鍒涘缓鏂囦欢鍑洪敊,{0}",new String[]{fileName}); + } + File logFile = new File(item.getPath()); + if(!logFile.exists() || !logFile.isFile()){ + throw new VciBaseException("鏈湴鏃ュ織鏂囦欢璺緞"+item.getPath()+"涓湭鎵惧埌鏃ュ織"); + } + + try(OutputStream os = new FileOutputStream(file); + InputStream ins = new FileInputStream(logFile); + ){ + IOUtils.copy(ins,os); + }catch (Throwable e){ + throw new VciBaseException("涓嬭浇鏂囦欢鍒颁复鏃舵枃浠跺す閲屽嚭閿�,{0}",new String[]{fileName}); + } + }); + String zipName = new File(tempFolder).getPath() + File.separator + getLogFileName(logFullPaths) + "绛�"+file1.length + "涓枃浠�.zip"; + zipUtil.folderToZipFile(tempFolder,zipName); + fileObjectBO.setFileLocalPath(zipName); + fileObjectBO.setFileExtension(".log"); + if(log.isDebugEnabled()){ + log.debug("涓嬭浇鏂囦欢鐨勪俊鎭�,",zipName); + } + } + } + return fileObjectBO; + } + + /** + * 鍒犻櫎鏃ュ織鏂囦欢 + * @param localLogVO 鏂囦欢鍏ㄨ矾寰勯泦鍚� + * @throws ServerException + */ + @Override + public R deleteLogFile(LocalLogVO localLogVO) throws ServerException { + List<String> resMsgs = new ArrayList<>(); + // 鍒ゆ柇鏄惁鏄棩蹇楅《灞傜洰褰� + if(localLogVO.getHasChildren()){ + // 鏄《灞傜洰褰曪紝闇�瑕佸惊鐜幓鍒犻櫎鍖呭惈鐨勬墍鏈夋棩蹇楁枃浠� + File parentFile = new File(localLogVO.getLogFullPaths()); + if(parentFile.isDirectory()){ + Arrays.stream(parentFile.listFiles()).forEach(logFile->{ + if (logFile.exists()) { + //鍒犻櫎澶辫触鐨勭洿鎺ヨ褰曚笅鏂囦欢鍚� + if (!logFile.delete()) { + resMsgs.add(getLogFileName(logFile.getPath())); + } + } + }); + } + }else { + // 鍗曚釜鍒犻櫎 + File file = new File(localLogVO.getLogFullPaths()); + if (file.exists()) { + //鍒犻櫎澶辫触鐨勭洿鎺ヨ褰曚笅鏂囦欢鍚� + if (!file.delete()) { + resMsgs.add(getLogFileName(localLogVO.getLogFullPaths())); + } + } + } + return resMsgs.size()==0 ? R.success("鍒犻櫎鎴愬姛!"):R.fail("浠ヤ笅鏃ュ織鏂囦欢锛�"+resMsgs.stream().collect(Collectors.joining(","))+"鍒犻櫎澶辫触!"); + } + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogOperateServiceImpl.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogOperateServiceImpl.java new file mode 100644 index 0000000..a7d5fd0 --- /dev/null +++ b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogOperateServiceImpl.java @@ -0,0 +1,59 @@ +package com.vci.ubcs.log.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.vci.ubcs.log.entity.LogOperate; +import com.vci.ubcs.log.mapper.LogOperateMapper; +import com.vci.ubcs.log.service.ILogOperateService; +import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 鎿嶄綔鏃ュ織绠$悊:(鍖呮嫭鐧诲綍鏃ュ織銆佹搷浣滄棩蹇椼�佹巿鏉冩棩蹇楋紝浠ュ強绠$悊鍛樼殑浠ヤ笂涓夌鏃ュ織) + * @author ludc + * @date 2023/11/24 10:51 + */ +@Service +public class LogOperateServiceImpl extends ServiceImpl<LogOperateMapper,LogOperate> implements ILogOperateService { + + @Autowired + private LogOperateMapper logOperateMapper; + + /** + * 淇濆瓨鎿嶄綔鏃ュ織 + * @param logOperate + * @return + */ + @Override + public boolean saveLogOperate(LogOperate logOperate)throws ServiceException { + if(Func.isEmpty(logOperate)){ + return false; + } + return SqlHelper.retBool(logOperateMapper.insert(logOperate)); + } + + /** + * 鏉′欢鏌ヨ鑾峰彇鏃ュ織鍒楄〃 + * @param bladeQueryObject + * @return + */ + @Override + public List<LogOperate> listByCondition(BladeQueryObject bladeQueryObject) throws ServiceException{ + Map<String, Object> conditionMap = bladeQueryObject.getConditionMap(); + if(conditionMap.isEmpty() || Func.isBlank(conditionMap.get("logType").toString())){ + throw new ServiceException("鏃ュ織鏌ヨ蹇呬紶鍙傛暟銆愭棩蹇楃被鍨嬨�戜笉鑳戒负绌猴紒"); + } + // map瀵硅薄杞崲涓烘煡璇㈠璞� + QueryWrapper<LogOperate> queryWrapper = Condition.getQueryWrapper(bladeQueryObject.getConditionMap(),LogOperate.class); + return this.list(queryWrapper); + } + +} diff --git a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogSystemServiceImpl.java b/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogSystemServiceImpl.java deleted file mode 100644 index 6f6f4ea..0000000 --- a/Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogSystemServiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.vci.ubcs.log.service.impl; - -import com.vci.ubcs.log.service.ILogSystemService; -import com.vci.ubcs.log.entity.SystemLog; -import org.springblade.core.log.exception.ServiceException; -import com.vci.ubcs.omd.cache.EnumCache; -import com.vci.ubcs.omd.enums.EnumEnum; -import com.vci.ubcs.resource.bo.FileObjectBO; -import org.springblade.core.tool.utils.Func; -import org.springframework.stereotype.Service; -import java.io.File; -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.BasicFileAttributes; -import java.rmi.ServerException; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * 鏈湴绯荤粺鏃ュ織 - * @author ludc - * @date 2023/10/31 15:39 - */ -@Service -public class LogSystemServiceImpl implements ILogSystemService{ - - /** - * 鍚勪釜鏈嶅姟瀛樻斁鐨勭殑鐖惰矾寰� - */ - private final String parentPath = "/data1/ubcs/ubcs-server"; - - /** - * 鍚勪釜鏈嶅姟鐨勬棩蹇楀叿浣撶殑鐩綍璺緞 - */ - //@Value("#{'${ip-whitelist.ip}'.split(',')}") - private List<String> serviceDirNames = new ArrayList<>(Arrays.asList("/ubcs_code/target/log","/ubcs_omd/target/log","/ubcs_system/target/log")); - - /** - * 鑾峰彇鏈湴鏃ュ織鍒楄〃 - * @param logParentPath - * @return - */ - @Override - public List<SystemLog> getSystemLogList(String logParentPath) { - List<SystemLog> systemLogs = new ArrayList<>(); - // 涓嶄负绌鸿鏄庢槸鍔犺浇褰撳墠杩欎釜鏈嶅姟璺緞涓嬬殑鏃ュ織鏂囦欢 - if(Func.isNotEmpty(logParentPath)){ - File file = new File(logParentPath); - if (file.isDirectory()) { - File[] files = file.listFiles(); - Arrays.stream(files).forEach(item->{ - // 缁勫缓鏃ュ織鏂囦欢瀵硅薄 - SystemLog systemLog = new SystemLog(); - systemLog.setLogName(item.getName()); - systemLog.setLogType(getLogType(item.getName())); - systemLog.setCreateTime(getLastModifiedOrCreatTime(false,logParentPath)); - systemLog.setLastmodifier(getLastModifiedOrCreatTime(true,logParentPath)); - systemLog.setLogPath(logParentPath); - String serviceId = getServiceId(logParentPath); - systemLog.setServiceId(serviceId); - systemLog.setServiceName(getServiceName(serviceId)); - systemLogs.add(systemLog); - }); - } - }else { - serviceDirNames.stream().forEach(serviceDirName->{ - File file = new File(parentPath+serviceDirName); - SystemLog systemLog = new SystemLog(); - systemLog.setLastmodifier(getLastModifiedOrCreatTime(true,parentPath+serviceDirName)); - systemLog.setCreateTime(getLastModifiedOrCreatTime(false,parentPath+serviceDirName)); - systemLog.setLogPath(parentPath+serviceDirName); - String serviceId = getServiceId(logParentPath); - systemLog.setServiceId(serviceId); - systemLog.setServiceName(getServiceName(serviceId)); - systemLogs.add(systemLog); - }); - } - return systemLogs; - } - - /** - * 鑾峰彇鏂囦欢鏈�鍚庝慨鏀规垨鑰呭垱寤烘椂闂� - * @param isModifier - * @return - */ - private String getLastModifiedOrCreatTime(boolean isModifier,String pathStr) { - Path path = FileSystems.getDefault().getPath(pathStr); - String date = ""; - try { - BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 鏄幏鍙栨渶鍚庝慨鏀规椂闂� - if(isModifier){ - date = dateFormat.format(new Date(attr.lastModifiedTime().toMillis())); - }else { - date = dateFormat.format(new Date(attr.creationTime().toMillis())); - } - } catch (IOException e) { - throw new ServiceException("Error reading file date attributes: " + e.getMessage()); - } - return date; - } - - /** - * 鑾峰彇鏃ュ織绫诲瀷 - * @param fileName - * @return - */ - private String getLogType(String fileName){ - //鍒ゆ柇鏃ュ織鐨勭殑绫诲瀷 - if (fileName.contains("error")) { - return "Error"; - } else if (fileName.contains("info")) { - return "Info"; - } else if (fileName.contains("warning")) { - return "Warning"; - } else { - return "Unknown"; - } - } - - /** - * 鑾峰彇鏈嶅姟ID - * @param servciePath - * @return - */ - private String getServiceId(String servciePath){ - String[] parts = servciePath.split("/"); - String extractedString = parts[parts.length - 2]; - return extractedString; - } - - /** - * 鑾峰彇鏈嶅姟鍚嶇О - * @param serViceId - * @return - */ - private String getServiceName(String serViceId){ - return EnumCache.getValue(EnumEnum.SERCIVE_NAME_ROLE, serViceId); - } - - /** - * 涓嬭浇鏃ュ織鏂囦欢 - * @param condition 鏌ヨ鏉′欢map - * @return - * @throws ServerException - */ - @Override - public FileObjectBO downloadLogByServiceNameAndFileName(Map<String, String> condition) throws ServerException { - return null; - } - - /** - * 鍒犻櫎鏃ュ織鏂囦欢 - * @param condition 涓婚敭闆嗗悎 - * @throws ServerException - */ - @Override - public void deleteLogFile(Map<String, String> condition) throws ServerException { - - } - -} diff --git a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/java/com/vci/ubcs/resource/controller/FileController.java b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/java/com/vci/ubcs/resource/controller/FileController.java index b81f862..626effe 100644 --- a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/java/com/vci/ubcs/resource/controller/FileController.java +++ b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/java/com/vci/ubcs/resource/controller/FileController.java @@ -1,6 +1,7 @@ package com.vci.ubcs.resource.controller; import com.alibaba.fastjson.JSON; +import com.alibaba.nacos.common.utils.StringUtils; import com.baomidou.mybatisplus.core.metadata.IPage; import com.vci.ubcs.resource.dto.FileObjectDTO; import com.vci.ubcs.resource.dto.FileReleaseDTO; @@ -24,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.List; @@ -38,36 +40,40 @@ @Slf4j public class FileController { - /** - * 鏂囦欢鏈嶅姟 - */ - @Autowired - private IFileService fileService; + /** + * 鏂囦欢鏈嶅姟 + */ + @Autowired + private IFileService fileService; - /** - * 鏍规嵁鏂囦欢涓婚敭涓嬭浇鏂囦欢 - * @param fileOids 鏂囦欢鐨勪富閿� - * @param response 鍝嶅簲鐨勫璞� - * @return 鎵ц缁撴灉锛屽彧鏈変笅杞藉け璐ョ殑鏃跺�欐墠浼氳繖鏍� - */ + /** + * 鏍规嵁鏂囦欢涓婚敭涓嬭浇鏂囦欢 + * @param fileOids 鏂囦欢鐨勪富閿� + * @param response 鍝嶅簲鐨勫璞� + * @return 鎵ц缁撴灉锛屽彧鏈変笅杞藉け璐ョ殑鏃跺�欐墠浼氳繖鏍� + */ @RequestMapping(value = "/downloadFilesByOids",method = {RequestMethod.GET,RequestMethod.POST}) - public String downloadFilesByOids(@RequestParam String fileOids, HttpServletResponse response){ - try{ + public void downloadFilesByOids(@RequestParam String fileOids, HttpServletResponse response) throws IOException { + try { + //ControllerUtil.writeFileToResponse(response,excelName); FileDownloadUtil.downloadFile(response, fileService.downloadFileByOids(VciBaseUtil.str2List(fileOids))); - }catch (Throwable e){ - return JSON.toJSONString(R.fail(LangBaseUtil.getErrorMsg(e))); + } catch (Throwable e) { + //濡傛灉鍑洪敊,鎶婇敊璇俊鎭啓鍒皌ext + String msg = LangBaseUtil.getErrorMsg(e); + if(StringUtils.isBlank(msg)){ + msg = "鏈煡閿欒"; + } + ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null); } - //鍥犱负璁剧疆浜嗗搷搴攃ontentType,鎵�浠ヨ繖鍎夸笉鑳藉啀鐩存帴杩斿洖R浜嗭紝鍙兘浼氬鑷存姤閿� - return JSON.toJSONString(R.success("涓嬭浇瀹屾垚")) ; } - /** - * 鏂囦欢鍒犻櫎 - * @param oids 鏂囦欢鐨勪富閿� - * @return 鏂囦欢鍐呭 - */ - @DeleteMapping("/deleteFile") - public R deleteFile(@RequestBody Collection<String> oids){ + /** + * 鏂囦欢鍒犻櫎 + * @param oids 鏂囦欢鐨勪富閿� + * @return 鏂囦欢鍐呭 + */ + @DeleteMapping("/deleteFile") + public R deleteFile(@RequestBody Collection<String> oids){ try { fileService.deleteFiles(oids); }catch (Throwable e){ @@ -79,104 +85,104 @@ log.debug(msg); return R.fail(msg); } - return R.success("鍒犻櫎鎴愬姛"); - } + return R.success("鍒犻櫎鎴愬姛"); + } - /** - * 鍓嶇椤甸潰鍗曟枃浠朵笂浼犮��(鍏堟暟鎹紝鍚庢枃浠舵ā寮忎笂浼�) - * @param file 涓婁紶鐨勬枃浠� - * @param fileObjectDTO 鏂囦欢淇℃伅浼犺緭瀵硅薄 - * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄 - */ - @PostMapping("/uploadFile") - public R<FileObjectVO> uploadFile(MultipartFile file, FileObjectDTO fileObjectDTO){ - if (file != null ) { - return fileService.uploadFile(file, fileObjectDTO); - } else { - return R.fail("鏃犱笂浼犵殑鏂囦欢"); - } - } + /** + * 鍓嶇椤甸潰鍗曟枃浠朵笂浼犮��(鍏堟暟鎹紝鍚庢枃浠舵ā寮忎笂浼�) + * @param file 涓婁紶鐨勬枃浠� + * @param fileObjectDTO 鏂囦欢淇℃伅浼犺緭瀵硅薄 + * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄 + */ + @PostMapping("/uploadFile") + public R<FileObjectVO> uploadFile(MultipartFile file, FileObjectDTO fileObjectDTO){ + if (file != null ) { + return fileService.uploadFile(file, fileObjectDTO); + } else { + return R.fail("鏃犱笂浼犵殑鏂囦欢"); + } + } - /** - * 鍦ㄤ笂浼犳枃浠跺悗锛屼繚瀛樻枃浠剁殑淇℃伅 - * @param fileObjectDTO 鏂囦欢淇℃伅浼犺緭瀵硅薄 - * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄 - */ - @PostMapping("/saveFileAfterUpload") - public R<FileObjectVO> saveFileAfterUpload( @RequestBody FileObjectDTO fileObjectDTO){ - return fileService.saveFileAfterUpload(fileObjectDTO); - } + /** + * 鍦ㄤ笂浼犳枃浠跺悗锛屼繚瀛樻枃浠剁殑淇℃伅 + * @param fileObjectDTO 鏂囦欢淇℃伅浼犺緭瀵硅薄 + * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄 + */ + @PostMapping("/saveFileAfterUpload") + public R<FileObjectVO> saveFileAfterUpload( @RequestBody FileObjectDTO fileObjectDTO){ + return fileService.saveFileAfterUpload(fileObjectDTO); + } - /** - * 灏嗗師鏁版嵁涓嬬殑鎵�鏈夋枃浠跺叡浜埌鍏朵粬鐨勪笟鍔℃暟鎹笅 - * @param shareDTO 鏂囦欢鍒嗕韩 - * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄,鏄涓� - */ - @PostMapping("/shareFiles") - public R<List<FileObjectVO>> shareFiles(@RequestBody FileShareDTO shareDTO){ - return fileService.shareFiles(shareDTO); - } + /** + * 灏嗗師鏁版嵁涓嬬殑鎵�鏈夋枃浠跺叡浜埌鍏朵粬鐨勪笟鍔℃暟鎹笅 + * @param shareDTO 鏂囦欢鍒嗕韩 + * @return 鏂囦欢淇℃伅鏄剧ず瀵硅薄,鏄涓� + */ + @PostMapping("/shareFiles") + public R<List<FileObjectVO>> shareFiles(@RequestBody FileShareDTO shareDTO){ + return fileService.shareFiles(shareDTO); + } - /** - * 淇敼鏂囦欢淇℃伅(涓嶅惈鏂囦欢),娉ㄦ剰objectName鍜宖ilePath涓嶄細鍙樺寲 - * @param fileDTOs 鏂囦欢鐨勬暟鎹璞� - * @return 鎵ц缁撴灉 - */ - @PostMapping("/updateFileInfos") - public R updateFileInfos(@RequestBody Collection<FileObjectDTO> fileDTOs){ - return fileService.updateFileInfos(fileDTOs); - } + /** + * 淇敼鏂囦欢淇℃伅(涓嶅惈鏂囦欢),娉ㄦ剰objectName鍜宖ilePath涓嶄細鍙樺寲 + * @param fileDTOs 鏂囦欢鐨勬暟鎹璞� + * @return 鎵ц缁撴灉 + */ + @PostMapping("/updateFileInfos") + public R updateFileInfos(@RequestBody Collection<FileObjectDTO> fileDTOs){ + return fileService.updateFileInfos(fileDTOs); + } - /** - * 鏂囦欢鐢熸晥 - * @param ids 鏂囦欢鐨勪富閿� - * @return 鎵ц缁撴灉 - */ - @PutMapping("/releasedFiles") - public R releasedFiles(@RequestBody Collection<String> ids){ - return fileService.releasedFiles(ids); - } + /** + * 鏂囦欢鐢熸晥 + * @param ids 鏂囦欢鐨勪富閿� + * @return 鎵ц缁撴灉 + */ + @PutMapping("/releasedFiles") + public R releasedFiles(@RequestBody Collection<String> ids){ + return fileService.releasedFiles(ids); + } - /** - * 鎵归噺鎸囧畾鏂囦欢涓氬姟鏁版嵁鍚庣敓鏁� - * @param releaseDTOS 鐢熸晥鐨勭浉鍏充俊鎭� - * @return 鎵ц缁撴灉 - */ - @PutMapping("/releasedFilesForOwn") - public R releasedFilesForOwn(@RequestBody Collection<FileReleaseDTO> releaseDTOS){ - return fileService.releasedFilesForOwn(releaseDTOS); - } + /** + * 鎵归噺鎸囧畾鏂囦欢涓氬姟鏁版嵁鍚庣敓鏁� + * @param releaseDTOS 鐢熸晥鐨勭浉鍏充俊鎭� + * @return 鎵ц缁撴灉 + */ + @PutMapping("/releasedFilesForOwn") + public R releasedFilesForOwn(@RequestBody Collection<FileReleaseDTO> releaseDTOS){ + return fileService.releasedFilesForOwn(releaseDTOS); + } - /** - * 浣跨敤涓氬姟绫诲瀷鏌ヨ鏂囦欢鐨勪俊鎭紝鎻愪緵缁欓〉闈㈣皟鐢� - * @param fileQuery 鏌ヨ瀵硅薄 - * @return 鏂囦欢鐨勬樉绀哄璞� - */ - @RequestMapping(value = "/listFiles",method = {RequestMethod.GET,RequestMethod.POST}) - public R<IPage<FileObjectVO>> listFiles(FileQuery fileQuery, Query query){ - return R.data(fileService.listFiles(fileQuery,query)); - } + /** + * 浣跨敤涓氬姟绫诲瀷鏌ヨ鏂囦欢鐨勪俊鎭紝鎻愪緵缁欓〉闈㈣皟鐢� + * @param fileQuery 鏌ヨ瀵硅薄 + * @return 鏂囦欢鐨勬樉绀哄璞� + */ + @RequestMapping(value = "/listFiles",method = {RequestMethod.GET,RequestMethod.POST}) + public R<IPage<FileObjectVO>> listFiles(FileQuery fileQuery, Query query){ + return R.data(fileService.listFiles(fileQuery,query)); + } - /** - * 浣跨敤鏂囦欢涓婚敭鑾峰彇瀵硅薄 - * @param oid 涓婚敭 - * @return 鏂囦欢鏄剧ず瀵硅薄 - */ - @GetMapping("/get") - public FileObjectVO get(String oid){ - return fileService.get(oid); - } + /** + * 浣跨敤鏂囦欢涓婚敭鑾峰彇瀵硅薄 + * @param oid 涓婚敭 + * @return 鏂囦欢鏄剧ず瀵硅薄 + */ + @GetMapping("/get") + public FileObjectVO get(String oid){ + return fileService.get(oid); + } - /** - * 浣跨敤鏂囦欢鐨勪富閿壒閲忚幏鍙栧璞� - * @param oids 鏂囦欢鐨勪富閿泦鍚� - * @return 鏂囦欢鐨勬樉绀轰俊鎭� - */ - @GetMapping("/listFilesByOids") - public List<FileObjectVO> listFilesByOids( Collection<String> oids){ - return fileService.listFilesByOids(oids); - } + /** + * 浣跨敤鏂囦欢鐨勪富閿壒閲忚幏鍙栧璞� + * @param oids 鏂囦欢鐨勪富閿泦鍚� + * @return 鏂囦欢鐨勬樉绀轰俊鎭� + */ + @GetMapping("/listFilesByOids") + public List<FileObjectVO> listFilesByOids( Collection<String> oids){ + return fileService.listFilesByOids(oids); + } } diff --git a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/application-prod.yml b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/application-prod.yml index d80f6c2..080f06c 100644 --- a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/application-prod.yml +++ b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/application-prod.yml @@ -23,7 +23,3 @@ secret-key: Reo4wW8EWF4gSizUmVsNjWfbDZzR3rBYFn5Jehd9 bucket-name: vci-ubcs -#鍏抽棴椹煎嘲鍛藉悕鏄犲皠 -mybatis-plus: - configuration: - map-underscore-to-camel-case: false diff --git a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/AttachMapper.xml b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/AttachMapper.xml index 81ffb52..c29205b 100644 --- a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/AttachMapper.xml +++ b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/AttachMapper.xml @@ -22,7 +22,7 @@ <select id="selectAttachPage" resultMap="attachResultMap"> - select * from blade_attach where is_deleted = 0 + select * from blade_attach where isdeleted = 0 </select> </mapper> diff --git a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/SmsMapper.xml b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/SmsMapper.xml index 002cc0f..ac43f88 100644 --- a/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/SmsMapper.xml +++ b/Source/UBCS/ubcs-ops/ubcs-resource/src/main/resources/mapper/SmsMapper.xml @@ -24,7 +24,7 @@ <select id="selectSmsPage" resultMap="smsResultMap"> - select * from pl_sys_sms where is_deleted = 0 + select * from pl_sys_sms where isdeleted = 0 </select> </mapper> diff --git a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/DockingPreAttrMappingServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/DockingPreAttrMappingServiceImpl.java index 9c6eef1..86a2b9b 100644 --- a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/DockingPreAttrMappingServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/DockingPreAttrMappingServiceImpl.java @@ -225,7 +225,7 @@ try { count = dockingPreAttrMappingMapper.selectCount(Wrappers.<DockingPreAttrMapping>query().lambda().eq(DockingPreAttrMapping::getTargetClassifyId, targetClassifyId).eq(DockingPreAttrMapping::getSourceClassifyId,sourceClassifyId)); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); } finally { return count>0?true:false; } diff --git a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/GroupMdmInterServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/GroupMdmInterServiceImpl.java index b0535f1..3db3194 100644 --- a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/GroupMdmInterServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/service/impl/GroupMdmInterServiceImpl.java @@ -471,7 +471,7 @@ } return R.success(message); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); log.error("鑾峰彇鏁版嵁妯″瀷澶辫触"+e); R.fail(message); } @@ -537,7 +537,7 @@ } }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); log.error("鑾峰彇鐢宠鍗曠姸鎬佸け璐�"+e); throw new VciBaseException(message); } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java index ac7770b..5886f2d 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java @@ -16,12 +16,10 @@ */ package com.vci.ubcs.code; -import com.vci.ubcs.starter.util.VciSpringUtil; import org.springblade.core.cloud.client.UbcsCloudApplication; import org.springblade.core.launch.UbcsApplication; import org.springblade.core.launch.constant.AppConstant; import org.springframework.context.annotation.ComponentScan; -import org.springframework.stereotype.Component; /** * Code鍚姩鍣� diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSyncUniversalController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSyncUniversalController.java index 44ea636..0f2f922 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSyncUniversalController.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSyncUniversalController.java @@ -71,7 +71,7 @@ this.setHttpToThreadLocal(request); result= universalInterfaceI.syncEditData(dataString,dataType); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); logger.error("syncData->"+e.getMessage()); } return result; diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeApplyWebManagementServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeApplyWebManagementServiceImpl.java index f43d83a..a0be413 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeApplyWebManagementServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeApplyWebManagementServiceImpl.java @@ -48,7 +48,7 @@ QueryWrapper<SystemClassifyRole> wrapper = new QueryWrapper<>(); wrapper.eq("systemOid",systemOid); wrapper.eq("systemId",systemId); - List<SystemClassifyRole> systemClassifyRoles = this.listByIds(roleList.stream().map(SystemClassifyRole ::getOid).collect(Collectors.toList()));; + List<SystemClassifyRole> systemClassifyRoles = this.listByIds(roleList.stream().map(SystemClassifyRole ::getOid).collect(Collectors.toList())); this.remove(wrapper); List<SystemClassifyRole> newSCRoles = new ArrayList<>(); //鏁版嵁澶勭悊 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 91912c7..c596095 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 @@ -873,13 +873,13 @@ //涓嶅拷鐣ュぇ灏忓啓銆佷笉鍘荤┖銆佷笉蹇界暐鍏ㄥ崐瑙� temp = "%s"; } - queryKey = String.format(temp, "t." + attrId); + queryKey = String.format(temp, "nvl("+ "t." + attrId +",'/')"); queryValue = String.format(temp, "'" + (trim ? value.trim() : value) + "'"); conditionMap.put(queryKey, queryValue); } else { if(StringUtils.isNotBlank(value)) { //涓虹┖鐨勬椂鍊欎笉浠h〃涓嶆牎楠岋紝鍙槸涓嶅幓闄ょ浉鍏崇殑淇℃伅 - conditionMap.put("t." + attrId, "'" + value + "'"); + conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + value + "'"); }else{ conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL); } @@ -1961,7 +1961,7 @@ String sqlHasPage = pageHelper.getLimit() > 0 ? ("select * from (select A.*,rownum RN from (" + sql + whereSubfixForPage) : sql; String sqlCount = "select count(1) from " + tableName + SPACE + "t" + SPACE + joinTableList.values().stream().collect(Collectors.joining(SPACE)) + (StringUtils.isBlank(whereSql) ? "" : " where ") + whereSql; - String sqlId = "select ID from " + tableName + SPACE + "t" + SPACE + joinTableList.values().stream().collect(Collectors.joining(SPACE)) + String sqlId = "select t.ID from " + tableName + SPACE + "t" + SPACE + joinTableList.values().stream().collect(Collectors.joining(SPACE)) + (StringUtils.isBlank(whereSql) ? "" : " where ") + whereSql; CodeTemplateAttrSqlBO sqlBO = new CodeTemplateAttrSqlBO(); sqlBO.setTableName(tableName); 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 90cabea..87cfaee 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 @@ -885,7 +885,7 @@ String idFieldName = attrVOS.stream().filter(s -> VciQueryWrapperForDO.ID_FIELD.equalsIgnoreCase(s.getId())).findFirst().orElseGet(() -> new CodeClassifyTemplateAttrVO()).getName(); getFieldIndexMap(titleRowData, attrNameIdMap, fieldIndexMap); //鍏堜笉鐢ㄧ灞炴�ф槸鍚﹂兘瀛樺湪锛屽厛杞崲涓�涓嬫暟鎹� - List<ClientBusinessObject> cboList = new CopyOnWriteArrayList<>(); + List<ClientBusinessObject> cboList = new ArrayList<>(); String fullPath = getFullPath(classifyFullInfo); //鎴戜滑闇�瑕佽幏鍙栧埌鎵�鏈夌殑涓嬬骇鍒嗙被鐨刼id鐨勮矾寰勶紝鍥犱负鍚庨潰闇�瑕� Map<String/**涓婚敭**/, String/**璺緞**/> childOidPathMap = getChildClassifyPathMap(classifyFullInfo, fullPath); 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 e468dc1..56d77fd 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 @@ -1070,7 +1070,7 @@ } }); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); msg="缂栫爜鏇存敼/鐘舵�佹洿鏀�/鍒犻櫎:"+e.getMessage(); /* XMLResultSystemVO XMLResultSystemVO=new XMLResultSystemVO(); XMLResultSystemVO.setErrorid(errorid); @@ -1254,7 +1254,7 @@ issucess=true; resultData.setLibrary(libraryVo); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); msg="鏌ヨ鍒嗙被澶辫触:"+e.getMessage(); }finally { resultData.setErrorid(errorid); @@ -1473,7 +1473,7 @@ msg = "鎺ュ彛鍙傛暟锛歭ibrary 鏈煡璇㈠埌瀵瑰簲鐨勫簱鑺傜偣淇℃伅"; } }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); msg="鏌ヨ鏁版嵁澶辫触:"+e.getMessage(); }finally { resultDataVO.setErrorid(errorid); @@ -1925,7 +1925,7 @@ issucess=true; resultClassifyRuleData.setLibrary(resultLibraryVO); }catch (Throwable e){ - e.printStackTrace();; + e.printStackTrace(); msg="鏌ヨ鍒嗙被澶辫触:"+e.getMessage(); }finally { resultClassifyRuleData.setErrorid(errorid); diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeButtonWrapper.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeButtonWrapper.java index c178bcd..fd8b3a2 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeButtonWrapper.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeButtonWrapper.java @@ -38,7 +38,7 @@ @Override public CodeButtonVO entityVO(CodeButton codebutton) { - CodeButtonVO codebuttonVO = new CodeButtonVO();; + CodeButtonVO codebuttonVO = new CodeButtonVO(); BeanUtilForVCI.copyPropertiesIgnoreCase(codebutton,codebuttonVO); Objects.requireNonNull(codebuttonVO); codebuttonVO.setUsedpositiontypeText(DictCache.getValue("codeButtonPosition", codebutton.getUsedPositionType())); diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MdmCountConfigController.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MdmCountConfigController.java index 49d1bdf..49f7db5 100644 --- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MdmCountConfigController.java +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MdmCountConfigController.java @@ -30,5 +30,4 @@ return countConfigService.saveMdmCountConfig(mdmCountConfigVO); } - } -- Gitblit v1.9.3