From 72f86b4de6228eba1cc21a1006e8e3bf80f95940 Mon Sep 17 00:00:00 2001 From: kylin L <452061493@qq.com> Date: Fri, 5 Jul 2024 09:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=88=86=E6=9E=90=E5=92=8C?= =?UTF-8?q?=E6=8C=89=E5=AD=A3=E5=BA=A6=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/code/analysis/analysis.html | 253 +++++++++++++++--- .../controller/StatisticalController.java | 34 ++- .../com/zdxt/code/domain/StatisticalVo.java | 41 +++ .../zdxt/code/mapper/StatisticalMapper.java | 4 + .../zdxt/code/service/StatisticalService.java | 7 + .../service/impl/StatisticalServiceImpl.java | 49 +++- .../EnforcementInspectionProgramMapper.xml | 24 +- .../mapper/EnforcementRegistrationMapper.xml | 24 +- .../mapper/EnterpriseLawEnforcementMapper.xml | 24 +- .../resources/mapper/StatisticalMapper.xml | 52 ++++ 10 files changed, 431 insertions(+), 81 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html index 4ed9617a..f2416058 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html @@ -3,48 +3,180 @@ - +
-

深圳市各类行政检查实施情况分析

-
年度 -季度 -月度 -
-
案件数量执法人员检查事项企业类型
-
-
-
- -
-
-
- -
-
+

深圳市各类行政检查实施情况分析

