Browse Source

监督端-统计修改-1209客户需求

v4
zouyx 2 years ago
parent
commit
487ff48c88
  1. 109
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/LawEnforcementWarningList/LawEnforcementWarningList.html
  2. 109
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/LawEnforcementWarningList/registrationDetail.html
  3. 27
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html
  4. 1
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html
  5. 55
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/staticRegistration.html
  6. 8
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/ruleItemList.html
  7. 3
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html
  8. 31
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java
  9. 46
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/DeptStaticController.java
  10. 16
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java
  11. 75
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java
  12. 82
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/LawEnforcementWarningListController.java
  13. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementCheckStatistics.java
  14. 18
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java
  15. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/LawEnforcementWarningListMapper.java
  16. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ILawEnforcementWarningListService.java
  17. 18
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java
  18. 40
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementCheckStatisticsImpl.java
  19. 5
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LawEnforcementWarningListServiceImpl.java
  20. 38
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementCheckStatisticsMapper.xml
  21. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  22. 55
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LawEnforcementWarningListMapper.xml

109
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/LawEnforcementWarningList/LawEnforcementWarningList.html

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="zdxtInclude :: header('执法预警列表列表')" /> <th:block th:include="zdxtInclude :: header('执法预警列表列表')" />
<th:block th:include="zdxtInclude :: datetimepicker-css" />
<link type="text/css" href="/css/stat1.css" rel="stylesheet" /> <link type="text/css" href="/css/stat1.css" rel="stylesheet" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
@ -33,6 +34,7 @@
<li> <li>
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-reset btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-warning btn-sm" onclick="downloadRW()"><i class="fa fa-share-square-o"></i> 导出</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -43,7 +45,7 @@
当月累计接受行政检查三至四次为黄色提示,五至六次为橙色提示,七次及以上为红色提示。 当月累计接受行政检查三至四次为黄色提示,五至六次为橙色提示,七次及以上为红色提示。
</div> </div>
<div class="col-sm-12 select-table table-bordered"> <div class="col-sm-12 select-table table-bordered">
<div id="detail2" class="detail-list" style="width: 75%;margin-top: 10%"> <div id="detail2" class="detail-list" style="width: 75%;">
<span id="closeButton2" class="detail-close" onclick="closeUnite()">×</span> <span id="closeButton2" class="detail-close" onclick="closeUnite()">×</span>
<table id="bootstrap-table3"></table> <table id="bootstrap-table3"></table>
</div> </div>
@ -71,54 +73,55 @@
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "执法预警列表", modalName: "执法预警列表",
showHeader: false, showHeader: true,
showFooter: false, showFooter: false,
showColumns: false, showColumns: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
pagination: true,
pageSize: 10,
pageList: [10, 25, 50],
columns: [ columns: [
{ {
field : 'id', field : 'id',
title : '主键ID', title : '主键ID',
visible: false visible: false
}, },
{ {
field : 'warningTime', field : 'enterpriseName',
title : '预警时间' title : '企业名称'
}, },
{ {
field : 'enforcementNumber', field : 'warningCause',
title : '检查次数', title : '预警原因',
formatter:function (value,row,index) { formatter:function (value,row,index) {
return "<span style='cursor: pointer;color: green'" + return "<span style='cursor: pointer;color: blue'" +
" onclick='selectUnite(\""+row.enterpriseNumber+ "\",\""+row.beginTime+ "\",\""+row.endTime+ "\")'>" +value+ "</span>"; " onclick='selectUnite(\""+row.enterpriseNumber+ "\",\""+row.beginTime+ "\",\""+row.endTime+ "\")'>" +value+ "</span>";
// ,' + row.beginTime + ',' + row.endTime +" }
} },
}, {
{ field : 'warningLevel',
field : 'enterpriseName', title : '预警等级',
title : '企业名称' formatter:function (value,row,index) {
}, var map=getColor();
{ for (let i = 0; i < warnLevel.length; i++) {
field : 'warningLevel', // if(warnLevel[i].dictValue == value){
title : '预警等级', // return warnLevel[i].dictLabel
formatter:function (value,row,index) { // }
var map=getColor(); if(value == warnLevel[i].dictValue){
for (let i = 0; i < warnLevel.length; i++) { var color=map.get(warnLevel[i].dictValue);
// if(warnLevel[i].dictValue == value){ return '<a style="'+color+'"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>'+' '+warnLevel[i].dictLabel+'</a>'
// return warnLevel[i].dictLabel }
// }
if(value == warnLevel[i].dictValue){
var color=map.get(warnLevel[i].dictValue);
return '<a style="'+color+'"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>'+' '+warnLevel[i].dictLabel+'</a>'
} }
} }
} },
}, {
{ field : 'warningTime',
field : 'warningCause', title : '预警时间',
title : '预警原因' formatter:function (value){
}, return value.slice(0, -9);
}
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
@ -197,6 +200,28 @@
}; };
$("#bootstrap-table3").bootstrapTable(options); $("#bootstrap-table3").bootstrapTable(options);
}); });
function downloadRW(){
var currentId=$('form').eq(0).attr('id');
var params = $.common.formToJSON(currentId);
$.ajax({
type: "POST",
data: JSON.stringify(params),
contentType: 'application/json',
//设置响应类型
xhrFields: {responseType: "blob"},
url: prefix+"/exportWarnList",
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)
}
})
}
</script> </script>
</body> </body>
</html> </html>

109
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/LawEnforcementWarningList/registrationDetail.html

