Browse Source

移动端统计修改

v2
zouyx 2 years ago
parent
commit
e35953c1bf
  1. 20
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java
  2. 1
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java
  3. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml
  4. 141
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html
  5. 31
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/add.html
  6. 31
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/edit.html
  7. 4
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/ruleItemList.html
  8. 4
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html
  9. 64
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java
  10. 26
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  11. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/RuleListMapper.xml
  12. 33
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

20
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java

@ -109,7 +109,25 @@ public class AppEnterpriseInformationController extends BaseController
return enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation) > 0 ? return enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation) > 0 ?
ZDResponse.success("修改成功"): ZDResponse.error("修改失败"); ZDResponse.success("修改成功"): ZDResponse.error("修改失败");
} }
@PostMapping("/editNotQX")
@ResponseBody
public ZDResponse editNotQX(@RequestBody EnterpriseInformation enterpriseInformation)
{
int i=enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation);
return i > 0 ?
ZDResponse.success("修改成功"): ZDResponse.error("修改失败");
}
@PostMapping("/unsubscribeNotQX")
@ResponseBody
public ZDResponse unsubscribeNotQX(@RequestBody EnterpriseInformation enterpriseInformation)
{
if(enterpriseInformation.getEnterpriseNumber()!=null&&!"".equals(enterpriseInformation.getEnterpriseNumber())){
enterpriseInformation.setId(enterpriseInformationService.selectEnterpriseInformationByNum(enterpriseInformation.getEnterpriseNumber()).getId());enterpriseInformationService.selectEnterpriseInformationByNum(enterpriseInformation.getEnterpriseNumber());
}
int i=enterpriseInformationService.updateEnterpriseInformation(enterpriseInformation);
return i > 0 ?
ZDResponse.success("注销成功"): ZDResponse.error("注销失败");
}
/** /**
* 修改保存企业信息登记 * 修改保存企业信息登记

1
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java

@ -97,6 +97,7 @@ public class DeptController extends BaseController {
{ {
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
} }
dept.setDeptId("111111111");
return toAjax(deptService.insertDept(dept)); return toAjax(deptService.insertDept(dept));
} }

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml

@ -223,7 +223,7 @@
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select> </select>
<insert id="insertDept" parameterType="Dept" keyProperty="deptId" useGeneratedKeys="true"> <insert id="insertDept" parameterType="Dept" keyProperty="deptId">
insert into sys_dept( insert into sys_dept(
<if test="deptId != null and deptId != ''">dept_id,</if> <if test="deptId != null and deptId != ''">dept_id,</if>
<if test="parentId != null and parentId != ''">parent_id,</if> <if test="parentId != null and parentId != ''">parent_id,</if>

141
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/analysis/analysis.html

@ -21,25 +21,27 @@
<h1 class="headtit">深圳市各类行政检查实施情况分析</h1> <h1 class="headtit">深圳市各类行政检查实施情况分析</h1>
<div class="seltime" id="searchDiv"> <div class="seltime" id="searchDiv">
<i class="icsty"></i> <i class="icsty"></i>
<span><select id="qorm" name="qorm" onchange="selectDate()"> <span>时间类型:<select id="qorm" name="qorm" onchange="selectDate()">
<option value="q">季度</option> <option value="q">季度</option>
<option value="m">月度</option> <option value="m">月度</option>
</select>年度</span> </select></span>
<span><select id="year" name="year" onchange="selectDate()"> <span>年度:<select id="year" name="year" onchange="selectDate()">
<option value="2027">2027</option> <option value="2027">2027</option>
<option value="2026">2026</option> <option value="2026">2026</option>
<option value="2025">2025</option> <option value="2025">2025</option>
<option value="2024">2024</option> <option value="2024">2024</option>
<option value="2023">2023</option> <option value="2023">2023</option>
<option value="2022">2022</option> <option value="2022">2022</option>
</select>年度</span> </select></span>
<span><select id="quarter" name="quarter" onchange="selectDate()"> <span id="quarterName">季度:</span>
<select id="quarter" name="quarter" onchange="selectDate()">
<option value="q1">1季度</option> <option value="q1">1季度</option>
<option value="q2">2季度</option> <option value="q2">2季度</option>
<option value="q3">3季度</option> <option value="q3">3季度</option>
<option value="q4">4季度</option> <option value="q4">4季度</option>
</select>季度</span> </select>
<span><select id="month" name="month" onchange="selectDate()"> <span id="monthName">月度:</span>
<select id="month" name="month" onchange="selectDate()">
<option value="01">1</option> <option value="01">1</option>
<option value="02">2</option> <option value="02">2</option>
<option value="03">3</option> <option value="03">3</option>
@ -52,16 +54,16 @@
<option value="10">10</option> <option value="10">10</option>
<option value="11">11</option> <option value="11">11</option>
<option value="12">12</option> <option value="12">12</option>
</select>月度</span> </select>
<span style="width: 20%"><select style="width: 80%" id="lawField" name="lawField" th:with="type=${@dict.getType('law_field')}" onchange="queryData()"> <span style="width: 20%">领域:<select style="width: 80%" id="lawField" name="lawField" th:with="type=${@dict.getType('law_field')}" onchange="selectDate()">
<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>
</select>领域</span> </select></span>
<span style="width: 20%"> <span style="width: 20%">类别:
<select style="width: 80%" id="checkCategory" name="checkCategory" th:with="type=${@dict.getType('check_category')}" onchange="queryData()"> <select style="width: 80%" id="checkCategory" name="checkCategory" th:with="type=${@dict.getType('check_category')}" onchange="selectDate()">
<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>
</select>类别</span> </select></span>
<div class="modelDiv"> <div class="modelDiv">
<span style="display:flex; width: 50%">分析模板:</span> <span style="display:flex; width: 50%">分析模板:</span>
<select name="excelModel" id="excelModel" th:with="type=${@dict.getType('excelModel')}" class="form-control"> <select name="excelModel" id="excelModel" th:with="type=${@dict.getType('excelModel')}" class="form-control">
@ -150,7 +152,12 @@
} }
} }
function queryCaseAnalysis(qorm, year, quarter, month, month) { function queryCaseAnalysis(qorm, year, quarter, month) {
if(qorm=="m"){
quarter="";
}else{
month="";
}
$.ajax({ $.ajax({
url: prefix + '/caseAnalysis', //后台url url: prefix + '/caseAnalysis', //后台url
data: { data: {
@ -170,7 +177,12 @@
} }
}); });
} }
function queryEnforcerAnalysis(qorm, year, quarter, month, month) { function queryEnforcerAnalysis(qorm, year, quarter, month) {
if(qorm=="m"){
quarter="";
}else{
month="";
}
$.ajax({ $.ajax({
url: prefix + '/enforcerAnalysis', //后台url url: prefix + '/enforcerAnalysis', //后台url
data: { data: {
@ -178,6 +190,8 @@
"year": year, "year": year,
"quarter": quarter, "quarter": quarter,
"month": month, "month": month,
"lawField": $('#lawField').val(),
"checkCategory": $('#checkCategory').val(),
}, },
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
@ -194,7 +208,12 @@
} }
}); });
} }
function queryItemAnalysis(qorm, year, quarter, month, month) { function queryItemAnalysis(qorm, year, quarter, month) {
if(qorm=="m"){
quarter="";
}else{
month="";
}
$.ajax({ $.ajax({
url: prefix + '/itemAnalysis', //后台url url: prefix + '/itemAnalysis', //后台url
data: { data: {
@ -202,6 +221,8 @@
"year": year, "year": year,
"quarter": quarter, "quarter": quarter,
"month": month, "month": month,
"lawField": $('#lawField').val(),
"checkCategory": $('#checkCategory').val(),
}, },
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
@ -219,7 +240,12 @@
} }
}); });
} }
function queryEnterpriseAnalysis(qorm, year, quarter, month, month) { function queryEnterpriseAnalysis(qorm, year, quarter, month) {
if(qorm=="m"){
quarter="";
}else{
month="";
}
$.ajax({ $.ajax({
url: prefix + '/enterpriseAnalysis', //后台url url: prefix + '/enterpriseAnalysis', //后台url
data: { data: {
@ -227,6 +253,8 @@
"year": year, "year": year,
"quarter": quarter, "quarter": quarter,
"month": month, "month": month,
"lawField": $('#lawField').val(),
"checkCategory": $('#checkCategory').val(),
}, },
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
@ -244,7 +272,12 @@
} }
}); });
} }
function queryEnterpriseSortAnalysis(qorm, year, quarter, month, month) { function queryEnterpriseSortAnalysis(qorm, year, quarter, month) {
if(qorm=="m"){
quarter="";
}else{
month="";
}
$.ajax({ $.ajax({
url: prefix + '/enterpriseSortAnalysis', //后台url url: prefix + '/enterpriseSortAnalysis', //后台url
data: { data: {
@ -252,6 +285,8 @@
"year": year, "year": year,
"quarter": quarter, "quarter": quarter,
"month": month, "month": month,
"lawField": $('#lawField').val(),
"checkCategory": $('#checkCategory').val(),
}, },
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
@ -304,6 +339,18 @@
function selectDate() { function selectDate() {
var qormElement = document.getElementById("qorm"); var qormElement = document.getElementById("qorm");
var qormValue = qormElement.options[qormElement.selectedIndex].value; var qormValue = qormElement.options[qormElement.selectedIndex].value;
// 判断选择的月度还是季度
if ("m"==qormValue) {
$("#monthName").show();
$("#quarterName").hide();
$("#month").show();
$("#quarter").hide();
} else {
$("#monthName").hide();
$("#quarterName").show();
$("#month").hide();
$("#quarter").show();
}
var yearElement = document.getElementById("year"); var yearElement = document.getElementById("year");
var yearValue = yearElement.options[yearElement.selectedIndex].value; var yearValue = yearElement.options[yearElement.selectedIndex].value;
var quarterElement = document.getElementById("quarter"); var quarterElement = document.getElementById("quarter");
@ -458,7 +505,7 @@
* 导出excel * 导出excel
* @param id 主键 * @param id 主键
*/ */
function exportData() { /*function exportData() {
// $.modal.open("数据导出模板选择" , prefix + "/analysisModel", 800, 300); // $.modal.open("数据导出模板选择" , prefix + "/analysisModel", 800, 300);
var div = document.getElementById('searchDiv'); var div = document.getElementById('searchDiv');
var selects = div.getElementsByTagName('select'); var selects = div.getElementsByTagName('select');
@ -471,6 +518,62 @@
obj[name] = value; obj[name] = value;
} }
window.location.href = prefix + "/export?statisticalStr=" + encodeURIComponent(JSON.stringify(obj)); window.location.href = prefix + "/export?statisticalStr=" + encodeURIComponent(JSON.stringify(obj));
}*/
function exportData() {
console.log($('#excelModel').val())
var exportData= {
"qorm": $('#qorm').val(),
"year": $('#year').val(),
"quarter": $('#quarter').val(),
"month": $('#month').val(),
"lawField": $('#lawField').val(),
"checkCategory": $('#checkCategory').val(),
};
if(exportData.qorm=="m"){
exportData.quarter="";
}else{
exportData.month="";
};
if($('#excelModel').val()==1) {
$.ajax({
type: "POST",
data: JSON.stringify(exportData),
contentType: 'application/json',
//设置响应类型
xhrFields: {responseType: "blob"},
url: prefix+"/exportLawEnforcerExcel",
success: function (result) {
const link = document.createElement('a');
let blob = new Blob([result], {type: 'application/vnd.ms-excel'});
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', "执法人员模板.xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link)
}
})
}else if($('#excelModel').val()==2) {
$.ajax({
type: "POST",
data: JSON.stringify(exportData),
contentType: 'application/json',
//设置响应类型
xhrFields: {responseType: "blob"},
url: prefix+"/exportEnterpriseRankExcel",
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>

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

@ -12,6 +12,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input name="cycleTime" class="form-control" type="text"> <input name="cycleTime" class="form-control" type="text">
</div> </div>
<label>月</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">告警次数:</label> <label class="col-sm-3 control-label">告警次数:</label>
@ -22,10 +23,13 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">告警级别:</label> <label class="col-sm-3 control-label">告警级别:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="alarmType" class="form-control m-b" th:with="type=${@dict.getType('warnLevel')}"> <select name="alarmType" class="form-control m-b" th:with="type=${@dict.getType('warnLevel')}" id="alarmType" onclick="colorChange()">
<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>
</select> </select>
</div> </div>
<label id="firstColor" style="color: red">红色</label>
<label id="secondColor" style="color: orange">橙色</label>
<label id="thirdColor" style="color: orange">橙色</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
@ -41,6 +45,11 @@
<th:block th:include="zdxtInclude :: footer" /> <th:block th:include="zdxtInclude :: footer" />
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "code/ruleItemList"; var prefix = ctx + "code/ruleItemList";
window.onload = function () {
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").hide();
}
$("#form-list-add").validate({ $("#form-list-add").validate({
focusCleanup: true focusCleanup: true
}); });
@ -50,6 +59,26 @@
$.operate.save(prefix + "/add", $('#form-list-add').serialize()); $.operate.save(prefix + "/add", $('#form-list-add').serialize());
} }
} }
function colorChange(){
let type=document.getElementById("alarmType");
if(type.value=="1"){
$("#firstColor").show();
$("#secondColor").hide();
$("#thirdColor").hide();
}else if(type.value=="2"){
$("#firstColor").hide();
$("#secondColor").show();
$("#thirdColor").hide();
} else if(type.value=="3"){
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").show();
}else{
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").hide();
}
}
</script> </script>
</body> </body>
</html> </html>

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

@ -12,6 +12,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input name="cycleTime" th:field="*{cycleTime}" class="form-control" type="text"> <input name="cycleTime" th:field="*{cycleTime}" class="form-control" type="text">
</div> </div>
<label>月</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">告警次数:</label> <label class="col-sm-3 control-label">告警次数:</label>
@ -22,11 +23,14 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">告警级别:</label> <label class="col-sm-3 control-label">告警级别:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="alarmType" class="form-control m-b" th:with="type=${@dict.getType('warnLevel')}"> <select name="alarmType" class="form-control m-b" th:with="type=${@dict.getType('warnLevel')}" id="alarmType" onclick="colorChange()">
<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>
</select> </select>
</div> </div>
<label id="firstColor" style="color: red;margin-top: 10px;">红色</label>
<label id="secondColor" style="color: orange;margin-top: 10px;">橙色</label>
<label id="thirdColor" style="color: yellow;margin-top: 10px;">黄色</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">状态:</label> <label class="col-sm-3 control-label">状态:</label>
@ -42,6 +46,11 @@
<th:block th:include="zdxtInclude :: footer" /> <th:block th:include="zdxtInclude :: footer" />
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "code/ruleItemList"; var prefix = ctx + "code/ruleItemList";
window.onload = function () {
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").hide();
}
$("#form-list-edit").validate({ $("#form-list-edit").validate({
focusCleanup: true focusCleanup: true
}); });
@ -51,6 +60,26 @@
$.operate.save(prefix + "/edit", $('#form-list-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-list-edit').serialize());
} }
} }
function colorChange(){
let type=document.getElementById("alarmType");
if(type.value=="1"){
$("#firstColor").show();
$("#secondColor").hide();
$("#thirdColor").hide();
}else if(type.value=="2"){
$("#firstColor").hide();
$("#secondColor").show();
$("#thirdColor").hide();
} else if(type.value=="3"){
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").show();
}else{
$("#firstColor").hide();
$("#secondColor").hide();
$("#thirdColor").hide();
}
}
</script> </script>
</body> </body>
</html> </html>

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

