Merge remote-tracking branch 'origin/master'
已修改28个文件
已删除3个文件
已重命名1个文件
已添加14个文件
| | |
| | | }) |
| | | } |
| | | |
| | | 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 |
| | | }) |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | let that = this; |
| | | items.forEach((item) => { |
| | | let formItem = this.resetFormConfig(item); |
| | | |
| | | if (formItem.field == "lcstatus") { |
| | | formItem.field = formItem.field + "_text"; |
| | | formItem.readOnly = true; |
| | |
| | | </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"> |
| | |
| | | <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" |
| | | <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> |
| | | </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" |
| | |
| | | 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> |
| | |
| | | :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" |
| | |
| | | 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; |
| | |
| | | /deep/ .el-table__fixed { |
| | | height: calc(100vh - 370px)!important; |
| | | } |
| | | |
| | | // æ»å¨æ¡æ ·å¼ä¿®æ¹ |
| | | // æ»å¨æ¡ç宽度 |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar { |
| | |
| | | width: 10px; |
| | | |
| | | } |
| | | |
| | | // æ»å¨æ¡çæ»å |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | background-color: #ececec; |
| | |
| | | <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) { |
| | | export default { |
| | | name: "ColumnarChart", |
| | | props:{ |
| | | columnarData:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | chartName:{ |
| | | type:String, |
| | | default: "" |
| | | } |
| | | }, |
| | | 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]; |
| | | })); |
| | | }) |
| | | ); |
| | | }); |
| | | |
| | | 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]; // 设置å个è§é½ä¸ºåè§ |
| | | 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: data[i][j], |
| | | value: newval[i][j], |
| | | itemStyle: { |
| | | normal: { |
| | | barBorderRadius: borderRadius, // 设置åè§ |
| | | color: colors[i], |
| | | show: function (params) { |
| | | // æ ¹æ®æ°æ®å¼ç大尿¥å¤ææ¯å¦æ¾ç¤º label |
| | | return params.value > 30; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | var seriesName = ''; |
| | | if (i === 0) { |
| | | seriesName = 'æ»é'; |
| | | } else if (i === 1) { |
| | | seriesName = 'æ°å¢'; |
| | | } |
| | | let seriesName = (i === 0 ? "æ»é" : "æ°å¢") |
| | | seriesData.push({ |
| | | name: seriesName, |
| | | type: 'bar', |
| | | stack: 'æ»é', |
| | | type: "bar", |
| | | stack: "æ»é", |
| | | barWidth: 60, |
| | | data: curSeriesData, |
| | | label: { |
| | | show: true, |
| | | position: 'top' |
| | | }, |
| | | itemStyle: { |
| | | color: colors[i] // 设置æ±åçé¢è² |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | } |
| | | focus: "series", |
| | | }, |
| | | }); |
| | | this.chartOptions.series=seriesData |
| | | } |
| | | |
| | | export default { |
| | | name: "ColumnarChart", |
| | | } |
| | | } |
| | | }, |
| | | chartName:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | console.log(newval) |
| | | this.chartOptions.title.text = newval + "æ°æ®ç»è®¡" |
| | | } |
| | | }, |
| | | immediate:true, |
| | | deep:true |
| | | } |
| | | }, |
| | | 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> |
| | |
| | | <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 '], |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <basic-container style="width: 100%"> |
| | | <v-chart :options="chartOptions" :auto-resize="true" id="chart"></v-chart> |
| | | </basic-container> |
| | | </template> |
| | |
| | | import 'echarts/lib/component/legend' |
| | | export default { |
| | | name: "pieChart", |
| | | props:{ |
| | | pieData:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | chartName:{ |
| | | type:String, |
| | | default: "" |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chartOptions: { |
| | |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function (params) { |
| | | var result = ''; |
| | | let result = ''; |
| | | if (params.componentType === 'series') { |
| | | result += params.name + '<br/>'; |
| | | result += 'æ°å¢ï¼' + params.data.newValue + '<br/>'; |
| | |
| | | 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]; |
| | | } |
| | | }, |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | #chart { |
| | | width: 800px; |
| | | height: 600px; |
| | | width: 90%; |
| | | height: 530px; |
| | | } |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | 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', |
| | |
| | | return result; |
| | | } |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
ÎļþÃû´Ó Source/UBCS/ubcs-ops-api/ubcs-log-api/src/main/java/com/vci/ubcs/log/entity/SystemLog.java ÐÞ¸Ä |
| | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author ludc |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SystemLog { |
| | | public class LocalLog implements Serializable { |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 2217599544701726181L; |
| | | |
| | | /** |
| | | * æ¥å¿æå±æå¡åç§° |
| | |
| | | /** |
| | | * æ¥å¿çæåä¿®æ¹æ¶é´ |
| | | */ |
| | | private String lastmodifier; |
| | | private String lastModifier; |
| | | |
| | | /** |
| | | * æ¯å¦å
å«åå¨åæä»¶ |
| | | */ |
| | | private Boolean hasChildren; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | */ |
| | | 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; |
| | | |
| | | /** |
| | |
| | | @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; |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value = "é件大å°") |
| | | private Long attachSize; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField("TENANT_ID") |
| | | private String tenantId; |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶ |
| | | * @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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * @author Chill |
| | | */ |
| | | @EnableDiscoveryClient |
| | | @EnableFeignClients("org.springblade") |
| | | @EnableFeignClients(basePackages = {"com.vci.ubcs", "org.springblade"}) |
| | | @SpringBootApplication |
| | | public class LogApplication { |
| | | |
| | |
| | | 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; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) { |
| | | //妿åºé,æé误信æ¯åå°text |
| | | 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); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | log.setParams(log.getParams().replace("&", "&")); |
| | | return R.data(errorLogService.save(log)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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{ |
| | | // æ¯ç¶ç®å½ï¼æä»¥éè¦è·åå°ä¸é¢çææåç®å½ |
| | | // æå¤ä¸ªï¼éè¦ä½¿ç¨zipè¿è¡å缩 |
| | | 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(","))+"å é¤å¤±è´¥!"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | * @return æ§è¡ç»æï¼åªæä¸è½½å¤±è´¥çæ¶åæä¼è¿æ · |
| | | */ |
| | | @RequestMapping(value = "/downloadFilesByOids",method = {RequestMethod.GET,RequestMethod.POST}) |
| | | public String downloadFilesByOids(@RequestParam String fileOids, HttpServletResponse response){ |
| | | 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))); |
| | | //妿åºé,æé误信æ¯åå°text |
| | | String msg = LangBaseUtil.getErrorMsg(e); |
| | | if(StringUtils.isBlank(msg)){ |
| | | msg = "æªç¥é误"; |
| | | } |
| | | //å 为设置äºååºcontentType,æä»¥è¿å¿ä¸è½åç´æ¥è¿åRäºï¼å¯è½ä¼å¯¼è´æ¥é |
| | | return JSON.toJSONString(R.success("ä¸è½½å®æ")) ; |
| | | ControllerUtil.writeDataToResponse(response,msg.getBytes(StandardCharsets.UTF_8),null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | secret-key: Reo4wW8EWF4gSizUmVsNjWfbDZzR3rBYFn5Jehd9 |
| | | bucket-name: vci-ubcs |
| | | |
| | | #å
³é驼峰å½åæ å° |
| | | mybatis-plus: |
| | | configuration: |
| | | map-underscore-to-camel-case: false |
| | |
| | | |
| | | |
| | | <select id="selectAttachPage" resultMap="attachResultMap"> |
| | | select * from blade_attach where is_deleted = 0 |
| | | select * from blade_attach where isdeleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="selectSmsPage" resultMap="smsResultMap"> |
| | | select * from pl_sys_sms where is_deleted = 0 |
| | | select * from pl_sys_sms where isdeleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | return R.success(message); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | log.error("è·åæ°æ®æ¨¡å失败"+e); |
| | | R.fail(message); |
| | | } |
| | |
| | | } |
| | | |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | log.error("è·åç³è¯·åç¶æå¤±è´¥"+e); |
| | | throw new VciBaseException(message); |
| | | } |
| | |
| | | */ |
| | | 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å¯å¨å¨ |
| | |
| | | this.setHttpToThreadLocal(request); |
| | | result= universalInterfaceI.syncEditData(dataString,dataType); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | logger.error("syncData->"+e.getMessage()); |
| | | } |
| | | return result; |
| | |
| | | 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<>(); |
| | | //æ°æ®å¤ç |
| | |
| | | //ä¸å¿½ç¥å¤§å°åãä¸å»ç©ºãä¸å¿½ç¥å
¨åè§ |
| | | 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)) { |
| | | //ä¸ºç©ºçæ¶åä¸ä»£è¡¨ä¸æ ¡éªï¼åªæ¯ä¸å»é¤ç¸å
³çä¿¡æ¯ |
| | | conditionMap.put("t." + attrId, "'" + value + "'"); |
| | | conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + value + "'"); |
| | | }else{ |
| | | conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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); |
| | | //æä»¬éè¦è·åå°ææçä¸çº§åç±»çoidçè·¯å¾ï¼å 为åé¢éè¦ |
| | | Map<String/**主é®**/, String/**è·¯å¾**/> childOidPathMap = getChildClassifyPathMap(classifyFullInfo, fullPath); |
| | |
| | | } |
| | | }); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | msg="ç¼ç æ´æ¹/ç¶ææ´æ¹/å é¤:"+e.getMessage(); |
| | | /* XMLResultSystemVO XMLResultSystemVO=new XMLResultSystemVO(); |
| | | XMLResultSystemVO.setErrorid(errorid); |
| | |
| | | issucess=true; |
| | | resultData.setLibrary(libraryVo); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | msg="æ¥è¯¢å类失败:"+e.getMessage(); |
| | | }finally { |
| | | resultData.setErrorid(errorid); |
| | |
| | | msg = "æ¥å£åæ°ï¼library æªæ¥è¯¢å°å¯¹åºçåºèç¹ä¿¡æ¯"; |
| | | } |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | msg="æ¥è¯¢æ°æ®å¤±è´¥:"+e.getMessage(); |
| | | }finally { |
| | | resultDataVO.setErrorid(errorid); |
| | |
| | | issucess=true; |
| | | resultClassifyRuleData.setLibrary(resultLibraryVO); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | e.printStackTrace(); |
| | | msg="æ¥è¯¢å类失败:"+e.getMessage(); |
| | | }finally { |
| | | resultClassifyRuleData.setErrorid(errorid); |
| | |
| | | |
| | | @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())); |
| | |
| | | return countConfigService.saveMdmCountConfig(mdmCountConfigVO); |
| | | } |
| | | |
| | | |
| | | } |