+
+ + 年度 + 年度 + 季度 + 月度 +
+
+ 案件数量 + 执法人员 + 检查事项 + 企业类型 +
-
-
+
+
+
+
+
+
+
+
+
+
+
+
- - + + diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java index 683ec364..5b8cbc93 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,8 +38,8 @@ public class StatisticalController { */ @GetMapping("/analysis") public String analysis(StatisticalVo statisticalVo,ModelMap mmp){ - List statisticalVos = statisticalService.StatisticalCaseload(statisticalVo); - mmp.put("statisticalVos",statisticalVos); +// List statisticalVos = statisticalService.StatisticalCaseload(statisticalVo); +// mmp.put("statisticalVos",statisticalVos); return prefix2 + "/analysis"; } /** @@ -51,4 +52,33 @@ public class StatisticalController { Map map = statisticalService.statisticalData(statisticalVo); return ZDResponse.success("查询成功",map); } + + + @GetMapping("/checkAnalysis") + @ResponseBody + public ZDResponse checkAnalysis(StatisticalVo statisticalVo){ + List statisticalVos = statisticalService.StatisticalCaseload(statisticalVo); + return ZDResponse.success("查询成功", statisticalVos); + } + + @GetMapping("/caseAnalysis") + @ResponseBody + public ZDResponse caseAnalysis(StatisticalVo statisticalVo){ + List statisticalVos = statisticalService.caseAnalysis(statisticalVo); + return ZDResponse.success("查询成功", statisticalVos); + } + + @GetMapping("/enforcerAnalysis") + @ResponseBody + public ZDResponse enforcerAnalysis(StatisticalVo statisticalVo){ + List statisticalVos = statisticalService.enforcerAnalysis(statisticalVo); + return ZDResponse.success("查询成功", statisticalVos); + } + + @GetMapping("/enterpriseAnalysis") + @ResponseBody + public ZDResponse enterpriseAnalysis(StatisticalVo statisticalVo){ + List statisticalVos = statisticalService.enterpriseAnalysis(statisticalVo); + return ZDResponse.success("查询成功", statisticalVos); + } } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java index 235e5208..9dedb66a 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java @@ -43,6 +43,47 @@ public class StatisticalVo extends BaseDomain { */ private Integer complaintCount; + /** 季度 或 月度 */ + private String qorm; + /** 年 */ + private String year; + /** 季 */ + private String quarter; + /** 月 */ + private String month; + + public String getQorm() { + return qorm; + } + + public void setQorm(String qorm) { + this.qorm = qorm; + } + + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + public String getQuarter() { + return quarter; + } + + public void setQuarter(String quarter) { + this.quarter = quarter; + } + + public String getMonth() { + return month; + } + + public void setMonth(String month) { + this.month = month; + } + public String getLawEnforcement() { return lawEnforcement; } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java index 66de1189..730e530b 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java @@ -42,4 +42,8 @@ public interface StatisticalMapper { * @return */ StatisticalVo statisticalToMouth(StatisticalVo statisticalVo); + + List caseAnalysis(StatisticalVo statisticalVo); + List enforcerAnalysis(StatisticalVo statisticalVo); + List enterpriseAnalysis(StatisticalVo statisticalVo); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java index 97ef3799..e3417400 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalService.java @@ -21,4 +21,11 @@ public interface StatisticalService { */ Map statisticalData(StatisticalVo statisticalVo); + /** 统计案件数量 */ + List caseAnalysis(StatisticalVo statisticalVo); + /** 统计执法人员案件数量 */ + List enforcerAnalysis(StatisticalVo statisticalVo); + /** 统计案件中的企业类型 */ + List enterpriseAnalysis(StatisticalVo statisticalVo); + } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java index b5d4af34..c7926398 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalServiceImpl.java @@ -9,6 +9,7 @@ import com.zdxt.common.annotation.DataScope; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -25,7 +26,6 @@ public class StatisticalServiceImpl implements StatisticalService @Override public List StatisticalCaseload(StatisticalVo statisticalVo) { - List statisticalVos = statisticalMapper.StatisticalCaseload(statisticalVo); return statisticalVos; } @@ -57,4 +57,51 @@ public class StatisticalServiceImpl implements StatisticalService dataList.put("mouth",statisticalVos3); return dataList; } + + @Override + public List caseAnalysis(StatisticalVo statisticalVo) { + this.putParams(statisticalVo); + List statisticalVos = statisticalMapper.caseAnalysis(statisticalVo); + return statisticalVos; + } + + @Override + public List enforcerAnalysis(StatisticalVo statisticalVo) { + this.putParams(statisticalVo); + List statisticalVos = statisticalMapper.enforcerAnalysis(statisticalVo); + return statisticalVos; + } + + @Override + public List enterpriseAnalysis(StatisticalVo statisticalVo) { + this.putParams(statisticalVo); + List statisticalVos = statisticalMapper.enterpriseAnalysis(statisticalVo); + return statisticalVos; + } + + private void putParams(StatisticalVo statisticalVo) { + Map params = statisticalVo.getParams(); + if ("q".equals(statisticalVo.getQorm())) { + switch (statisticalVo.getQuarter()){ + case "q1": + params.put("startDate", statisticalVo.getYear()+"-01"); + params.put("endDate", statisticalVo.getYear()+"-03"); + break; + case "q2": + params.put("startDate", statisticalVo.getYear()+"-04"); + params.put("endDate", statisticalVo.getYear()+"-06"); + break; + case "q3": + params.put("startDate", statisticalVo.getYear()+"-07"); + params.put("endDate", statisticalVo.getYear()+"-09"); + break; + case "q4": + params.put("startDate", statisticalVo.getYear()+"-10"); + params.put("endDate", statisticalVo.getYear()+"-12"); + break; + } + } else if ("m".equals(statisticalVo.getQorm())) { + params.put("yearMonth", statisticalVo.getYear()+'-'+statisticalVo.getMonth()); + } + } } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml index f1d80ff2..21244ae8 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml @@ -46,20 +46,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') - and create_time >= CONCAT(YEAR(CURDATE()), '-', - CASE WHEN QUARTER(CURDATE()) IN (1) THEN 2 - WHEN QUARTER(CURDATE()) IN (2) THEN 4 - WHEN QUARTER(CURDATE()) IN (3) THEN 7 - ELSE 10 END, '-01') - and create_time <= CONCAT(YEAR(CURDATE()), '-', + AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', + CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' + WHEN QUARTER(CURDATE()) IN (2) THEN '04' + WHEN QUARTER(CURDATE()) IN (3) THEN '07' + ELSE '10' END) + and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', CASE - WHEN QUARTER(CURDATE()) IN (1) THEN 3 - WHEN QUARTER(CURDATE()) IN (2) THEN 6 - WHEN QUARTER(CURDATE()) IN (3) THEN 9 - ELSE 12 - END, - '-', - DAY(LAST_DAY(CURDATE()))) + WHEN QUARTER(CURDATE()) IN (1) THEN '03' + WHEN QUARTER(CURDATE()) IN (2) THEN '06' + WHEN QUARTER(CURDATE()) IN (3) THEN '09' + ELSE '12' + END) and DATE_FORMAT(create_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml index d3bae926..1ca63ae8 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml @@ -86,20 +86,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') - and enforcement_time >= CONCAT(YEAR(CURDATE()), '-', - CASE WHEN QUARTER(CURDATE()) IN (1) THEN 2 - WHEN QUARTER(CURDATE()) IN (2) THEN 4 - WHEN QUARTER(CURDATE()) IN (3) THEN 7 - ELSE 10 END, '-01') - and enforcement_time <= CONCAT(YEAR(CURDATE()), '-', + AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', + CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' + WHEN QUARTER(CURDATE()) IN (2) THEN '04' + WHEN QUARTER(CURDATE()) IN (3) THEN '07' + ELSE '10' END) + and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', CASE - WHEN QUARTER(CURDATE()) IN (1) THEN 3 - WHEN QUARTER(CURDATE()) IN (2) THEN 6 - WHEN QUARTER(CURDATE()) IN (3) THEN 9 - ELSE 12 - END, - '-', - DAY(LAST_DAY(CURDATE()))) + WHEN QUARTER(CURDATE()) IN (1) THEN '03' + WHEN QUARTER(CURDATE()) IN (2) THEN '06' + WHEN QUARTER(CURDATE()) IN (3) THEN '09' + ELSE '12' + END) and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml index d67c72ac..ba7be945 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml @@ -72,20 +72,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DATE_FORMAT(check_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') - and check_time >= CONCAT(YEAR(CURDATE()), '-', - CASE WHEN QUARTER(CURDATE()) IN (1) THEN 2 - WHEN QUARTER(CURDATE()) IN (2) THEN 4 - WHEN QUARTER(CURDATE()) IN (3) THEN 7 - ELSE 10 END, '-01') - and check_time <= CONCAT(YEAR(CURDATE()), '-', + AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', + CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' + WHEN QUARTER(CURDATE()) IN (2) THEN '04' + WHEN QUARTER(CURDATE()) IN (3) THEN '07' + ELSE '10' END) + and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', CASE - WHEN QUARTER(CURDATE()) IN (1) THEN 3 - WHEN QUARTER(CURDATE()) IN (2) THEN 6 - WHEN QUARTER(CURDATE()) IN (3) THEN 9 - ELSE 12 - END, - '-', - DAY(LAST_DAY(CURDATE()))) + WHEN QUARTER(CURDATE()) IN (1) THEN '03' + WHEN QUARTER(CURDATE()) IN (2) THEN '06' + WHEN QUARTER(CURDATE()) IN (3) THEN '09' + ELSE '12' + END) and DATE_FORMAT(check_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml index cd070ddf..aa0daa51 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml @@ -111,4 +111,56 @@ + + + + + + + + \ No newline at end of file