@ -15,8 +15,8 @@
<input type="text" name="lawEnforcement"/> <input type="text" name="lawEnforcement"/>
<!-- <input type="hidden" th:value="${time}" name="dateSearch"/>--> <!-- <input type="hidden" th:value="${time}" name="dateSearch"/>-->
<input type="hidden" th:value="${enterpriseNumber}" name="enterpriseNumber"/> <input type="hidden" th:value="${enterpriseNumber}" name="enterpriseNumber"/>
<input type="hidden" th:value="${beginTime}" name="params[beginTime]"/> <input type="hidden" th:value="${beginTime}" name="beginTime"/>
<input type="hidden" th:value="${endTime}" name="params[endTime]"/> <input type="hidden" th:value="${endTime}" name="endTime"/>
</li> </li>
<li> <li>
<p>执法人员:</p> <p>执法人员:</p>
@ -24,13 +24,13 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<p>检查时间:</p> <p>检查时间:</p>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginEnforcementTime]"/> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginEnforcementTime"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endEnforcementTime]"/> <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endEnforcementTime"/>
</li> </li>
<li> <li>
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-success btn-sm" onclick="rTable()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-reset btn-sm" onclick="rest1()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -46,8 +46,101 @@
<th:block th:include="zdxtInclude :: footer" /> <th:block th:include="zdxtInclude :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "code/registration"; var prefix = ctx + "code/registration";
window.onload = function () {
rTable();
}
$(function() { $(function() {
var options = {
modalName: "执法记录统计",
showHeader: true,
showFooter: false,
showColumns: false,
showRefresh: false,
showToggle: false,
pagination: true,
pageSize: 10,
pageList: [10, 25, 50],
//quarterBoolean:quarterBoolean,
columns: [
{
field : 'enterpriseName',
title : '被检查企业名称',
formatter:function (value) {
return "<div style='text-align: left'>"+ value +"</div>";
}
},
{
field : 'qy',
title : '企业所属区域'
},
{
field : 'jd',
title : '企业所属街道'
},
{
field : 'bureauDeptName',
title : '执法部门',
/*formatter:function (value,row,index) {
if(row.uniteType==1){
return "<div style='text-align: left'>"+ value +"(牵头单位)</div>";
}else {
return "<div style='text-align: left'>" + value + "</div>";
}
}*/
},
{
field : 'lawEnforcement',
title : '执法人员',
formatter:function (value,row,index) {
name="";
if(row.lawEnforcer!=""&&row.lawEnforcer!=null){
name=row.lawEnforcer;
}
if(row.lawEnforcer!=""&&row.lawEnforcer!=null&&row.lawEnforcerTwo!=""&&row.lawEnforcerTwo!=null){
name=name+",";
}
if(row.lawEnforcerTwo!=""&&row.lawEnforcerTwo!=null){
name=name+row.lawEnforcerTwo;
}
return name;
}
},
{
field : 'lawEnforcementItemText',
title : '检查事项',
formatter:function (value,row,index) {
return "<div style='text-align: left'>"+ $.table.tooltip(value) +"</div>";
}
},
{
field : 'createTime',
title : '检查时间'
},
]
};
console.log(options);
$("#bootstrap-table").bootstrapTable(options);
});
function rTable(){
var currentId=$('form').eq(0).attr('id');
var params = $.common.formToJSON(currentId);
$.ajax({
url: prefix + "/RWList",
method: 'post',
data:params,
success:function (response){
$('#bootstrap-table').bootstrapTable('load', response);
},error:function (xhr,status,error){
console.error("请求失败:",status,error);
}
})
}
function rest1(){
$('form').eq(0).trigger("reset");
console.log($.common.formToJSON($('form').eq(0).attr('id')));
rTable();
}
/*$(function() {
var options = { var options = {
url: prefix + "/listWarn", url: prefix + "/listWarn",
createUrl: prefix + "/add", createUrl: prefix + "/add",
@ -99,7 +192,7 @@
},] },]
}; };
$.table.init(options); $.table.init(options);
}); });*/
</script> </script>
</body> </body>
</html> </html>

27
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html

@ -281,7 +281,14 @@
}, },
{ {
field : 'percentage', field : 'percentage',
title : '占比' title : '占比',
formatter:function (value,row,index) {
if(row.numInt>0){
return '<span>' + value + '</span>';
}else {
return null;
}
}
}, },
] ]
} }
@ -307,7 +314,14 @@
}, },
{ {
field : 'percentage', field : 'percentage',
title : '占比' title : '占比',
formatter:function (value,row,index) {
if(row.numInt>0){
return '<span>' + value + '</span>';
}else {
return null;
}
}
}, },
] ]
} }
@ -333,7 +347,14 @@
}, },
{ {
field : 'percentage', field : 'percentage',
title : '占比' title : '占比',
formatter:function (value,row,index) {
if(row.numInt>0){
return '<span>' + value + '</span>';
}else {
return null;
}
}
}, },
] ]
} }

1
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/deptStatic/deptStatic.html

