From 374330ee72d7574a57eee93eacf08da69b02caa9 Mon Sep 17 00:00:00 2001 From: shil <452061493@qq.com> Date: Wed, 21 May 2025 10:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E5=88=86=E6=9E=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=A5=BD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppThirdLoginController.java | 10 +- .../framework/config/XssAndSqlFilter.java | 3 +- .../resources/mapper/system/DeptMapper.xml | 3 + .../statistical/scripts/charts-analyov.js | 30 ++--- .../code/statistical/overall-analysis.html | 26 ++--- .../code/statistical/single-analysis.html | 58 ++++++---- .../StatisticalPanelController.java | 93 +-------------- .../EnterpriseInformationServiceImpl.java | 13 ++- .../impl/StatisticalPaneServiceImpl.java | 108 ++++++++++++++---- .../mapper/EnforcementRegistrationMapper.xml | 4 - .../mapper/StatisticalPanelMapper.xml | 70 +++++++++--- 11 files changed, 230 insertions(+), 188 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java index 4791a192..916f76c9 100644 --- a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java +++ b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java @@ -174,8 +174,8 @@ public class AppThirdLoginController { public ZDResponse szyptGetToken(@RequestParam("code") String code, @RequestParam("url") String url){ try { System.out.println("====================== 获取政务微信认证签名URL ======================"); + log.info("获取政务微信认证签名code:{}",code); log.info("获取政务微信认证签名URL:{}",url); - System.out.println(url); // 获取 access_token String accessTokenJson = HttpUtil.HttpSendGet(szyptUrl + "/cgi-bin/gettoken?corpid="+szyptCorpid+"&corpsecret="+szyptCorpsecret, null); JSONObject tokenObj = JSONObject.parseObject(accessTokenJson); @@ -183,14 +183,15 @@ public class AppThirdLoginController { String jsapiTicket = HttpUtil.HttpSendGet(szyptUrl + "/cgi-bin/get_jsapi_ticket?access_token="+token, null); JSONObject ticketObj = JSONObject.parseObject(jsapiTicket); String ticket = ticketObj.getString("ticket"); - System.out.println("====================== jsapiTicket ======================"); - System.out.println(ticket); - System.out.println("====================== jsapiTicket ======================"); + log.info("====================== jsapiTicket start ======================"); + log.info("ticket: {}",ticket); + log.info("====================== jsapiTicket end ======================"); long timestamp = System.currentTimeMillis() / 1000; //随机字符串 String nonceStr = "Wm3WZYTPz0wzccnW"; String signature = getSignature(ticket, nonceStr, timestamp, url); + log.info("signature: {}",signature); Map data = new HashMap<>(); data.put("agentid", szyptAgentid); @@ -200,6 +201,7 @@ public class AppThirdLoginController { data.put("signature", signature); return ZDResponse.success("操作成功", data); } catch (Exception e) { + log.error(e.getMessage()); e.printStackTrace(); } diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlFilter.java b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlFilter.java index 1bbf8bcd..c30ff393 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlFilter.java +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/framework/config/XssAndSqlFilter.java @@ -36,7 +36,8 @@ public class XssAndSqlFilter implements Filter { HttpServletRequest req = (HttpServletRequest) request; //获取请求你ip后的全部路径 String uri = req.getRequestURI(); - if (uri.indexOf("/system/notice/") >= 0) { + if (uri.indexOf("/system/notice/") >= 0 + || uri.indexOf("/app/enterpriseInformation/getEnterpriseInfoBySj") >= 0) { chain.doFilter(request, response); return; } diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml index 3a9271d7..762111a0 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml @@ -152,6 +152,9 @@ AND dept_name like concat('%', #{deptName}, '%') + + AND isDeleted = #{isDeleted} + AND status = #{status} diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js index 03b846af..1a6447c9 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/static/statistical/scripts/charts-analyov.js @@ -27,11 +27,11 @@ var complaint_order_chart = null; var bureau_order_chart = null; /** 各区综合分析 */ -function sixIndicators_area(qy) { +function sixIndicators_area(deptId, area) { $.ajax({ url: ctx + "code/statisticalPanel/sixIndicators_area", type: "get", - data: {dateType: "year", year:"2025", qy:qy}, + data: {dateType: "year", year:"2025", deptId: deptId, qy: area}, success: function(res) { if(res.success) { // chartArea(res.data); @@ -165,12 +165,12 @@ function sixIndicators_area(qy) { } /** 检查类别数量及占比 */ -function reg_type(qy) { +function reg_type(deptId) { $.ajax({ // url: ctx + "code/registration/echarts1", url: ctx + "code/statisticalPanel/staisticalCheck_category", type: "get", - data: {year: '2025', dateSearch: 'year', qy:qy}, + data: {year: '2025', dateType: 'year', deptId: deptId}, success: function(res) { var types = [] for (var i=0; i
-

企业类别数量及占比

+

被检查企业类别数量及占比

@@ -256,11 +256,11 @@ queryDept(); }); - function sixIndicators(qy) { + function sixIndicators(deptId, area) { $.ajax({ url: ctx + "code/statisticalPanel/sixIndicators", type: "get", - data: {dateType: "year", year:"2025", qy: qy}, + data: {dateType: "year", year:"2025", deptId: deptId, qy: area}, success: function(res) { if(res.success) { const indicators = res.data; @@ -316,9 +316,9 @@ const datas = res.data; var html = ''; if(datas.length >= 11) { - html += '
全区
'; + html += '
全区
'; $("#dept_flag").html('全区') - changeArea('2', null) + changeArea(null, null) } else { var area = datas[0].deptName; $("#dept_flag").html(area) @@ -346,14 +346,14 @@ } function changeArea(id, area) { - sixIndicators(area) - sixIndicators_area(area); - reg_type(area); - enterprise_type(area); - complaint_type(area); - reg_order(area); - complaint_order(area); - bureau_order(area); + sixIndicators(id, area) + sixIndicators_area(id, area); + reg_type(id); + enterprise_type(id); + complaint_type(id); + reg_order(id); + complaint_order(id); + bureau_order(id); if (null == area) area = "全区" $("#dept_flag").html(area) } diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html index 51b03b63..a0ce3a2b 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html @@ -129,7 +129,7 @@ -%
-
企业数量
+
企业数量(全市)
-
@@ -267,9 +267,6 @@ var ctx="/" $(function(){ - sixIndicators(null); - checkCategory(); - enforceType(); queryDept(); }); @@ -277,15 +274,16 @@ $.ajax({ url: ctx + "code/statisticalPanel/sixIndicators", type: "get", - data: {dateType: "year", year:"2025", bureauDeptId: deptId}, + data: {dateType: "year", year:"2025", deptId: deptId}, success: function(res) { if(res.success) { const indicators = res.data; html = ""; for(var i=0; i < indicators.length; i++) { var indicator = indicators[i]; + var title = indicator.title=="企业数量"?"企业数量(全市)":indicator.title; html += '
'; - html += '
'+indicator.title+'
'; + html += '
'+title+'
'; html += '
'+indicator.num+''; html += '
'; html += '
'; @@ -323,11 +321,11 @@ } /** 检查类别 */ - function checkCategory() { + function checkCategory(deptId) { $.ajax({ url: ctx + "code/statisticalPanel/staisticalCheck_category", type: "get", - data: {dateType: "year", year:"2025"}, + data: {dateType: "year", year:"2025", deptId: deptId}, success: function(res) { if(res.success) { var html = ""; @@ -349,11 +347,11 @@ } /** 投诉类型 */ - function enforceType() { + function enforceType(deptId) { $.ajax({ url: ctx + "code/statisticalPanel/staisticalEnforce_type", type: "get", - data: {dateType: "year", year:"2025"}, + data: {dateType: "year", year:"2025", deptId: deptId}, success: function(res) { if(res.success) { var html = "

行政执法投诉类别及占比

"; @@ -382,9 +380,17 @@ data: {zone: "1"}, success: function(res) { if(res.success) { - $("#dept_flag").html('全市直') - var html = '
全市直
'; const datas = res.data; + var html = ''; + if(datas.length >= 29) { + html += '
全市直
'; + $("#dept_flag").html('全市直') + changeArea('2', null) + } else { + var area = datas[0].deptName; + $("#dept_flag").html(area) + changeArea(datas[0].deptId, area) + } for(var i=0; i'+datas[i].deptName+'' } @@ -407,8 +413,11 @@ } function changeArea(id, area) { - console.log(id) sixIndicators(id); + checkCategory(id); + enforceType(id); + queryDept(id); + if (null == area) area = "全市值" $("#dept_flag").html(area) } @@ -443,8 +452,9 @@ /*******职权使用次数排行***********/ - + // 基于准备好的dom,初始化echarts实例 + function tmp1() { var myChart = echarts.init(document.getElementById('powerNumber')); // 指定图表的配置项和数据 @@ -538,12 +548,12 @@ myChart.setOption(option); window.addEventListener("resize",function(){ myChart.resize(); - }); - + }); +} /*******职权被投诉次数排行***********/ - + function tmp2() { // 基于准备好的dom,初始化echarts实例 var myChart = echarts.init(document.getElementById('powerComplaint')); @@ -578,7 +588,8 @@ xAxis : [ { type : 'category', - data : ['深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局'], + // data : ['深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局','深圳市司法局'], + data : [], axisLine: {show: false}, axisTick: {show: false}, axisLabel: { @@ -622,7 +633,8 @@ backgroundStyle: { borderRadius: [10, 10, 0, 0] }, - data:[13, 12, 11, 9, 8, 7, 6, 5, 5, 4], + // data:[13, 12, 11, 9, 8, 7, 6, 5, 5, 4], + data:[], color:'#7ca9fb', itemStyle: { borderRadius: [10, 10, 0, 0] @@ -639,13 +651,10 @@ window.addEventListener("resize",function(){ myChart.resize(); }); - +} //*****************职权使用率 - -$(function () { - xdnx(); function xdnx() { // 基于准备好的dom,初始化echarts实例 @@ -761,8 +770,7 @@ function xdnx() { }); } -}); - + diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java index a89c80eb..3c3a4669 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java @@ -1,7 +1,9 @@ package com.zdxt.code.controller; +import com.zdxt.auth.common.utils.StringUtils; import com.zdxt.auth.dto.DeptBean; import com.zdxt.auth.feign.DeptApi; +import com.zdxt.auth.project.system.dict.service.IDictDataService; import com.zdxt.code.domain.ComprehensiveAnalysis; import com.zdxt.code.domain.SixAnalysis; import com.zdxt.code.domain.SixAnalysisParams; @@ -11,6 +13,7 @@ import com.zdxt.code.service.StatisticalPaneService; import com.zdxt.common.ZDResponse; import com.zdxt.common.controller.BaseController; import com.zdxt.domain.auth.Dept; +import com.zdxt.domain.auth.DictData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -22,7 +25,9 @@ import org.springframework.web.bind.annotation.ResponseBody; import java.time.LocalDate; import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 综合统计 @@ -34,6 +39,7 @@ public class StatisticalPanelController extends BaseController { @Autowired private StatisticalPaneService statisticalPaneService; + @Autowired private IDictDataService iDictDataService; @Autowired private DeptApi deptApi; @@ -129,93 +135,6 @@ public class StatisticalPanelController extends BaseController { @GetMapping("/sixIndicators") @ResponseBody public ZDResponse sixIndicators(SixAnalysisParams params){ -// // 获取当前月的 今天 / 第一天 -// LocalDate current_day = LocalDate.now(); // 当月的今天 -// LocalDate current_one_day = current_day.withDayOfMonth(1); // 当月第一天 -// LocalDate current_finally_day = current_day.with(TemporalAdjusters.lastDayOfMonth()); // 当月最后一天 -// // 获取上个月的 今天 / 第一天 -// LocalDate last_day = current_day.minusMonths(1); // 上月的今天 -// LocalDate last_one_day = current_day.minusMonths(1).withDayOfMonth(1); // 上月第一天 -// LocalDate last_finally_day = current_day.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth()); // 上月最后一天 -// -// -// // 如果当前日期是这个月的最后一天 or 当前月份天>上一月最后一天,则调整到上个月的最后一天 -// if (current_day.getDayOfMonth() > last_day.lengthOfMonth() || current_day.equals(current_finally_day)) { -// last_day = last_finally_day; -// } -// -// List all_area=new ArrayList<>(); -// -// // 涉企检查数量 -// SixAnalysis registration = new SixAnalysis(); -// all_area.add(registration); -// registration.setTitle("涉企检查数量"); -// int reg_num = statisticalPaneService.staisticalRegistration(params); -// registration.setNum(reg_num); -// registration.setRing_ratio("0"); -// registration.setYoy("0"); -// // 联合检查数量 -// SixAnalysis unite_registration = new SixAnalysis(); -// all_area.add(unite_registration); -// unite_registration.setTitle("联合检查数量"); -// params.setUniteCheck("0"); -// int unite_reg_num = statisticalPaneService.staisticalRegistration(params); -// unite_registration.setNum(unite_reg_num); -// unite_registration.setRing_ratio("0"); -// unite_registration.setYoy("0"); -// params.setUniteCheck(null); -// // 行政检查预告数量 -// SixAnalysis lawEnforcement = new SixAnalysis(); -// all_area.add(lawEnforcement); -// lawEnforcement.setTitle("行政检查预告数量"); -// int law_num = statisticalPaneService.staisticalLawEnforcement(params); -// lawEnforcement.setNum(law_num); -// lawEnforcement.setRing_ratio("0"); -// lawEnforcement.setYoy("0"); -// //涉企投诉数量 -// SixAnalysis complaint = new SixAnalysis(); -// all_area.add(complaint); -// complaint.setTitle("涉企投诉数量"); -// int com_num = statisticalPaneService.staisticalComplaint(params); -// complaint.setNum(com_num); -// complaint.setRing_ratio("0"); -// complaint.setYoy("0"); -// //企业数量 -// SixAnalysis enterprise = new SixAnalysis(); -// all_area.add(enterprise); -// enterprise.setTitle("企业数量"); -// int ent_num = statisticalPaneService.staisticalEnterprise(params); -// enterprise.setNum(ent_num); -// enterprise.setRing_ratio("0"); -// enterprise.setYoy("0"); -// -// params.setDateType("day"); -// /** -------- 本月 -------- */ -// params.setBeginTime(current_one_day.toString()); -// params.setEndTime(current_finally_day.toString()); -// -// registration.setCurrent_month_num(statisticalPaneService.staisticalRegistration(params)); -// params.setUniteCheck("0"); -// unite_registration.setCurrent_month_num(statisticalPaneService.staisticalRegistration(params)); -// params.setUniteCheck(null); -// lawEnforcement.setCurrent_month_num(statisticalPaneService.staisticalLawEnforcement(params)); -// complaint.setCurrent_month_num(statisticalPaneService.staisticalComplaint(params)); -// enterprise.setCurrent_month_num(statisticalPaneService.staisticalEnterprise(params)); -// -// /** -------- 昨天 -------- */ -// LocalDate yesterday = LocalDate.now().minusDays(1); -// params.setBeginTime(yesterday.toString()); -// params.setEndTime(yesterday.toString()); -// -// registration.setYesterday_num(statisticalPaneService.staisticalRegistration(params)); -// params.setUniteCheck("0"); -// unite_registration.setYesterday_num(statisticalPaneService.staisticalRegistration(params)); -// params.setUniteCheck(null); -// lawEnforcement.setYesterday_num(statisticalPaneService.staisticalLawEnforcement(params)); -// complaint.setYesterday_num(statisticalPaneService.staisticalComplaint(params)); -// enterprise.setYesterday_num(statisticalPaneService.staisticalEnterprise(params)); -// -// return ZDResponse.success("总数据统计", all_area); return ZDResponse.success("总数据统计", statisticalPaneService.sixIndicators(params)); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java index 01abdac4..8d165c8b 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java @@ -771,7 +771,18 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS // 将查询字符串拆分为键值对 Map queryParams = new HashMap<>(); if (query != null) { - String[] pairs = query.split("&"); + String split_flag = "&"; + if (query.indexOf("&") < 0) { + if (query.indexOf("&") < 0) { + split_flag = "%26"; + } else { + split_flag = "&"; + } + } else { + split_flag = "&"; + } +// String split_flag = query.indexOf("&") < 0 ?"%26":"&"; // 有些链接的 & 会被转义成 %26 + String[] pairs = query.split(split_flag); for (String pair : pairs) { int idx = pair.indexOf("="); String key = pair.substring(0, idx); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java index b665d478..57b2ecab 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java @@ -647,10 +647,13 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { */ @Override public List sixIndicators(SixAnalysisParams params) { -// if (StringUtils.isNotEmpty(params.getQy())) { -// String qy=iDictDataService.selectDictLabel("address_Type",params.getQy()); -// params.setQy(qy); -// } + // 如果部门为空这表示全了全部, 如果是区直则定位为 区 的deptId, 市则 市的deptId, 全市则 深圳市的部门id + if (StringUtils.isEmpty(params.getDeptId())) { + Dept deptParams = new Dept(); + deptParams.setIsDeleted("深圳市/区"); + List depts = iDeptService.selectDeptList(deptParams); + params.setDeptId(depts.get(0).getDeptId()); + } // 获取当前月的 今天 / 第一天 LocalDate current_day = LocalDate.now(); // 当月的今天 @@ -667,13 +670,16 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { last_day = last_finally_day; } + String tmpArea = params.getQy(); + params.setQy(null); + List all_area=new ArrayList<>(); /** -------- 总数 -------- */ // 涉企检查数量 SixAnalysis registration = new SixAnalysis(); all_area.add(registration); registration.setTitle("涉企检查数量"); - int reg_num = this.staisticalRegistration(params); + int reg_num = statisticalPanelMapper.staisticalRegistration(params); double reg_rr_num = statisticalPanelMapper.staisticalRegistration_rr(params); double reg_yoy_num = statisticalPanelMapper.staisticalRegistration_yoy(params); registration.setNum(reg_num); @@ -684,7 +690,7 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { all_area.add(unite_registration); unite_registration.setTitle("联合检查数量"); params.setUniteCheck("0"); - int unite_reg_num = this.staisticalRegistration(params); + int unite_reg_num = statisticalPanelMapper.staisticalRegistration(params); double unite_reg_rr_num = statisticalPanelMapper.staisticalRegistration_rr(params); double unite_reg_yoy_num = statisticalPanelMapper.staisticalRegistration_yoy(params); unite_registration.setNum(unite_reg_num); @@ -725,9 +731,11 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { SixAnalysis enterprise = new SixAnalysis(); all_area.add(enterprise); enterprise.setTitle("企业数量"); + params.setQy(tmpArea); int ent_num = statisticalPanelMapper.staisticalEnterprise(params); double ent_rr_num = statisticalPanelMapper.staisticalEnterprise_rr(params); double ent_yoy_num = statisticalPanelMapper.staisticalEnterprise_yoy(params); + params.setQy(null); enterprise.setNum(ent_num); enterprise.setRing_ratio(this.calculateRingRatio(ent_rr_num, ent_num)); enterprise.setYoy(this.calculateYearOverYear(ent_yoy_num, ent_num)); @@ -742,10 +750,12 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { params.setUniteCheck("0"); unite_registration.setCurrent_month_num(statisticalPanelMapper.staisticalRegistration(params)); params.setUniteCheck(null); - lawEnforcement.setCurrent_month_num(this.staisticalLawEnforcement(params)); - complaint.setCurrent_month_num(this.staisticalComplaint(params)); + lawEnforcement.setCurrent_month_num(statisticalPanelMapper.staisticalLawEnforcement(params)); + complaint.setCurrent_month_num(statisticalPanelMapper.staisticalComplaint(params)); // warning.setCurrent_month_num(statisticalPanelMapper.staisticalWarning(params)); - enterprise.setCurrent_month_num(this.staisticalEnterprise(params)); + params.setQy(tmpArea); + enterprise.setCurrent_month_num(statisticalPanelMapper.staisticalEnterprise(params)); + params.setQy(null); /** -------- 昨天 -------- */ LocalDate yesterday = LocalDate.now().minusDays(1); @@ -756,10 +766,12 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { params.setUniteCheck("0"); unite_registration.setYesterday_num(statisticalPanelMapper.staisticalRegistration(params)); params.setUniteCheck(null); - lawEnforcement.setYesterday_num(this.staisticalLawEnforcement(params)); - complaint.setYesterday_num(this.staisticalComplaint(params)); + lawEnforcement.setYesterday_num(statisticalPanelMapper.staisticalLawEnforcement(params)); + complaint.setYesterday_num(statisticalPanelMapper.staisticalComplaint(params)); // warning.setYesterday_num(statisticalPanelMapper.staisticalWarning(params)); - enterprise.setYesterday_num(this.staisticalEnterprise(params)); + params.setQy(tmpArea); + enterprise.setYesterday_num(statisticalPanelMapper.staisticalEnterprise(params)); + params.setQy(null); return all_area; } @@ -795,38 +807,69 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { @Override public List> sixIndicators_area(SixAnalysisParams params) { + // 如果部门为空这表示全了全部, 如果是区直则定位为 区 的deptId, 市则 市的deptId, 全市则 深圳市的部门id + String tmp_deptId = params.getDeptId(); + Dept deptParams = new Dept(); + deptParams.setZone(2); + List depts = iDeptService.selectDeptList(deptParams); String area_flag = params.getQy(); - List area_list = iDictDataService.selectDictDataByType("address_Type"); +// List area_list = iDictDataService.selectDictDataByType("address_Type"); List> all_area=new ArrayList<>(); - for(DictData area:area_list) { + for(Dept area:depts) { Map info = new HashMap<>(); - info.put("area", area.getDictLabel()); - params.setQy(area.getDictLabel()); + info.put("area", area.getDeptName()); +// params.setQy(area.getDictLabel()); + String area_dict = area.getDeptName(); List areas = new ArrayList<>(); + params.setQy(null); + if (StringUtils.isEmpty(tmp_deptId)) { + params.setDeptId(area.getDeptId()); + } + /** -------- 总数 -------- */ // 涉企检查数量 SixAnalysis registration = new SixAnalysis(); areas.add(registration); registration.setTitle("涉企检查次数"); - registration.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalRegistration(params):0); + if (area_flag.equals(area_dict) || StringUtils.isEmpty(area_flag)) { + registration.setNum(statisticalPanelMapper.staisticalRegistration(params)); + } else { + registration.setNum(0); + } +// registration.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalRegistration(params):0); // 联合检查数量 SixAnalysis unite_registration = new SixAnalysis(); areas.add(unite_registration); unite_registration.setTitle("联合检查次数"); params.setUniteCheck("0"); - unite_registration.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalRegistration(params):0); + if (area_flag.equals(area_dict) || StringUtils.isEmpty(area_flag)) { + unite_registration.setNum(statisticalPanelMapper.staisticalRegistration(params)); + } else { + unite_registration.setNum(0); + } +// unite_registration.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalRegistration(params):0); params.setUniteCheck(null); // 行政检查预告数量 SixAnalysis lawEnforcement = new SixAnalysis(); areas.add(lawEnforcement); lawEnforcement.setTitle("行政检查预告次数"); - lawEnforcement.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?this.staisticalLawEnforcement(params):0); + if (area_flag.equals(area_dict) || StringUtils.isEmpty(area_flag)) { + lawEnforcement.setNum(statisticalPanelMapper.staisticalLawEnforcement(params)); + } else { + lawEnforcement.setNum(0); + } +// lawEnforcement.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalLawEnforcement(params):0); //涉企投诉数量 SixAnalysis complaint = new SixAnalysis(); areas.add(complaint); complaint.setTitle("涉企投诉次数"); - complaint.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?this.staisticalComplaint(params):0); + if (area_flag.equals(area_dict) || StringUtils.isEmpty(area_flag)) { + complaint.setNum(statisticalPanelMapper.staisticalComplaint(params)); + } else { + complaint.setNum(0); + } +// complaint.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalComplaint(params):0); //执法预警数量 // SixAnalysis warning = new SixAnalysis(); // areas.add(warning); @@ -836,7 +879,13 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { SixAnalysis enterprise = new SixAnalysis(); areas.add(enterprise); enterprise.setTitle("企业数量"); - enterprise.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?this.staisticalEnterprise(params):0); + if (area_flag.equals(area_dict) || StringUtils.isEmpty(area_flag)) { + params.setQy(area_dict); + enterprise.setNum(statisticalPanelMapper.staisticalEnterprise(params)); + } else { + enterprise.setNum(0); + } +// enterprise.setNum(area_flag.equals(params.getQy()) || StringUtils.isEmpty(area_flag)?statisticalPanelMapper.staisticalEnterprise(params):0); info.put("list", areas); all_area.add(info); } @@ -846,19 +895,23 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { /** 排行 */ @Override + @DataScope(userAlias = "r", deptAlias = "r", deptField = "bureau_dept_id") public List> staisticalRegistration_order(SixAnalysisParams params) { return statisticalPanelMapper.staisticalRegistration_order(params); } @Override +// @DataScope(deptAlias = "c", deptField = "complaint_department_id") public List> staisticalComplaint_order(SixAnalysisParams params) { return statisticalPanelMapper.staisticalComplaint_order(params); } @Override +// @DataScope(userAlias = "r", deptAlias = "r", deptField = "bureau_dept_id") public List> staisticalBureau_order(SixAnalysisParams params) { return statisticalPanelMapper.staisticalBureau_order(params); } @Override +// @DataScope(userAlias = "r", deptAlias = "r", deptField = "bureau_dept_id") public List> staisticalCheck_category(SixAnalysisParams params) { List> results = new ArrayList<>(); List checkCategory = iDictDataService.selectDictDataByType("check_category"); @@ -879,7 +932,11 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { } for (Map tmpMap : results) { double per = Double.parseDouble(tmpMap.get("num").toString()) / total * 100; - tmpMap.put("per", String.format("%.2f", per)+"%"); + if (Double.isNaN(per)) { + tmpMap.put("per", 0+"%"); + } else { + tmpMap.put("per", String.format("%.2f", per)+"%"); + } } return results; } @@ -931,6 +988,7 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { } @Override +// @DataScope(deptAlias = "c", deptField = "complaint_department_id") public List> staisticalEnforce_type(SixAnalysisParams params) { List> results = new ArrayList<>(); List checkCategory = iDictDataService.selectDictDataByType("caseType"); @@ -951,7 +1009,11 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService { } for (Map tmpMap : results) { double per = Double.parseDouble(tmpMap.get("num").toString()) / total * 100; - tmpMap.put("per", String.format("%.2f", per)+"%"); + if (Double.isNaN(per)) { + tmpMap.put("per", 0+"%"); + } else { + tmpMap.put("per", String.format("%.2f", per)+"%"); + } } return results.subList(0, Math.min(6, results.size())); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml index 820386f3..76c970f2 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml @@ -147,10 +147,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and enforcement_time <= #{params.endTime} - - - ${params.dataScope} - order by enforcement_time desc diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml index 21de8db8..3490a1e2 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml @@ -136,6 +136,9 @@ and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) @@ -185,6 +188,9 @@ and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) @@ -234,6 +240,9 @@ and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) @@ -277,8 +286,10 @@ and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) - and n.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -316,6 +327,9 @@ and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) and n.bureau_dept_id=#{bureauDeptId} @@ -355,6 +369,9 @@ and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) and n.bureau_dept_id=#{bureauDeptId} @@ -398,8 +415,10 @@ and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) - and c.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -439,8 +458,10 @@ and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) - and c.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -480,8 +501,10 @@ and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) - and c.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -520,7 +543,9 @@ and w.enterprise_number is not null and warn_type = 1 and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) - and w.bureau_dept_id=#{bureauDeptId} + + and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -557,7 +582,9 @@ and w.enterprise_number is not null and warn_type = 1 and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) - and w.bureau_dept_id=#{bureauDeptId} + + and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -594,7 +621,9 @@ and w.enterprise_number is not null and warn_type = 1 and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) - and w.bureau_dept_id=#{bureauDeptId} + + and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -633,7 +662,6 @@ and e.company_org_type is not null and e.enterprise_address is not null and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) - and e.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -666,7 +694,6 @@ and e.company_org_type is not null and e.enterprise_address is not null and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) - and e.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -703,7 +730,6 @@ and e.company_org_type is not null and e.enterprise_address is not null and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) - and e.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -752,7 +778,9 @@ and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) - and r.bureau_dept_id=#{bureauDeptId} + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -792,7 +820,9 @@ and c.enforce_type is not null and c.enterprise_number is not null and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) - and c.bureau_dept_id=#{bureauDeptId} + + and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -840,7 +870,9 @@ and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) - and r.bureau_dept_id=#{bureauDeptId} + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -890,10 +922,12 @@ and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) - and r.bureau_dept_id=#{bureauDeptId} and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) @@ -942,6 +976,9 @@ and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) + + and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId}) + and r.unite_check is not null and r.unite_check is null and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) @@ -974,6 +1011,7 @@ ${params.dataScope} + group by enterprise_number