@ -20,7 +20,7 @@
</li> </li>
<li> <li>
<p>告警级别:</p> <p>告警级别:</p>
<select name="alarmType" th:with="type=${@dict.getType('')}"> <select name="alarmType" th:with="type=${@dict.getType('warnLevel')}">
<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>
</select> </select>
@ -29,6 +29,8 @@
<p>状态:</p> <p>状态:</p>
<select name="status"> <select name="status">
<option value="">所有</option> <option value="">所有</option>
<option value="0">启用</option>
<option value="1">禁用</option>
</select> </select>
</li> </li>
<li> <li>

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

@ -153,6 +153,7 @@
</div> </div>
<div id="con_one_4" class="tab_item"> <div id="con_one_4" class="tab_item">
<span style="font-size: 20px;">企业数量总计:<span id="enterprise_Total"></span></span>
<div class="tab_cont"> <div class="tab_cont">
<div class="listhead"> <div class="listhead">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="desktab"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="desktab">
@ -724,7 +725,8 @@
barDatas.push(list[i].total); barDatas.push(list[i].total);
tmpList.push({name: list[i].name, value: list[i].total}) tmpList.push({name: list[i].name, value: list[i].total})
} }
document.getElementById("enterprise_Total").innerText=data.data.length;
console.log(data)
var tabStr = fillTable(tmpList); var tabStr = fillTable(tmpList);
document.getElementById("echartSortTable").innerHTML = tabStr; document.getElementById("echartSortTable").innerHTML = tabStr;

