From 7c322ef7ac4cb12fa543a65286b254c117a47203 Mon Sep 17 00:00:00 2001 From: zouyx <1798599149@qq.com> Date: Thu, 5 Dec 2024 16:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E7=9D=A3=E7=AB=AF-=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/complaintStatic/complaintStatic.html | 435 ++++++++++++++---- .../project/code/deptStatic/deptStatic.html | 3 +- .../code/registration/registration.html | 11 +- .../code/statistical/staticProgram.html | 28 +- .../statisticsEnterprise.html | 22 +- .../controller/ComplaintStaticController.java | 129 +++++- ...nforcementInspectionProgramController.java | 9 +- .../mapper/ComplaintStatisticsMapper.java | 7 + .../service/ComplaintStatisticsService.java | 6 + .../service/impl/ComplaintStatisticsImpl.java | 83 +++- .../EnforcementRegistrationServiceImpl.java | 32 +- .../impl/StatisticsEnterpriseServiceImpl.java | 12 +- .../mapper/ComplaintStatisticsMapper.xml | 16 + .../resources/mapper/Zfryjdm2405301Mapper.xml | 4 +- 14 files changed, 666 insertions(+), 131 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html index 6b3138af..a33c4410 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html @@ -125,7 +125,6 @@
  • 时段:

    + + + + +
  • - -
    +
    -

    投诉类型数量及占比

    -
    +
    +
    +
    +
    +
    +
    +

    投诉企业所属区域数量及占比

    +
    +
    +
    +
    +
    +
    +

    投诉企业所属街道数量及占比

    +
    @@ -200,7 +213,9 @@ var prefix = ctx + "code/complaintStatic"; var caseType=[[${@dict.getType('caseType')}]]; /*var myChart = echarts.init(document.getElementById('container'));*/ - var myChart = echarts.init(document.getElementById('echartComplaint')); + var myChart1 = echarts.init(document.getElementById('echartComplaint1')); + var myChart2 = echarts.init(document.getElementById('echartComplaint2')); + var myChart3 = echarts.init(document.getElementById('echartComplaint3')); var pieData; var deptName; window.onload = function () { @@ -211,6 +226,10 @@ $('#detail').hide(); rTable1(); rTable2(); + $('#cont-two-1').show(); + $('#cont-two-2').hide(); + $('#cont-two-3').hide(); + rTable2(); } $(function() { var options1 = { @@ -226,38 +245,11 @@ columns: [ { field : 'complaintDepartment', - title : '被投诉对象' + title : '被投诉对象', + align : 'left', + width : 1050, + }, - /*{ - field : 'complaintType', - title : '投诉类型', - formatter:function (value,row,index) { - console.log(row.complaintDepartment); - var rowName=row.complaintDepartment; - var cName=document.getElementById('cType').value - if(cName==null||cName==""||cName==undefined){ - if(row.complaintDepartment==null||row.complaintDepartment==""||row.complaintDepartment==undefined){ - return ''+'全部'+''; - }else { - return ''+'全部'+''; - } - } - for(let i=0;i'+caseType[i].dictLabel+''; - }else { - return ''+caseType[i].dictLabel+''; - } - } - } - if(row.complaintDepartment==null||row.complaintDepartment==""||row.complaintDepartment==undefined){ - return ''+cName+''; - }else { - return ''+cName+''; - } - } - },*/ { field : 'total', title : '投诉数量', @@ -271,25 +263,13 @@ }); $(function() { var options2 = { - //url: prefix + "/list2", modalName: "投诉类型统计", - //method: 'post', - /*queryParams: function (params) { - return { - dateSearch:params.dateSearch, - month:params.month, - quarter:params.quarter, - year:params.year - }; - }, - queryParamsType:"",*/ sidePagination: "server", showHeader: true, showFooter: false, showColumns: false, showRefresh: false, showToggle: false, - //quarterBoolean:quarterBoolean, columns: [ { field : 'name', @@ -307,6 +287,58 @@ } $("#bootstrap-table2").bootstrapTable(options2); }); + $(function() { + var options = { + modalName: "投诉企业所属区域统计", + sidePagination: "server", + showHeader: true, + showFooter: false, + showColumns: false, + showRefresh: false, + showToggle: false, + columns: [ + { + field : 'name', + title : '投诉企业所属区域' + }, + { + field : 'numInt', + title : '投诉数量' + }, + { + field : 'percentage', + title : '占比' + }, + ] + } + $("#bootstrap-table3").bootstrapTable(options); + }); + $(function() { + var options = { + modalName: "投诉企业所属街道统计", + sidePagination: "server", + showHeader: true, + showFooter: false, + showColumns: false, + showRefresh: false, + showToggle: false, + columns: [ + { + field : 'name', + title : '投诉企业所属街道' + }, + { + field : 'numInt', + title : '投诉数量' + }, + { + field : 'percentage', + title : '占比' + }, + ] + } + $("#bootstrap-table4").bootstrapTable(options); + }); $(function() { var options3 = { modalName: "类型显示", @@ -346,13 +378,6 @@ } return string; }else{ - /*let list=["http://localhost:8080/","D:/code/zdxt/zdxtLawEnforcementCode/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/template/a6c39541059498889daec9d3acd601a.png","/profile//2024/01/11/35082e876f84a21f40f075adf4f0da30.png"]; - let string=''; - if (list.length > 0) { - for (let i = 0; i < list.length; i++) { - string = string + ''; - } - }*/ return null; } } @@ -380,10 +405,18 @@ function dataMake(res){ var newData=[]; for(let i=0;i0) { + let d = {}; + d.name = res[i].name; + d.value = res[i].numInt; + d.percentage = res[i].percentage; + console.log(d) + newData.push(d); + }*/ + let d = {}; + d.name = res[i].name; + d.value = res[i].numInt; + d.percentage = res[i].percentage; console.log(d) newData.push(d); } @@ -413,9 +446,27 @@ }) } function searchComplaint2 () { - rTable2(); + var qy = document.getElementById("qy"); + console.log(qy.value) + if(qy.value==""){ + $('#cont-two-1').hide(); + $('#cont-two-2').show(); + $('#cont-two-3').hide(); + rTable3(); + }else if(qy.value=="type"){ + $('#cont-two-1').show(); + $('#cont-two-2').hide(); + $('#cont-two-3').hide(); + rTable2(); + }else{ + $('#cont-two-1').hide(); + $('#cont-two-2').hide(); + $('#cont-two-3').show(); + rTable4(); + } var currentId=$('form').eq(1).attr('id'); var params = $.common.formToJSON(currentId); + params.qy=qy.value; $.ajax({ url:prefix+'/searchType2', type:'GET', @@ -455,14 +506,26 @@ trigger: 'item', formatter: '{b}: {c} ({d}%)' }, - color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'], + /*color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'],*/ + color: [ + '#9aa690', '#f4d1d7', '#c2cedc', '#e6d6d9', + '#686789', '#91a0a5', '#b57c82', '#feecd8', + '#ab545a', '#9fabb9', '#ecced0', '#8a95a9', + '#858FAC', '#B1722D', + ], series: [{ - top: '5%', - left: '20%', + /*top: '5%', + left: '20%',*/ + top:'-7%', type: 'pie', name: '名称', - radius: ['28%', '36%'], - center: ['50%', '30%'], + /*radius: ['28%', '36%'], + center: ['50%', '30%'],*/ + radius:'65%', + itemStyle:{ + borderWidth:2, //设置border的宽度有多大 + borderColor:'#fff', + }, label: { formatter: '{b}: {c} ({d}%)', borderWidth: 1, @@ -481,7 +544,130 @@ data: pieData, }] } - myChart.setOption(option3); + myChart1.setOption(option3); + }, + error:function (xhr,status,error){ + console.error("请求失败:",status,error); + } + }) + } + function rTable3(){ + var currentId=$('form').eq(1).attr('id') + var params = $.common.formToJSON(currentId); + params.qy=null; + $.ajax({ + url: prefix + "/qyComplaintList", + method: 'post', + data:params, + success:function (response){ + $('#bootstrap-table3').bootstrapTable('load', response); + pieData=dataMake(response.rows); + console.log(pieData); + var option = { + tooltip: { + trigger: 'item', + formatter: '{b}: {c} ({d}%)' + }, + /*color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'],*/ + color: [ + '#9aa690', '#f4d1d7', '#c2cedc', '#e6d6d9', + '#686789', '#91a0a5', '#b57c82', '#feecd8', + '#ab545a', '#9fabb9', '#ecced0', '#8a95a9', + '#858FAC', '#B1722D', + ], + series: [{ + /*top: '5%', + left: '20%',*/ + top:'-7%', + type: 'pie', + name: '名称', + /*radius: ['28%', '36%'], + center: ['50%', '30%'],*/ + radius:'65%', + itemStyle:{ + borderWidth:2, //设置border的宽度有多大 + borderColor:'#fff', + }, + label: { + formatter: '{b}: {c} ({d}%)', + borderWidth: 1, + borderRadius: 4, + color: '#4F4F4F', + fontFamily: 'PingFangSC-Regular', + fontSize: '14', + rich: { + a: { + color: '#4F4F4F', + lineHeight: 18, + align: 'center' + } + } + }, + data: pieData, + }] + } + myChart2.setOption(option); + }, + error:function (xhr,status,error){ + console.error("请求失败:",status,error); + } + }) + } + function rTable4(){ + var currentId=$('form').eq(1).attr('id') + var params = $.common.formToJSON(currentId); + $.ajax({ + url: prefix + "/jdComplaintList", + method: 'post', + data:params, + success:function (response){ + $('#bootstrap-table4').bootstrapTable('load', response); + pieData=dataMake(response.rows); + console.log(pieData); + var option = { + tooltip: { + trigger: 'item', + formatter: '{b}: {c} ({d}%)' + }, + /*color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'],*/ + color: [ + '#9aa690', '#f4d1d7', '#c2cedc', '#e6d6d9', + '#686789', '#91a0a5', '#b57c82', '#feecd8', + '#ab545a', '#9fabb9', '#ecced0', '#8a95a9', + '#858FAC', '#B1722D', + ], + series: [{ + /*top: '5%', + left: '20%',*/ + top:'-7%', + type: 'pie', + name: '名称', + /*radius: ['28%', '36%'], + center: ['50%', '30%'],*/ + radius:'65%', + itemStyle:{ + borderWidth:2, //设置border的宽度有多大 + borderColor:'#fff', + }, + label: { + formatter: '{b}: {c} ({d}%)', + borderWidth: 1, + borderRadius: 4, + color: '#4F4F4F', + fontFamily: 'PingFangSC-Regular', + fontSize: '14', + rich: { + a: { + color: '#4F4F4F', + lineHeight: 18, + align: 'center' + } + } + }, + data: pieData, + }] + } + myChart3.setOption(option); }, error:function (xhr,status,error){ console.error("请求失败:",status,error); @@ -559,9 +745,30 @@ } function complaintRest2(){ $('form').eq(1).trigger("reset"); - searchComplaint2() timeType2(); + document.getElementById("qy").value="type"; + searchComplaint2(); } + /*function typeMake(){ + var qy = document.getElementById("qy"); + console.log(qy.value) + if(qy.value==""){ + $('#cont-two-1').hide(); + $('#cont-two-2').show(); + $('#cont-two-3').hide(); + rTable3(); + }else if(qy.value=="type"){ + $('#cont-two-1').show(); + $('#cont-two-2').hide(); + $('#cont-two-3').hide(); + rTable2(); + }else{ + $('#cont-two-1').hide(); + $('#cont-two-2').hide(); + $('#cont-two-3').show(); + rTable4(); + } + }*/ function downloadC1(){ var currentId=$('form').eq(0).attr('id'); var params = $.common.formToJSON(currentId); @@ -589,24 +796,64 @@ var currentId=$('form').eq(1).attr('id'); var params = $.common.formToJSON(currentId); delete params.dateSearch; - $.ajax({ - type: "POST", - data: JSON.stringify(params), - contentType: 'application/json', - //设置响应类型 - xhrFields: {responseType: "blob"}, - url: prefix+"/export2", - success: function (result) { - const link = document.createElement('a'); - let blob = new Blob([result], {type: 'application/vnd.ms-excel'}); - link.style.display = 'none'; - link.href = URL.createObjectURL(blob); - link.setAttribute('download', "投诉类型统计.xls"); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link) - } - }) + if(document.getElementById("qy").value=="type") { + $.ajax({ + type: "POST", + data: JSON.stringify(params), + contentType: 'application/json', + //设置响应类型 + xhrFields: {responseType: "blob"}, + url: prefix + "/export2", + success: function (result) { + const link = document.createElement('a'); + let blob = new Blob([result], {type: 'application/vnd.ms-excel'}); + link.style.display = 'none'; + link.href = URL.createObjectURL(blob); + link.setAttribute('download', "投诉类型统计.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link) + } + }) + }else if(document.getElementById("qy").value==""){ + $.ajax({ + type: "POST", + data: JSON.stringify(params), + contentType: 'application/json', + //设置响应类型 + xhrFields: {responseType: "blob"}, + url: prefix + "/export3", + success: function (result) { + const link = document.createElement('a'); + let blob = new Blob([result], {type: 'application/vnd.ms-excel'}); + link.style.display = 'none'; + link.href = URL.createObjectURL(blob); + link.setAttribute('download', "投诉企业所属区域统计.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link) + } + }) + }else{ + $.ajax({ + type: "POST", + data: JSON.stringify(params), + contentType: 'application/json', + //设置响应类型 + xhrFields: {responseType: "blob"}, + url: prefix + "/export4", + success: function (result) { + const link = document.createElement('a'); + let blob = new Blob([result], {type: 'application/vnd.ms-excel'}); + link.style.display = 'none'; + link.href = URL.createObjectURL(blob); + link.setAttribute('download', "投诉企业所属街道统计.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link) + } + }) + } } diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html index 4a66d357..88df8937 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html @@ -82,7 +82,8 @@ },*/ { field : 'zfdw', - title : '部门名称' + title : '部门名称', + align: 'left', }, { field : 'name', diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html index b75ab046..2b12670f 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html @@ -606,11 +606,12 @@ color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'], series: [{ top: '20%', - left: '20%', + /*left: '20%',*/ type: 'pie', name: '名称', - radius: ['30%', '45%'], - center: ['50%', '55%'], + /*radius: ['30%', '45%'], + center: ['50%', '55%'],*/ + radius: '65%', label: { formatter: '{b}: {c} ({d}%)', borderWidth: 1, @@ -626,6 +627,10 @@ } } }, + itemStyle:{ + borderWidth:2, //设置border的宽度有多大 + borderColor:'#fff', + }, data: response, }] }; diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html index 7d5be57e..cf86bd96 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html @@ -106,6 +106,7 @@ -
    +

    年年度检查计划排行(TOP10)

    -
    +

    年季度检查计划排行(TOP10)

    -
    +

    年月度检查计划排行(TOP10)

    @@ -177,6 +178,9 @@ $("#quarter").hide(); $("#month").hide(); $("#select-time").hide(); + $("#chart-box-1").hide(); + $("#chart-box-2").hide(); + $("#chart-box-3").hide(); echartsTotal(); }; @@ -187,6 +191,15 @@ menu.className = i == cursel ? "actit" : ""; con.style.zIndex = i == cursel ? "1" : "-999"; } + if(cursel==2){ + $("#chart-box-1").show(); + $("#chart-box-2").show(); + $("#chart-box-3").show(); + }else if(cursel==1){ + $("#chart-box-1").hide(); + $("#chart-box-2").hide(); + $("#chart-box-3").hide(); + } } /** 检查事项 */ @@ -200,10 +213,13 @@ console.log(data.data); var e = data.data; if(e != "undefined" && e != null){ + let total=e.yearTotal+e.quarterTotal+e.monthTotal; + $("#total").text(total); $("#yearTotal").text(e.yearTotal); $("#quarterTotal").text(e.quarterTotal); $("#monthTotal").text(e.monthTotal); }else { + $("#total").text(0); $("#yearTotal").text(0); $("#quarterTotal").text(0); $("#monthTotal").text(0); @@ -382,6 +398,12 @@ return "
    "+ value +"
    "; } }, + { + field : 'total', + title : '总数', + align : 'center', + width: 259, + }, { field : 'yearTotal', title : '年度计划', diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statisticsEnterprise/statisticsEnterprise.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statisticsEnterprise/statisticsEnterprise.html index c997ed4f..9ee0194b 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statisticsEnterprise/statisticsEnterprise.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statisticsEnterprise/statisticsEnterprise.html @@ -332,6 +332,13 @@ //data:params, success:function (response){ $('#bootstrap-table2').bootstrapTable('load', response); + var eData=[]; + for(let i=0;i0){ + eData.push(response[i]); + } + } + console.log(eData); var option3 = { /*color:['#1874CD','#3A5FCD','#436EEE','#4876FF','#1E90FF'],*/ /*tooltip: {}, @@ -365,12 +372,13 @@ },*/ color: ['#1f74f1', '#79e24a', '#41d5d3', '#f59036', '#fed100', '#ababac'], series: [{ - top: '5%', - left: '20%', + top: '-7%', + /*left: '20%',*/ type: 'pie', name: '名称', - radius: ['28%', '36%'], - center: ['50%', '30%'], + /*radius: ['28%', '36%'], + center: ['50%', '30%'],*/ + radius: '70%', label: { formatter: '{b}: {c} ({d}%)', borderWidth: 1, @@ -386,7 +394,11 @@ } } }, - data: response, + itemStyle:{ + borderWidth:2, //设置border的宽度有多大 + borderColor:'#fff', + }, + data: eData, }] } myChart.setOption(option3); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java index a1d9a0d0..764d3858 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java @@ -1,5 +1,6 @@ package com.zdxt.code.controller; +import cn.hutool.core.util.StrUtil; import com.zdxt.auth.feign.ZdxtFileCommonApi; import com.zdxt.auth.framework.web.domain.AjaxResult; import com.zdxt.auth.project.system.dept.service.IDeptService; @@ -87,7 +88,13 @@ public class ComplaintStaticController extends BaseController { public String searchType2(SearchType searchType,Model model){ model.addAttribute("year",searchType.getYear()); ComplaintStatistics complaintStatistics=dateMake(searchType); - List complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics);//权限 + List complaintStatisticsList =new ArrayList<>(); + if(StrUtil.hasEmpty(searchType.getQy()) || searchType.getQy().equals("type")) { + complaintStatisticsList = complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics);//权限 + }else{ + String qy=dictDataMapper.selectDictLabel("address_type",searchType.getQy()); + complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics).stream().filter(item -> (!StrUtil.hasEmpty(item.getEnterpriseAddress()))&&(item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区"))).collect(Collectors.toList()); + } model.addAttribute("Number3",complaintStatisticsList.size()); model.addAttribute("dou","100%"); return prefix+"/complaintB"; @@ -220,7 +227,107 @@ public class ComplaintStaticController extends BaseController { styleRow2.setBorderLeft(BorderStyle.THIN); styleRow2.setFont(font2); //设置表头 - String[] headerList = {"企业类型", "企业数量", "占比"}; + String[] headerList = {"投诉类型", "企业数量", "占比"}; + HSSFRow headerRow = sheet.createRow(0); + for (int i = 0; i < headerList.length; i++) { + HSSFCell cell = headerRow.createCell(i); + HSSFRichTextString text = new HSSFRichTextString(headerList[i]); + cell.setCellValue(text); + cell.setCellStyle(styleRow2); + } + for(int i=0;i complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics);//权限 + List statisticsIndicatorList=complaintStatisticsService.qyComplaintList(complaintStatisticsList,searchType); + HSSFWorkbook workbook = new HSSFWorkbook(); + HSSFSheet sheet = workbook.createSheet("投诉企业所属区域统计"); + //设置文件名称 + String fileName = "投诉企业所属区域统计.xls"; + //自适应列宽 + sheet.setDefaultColumnWidth(20);//全局 + //表头样式 + HSSFFont font2=workbook.createFont(); + font2.setFontName("微软雅黑"); + font2.setBold(true); + font2.setFontHeightInPoints((short) 11); + HSSFCellStyle styleRow2=workbook.createCellStyle(); + styleRow2.setWrapText(true);//换行 + styleRow2.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + styleRow2.setFillPattern(FillPatternType.SOLID_FOREGROUND); + styleRow2.setAlignment(HorizontalAlignment.CENTER); + styleRow2.setVerticalAlignment(VerticalAlignment.CENTER); + styleRow2.setBorderTop(BorderStyle.THIN); + styleRow2.setBorderRight(BorderStyle.THIN); + styleRow2.setBorderBottom(BorderStyle.THIN); + styleRow2.setBorderLeft(BorderStyle.THIN); + styleRow2.setFont(font2); + //设置表头 + String[] headerList = {"投诉企业所属区域", "企业数量", "占比"}; + HSSFRow headerRow = sheet.createRow(0); + for (int i = 0; i < headerList.length; i++) { + HSSFCell cell = headerRow.createCell(i); + HSSFRichTextString text = new HSSFRichTextString(headerList[i]); + cell.setCellValue(text); + cell.setCellStyle(styleRow2); + } + for(int i=0;i complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics);//权限 + List statisticsIndicatorList=complaintStatisticsService.jdComplaintList(complaintStatisticsList,searchType); + HSSFWorkbook workbook = new HSSFWorkbook(); + HSSFSheet sheet = workbook.createSheet("投诉企业所属街道统计"); + //设置文件名称 + String fileName = "投诉企业所属街道统计.xls"; + //自适应列宽 + sheet.setDefaultColumnWidth(20);//全局 + //表头样式 + HSSFFont font2=workbook.createFont(); + font2.setFontName("微软雅黑"); + font2.setBold(true); + font2.setFontHeightInPoints((short) 11); + HSSFCellStyle styleRow2=workbook.createCellStyle(); + styleRow2.setWrapText(true);//换行 + styleRow2.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + styleRow2.setFillPattern(FillPatternType.SOLID_FOREGROUND); + styleRow2.setAlignment(HorizontalAlignment.CENTER); + styleRow2.setVerticalAlignment(VerticalAlignment.CENTER); + styleRow2.setBorderTop(BorderStyle.THIN); + styleRow2.setBorderRight(BorderStyle.THIN); + styleRow2.setBorderBottom(BorderStyle.THIN); + styleRow2.setBorderLeft(BorderStyle.THIN); + styleRow2.setFont(font2); + //设置表头 + String[] headerList = {"投诉企业所属街道", "企业数量", "占比"}; HSSFRow headerRow = sheet.createRow(0); for (int i = 0; i < headerList.length; i++) { HSSFCell cell = headerRow.createCell(i); @@ -294,6 +401,24 @@ public class ComplaintStaticController extends BaseController { List list=complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics); return getDataTable(list); } + + @RequiresPermissions("code:complaintStatic:list") + @PostMapping("/qyComplaintList") + @ResponseBody + public TableDataInfo qyComplaintList(SearchType searchType) { + ComplaintStatistics complaintStatistics=dateMake(searchType); + List complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics);//权限 + return getDataTable(complaintStatisticsService.qyComplaintList(complaintStatisticsList,searchType)); + } + @RequiresPermissions("code:complaintStatic:list") + @PostMapping("/jdComplaintList") + @ResponseBody + public TableDataInfo jdComplaintList(SearchType searchType) { + ComplaintStatistics complaintStatistics=dateMake(searchType); + List complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics);//权限 + return getDataTable(complaintStatisticsService.jdComplaintList(complaintStatisticsList,searchType)); + } + public List yearMake(){ int current=LocalDate.now().getYear(); List yearList=new ArrayList<>(); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java index 2738f396..18b674a5 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java @@ -164,7 +164,7 @@ public class EnforcementInspectionProgramController extends BaseController styleRow2.setBorderLeft(BorderStyle.THIN); styleRow2.setFont(font2); //设置表头 - String[] headerList = {"执法部门", "年度计划", "季度计划", "月度计划"}; + String[] headerList = {"执法部门","总数", "年度计划", "季度计划", "月度计划"}; HSSFRow headerRow = sheet.createRow(0); for (int i = 0; i < headerList.length; i++) { HSSFCell cell = headerRow.createCell(i); @@ -175,9 +175,10 @@ public class EnforcementInspectionProgramController extends BaseController for(int i=0;i selectAppComplaintStatisticsP1(SearchType searchType); + + /** + * 投诉统计表联企业信息表,获取企业注册地 + * @param complaintStatistics + * @return + */ + List selectComplaintStatisticsLEFTEnterpriseList(ComplaintStatistics complaintStatistics); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ComplaintStatisticsService.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ComplaintStatisticsService.java index 8e1dc667..7489a4b8 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ComplaintStatisticsService.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ComplaintStatisticsService.java @@ -15,9 +15,15 @@ public interface ComplaintStatisticsService { List selectComplaintStatisticsGroupByType(ComplaintStatistics complaintStatistics); + List selectComplaintStatisticsLEFTEnterpriseList(ComplaintStatistics complaintStatistics); + void insertComplaintStatistics(EnterpriseComplaint enterpriseComplaint); List type(List complaintStatisticsList); + List qyComplaintList(List complaintStatisticsList,SearchType searchType); + + List jdComplaintList(List complaintStatisticsList,SearchType searchType); + List list1(SearchType searchType, ComplaintStatistics complaintStatistics); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java index 82867f59..4ea6b3e5 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java @@ -1,5 +1,6 @@ package com.zdxt.code.service.impl; +import cn.hutool.core.util.StrUtil; import com.zdxt.auth.project.system.dept.service.IDeptService; import com.zdxt.auth.project.system.dict.mapper.DictDataMapper; import com.zdxt.code.domain.ComplaintStatistics; @@ -40,6 +41,10 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService { return complaintStatisticsMapper.selectComplaintStatisticsGroupByType(complaintStatistics); } @Override + public List selectComplaintStatisticsLEFTEnterpriseList(ComplaintStatistics complaintStatistics){ + return complaintStatisticsMapper.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics); + } + @Override public void insertComplaintStatistics(EnterpriseComplaint enterpriseComplaint) { SimpleDateFormat str = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if(enterpriseComplaint.getRelId()==null||"".equals(enterpriseComplaint.getRelId())){//入企不扫码 @@ -135,7 +140,7 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService { Map map=complaintStatisticsList.stream().collect(Collectors.groupingBy(item->item.getEnforceType()==null?100:item.getEnforceType(),Collectors.counting())); Map dictDataMap=dictDataMapper.selectDictDataByType("caseType").stream().collect(Collectors.toMap(DictData::getDictValue,DictData::getDictLabel)); List list=new ArrayList<>(); - for(int i:map.keySet()){ + /* for(int i:map.keySet()){ StatisticsIndicator s=new StatisticsIndicator(); if(i==100){ s.setName(""); @@ -151,10 +156,86 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService { s.setPercentage((double)map.get(i)/number); } list.add(s); + }*/ + for(String s:dictDataMap.keySet()){ + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + if(map.containsKey(Integer.parseInt(s))){ + statisticsIndicator.setName(dictDataMap.get(s)); + statisticsIndicator.setNumInt(Integer.parseInt(map.get(Integer.parseInt(s))+"")); + statisticsIndicator.setPercentage((double)map.get(Integer.parseInt(s))/number); + map.remove(Integer.parseInt(s)); + }else{ + statisticsIndicator.setName(dictDataMap.get(s)); + } + list.add(statisticsIndicator); + } + if(!map.isEmpty()){ + int num=0; + for(int i:map.keySet()){ + num=num+Integer.parseInt(map.get(i)+""); + } + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + statisticsIndicator.setName(""); + statisticsIndicator.setNumInt(num); + statisticsIndicator.setPercentage((double)num/number); + list.add(statisticsIndicator); } return list; } @Override + public List qyComplaintList(List complaintStatisticsList, SearchType searchType){ + List dictDataList=dictDataMapper.selectDictDataByType("address_type"); + List statisticsIndicatorList=new ArrayList<>(); + List fitterNullList=complaintStatisticsList.stream().filter(item -> !StrUtil.hasEmpty(item.getEnterpriseAddress())).collect(Collectors.toList()); + List complaintStatisticsAfterList=fitterNullList; + for(DictData dictData:dictDataList){ + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + statisticsIndicator.setName(dictData.getDictLabel()); + if(!complaintStatisticsAfterList.isEmpty()) { + List list = complaintStatisticsAfterList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + dictData.getDictLabel().substring(0, dictData.getDictLabel().indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + dictData.getDictLabel().substring(0, dictData.getDictLabel().indexOf("区")) + "新区")).collect(Collectors.toList()); + statisticsIndicator.setNumInt(list.size()); + statisticsIndicator.setPercentage((double) list.size() / complaintStatisticsList.size()); + complaintStatisticsAfterList= complaintStatisticsAfterList.stream().filter(item -> !(item.getEnterpriseAddress().startsWith("深圳市" + dictData.getDictLabel().substring(0, dictData.getDictLabel().indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + dictData.getDictLabel().substring(0, dictData.getDictLabel().indexOf("区")) + "新区"))).collect(Collectors.toList()); + } + statisticsIndicatorList.add(statisticsIndicator); + } + if(complaintStatisticsAfterList.size()+(complaintStatisticsList.size()- fitterNullList.size())>0){ + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + statisticsIndicator.setName("其他"); + statisticsIndicator.setNumInt(complaintStatisticsAfterList.size()+(complaintStatisticsList.size()- fitterNullList.size())); + statisticsIndicator.setPercentage((double) (complaintStatisticsAfterList.size()+(complaintStatisticsList.size()- fitterNullList.size()))/ complaintStatisticsList.size()); + statisticsIndicatorList.add(statisticsIndicator); + } + return statisticsIndicatorList; + } + @Override + public List jdComplaintList(List complaintStatisticsList, SearchType searchType){ + String qy=dictDataMapper.selectDictLabel("address_type",searchType.getQy()); + List dictDataList=dictDataMapper.selectDictDataByType(searchType.getQy()); + List statisticsIndicatorList=new ArrayList<>(); + complaintStatisticsList=complaintStatisticsList.stream().filter(item -> (!StrUtil.hasEmpty(item.getEnterpriseAddress()))&&(item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区"))).collect(Collectors.toList()); + List complaintStatisticsAfterList=complaintStatisticsList; + for(DictData dictData:dictDataList){ + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + statisticsIndicator.setName(dictData.getDictLabel()); + if(!complaintStatisticsAfterList.isEmpty()) { + List list = complaintStatisticsAfterList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区"+dictData.getDictLabel()) || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区"+dictData.getDictLabel())).collect(Collectors.toList()); + statisticsIndicator.setNumInt(list.size()); + statisticsIndicator.setPercentage((double) list.size() / complaintStatisticsList.size()); + complaintStatisticsAfterList= complaintStatisticsAfterList.stream().filter(item -> !(item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区"+dictData.getDictLabel()) || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区"+dictData.getDictLabel()))).collect(Collectors.toList()); + } + statisticsIndicatorList.add(statisticsIndicator); + } + if(!complaintStatisticsAfterList.isEmpty()){ + StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); + statisticsIndicator.setName("其他"); + statisticsIndicator.setNumInt(complaintStatisticsAfterList.size()); + statisticsIndicator.setPercentage((double) (complaintStatisticsAfterList.size()) / complaintStatisticsList.size()); + statisticsIndicatorList.add(statisticsIndicator); + } + return statisticsIndicatorList; + } + @Override public List list1(SearchType searchType,ComplaintStatistics complaintStatistics){ if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) { complaintStatistics.setEnforceType(Integer.parseInt(searchType.getcType())); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java index 1203b684..fc038b61 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java @@ -717,7 +717,7 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat styleRow2.setBorderLeft(BorderStyle.THIN); styleRow2.setFont(font2); //设置表头 - String[] headerList = {"区域", "街道", "执法部门", "执法人员","企业名称","检查事项","联合检查","行政检查类别","是否扫码","未扫码原因","是否投诉","检查时间"}; + String[] headerList = {"被检查企业名称","企业所属区域", "企业所属街道", "执法部门", "执法人员","检查事项","检查时间","联合检查","行政检查类别","是否扫码","未扫码原因","是否投诉"}; HSSFRow headerRow = sheet.createRow(0); for (int i = 0; i < headerList.length; i++) { HSSFCell cell = headerRow.createCell(i); @@ -732,12 +732,14 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat EnforcementRegistration e=enforcementRegistrationList.get(i); HSSFRow row = sheet.createRow(i+1); HSSFCell cell1 = row.createCell(0); - cell1.setCellValue(e.getQy()); + cell1.setCellValue(e.getEnterpriseName()); HSSFCell cell2 = row.createCell(1); - cell2.setCellValue(e.getJd()); + cell2.setCellValue(e.getQy()); HSSFCell cell3 = row.createCell(2); - cell3.setCellValue(e.getBureauDeptName()); + cell3.setCellValue(e.getJd()); HSSFCell cell4 = row.createCell(3); + cell4.setCellValue(e.getBureauDeptName()); + HSSFCell cell5 = row.createCell(4); String name=""; if(!"".equals(e.getLawEnforcer())&&e.getLawEnforcer()!=null){ name=e.getLawEnforcer(); @@ -748,40 +750,40 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat if(!"".equals(e.getLawEnforcerTwo())&&e.getLawEnforcerTwo()!=null){ name=name+e.getLawEnforcerTwo(); } - cell4.setCellValue(name); - HSSFCell cell5 = row.createCell(4); - cell5.setCellValue(e.getEnterpriseName()); + cell5.setCellValue(name); HSSFCell cell6 = row.createCell(5); cell6.setCellValue(e.getLawEnforcementItemText()); - HSSFCell cell7 = row.createCell(6); + HSSFCell cell12 = row.createCell(6 ); + cell12.setCellValue(e.getCreateTime()); + cell12.setCellStyle(dateStyle); + + HSSFCell cell7 = row.createCell(7); if(e.getUniteCheck()!=null&&!"".equals(e.getUniteCheck())){ cell7.setCellValue("是"); }else { cell7.setCellValue("否"); } - HSSFCell cell8 = row.createCell(7); + HSSFCell cell8 = row.createCell(8); if(dictDataMap1.containsKey(e.getCheckCategory())){ cell8.setCellValue(dictDataMap1.get(e.getCheckCategory()).getDictLabel()); } - HSSFCell cell9 = row.createCell(8); + HSSFCell cell9 = row.createCell(9); if(e.getCheckCss()!=null&&!"".equals(e.getCheckCss())){ cell9.setCellValue("否"); }else { cell9.setCellValue("是"); } - HSSFCell cell10 = row.createCell(9); + HSSFCell cell10 = row.createCell(10); if(dictDataMap2.containsKey(e.getCheckCss())){ cell10.setCellValue(dictDataMap2.get(e.getCheckCss()).getDictLabel()); } - HSSFCell cell11 = row.createCell(10); + HSSFCell cell11 = row.createCell(11); if(e.getIsComplaint()==0){ cell11.setCellValue("否"); }else { cell11.setCellValue("是"); } - HSSFCell cell12 = row.createCell(11 ); - cell12.setCellValue(e.getCreateTime()); - cell12.setCellStyle(dateStyle); + } //设置流格式 response.setCharacterEncoding("UTF-8"); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticsEnterpriseServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticsEnterpriseServiceImpl.java index 904a419d..40e7d94b 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticsEnterpriseServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticsEnterpriseServiceImpl.java @@ -188,7 +188,13 @@ public class StatisticsEnterpriseServiceImpl implements StatisticsEnterpriseServ @Override public List type(List enterpriseInformationList){ Listlist=iDictDataService.selectDictDataByType("enterpriseType"); - ListdictDataList=list.subList(0,4);//截取掉其他 + List dictDataList=new ArrayList<>(); + for(DictData d:list){ + if(!d.getDictLabel().equals("其他")){ + dictDataList.add(d); + } + } + /*ListdictDataList=list.subList(0,4);//截取掉其他*/ List statisticsIndicatorList=new ArrayList<>(); for(DictData d:dictDataList){ List type=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(d.getDictLabel())).collect(Collectors.toList()); @@ -198,6 +204,10 @@ public class StatisticsEnterpriseServiceImpl implements StatisticsEnterpriseServ s.setValue(type.size()); s.setPercentage((double)type.size()/enterpriseInformationList.size()); statisticsIndicatorList.add(s); + }else{ + StatisticsIndicator s=new StatisticsIndicator(); + s.setName(d.getDictLabel()); + statisticsIndicatorList.add(s); } } List qtList=enterpriseInformationList.stream().filter(item->!typeMake(dictDataList,item.getCompanyOrgType())).collect(Collectors.toList()); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml index d539bb8f..9d1c1545 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml @@ -47,6 +47,22 @@ +