@ -83,7 +83,6 @@
{ {
field : 'zfdw', field : 'zfdw',
title : '部门名称', title : '部门名称',
align: 'left',
}, },
{ {
field : 'name', field : 'name',

55
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/staticRegistration.html

@ -446,24 +446,59 @@
} }
} }
function downloadzf1(){ function downloadzf1(){
let beginDate=new Date();
let endDate=new Date();
let params={ let params={
beginTime:$('#startTime').val(), startTime:$('#startTime').val(),
endTime:$('#endTime').val() endTime:$('#endTime').val(),
bureauDeptName:$('#bureauDeptName').val(),
lawEnforcer:$('#lawEnforcer').val(),
enterpriseName:$('#enterpriseName').val(),
lawEnforcementItemText:$('#lawEnforcementItemText').val(),
year:$('#year').val(),
quarter:$('#quarter').val(),
month:$('#month').val(),
qy:$('#qy').val(),
jd:$('#jd').val(),
dateSearch:$('#dateSearch').val(),
} }
if($('#startTime').val()==null||$('#startTime').val()==""){ if($('#dateSearch').val()=="select-time"){
params.beginTime="2024-08-24"; if($('#startTime').val()==null||$('#startTime').val()==""){
} params.startTime="2024-08-24";
if($('#endTime').val()==null||$('#endTime').val()==""){ beginDate=new Date("2024-08-24");
let now=new Date(); }
params.endTime=now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate(); if($('#endTime').val()==null||$('#endTime').val()==""){
params.endTime=endDate.getFullYear()+"-"+(endDate.getMonth()+1)+"-"+endDate.getDate();
}
}else{
if($('#dateSearch').val()=="year"){
beginDate=new Date(params.year,0,1);
endDate=new Date(params.year,11,31);
}else if($('#dateSearch').val()=="quarter"){
if(params.quarter==""||params.quarter==null){
beginDate=new Date(params.year,0,1);
endDate=new Date(params.year,11,31);
}else{
beginDate=new Date(params.year,(params.quarter-1)*3,1);
endDate=new Date(params.year,(params.quarter)*3,0);
}
}else if($('#dateSearch').val()=="month"){
if(params.month==""||params.month==null){
beginDate=new Date(params.year,0,1);
endDate=new Date(params.year,11,31);
}else{
beginDate=new Date(params.year,params.month-1,1);
endDate=new Date(params.year,params.month,0);
}
}
} }
console.log(params); console.log(params);
let beginDate=new Date(params.beginTime);
let endDate=new Date(params.endTime);
console.log(beginDate); console.log(beginDate);
console.log(endDate); console.log(endDate);
let beginName=beginDate.getFullYear()+"年"+(beginDate.getMonth()+1)+"月"+beginDate.getDate()+"日"; let beginName=beginDate.getFullYear()+"年"+(beginDate.getMonth()+1)+"月"+beginDate.getDate()+"日";
let endName=endDate.getFullYear()+"年"+(endDate.getMonth()+1)+"月"+endDate.getDate()+"日"; let endName=endDate.getFullYear()+"年"+(endDate.getMonth()+1)+"月"+endDate.getDate()+"日";
console.log(beginName);
console.log(endName);
$.ajax({ $.ajax({
type: "POST", type: "POST",
contentType: 'application/json', contentType: 'application/json',

8
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/ruleItemList.html

@ -15,11 +15,11 @@
<input type="text" name="cycleTime"/> <input type="text" name="cycleTime"/>
</li> </li>
<li> <li>
<p>告警次数:</p> <p>检查次数:</p>
<input type="text" name="existAlarm"/> <input type="text" name="existAlarm"/>
</li> </li>
<li> <li>
<p>告警级别:</p> <p>预警级别:</p>
<select name="alarmType" th:with="type=${@dict.getType('')}"> <select name="alarmType" th:with="type=${@dict.getType('')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
@ -90,11 +90,11 @@
}, },
{ {
field : 'existAlarm', field : 'existAlarm',
title : '告警次数' title : '检查次数'
}, },
{ {
field : 'alarmType', field : 'alarmType',
title : '告警级别', title : '预警级别',
formatter:function (value, row, index) { formatter:function (value, row, index) {
for (let i = 0; i < warnLevel.length; i++) { for (let i = 0; i < warnLevel.length; i++) {
if(value == warnLevel[i].dictValue){ if(value == warnLevel[i].dictValue){

3
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html

@ -394,9 +394,6 @@
{ {
field : 'bureauDeptName', field : 'bureauDeptName',
title : '执法部门', title : '执法部门',
formatter:function (value) {
return "<div style='text-align: left'>"+ value +"</div>";
}
}, },
{ {
field : 'total', field : 'total',

31
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java

@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -78,25 +79,45 @@ public class ComplaintStaticController extends BaseController {
deptMap=deptList.stream().collect(Collectors.toMap(Dept::getDeptId, Function.identity())); deptMap=deptList.stream().collect(Collectors.toMap(Dept::getDeptId, Function.identity()));
complaintStatistics.setComplaintDepartmentIdList(new ArrayList<>(deptMap.keySet())); complaintStatistics.setComplaintDepartmentIdList(new ArrayList<>(deptMap.keySet()));
} }
model.addAttribute("Number1",complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics).size()); model.addAttribute("Number1",complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics).size());//待权限1209
model.addAttribute("Number2",complaintStatisticsService.selectComplaintStatisticsGroup(complaintStatistics).size()); model.addAttribute("Number2",complaintStatisticsService.selectComplaintStatisticsGroup(complaintStatistics).size());//待权限1209
return prefix+"/complaintA"; return prefix+"/complaintA";
} }
/**
* 投诉类型统计--返回切片值
* @param searchType
* @param model
* @return
*/
@RequiresPermissions("code:complaintStatic:list") @RequiresPermissions("code:complaintStatic:list")
@GetMapping("/searchType2") @GetMapping("/searchType2")
public String searchType2(SearchType searchType,Model model){ public String searchType2(SearchType searchType,Model model){
model.addAttribute("year",searchType.getYear()); model.addAttribute("year",searchType.getYear());
ComplaintStatistics complaintStatistics=dateMake(searchType); ComplaintStatistics complaintStatistics=dateMake(searchType);
List<ComplaintStatistics> complaintStatisticsList =new ArrayList<>(); List<ComplaintStatistics> complaintStatisticsList =new ArrayList<>();
List<ComplaintStatistics> complaintStatisticsAllList =new ArrayList<>();
//当类型查看为全市和投诉类型时,投诉总数一致
if(StrUtil.hasEmpty(searchType.getQy()) || searchType.getQy().equals("type")) { if(StrUtil.hasEmpty(searchType.getQy()) || searchType.getQy().equals("type")) {
complaintStatisticsList = complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics);//权限 //待权限1209
complaintStatisticsList = complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics);
complaintStatisticsAllList=complaintStatisticsList;
}else{ }else{
//当类型查看某区域时
String qy=dictDataMapper.selectDictLabel("address_type",searchType.getQy()); 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()); //待权限1209
complaintStatisticsList=complaintStatisticsService.selectComplaintStatisticsLEFTEnterpriseList(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());
complaintStatisticsAllList=complaintStatisticsService.selectComplaintStatisticsList(complaintStatistics);
} }
model.addAttribute("Number3",complaintStatisticsList.size()); model.addAttribute("Number3",complaintStatisticsList.size());
model.addAttribute("dou","100%"); if(complaintStatisticsList.size()>0){
DecimalFormat str=new DecimalFormat("0.00%");
model.addAttribute("dou", str.format((double)complaintStatisticsList.size()/complaintStatisticsAllList.size()));
}else {
model.addAttribute("dou", "0.00%");
}
return prefix+"/complaintB"; return prefix+"/complaintB";
} }
@RequiresPermissions("code:complaintStatic:list") @RequiresPermissions("code:complaintStatic:list")

46
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/DeptStaticController.java

@ -48,8 +48,8 @@ public class DeptStaticController extends BaseController {
@GetMapping() @GetMapping()
public String registration(Model model) public String registration(Model model)
{ {
List<Zfztjdm111915> deptList=iZfztjdm111915Service.selectZfztjdmList(new Zfztjdm111915()); List<Zfztjdm111915> deptList=iZfztjdm111915Service.selectZfztjdmList(new Zfztjdm111915());//待权限1209
List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(null); List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(null);//待权限1209
model.addAttribute("lawNumber",zfryjdm2405301List.size()); model.addAttribute("lawNumber",zfryjdm2405301List.size());
model.addAttribute("deptNumber",deptList.size()); model.addAttribute("deptNumber",deptList.size());
return prefix + "/deptStatic"; return prefix + "/deptStatic";
@ -60,8 +60,8 @@ public class DeptStaticController extends BaseController {
{ {
Zfztjdm111915 zfztjdm111915=new Zfztjdm111915(); Zfztjdm111915 zfztjdm111915=new Zfztjdm111915();
zfztjdm111915.setSubName(zfryjdm2405301.getZfdw()); zfztjdm111915.setSubName(zfryjdm2405301.getZfdw());
List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301); List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301);//待权限1209
List<Zfztjdm111915> deptList=iZfztjdm111915Service.selectZfztjdmList(zfztjdm111915); List<Zfztjdm111915> deptList=iZfztjdm111915Service.selectZfztjdmList(zfztjdm111915);//待权限1209
model.addAttribute("lawNumber",zfryjdm2405301List.size()); model.addAttribute("lawNumber",zfryjdm2405301List.size());
model.addAttribute("deptNumber",deptList.size()); model.addAttribute("deptNumber",deptList.size());
return prefix + "/fragmentB"; return prefix + "/fragmentB";
@ -72,53 +72,19 @@ public class DeptStaticController extends BaseController {
@ResponseBody @ResponseBody
public TableDataInfo list(Zfryjdm2405301 zfryjdm2405301) public TableDataInfo list(Zfryjdm2405301 zfryjdm2405301)
{ {
/*List<Dept> deptList=deptMapper.selectDeptList(new Dept());
deptList=deptList.stream().filter(item->item.getDeptId()!=null&&!"".equals(item.getDeptId())&&item.getDeptName()!=null&&!"".equals(item.getDeptName())).collect(Collectors.toList());
Map<String,String> deptIdMap=deptList.stream().collect(Collectors.toMap(Dept::getDeptId,Dept::getDeptName));
Map<String,String> deptNameMap=deptList.stream().collect(Collectors.toMap(Dept::getDeptName,Dept::getDeptId));
if(user.getIsMappingPerson()!=null&&!"".equals(user.getIsMappingPerson())){
for(String s:deptNameMap.keySet()){
if(s.contains(user.getIsMappingPerson())){
user.setDeptId(deptNameMap.get(s));
}
}
user.setIsMappingPerson(null);
}
startPage();
List<User> list=userMapper.selectUserList(user);
for(int i=0;i<list.size();i++){
if(deptIdMap.containsKey(list.get(i).getDeptId())){
list.get(i).setIsMappingPerson(deptIdMap.get(list.get(i).getDeptId()));
}else{
list.get(i).setIsMappingPerson(list.get(i).getDeptId());
}
}*/
startPage(); startPage();
List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301); List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301);//待权限1209
for(int i=0;i<zfryjdm2405301List.size();i++){ for(int i=0;i<zfryjdm2405301List.size();i++){
if(zfryjdm2405301List.get(i).getPhoneNumber()!=null&&!"".equals(zfryjdm2405301List.get(i).getPhoneNumber())&&zfryjdm2405301List.get(i).getPhoneNumber().length()>11) { if(zfryjdm2405301List.get(i).getPhoneNumber()!=null&&!"".equals(zfryjdm2405301List.get(i).getPhoneNumber())&&zfryjdm2405301List.get(i).getPhoneNumber().length()>11) {
zfryjdm2405301List.get(i).setPhoneNumber(IdCardCryptoUtil.symmetricDecryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", zfryjdm2405301List.get(i).getPhoneNumber())); zfryjdm2405301List.get(i).setPhoneNumber(IdCardCryptoUtil.symmetricDecryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", zfryjdm2405301List.get(i).getPhoneNumber()));
} }
} }
/*List<User> users=new ArrayList<>();
for(User u:list){
if(u.getDeptId()!=null&&!"".equals(u.getDeptId())){
}else if(deptMap.containsKey(u.getDeptId())){
u.setIsMappingPerson(deptMap.get(u.getDeptId()));
}else{
u.setIsMappingPerson(u.getDeptId());
}
users.add(u);
}*/
//list=users;
return getDataTable(zfryjdm2405301List); return getDataTable(zfryjdm2405301List);
} }
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public void exportDept(HttpServletResponse httpServletResponse, @RequestBody Zfryjdm2405301 zfryjdm2405301) throws IOException { public void exportDept(HttpServletResponse httpServletResponse, @RequestBody Zfryjdm2405301 zfryjdm2405301) throws IOException {
List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301); List<Zfryjdm2405301> zfryjdm2405301List=iZfryjdm2405301Service.selectZfryjdmList2(zfryjdm2405301);//待权限1209
for(int i=0;i<zfryjdm2405301List.size();i++){ for(int i=0;i<zfryjdm2405301List.size();i++){
if(zfryjdm2405301List.get(i).getPhoneNumber()!=null&&!"".equals(zfryjdm2405301List.get(i).getPhoneNumber())&&zfryjdm2405301List.get(i).getPhoneNumber().length()>11) { if(zfryjdm2405301List.get(i).getPhoneNumber()!=null&&!"".equals(zfryjdm2405301List.get(i).getPhoneNumber())&&zfryjdm2405301List.get(i).getPhoneNumber().length()>11) {
zfryjdm2405301List.get(i).setPhoneNumber(IdCardCryptoUtil.symmetricDecryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", zfryjdm2405301List.get(i).getPhoneNumber())); zfryjdm2405301List.get(i).setPhoneNumber(IdCardCryptoUtil.symmetricDecryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", zfryjdm2405301List.get(i).getPhoneNumber()));

16
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java

@ -132,7 +132,7 @@ public class EnforcementInspectionProgramController extends BaseController
public ZDResponse staticAllProgram(EnforcementInspectionProgramDto enforcementInspectionProgramDto) public ZDResponse staticAllProgram(EnforcementInspectionProgramDto enforcementInspectionProgramDto)
{ {
EnforcementInspectionProgramDto enforcementInspectionProgramDto1 = EnforcementInspectionProgramDto enforcementInspectionProgramDto1 =
enforcementInspectionProgramService.staticAllProgram(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticAllProgram(enforcementInspectionProgramDto);//待权限1209
return ZDResponse.success("执法计划分类统计总数查询成功",enforcementInspectionProgramDto1); return ZDResponse.success("执法计划分类统计总数查询成功",enforcementInspectionProgramDto1);
} }
@ -140,7 +140,7 @@ public class EnforcementInspectionProgramController extends BaseController
@ResponseBody @ResponseBody
public void export1(HttpServletResponse httpServletResponse,@RequestBody EnforcementInspectionProgramDto enforcementInspectionProgramDto) throws IOException { public void export1(HttpServletResponse httpServletResponse,@RequestBody EnforcementInspectionProgramDto enforcementInspectionProgramDto) throws IOException {
List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos = List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos =
enforcementInspectionProgramService.staticProgram(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticProgram(enforcementInspectionProgramDto);//待权限1209
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("检查计划统计"); HSSFSheet sheet = workbook.createSheet("检查计划统计");
//设置文件名称 //设置文件名称
@ -255,7 +255,7 @@ public class EnforcementInspectionProgramController extends BaseController
public ZDResponse staticProgramWithAll(EnforcementInspectionProgramDto enforcementInspectionProgramDto){ public ZDResponse staticProgramWithAll(EnforcementInspectionProgramDto enforcementInspectionProgramDto){
List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos = List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos =
enforcementInspectionProgramService.staticProgramWithAll(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticProgramWithAll(enforcementInspectionProgramDto);//待权限1209
return ZDResponse.success("统计总数执法计划排行榜统计",enforcementInspectionProgramDtos); return ZDResponse.success("统计总数执法计划排行榜统计",enforcementInspectionProgramDtos);
} }
/** /**
@ -267,11 +267,11 @@ public class EnforcementInspectionProgramController extends BaseController
public ZDResponse staticProgramWithYear(EnforcementInspectionProgramDto enforcementInspectionProgramDto){ public ZDResponse staticProgramWithYear(EnforcementInspectionProgramDto enforcementInspectionProgramDto){
List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos = List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos =
enforcementInspectionProgramService.staticProgramWithYear(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticProgramWithYear(enforcementInspectionProgramDto);//待权限1209
return ZDResponse.success("年度计划排行榜统计",enforcementInspectionProgramDtos); return ZDResponse.success("年度计划排行榜统计",enforcementInspectionProgramDtos);
} }
/** /**
* 统计年度计划柱状图 * 统计季度计划柱状图
* @return * @return
*/ */
@GetMapping("/staticProgramWithQuarter") @GetMapping("/staticProgramWithQuarter")
@ -279,12 +279,12 @@ public class EnforcementInspectionProgramController extends BaseController
public ZDResponse staticProgramWithQuarter(EnforcementInspectionProgramDto enforcementInspectionProgramDto){ public ZDResponse staticProgramWithQuarter(EnforcementInspectionProgramDto enforcementInspectionProgramDto){
List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos = List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos =
enforcementInspectionProgramService.staticProgramWithQuarter(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticProgramWithQuarter(enforcementInspectionProgramDto);//待权限1209
return ZDResponse.success("季度计划排行榜统计",enforcementInspectionProgramDtos); return ZDResponse.success("季度计划排行榜统计",enforcementInspectionProgramDtos);
} }
/** /**
* 统计年度计划柱状图 * 统计月度计划柱状图
* @return * @return
*/ */
@GetMapping("/staticProgramWithMonth") @GetMapping("/staticProgramWithMonth")
@ -292,7 +292,7 @@ public class EnforcementInspectionProgramController extends BaseController
public ZDResponse staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto){ public ZDResponse staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto){
List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos = List<EnforcementInspectionProgramDto> enforcementInspectionProgramDtos =
enforcementInspectionProgramService.staticProgramWithMonth(enforcementInspectionProgramDto); enforcementInspectionProgramService.staticProgramWithMonth(enforcementInspectionProgramDto);//待权限1209
return ZDResponse.success("月度计划排行榜统计",enforcementInspectionProgramDtos); return ZDResponse.success("月度计划排行榜统计",enforcementInspectionProgramDtos);
} }

75
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java

@ -11,6 +11,7 @@ import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.util.StrUtil;
import com.zdxt.auth.project.system.dept.service.IDeptService; import com.zdxt.auth.project.system.dept.service.IDeptService;
import com.zdxt.auth.project.system.dict.mapper.DictDataMapper; import com.zdxt.auth.project.system.dict.mapper.DictDataMapper;
import com.zdxt.auth.project.system.dict.service.IDictDataService; import com.zdxt.auth.project.system.dict.service.IDictDataService;
@ -713,22 +714,27 @@ public class EnforcementRegistrationController extends BaseController
} }
@PostMapping("/zfjdm") @PostMapping("/zfjdm")
@ResponseBody @ResponseBody
public void exportZFJDM(HttpServletResponse httpServletResponse,@RequestBody SearchType searchType) throws IOException, ParseException { public void exportZFJDM(HttpServletResponse httpServletResponse,@RequestBody EnforcementCheckStatistics enforcementCheckStatistics) throws IOException, ParseException {
EnforcementCheckStatistics enforcementCheckStatistics=new EnforcementCheckStatistics();
/* String month1=StringUtils.join(month,","); /* String month1=StringUtils.join(month,",");
enforcementCheckStatistics.setYear(year); enforcementCheckStatistics.setYear(year);
enforcementCheckStatistics.setMonth(month1);*/ enforcementCheckStatistics.setMonth(month1);*/
enforcementCheckStatistics.setStartTime(searchType.getBeginTime());
enforcementCheckStatistics.setEndTime(searchType.getEndTime());
enforcementCheckStatistics.setNowTime(new Date()); enforcementCheckStatistics.setNowTime(new Date());
List<EnforcementCheckStatistics> enforcementCheckStatisticsList=enforcementCheckStatisticsService.selectAllStatisticsList(enforcementCheckStatistics);
List<String> inOrderList=new ArrayList<>(); List<String> inOrderList=new ArrayList<>();
List<DictData> dictDataListQY=dictDataMapper.selectDictDataByType("address_type"); List<DictData> dictDataListQY=new ArrayList<>();
/*Collections.addAll(inOrderList,"福田区","罗湖区","盐田区","南山区","宝安区","龙岗区","龙华区", if(StrUtil.isNotEmpty(enforcementCheckStatistics.getQy())){
"坪山区","光明区","大鹏新区","深汕特别合作区");*/ String qy=dictDataMapper.selectDictLabel("address_type",enforcementCheckStatistics.getQy());
for(DictData d:dictDataListQY){ inOrderList.add(qy);
inOrderList.add(d.getDictLabel()); if(StrUtil.isNotEmpty(enforcementCheckStatistics.getJd())){
enforcementCheckStatistics.setJd(dictDataMapper.selectDictLabel(enforcementCheckStatistics.getQy(),enforcementCheckStatistics.getJd()));
}
enforcementCheckStatistics.setQy(qy);
}else{
dictDataListQY=dictDataMapper.selectDictDataByType("address_type");
for(DictData d:dictDataListQY){
inOrderList.add(d.getDictLabel());
}
} }
List<EnforcementCheckStatistics> enforcementCheckStatisticsList=enforcementCheckStatisticsService.selectAllStatisticsList(enforcementCheckStatistics);
Map<String,List<EnforcementCheckStatistics>> enforcementCheckStatisticsMap=new HashMap<>(); Map<String,List<EnforcementCheckStatistics>> enforcementCheckStatisticsMap=new HashMap<>();
for(int i=0;i<inOrderList.size();i++){ for(int i=0;i<inOrderList.size();i++){
String area=inOrderList.get(i); String area=inOrderList.get(i);
@ -738,11 +744,56 @@ public class EnforcementRegistrationController extends BaseController
} }
//将地址不属于各个区的筛出来放入执法记录map //将地址不属于各个区的筛出来放入执法记录map
List<EnforcementCheckStatistics> qt=enforcementCheckStatisticsList.stream().filter(item->!qyqtMake(inOrderList,item.getEnterpriseAddress())).collect(Collectors.toList()); List<EnforcementCheckStatistics> qt=enforcementCheckStatisticsList.stream().filter(item->!qyqtMake(inOrderList,item.getEnterpriseAddress())).collect(Collectors.toList());
enforcementCheckStatisticsMap.put("其他",qt); if(qt.size()>0){
enforcementCheckStatisticsMap.put("其他",qt);
inOrderList.add("其他");
}
List<EnterpriseStreet> enterpriseStreet=enforcementCheckStatisticsService.selectEnterpriseStreetList(); List<EnterpriseStreet> enterpriseStreet=enforcementCheckStatisticsService.selectEnterpriseStreetList();
inOrderList.add("其他");
enforcementCheckStatisticsService.ZFJDM(httpServletResponse,enforcementCheckStatistics,inOrderList,enforcementCheckStatisticsMap,enterpriseStreet); enforcementCheckStatisticsService.ZFJDM(httpServletResponse,enforcementCheckStatistics,inOrderList,enforcementCheckStatisticsMap,enterpriseStreet);
} }
@PostMapping("/RWList")
@ResponseBody
public TableDataInfo RWList (EnforcementRegistration enforcementRegistration){
List<DictData> qyList=iDictDataService.selectDictDataByType("address_Type");
List<String> qyStrings=new ArrayList<>();
for(DictData dictData:qyList){
qyStrings.add(dictData.getDictLabel());
}
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationAndAddressList(enforcementRegistration);
/*list=enforcementRegistrationService.untieCheck1Make(list);*///牵头单位标识
List<EnforcementRegistration> enforcementRegistrationsList=new ArrayList<>();
for(DictData qy:qyList){
List<DictData> jdList=iDictDataService.selectDictDataByType(qy.getDictValue());
/*List<String> jdStrings=new ArrayList<>();
for(DictData dictData:jdList){
jdStrings.add(dictData.getDictLabel());
}*/
List<EnforcementRegistration> qyEList=list.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + qy.getDictLabel().substring(0, qy.getDictLabel().indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + qy.getDictLabel().substring(0, qy.getDictLabel().indexOf("区")) + "新区")).collect(Collectors.toList());
for(DictData jd:jdList){
List<EnforcementRegistration> jdEList=list.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + qy.getDictLabel().substring(0, qy.getDictLabel().indexOf("区")) + "区"+jd.getDictLabel()) || item.getEnterpriseAddress().startsWith("深圳市" + qy.getDictLabel().substring(0, qy.getDictLabel().indexOf("区")) + "新区"+jd.getDictLabel())).collect(Collectors.toList());
if(jdEList.size()>0){
for(int i=0;i<jdEList.size();i++){
jdEList.get(i).setQy(qy.getDictLabel());
jdEList.get(i).setJd(jd.getDictLabel());
}
enforcementRegistrationsList.addAll(jdEList);
}
}
List<EnforcementRegistration>qtjdList=qyEList.stream().filter(item->!jdMake(qy.getDictLabel(),jdList,item.getEnterpriseAddress())).collect(Collectors.toList());
if(qtjdList.size()>0){
for(int i=0;i<qtjdList.size();i++){
qtjdList.get(i).setQy(qy.getDictLabel());
}
enforcementRegistrationsList.addAll(qtjdList);
}
}
List<EnforcementRegistration>qtqyList=list.stream().filter(item->!qyMake(qyStrings,item.getEnterpriseAddress())).collect(Collectors.toList());
if(qtqyList.size()>0){
enforcementRegistrationsList.addAll(qtqyList);
}
return getDataTable(enforcementRegistrationsList);
}
public Boolean qyqtMake(List<String> strings,String s){ public Boolean qyqtMake(List<String> strings,String s){
for (String string : strings) { for (String string : strings) {

82
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/LawEnforcementWarningListController.java

@ -1,23 +1,30 @@
package com.zdxt.code.controller; package com.zdxt.code.controller;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.zdxt.auth.project.system.dict.mapper.DictDataMapper;
import com.zdxt.code.domain.dto.EnforcementRegistrationDto;
import com.zdxt.common.ZDResponse; import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController; import com.zdxt.common.controller.BaseController;
import com.zdxt.common.util.DateUtils; import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.TableDataInfo; import com.zdxt.common.util.TableDataInfo;
import com.zdxt.domain.auth.DictData;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.zdxt.code.domain.LawEnforcementWarningList; import com.zdxt.code.domain.LawEnforcementWarningList;
import com.zdxt.code.service.ILawEnforcementWarningListService; import com.zdxt.code.service.ILawEnforcementWarningListService;
import javax.servlet.http.HttpServletResponse;
/** /**
* 执法预警列表Controller * 执法预警列表Controller
@ -33,6 +40,8 @@ public class LawEnforcementWarningListController extends BaseController
@Autowired @Autowired
private ILawEnforcementWarningListService lawEnforcementWarningListService; private ILawEnforcementWarningListService lawEnforcementWarningListService;
@Autowired
private DictDataMapper dictDataMapper;
@RequiresPermissions("code:LawEnforcementWarningList:view") @RequiresPermissions("code:LawEnforcementWarningList:view")
@GetMapping() @GetMapping()
@ -50,7 +59,7 @@ public class LawEnforcementWarningListController extends BaseController
public TableDataInfo list(LawEnforcementWarningList lawEnforcementWarningList) public TableDataInfo list(LawEnforcementWarningList lawEnforcementWarningList)
{ {
startPage(); startPage();
List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListList(lawEnforcementWarningList); List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListListOrderByNumber(lawEnforcementWarningList);
return getDataTable(list); return getDataTable(list);
} }
@ -139,4 +148,65 @@ public class LawEnforcementWarningListController extends BaseController
return prefix + "/registrationDetail"; return prefix + "/registrationDetail";
} }
@PostMapping("/exportWarnList")
@ResponseBody
public void export(HttpServletResponse httpServletResponse, @RequestBody LawEnforcementWarningList lawEnforcementWarningList) throws IOException {
List<LawEnforcementWarningList> lawEnforcementWarningListList=lawEnforcementWarningListService.selectLawEnforcementWarningListListOrderByNumber(lawEnforcementWarningList);
List<DictData>dictDataList=dictDataMapper.selectDictDataByType("warnLevel");
Map<String,DictData> map=dictDataList.stream().collect(Collectors.toMap(DictData::getDictValue, Function.identity()));
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);
}
HSSFCellStyle dateStyle= workbook.createCellStyle();
HSSFDataFormat cellDataFormat= workbook.createDataFormat();;
dateStyle.setDataFormat(cellDataFormat.getFormat("yyyy\"-\"m\"-\"d"));
for(int i=0;i<lawEnforcementWarningListList.size();i++){
HSSFRow row = sheet.createRow(i+1);
row.createCell(0).setCellValue(lawEnforcementWarningListList.get(i).getEnterpriseName());
row.createCell(1).setCellValue(lawEnforcementWarningListList.get(i).getWarningCause());
if(map.containsKey(lawEnforcementWarningListList.get(i).getWarningLevel()+"")){
row.createCell(2).setCellValue(map.get(lawEnforcementWarningListList.get(i).getWarningLevel()+"").getDictLabel());
}else {
row.createCell(2).setCellValue(lawEnforcementWarningListList.get(i).getWarningLevel());
}
HSSFCell cell = row.createCell(3);
cell.setCellValue(lawEnforcementWarningListList.get(i).getWarningTime());
cell.setCellStyle(dateStyle);
}
httpServletResponse.setCharacterEncoding("UTF-8");
httpServletResponse.setContentType("application/vnd.ms-excel");
httpServletResponse.setHeader("Content-disposition", "attachment;filename=" + fileName);
httpServletResponse.flushBuffer();
workbook.write(httpServletResponse.getOutputStream());
workbook.close();
}
} }

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementCheckStatistics.java

@ -29,6 +29,7 @@ public class EnforcementCheckStatistics extends BaseDomain {
private String lawEnforcerTwo; private String lawEnforcerTwo;
/** 检查事项 */ /** 检查事项 */
private String lawEnforcementItem; private String lawEnforcementItem;
private String lawEnforcementItemText;
/** 区域 */ /** 区域 */
private String deptName; private String deptName;
/** 备注 */ /** 备注 */
@ -49,4 +50,9 @@ public class EnforcementCheckStatistics extends BaseDomain {
private String endTime; private String endTime;
/** 当前时间 */ /** 当前时间 */
private Date nowTime; private Date nowTime;
private String qy;
private String jd;
private String lawEnforcer;
private String quarter;
private String dateSearch;
} }

18
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java

@ -136,11 +136,13 @@ public class EnforcementRegistration extends BaseDomain
* 开始时间 * 开始时间
*/ */
private String beginTime; private String beginTime;
private String beginEnforcementTime;
/** /**
* 结束时间 * 结束时间
*/ */
private String endTime; private String endTime;
private String endEnforcementTime;
/** 未扫码原因 */ /** 未扫码原因 */
private String enforce; private String enforce;
@ -711,4 +713,20 @@ public class EnforcementRegistration extends BaseDomain
public void setUniteType(int uniteType) { public void setUniteType(int uniteType) {
this.uniteType = uniteType; this.uniteType = uniteType;
} }
public String getBeginEnforcementTime() {
return beginEnforcementTime;
}
public void setBeginEnforcementTime(String beginEnforcementTime) {
this.beginEnforcementTime = beginEnforcementTime;
}
public String getEndEnforcementTime() {
return endEnforcementTime;
}
public void setEndEnforcementTime(String endEnforcementTime) {
this.endEnforcementTime = endEnforcementTime;
}
} }

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/LawEnforcementWarningListMapper.java

@ -28,6 +28,13 @@ public interface LawEnforcementWarningListMapper
List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList);
List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList);
List<LawEnforcementWarningList> selectLawEnforcementWarningListList2(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList2(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 查询执法预警列表列表显示最新(本企业)
* @param lawEnforcementWarningList
* @return
*/
List<LawEnforcementWarningList> selectLawEnforcementWarningListListOrderByNumber(LawEnforcementWarningList lawEnforcementWarningList);
/** /**
* 查询企业预警信息 * 查询企业预警信息
* @param lawEnforcementWarningList * @param lawEnforcementWarningList

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ILawEnforcementWarningListService.java

@ -27,6 +27,8 @@ public interface ILawEnforcementWarningListService
*/ */
List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList);
List<LawEnforcementWarningList> selectLawEnforcementWarningListListOrderByNumber(LawEnforcementWarningList lawEnforcementWarningList);
List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList);
List<LawEnforcementWarningList> selectLawEnforcementWarningListList2(LawEnforcementWarningList lawEnforcementWarningList); List<LawEnforcementWarningList> selectLawEnforcementWarningListList2(LawEnforcementWarningList lawEnforcementWarningList);

18
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java

@ -140,23 +140,6 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
Map<Integer,Long> map=complaintStatisticsList.stream().collect(Collectors.groupingBy(item->item.getEnforceType()==null?100:item.getEnforceType(),Collectors.counting())); Map<Integer,Long> map=complaintStatisticsList.stream().collect(Collectors.groupingBy(item->item.getEnforceType()==null?100:item.getEnforceType(),Collectors.counting()));
Map<String,String> dictDataMap=dictDataMapper.selectDictDataByType("caseType").stream().collect(Collectors.toMap(DictData::getDictValue,DictData::getDictLabel)); Map<String,String> dictDataMap=dictDataMapper.selectDictDataByType("caseType").stream().collect(Collectors.toMap(DictData::getDictValue,DictData::getDictLabel));
List<StatisticsIndicator> list=new ArrayList<>(); List<StatisticsIndicator> list=new ArrayList<>();
/* for(int i:map.keySet()){
StatisticsIndicator s=new StatisticsIndicator();
if(i==100){
s.setName("");
s.setNumInt(Integer.parseInt(map.get(100)+""));
s.setPercentage((double)map.get(100)/number);
}else {
if(dictDataMap.containsKey(i+"")){
s.setName(dictDataMap.get(i+""));
}else {
s.setName(i+"");
}
s.setNumInt(Integer.parseInt(map.get(i)+""));
s.setPercentage((double)map.get(i)/number);
}
list.add(s);
}*/
for(String s:dictDataMap.keySet()){ for(String s:dictDataMap.keySet()){
StatisticsIndicator statisticsIndicator=new StatisticsIndicator(); StatisticsIndicator statisticsIndicator=new StatisticsIndicator();
if(map.containsKey(Integer.parseInt(s))){ if(map.containsKey(Integer.parseInt(s))){
@ -235,6 +218,7 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
} }
return statisticsIndicatorList; return statisticsIndicatorList;
} }
@Override @Override
public List<ComplaintStatistics> list1(SearchType searchType,ComplaintStatistics complaintStatistics){ public List<ComplaintStatistics> list1(SearchType searchType,ComplaintStatistics complaintStatistics){
if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) { if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) {

40
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementCheckStatisticsImpl.java

@ -1,5 +1,6 @@
package com.zdxt.code.service.impl; package com.zdxt.code.service.impl;
import cn.hutool.core.util.StrUtil;
import com.zdxt.auth.project.system.dept.mapper.DeptMapper; import com.zdxt.auth.project.system.dept.mapper.DeptMapper;
import com.zdxt.auth.project.system.dict.mapper.DictDataMapper; import com.zdxt.auth.project.system.dict.mapper.DictDataMapper;
import com.zdxt.auth.project.system.user.mapper.UserMapper; import com.zdxt.auth.project.system.user.mapper.UserMapper;
@ -2272,8 +2273,43 @@ public class EnforcementCheckStatisticsImpl implements EnforcementCheckStatistic
SimpleDateFormat sYear=new SimpleDateFormat("yyyy"); SimpleDateFormat sYear=new SimpleDateFormat("yyyy");
SimpleDateFormat sMonther=new SimpleDateFormat("MM"); SimpleDateFormat sMonther=new SimpleDateFormat("MM");
SimpleDateFormat sDay=new SimpleDateFormat("dd"); SimpleDateFormat sDay=new SimpleDateFormat("dd");
String strStart=sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"日"; String strStart="";
String strEnd=sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"日"; String strEnd="";
LocalDate localDate=LocalDate.now();
if(StrUtil.isNotEmpty(enforcementCheckStatistics.getDateSearch())&&enforcementCheckStatistics.getDateSearch().equals("select-time")){
strStart=sYear.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"年"+sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"日";
strEnd=sYear.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"年"+sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"日";
}else if(StrUtil.isNotEmpty(enforcementCheckStatistics.getDateSearch())&&enforcementCheckStatistics.getDateSearch().equals("year")){
LocalDate localDate1=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(1).withDayOfMonth(1);
LocalDate localDate2=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth());
strStart=localDate1.getYear()+"年"+localDate1.getMonthValue()+"月"+localDate1.getDayOfMonth()+"日";
strEnd=localDate2.getYear()+"年"+localDate2.getMonthValue()+"月"+localDate2.getDayOfMonth()+"日";
}else if(StrUtil.isNotEmpty(enforcementCheckStatistics.getDateSearch())&&enforcementCheckStatistics.getDateSearch().equals("quarter")){
LocalDate localDate1=LocalDate.now();
LocalDate localDate2=LocalDate.now();
if(StrUtil.isNotEmpty(enforcementCheckStatistics.getQuarter())&&(!enforcementCheckStatistics.getQuarter().equals("0"))){
localDate1=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth((Integer.parseInt(enforcementCheckStatistics.getQuarter())-1)*3).withDayOfMonth(1);
localDate2=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(Integer.parseInt(enforcementCheckStatistics.getQuarter())*3).with(TemporalAdjusters.lastDayOfMonth());
}else{
localDate1=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(1).withDayOfMonth(1);
localDate2=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth());
}
strStart=localDate1.getYear()+"年"+localDate1.getMonthValue()+"月"+localDate1.getDayOfMonth()+"日";
strEnd=localDate2.getYear()+"年"+localDate2.getMonthValue()+"月"+localDate2.getDayOfMonth()+"日";
}else if(StrUtil.isNotEmpty(enforcementCheckStatistics.getDateSearch())&&enforcementCheckStatistics.getDateSearch().equals("month")){
LocalDate localDate1=LocalDate.now();
LocalDate localDate2=LocalDate.now();
if(StrUtil.isNotEmpty(enforcementCheckStatistics.getMonth())&&(!enforcementCheckStatistics.getMonth().equals("0"))){
localDate1=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(Integer.parseInt(enforcementCheckStatistics.getMonth())).withDayOfMonth(1);
localDate2=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(Integer.parseInt(enforcementCheckStatistics.getMonth())).with(TemporalAdjusters.lastDayOfMonth());
}else{
localDate1=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(1).withDayOfMonth(1);
localDate2=localDate.withYear(Integer.parseInt(enforcementCheckStatistics.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth());
}
strStart=localDate1.getYear()+"年"+localDate1.getMonthValue()+"月"+localDate1.getDayOfMonth()+"日";
strEnd=localDate2.getYear()+"年"+localDate2.getMonthValue()+"月"+localDate2.getDayOfMonth()+"日";
System.out.println(localDate1.getMonth());
}
String strNow=sYear.format(enforcementCheckStatistics.getNowTime())+"年"+sMonther.format(enforcementCheckStatistics.getNowTime())+"月"+sDay.format(enforcementCheckStatistics.getNowTime())+"日 "+enforcementCheckStatistics.getNowTime().getHours()+"时"+enforcementCheckStatistics.getNowTime().getMinutes()+"分"; String strNow=sYear.format(enforcementCheckStatistics.getNowTime())+"年"+sMonther.format(enforcementCheckStatistics.getNowTime())+"月"+sDay.format(enforcementCheckStatistics.getNowTime())+"日 "+enforcementCheckStatistics.getNowTime().getHours()+"时"+enforcementCheckStatistics.getNowTime().getMinutes()+"分";
cell1.setCellValue("行政执法检查统计\n(统计范围:"+strStart+"至"+strEnd+" 统计时间:"+strNow+" 企业赋码总数量:"+enterpriseStreet.size()+"家)"); cell1.setCellValue("行政执法检查统计\n(统计范围:"+strStart+"至"+strEnd+" 统计时间:"+strNow+" 企业赋码总数量:"+enterpriseStreet.size()+"家)");
//将单元格样式应用到该单元格 //将单元格样式应用到该单元格

5
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LawEnforcementWarningListServiceImpl.java

@ -46,6 +46,11 @@ public class LawEnforcementWarningListServiceImpl implements ILawEnforcementWarn
return lawEnforcementWarningListMapper.selectLawEnforcementWarningListList(lawEnforcementWarningList); return lawEnforcementWarningListMapper.selectLawEnforcementWarningListList(lawEnforcementWarningList);
} }
@Override @Override
public List<LawEnforcementWarningList> selectLawEnforcementWarningListListOrderByNumber(LawEnforcementWarningList lawEnforcementWarningList)
{
return lawEnforcementWarningListMapper.selectLawEnforcementWarningListListOrderByNumber(lawEnforcementWarningList);
}
@Override
public List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList) public List<LawEnforcementWarningList> selectLawEnforcementWarningListList1(LawEnforcementWarningList lawEnforcementWarningList)
{ {
return lawEnforcementWarningListMapper.selectLawEnforcementWarningListList1(lawEnforcementWarningList); return lawEnforcementWarningListMapper.selectLawEnforcementWarningListList1(lawEnforcementWarningList);

38
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementCheckStatisticsMapper.xml

@ -55,6 +55,44 @@
<where> <where>
and (e.enterprise_number not like "92440300MACQUM2M9C" and (e.enterprise_number not like "92440300MACQUM2M9C"
or e.enterprise_number is null) or e.enterprise_number is null)
and e.bureau_dept_name is not null
and e.law_enforcement_id is not null
and e.enterprise_name is not null
and e.enterprise_number is not null
and e.law_enforcer is not null
and e.law_enforcer_two is not null
and e.is_complaint is not null
and e.check_category is not null
and e.bureau_dept_id is not null
<if test="qy != null and qy != ''">
and (i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<if test="jd != null and jd != ''">
and (i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<if test="enterpriseName != null and enterpriseName != ''">
AND e.enterprise_name like concat(concat('%',#{enterpriseName}),'%')
</if>
<if test="bureauDeptName != null and bureauDeptName != ''">
AND e.bureau_dept_name like concat(concat('%',#{bureauDeptName}),'%')
</if>
<if test="lawEnforcer != null and lawEnforcer != ''">
AND (e.law_enforcer like concat(concat('%',#{lawEnforcer}),'%')
or
e.law_enforcer_two like concat(concat('%',#{lawEnforcer}),'%'))
</if>
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''">
AND e.law_enforcement_item_text like concat(concat('%',#{lawEnforcementItemText}),'%')
</if>
<if test="year != null and year != ''">
AND YEAR(e.create_time) = #{year}
</if>
<if test="quarter != null and quarter != '' ">
AND QUARTER(e.create_time) = #{quarter}
</if>
<if test="month != null and month != '' ">
AND DATE_FORMAT(e.create_time, '%m') = #{month}
</if>
<if test="startTime != null and startTime != ''"><!-- 开始时间检索 --> <if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
and DATE_FORMAT(e.create_time,'%Y-%m-%d') &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d') and DATE_FORMAT(e.create_time,'%Y-%m-%d') &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d')
</if> </if>

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -246,6 +246,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and DATE_FORMAT(r.create_time,'%Y-%m-%d') &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d') and DATE_FORMAT(r.create_time,'%Y-%m-%d') &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d')
</if> </if>
<if test="beginEnforcementTime != null and beginEnforcementTime != ''"><!-- 开始时间检索用于预警搜索 -->
and DATE_FORMAT(r.create_time,'%Y-%m-%d') &gt;= STR_TO_DATE(#{beginEnforcementTime},'%Y-%m-%d')
</if>
<if test="endEnforcementTime != null and endEnforcementTime != ''"><!-- 结束时间检索用于预警搜索 -->
and DATE_FORMAT(r.create_time,'%Y-%m-%d') &lt;= STR_TO_DATE(#{endEnforcementTime},'%Y-%m-%d')
</if>
<if test="year != null and year != ''"> <if test="year != null and year != ''">
AND YEAR(r.create_time) = #{year} AND YEAR(r.create_time) = #{year}
</if> </if>

55
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LawEnforcementWarningListMapper.xml

@ -80,6 +80,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY enforcement_number DESC,create_time DESC LIMIT 1000000000 ORDER BY enforcement_number DESC,create_time DESC LIMIT 1000000000
) t GROUP BY t.enterprise_number order by t.create_time desc ) t GROUP BY t.enterprise_number order by t.create_time desc
</select> </select>
<select id="selectLawEnforcementWarningListListOrderByNumber" parameterType="LawEnforcementWarningList" resultMap="LawEnforcementWarningListResult">
SELECT * FROM (
SELECT
id,
warning_time, warning_cause, warning_level ,
create_time, enterprise_name, enterprise_number,
enforcement_number,warn_type,enforcement_department,
enforcement_department_id,begin_time,end_time
FROM law_enforcement_warning_list
<where>
and warn_type = 1
<if test="warningTime != null "> and warning_time = #{warningTime}</if>
<if test="warningLevel != null "> and warning_level = #{warningLevel}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number like concat('%', #{enterpriseNumber}, '%')</if>
<if test="searchValue != null and searchValue != ''"> and (
enterprise_name like concat('%',#{searchValue},'%')
)</if>
<if test="searchDate != null and searchDate != ''">
and DATE_FORMAT(warning_time, '%Y-%m') = #{searchDate}
</if>
<if test="params.beginWarningTime != null and params.beginWarningTime != ''">
and warning_time <![CDATA[ >= ]]> #{params.beginWarningTime}
</if>
<if test="params.endWarningTime != null and params.endWarningTime != ''">
and warning_time <![CDATA[ <= ]]> #{params.endWarningTime}
</if>
<if test="warnType != null">AND warn_type = #{warnType}</if>
<if test=" enforcementDepartmentId != null and enforcementDepartmentId != ''">
enforcement_department_id = #{enforcementDepartmentId},
</if>
<if test="dateType != null and dateType == 1">
and DATE_FORMAT(warning_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<if test="dateType != null and dateType == 2">
AND DATE_FORMAT(warning_time, '%Y-%m') &gt;= 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(warning_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE
WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06'
WHEN QUARTER(CURDATE()) IN (3) THEN '09'
ELSE '12'
END)
</if>
<if test="dateType != null and dateType == 3">
and DATE_FORMAT(warning_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
</where>
ORDER BY enforcement_number DESC,create_time DESC LIMIT 1000000000
) t GROUP BY t.enterprise_number,DATE_FORMAT(t.warning_time, '%Y-%m') order by t.enforcement_number desc,t.warning_time desc
</select>
<!--<select id="selectLawEnforcementWarningListList1" parameterType="LawEnforcementWarningList" resultMap="LawEnforcementWarningListResult"> <!--<select id="selectLawEnforcementWarningListList1" parameterType="LawEnforcementWarningList" resultMap="LawEnforcementWarningListResult">
SELECT enforcement_department,enforcement_department_id,DATE_FORMAT(t.create_time,'%Y-%m') as searchDate,enforcement_number SELECT enforcement_department,enforcement_department_id,DATE_FORMAT(t.create_time,'%Y-%m') as searchDate,enforcement_number
FROM ( FROM (

Loading…
Cancel
Save