64
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalController.java

@ -7,14 +7,17 @@ import com.zdxt.code.domain.LawEnforcerExcel;
import com.zdxt.code.service.StatisticalService; import com.zdxt.code.service.StatisticalService;
import com.zdxt.common.ZDResponse; import com.zdxt.common.ZDResponse;
import com.zdxt.common.util.ExcelUtils; import com.zdxt.common.util.ExcelUtils;
import org.apache.poi.hssf.usermodel.*;
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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -122,4 +125,65 @@ public class StatisticalController {
public String analysisModel() { public String analysisModel() {
return prefix2 + "/analysisModel"; return prefix2 + "/analysisModel";
} }
@PostMapping("/exportLawEnforcerExcel")
public void exportLawEnforcerExcel(HttpServletResponse httpServletResponse,StatisticalVo statisticalVo) throws IOException {
List<StatisticalVo> statisticalVos = statisticalService.enforcerAnalysis(statisticalVo);
System.out.println(statisticalVos);
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("执法人员模板");
//设置文件名称
String fileName = "执法人员模板.xls";
//设置表头
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);
}
for(int i=0;i<statisticalVos.size();i++){
HSSFRow row = sheet.createRow(i+1);
HSSFCell cell1=row.createCell(0);
HSSFCell cell2=row.createCell(1);
cell1.setCellValue(statisticalVos.get(i).getLawEnforcer());
cell2.setCellValue(statisticalVos.get(i).getTotal());
}
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();
}
@PostMapping("/exportEnterpriseRankExcel")
public void exportEnterpriseRankExcel(HttpServletResponse httpServletResponse,StatisticalVo statisticalVo) throws IOException {
List<StatisticalVo> statisticalVos = statisticalService.enterpriseTableAnalysis(statisticalVo);
System.out.println(statisticalVos);
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("企业排序模板");
//设置文件名称
String fileName = "企业排序模板.xls";
//设置表头
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);
}
for(int i=0;i<statisticalVos.size();i++){
HSSFRow row = sheet.createRow(i+1);
HSSFCell cell1=row.createCell(0);
HSSFCell cell2=row.createCell(1);
cell1.setCellValue(statisticalVos.get(i).getName());
cell2.setCellValue(statisticalVos.get(i).getTotal());
}
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();
}
} }

26
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -248,18 +249,19 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
//查询最新的二维码数据 //查询最新的二维码数据
QrCodeGenerateHistory qrCodeGenerateHistory1 = QrCodeGenerateHistory qrCodeGenerateHistory1 =
iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseInformation.getEnterpriseNumber()); iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseInformation.getEnterpriseNumber());
//判断二维码生成时间 if(BeanUtil.isNotEmpty(qrCodeGenerateHistory1)){//判断二维码生成时间
Instant instant = qrCodeGenerateHistory1.getGenerateTime().toInstant(); Instant instant = qrCodeGenerateHistory1.getGenerateTime().toInstant();
ZoneId zoneId = ZoneId.systemDefault(); ZoneId zoneId = ZoneId.systemDefault();
// atZone()方法返回在指定时区从此Instant生成的ZonedDateTime。 // atZone()方法返回在指定时区从此Instant生成的ZonedDateTime。
LocalDateTime date1 = instant.atZone(zoneId).toLocalDateTime(); LocalDateTime date1 = instant.atZone(zoneId).toLocalDateTime();
//当前时间 //当前时间
LocalDateTime date2 = LocalDateTime.now(); LocalDateTime date2 = LocalDateTime.now();
//判断相差多少个小时 //判断相差多少个小时
long hoursDiff = ChronoUnit.HOURS.between(date1, date2); long hoursDiff = ChronoUnit.HOURS.between(date1, date2);
if(hoursDiff < 24){ if (hoursDiff < 24) {
log.error("二维码生成时间不足24小时"); log.error("二维码生成时间不足24小时");
return 0; return 0;
}
} }
// TODO 企业添加成功,生成企业二维码 // TODO 企业添加成功,生成企业二维码
String text = "https://www.baidu.com/s?ie=UTF-8&wd=%E7%99%BE%E5%BA%A6"; String text = "https://www.baidu.com/s?ie=UTF-8&wd=%E7%99%BE%E5%BA%A6";

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/RuleListMapper.xml

@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectRuleListVo"/> <include refid="selectRuleListVo"/>
<where> <where>
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if> <if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode}</if> <if test="ruleCode != null and ruleCode != ''"> and rule_code like concat('%', #{ruleCode}, '%')</if>
<if test="validBeginTime != null "> and valid_begin_time = #{validBeginTime}</if> <if test="validBeginTime != null "> and valid_begin_time = #{validBeginTime}</if>
<if test="validEndTime != null "> and valid_end_time = #{validEndTime}</if> <if test="validEndTime != null "> and valid_end_time = #{validEndTime}</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>

33
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

@ -139,6 +139,12 @@
<if test="industry!= null and industry!= ''"> <if test="industry!= null and industry!= ''">
AND ei.industry = #{industry} AND ei.industry = #{industry}
</if> </if>
<if test="lawField!= null and lawField!= ''">
AND er.law_field = #{lawField}
</if>
<if test="checkCategory!= null and checkCategory!= ''">
AND er.check_category = #{checkCategory}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>
@ -162,6 +168,12 @@
<if test="industry!= null and industry!= ''"> <if test="industry!= null and industry!= ''">
AND ei.industry = #{industry} AND ei.industry = #{industry}
</if> </if>
<if test="lawField!= null and lawField!= ''">
AND er.law_field = #{lawField}
</if>
<if test="checkCategory!= null and checkCategory!= ''">
AND er.check_category = #{checkCategory}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>
@ -187,6 +199,12 @@
<if test="industry!= null and industry!= '' "> <if test="industry!= null and industry!= '' ">
AND ei.industry = #{industry} AND ei.industry = #{industry}
</if> </if>
<if test="lawField!= null and lawField!= ''">
AND r.law_field = #{lawField}
</if>
<if test="checkCategory!= null and checkCategory!= ''">
AND r.check_category = #{checkCategory}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
GROUP BY d.id ORDER BY total DESC limit 100 GROUP BY d.id ORDER BY total DESC limit 100
@ -209,6 +227,12 @@
<if test="industry!= null and industry!= ''"> <if test="industry!= null and industry!= ''">
AND i.industry = #{industry} AND i.industry = #{industry}
</if> </if>
<if test="lawField!= null and lawField!= ''">
AND r.law_field = #{lawField}
</if>
<if test="checkCategory!= null and checkCategory!= ''">
AND r.check_category = #{checkCategory}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>
@ -277,6 +301,15 @@
<if test="params.yearMonth != null and params.yearMonth != ''"> <if test="params.yearMonth != null and params.yearMonth != ''">
AND DATE_FORMAT(er.enforcement_time, '%Y-%m') = #{params.yearMonth} AND DATE_FORMAT(er.enforcement_time, '%Y-%m') = #{params.yearMonth}
</if> </if>
<if test="industry!= null and industry!= '' ">
AND ei.industry = #{industry}
</if>
<if test="lawField!= null and lawField!= ''">
AND er.law_field = #{lawField}
</if>
<if test="checkCategory!= null and checkCategory!= ''">
AND er.check_category = #{checkCategory}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>

Loading…
Cancel
Save