24 changed files with 1237 additions and 109 deletions
@ -0,0 +1,14 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<li id="fragmentW" th:fragment="fragmentW"> |
|||
<p th:text="|${year}年|"></p> |
|||
<p th:text="|投诉数量 ${Number1}|"></p> |
|||
<p th:text="|投诉对象 ${Number2}|"></p> |
|||
</li> |
|||
</head> |
|||
<body> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,171 @@ |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
|
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('执法预警统计')"/> |
|||
<link type="text/css" href="/css/stat1.css" rel="stylesheet"/> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<p>执法部门:</p> |
|||
<input type="text" name="bureauDeptId"/> |
|||
</li> |
|||
<li> |
|||
<p>企业名称:</p> |
|||
<input type="text" name="name"/> |
|||
</li> |
|||
<li> |
|||
<p>时段:</p> |
|||
<select id="year" name="year"> |
|||
<!--<option value="2024">2024</option>--> |
|||
<option th:each="y:${yearList}" th:text="${y}" th:value="${y}"></option> |
|||
</select> |
|||
<select id="dateSearch" name="dateSearch" onchange="timeType()"> |
|||
<option value="year">年度</option> |
|||
<option value="quarter">季度</option> |
|||
<option value="month">月度</option> |
|||
</select> |
|||
<select id="quarter" name="quarter"> |
|||
<option value="">所有</option> |
|||
<option value="1">第一季度</option> |
|||
<option value="2">第二季度</option> |
|||
<option value="3">第三季度</option> |
|||
<option value="4">第四季度</option> |
|||
</select> |
|||
<select id="month" name="month"> |
|||
<option value="">所有</option> |
|||
<option value="01">1月</option> |
|||
<option value="02">2月</option> |
|||
<option value="03">3月</option> |
|||
<option value="04">4月</option> |
|||
<option value="05">5月</option> |
|||
<option value="06">6月</option> |
|||
<option value="07">7月</option> |
|||
<option value="08">8月</option> |
|||
<option value="09">9月</option> |
|||
<option value="10">10月</option> |
|||
<option value="11">11月</option> |
|||
<option value="12">12月</option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-rounded btn-sm" onclick="searchW()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset btn-rounded btn-sm" onclick="restW()"><i class="fa fa-refresh"></i> 重置</a> |
|||
<a class="btn btn-download btn-rounded btn-sm" onclick="download1()"><i class="fa fa-download"></i>导出</a> |
|||
</li> |
|||
</ul> |
|||
<ul> |
|||
<li id="fragmentW" th:fragment="fragmentW"> |
|||
<p th:text="|${year}年|"></p> |
|||
<p th:text="|投诉数量 ${Number1}|"></p> |
|||
<p th:text="|投诉对象 ${Number2}|"></p> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-bordered"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "code/statisticsWarning"; |
|||
window.onload=function (){ |
|||
wTable(); |
|||
$("#quarter").hide(); |
|||
$("#month").hide(); |
|||
} |
|||
$(function() { |
|||
var options = { |
|||
modalName: "执法预警统计", |
|||
showHeader: true, |
|||
showFooter: true, |
|||
showColumns: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
pagination: true, |
|||
pageSize: 10, |
|||
pageList: [10, 25, 50], |
|||
//quarterBoolean:quarterBoolean, |
|||
columns: [ |
|||
{ |
|||
field : 'enforcementDepartment', |
|||
title : '执法部门' |
|||
}, |
|||
{ |
|||
field : 'enterpriseName', |
|||
title : '企业名称' |
|||
}, |
|||
{ |
|||
field : 'warningCause', |
|||
title : '原因' |
|||
}, |
|||
{ |
|||
field : 'enforcementNumber', |
|||
title : '预警次数' |
|||
} |
|||
] |
|||
} |
|||
$("#bootstrap-table").bootstrapTable(options); |
|||
}); |
|||
function searchW () { |
|||
wTable() |
|||
var currentId = $('form').eq(0).attr('id'); |
|||
var params = $.common.formToJSON(currentId); |
|||
$.ajax({ |
|||
url: prefix + '/searchType', |
|||
type: 'GET', |
|||
data: params, |
|||
success: function (response) { |
|||
$('#fragmentW').html(response); |
|||
} |
|||
}) |
|||
} |
|||
function wTable(){ |
|||
var currentId=$('form').eq(0).attr('id') |
|||
var params = $.common.formToJSON(currentId); |
|||
$.ajax({ |
|||
url: prefix + "/list", |
|||
method: 'post', |
|||
data:params, |
|||
success:function (response){ |
|||
$('#bootstrap-table').bootstrapTable('load', response); |
|||
},error:function (xhr,status,error){ |
|||
console.error("请求失败:",status,error); |
|||
} |
|||
}) |
|||
} |
|||
function restW(){ |
|||
$('form').eq(0).trigger("reset"); |
|||
console.log($.common.formToJSON($('form').eq(0).attr('id'))); |
|||
searchW(); |
|||
timeType(); |
|||
} |
|||
function timeType() { |
|||
var dateSearch = document.getElementById("dateSearch"); |
|||
console.log(dateSearch.value) |
|||
if(dateSearch.value=="quarter"){ |
|||
$("#quarter").show(); |
|||
$("#month").hide(); |
|||
document.getElementById("month").value=""; |
|||
}else if(dateSearch.value=="month"){ |
|||
$("#quarter").hide(); |
|||
document.getElementById("quarter").value=""; |
|||
$("#month").show(); |
|||
}else { |
|||
$("#quarter").hide(); |
|||
document.getElementById("quarter").value=""; |
|||
$("#month").hide(); |
|||
document.getElementById("month").value=""; |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,14 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<li th:fragment="enterpriseFragment"> |
|||
<p th:text="|${year}年|"></p> |
|||
<p th:text="|企业数量 ${number2}|"></p> |
|||
<p th:text="|占比总计 ${number3}|"></p> |
|||
</li> |
|||
</head> |
|||
<body> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,296 @@ |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
|
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('企业统计')"/> |
|||
<link type="text/css" href="/css/stat1.css" rel="stylesheet"/> |
|||
<style> |
|||
.tab-content { |
|||
display: none; |
|||
} |
|||
|
|||
.tab-content.active { |
|||
display: block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<div class="statit"> |
|||
<span id="one1" class="actit" onclick="setTab('one',1,2)">企业数量统计</span> |
|||
<span id="one2" onclick="setTab('one',2,2)">企业类型统计</span> |
|||
</div> |
|||
<div id="one-tab1" class="tab-content active"> |
|||
<div> |
|||
<p th:text="全市"></p> |
|||
<p th:text="|企业数量 ${number}|"></p> |
|||
<p th:text="|续存企业数量 ${exist}|"></p> |
|||
<p th:text="|注销企业数量 ${logout}|"></p> |
|||
<a class="btn btn-download btn-rounded btn-sm" onclick="complaintDownload1()"><i class="fa fa-download"></i>导出</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-bordered"> |
|||
<table id="bootstrap-table1"></table> |
|||
</div> |
|||
</div> |
|||
<div id="one-tab2" class="tab-content"> |
|||
<form id="formId2"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<p>时段:</p> |
|||
<select id="year2" name="year"> |
|||
<!--<option value="2024">2024</option>--> |
|||
<option th:each="y:${yearList}" th:text="${y}" th:value="${y}"></option> |
|||
</select> |
|||
<select id="dateSearch2" name="dateSearch" onchange="timeType2()" ><!--创建时间--> |
|||
<option value="year">年度</option> |
|||
<option value="quarter">季度</option> |
|||
<option value="month">月度</option> |
|||
</select> |
|||
<select id="quarter2" name="quarter"> |
|||
<option value="">所有</option> |
|||
<option value="1">第一季度</option> |
|||
<option value="2">第二季度</option> |
|||
<option value="3">第三季度</option> |
|||
<option value="4">第四季度</option> |
|||
</select> |
|||
<select id="month2" name="month"> |
|||
<option value="">所有</option> |
|||
<option value="01">1月</option> |
|||
<option value="02">2月</option> |
|||
<option value="03">3月</option> |
|||
<option value="04">4月</option> |
|||
<option value="05">5月</option> |
|||
<option value="06">6月</option> |
|||
<option value="07">7月</option> |
|||
<option value="08">8月</option> |
|||
<option value="09">9月</option> |
|||
<option value="10">10月</option> |
|||
<option value="11">11月</option> |
|||
<option value="12">12月</option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-rounded btn-sm" onclick="eSearch2()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset btn-rounded btn-sm" onclick="eRest2()"><i class="fa fa-refresh"></i> 重置</a> |
|||
<a class="btn btn-download btn-rounded btn-sm" onclick="complaintDownload(2)"><i class="fa fa-download"></i>下载</a> |
|||
</li> |
|||
</ul> |
|||
<ul> |
|||
<li id="enterpriseFragment" th:fragment="enterpriseFragment"> |
|||
<p th:text="|${year}年|"></p> |
|||
<p th:text="|企业数量 ${number2}|"></p> |
|||
<p th:text="|占比总计 ${number3}|"></p> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
|
|||
</form> |
|||
<div> |
|||
<table id="bootstrap-table2" style="width: 550px;"></table> |
|||
<div id="container" style="width: 700px;height:550px;"></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer"/> |
|||
<th:block th:include="zdxtInclude ::echarts-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "code/statisticsEnterprise"; |
|||
var myChart = echarts.init(document.getElementById('container')); |
|||
window.onload = function () { |
|||
$("#quarter2").hide(); |
|||
$("#month2").hide(); |
|||
eTable1(); |
|||
eTable2(); |
|||
} |
|||
$(function() { |
|||
var options1 = { |
|||
modalName: "企业统计", |
|||
showHeader: true, |
|||
showFooter: false, |
|||
showColumns: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
/*pagination: true, |
|||
pageSize: 10, |
|||
pageList: [10, 25, 50],*/ |
|||
//quarterBoolean:quarterBoolean, |
|||
columns: [ |
|||
{ |
|||
field : 'name', |
|||
title : '区域', |
|||
formatter:function (value,row,index) { |
|||
return '<span ONCLICK="jd(\'' + value + '\')">'+value+'</span>'; |
|||
} |
|||
}, |
|||
{ |
|||
field : 'totalNumber', |
|||
title : '企业数量', |
|||
}, |
|||
{ |
|||
field : 'numInt', |
|||
title : '续存企业数量', |
|||
}, |
|||
{ |
|||
field : 'value', |
|||
title : '注销企业数量', |
|||
} |
|||
] |
|||
}; |
|||
$("#bootstrap-table1").bootstrapTable(options1); |
|||
}); |
|||
$(function() { |
|||
var options2 = { |
|||
modalName: "投诉类型统计", |
|||
showHeader: true, |
|||
showFooter: false, |
|||
showColumns: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
//quarterBoolean:quarterBoolean, |
|||
columns: [ |
|||
{ |
|||
field : 'name', |
|||
title : '企业类型' |
|||
}, |
|||
{ |
|||
field : 'value', |
|||
title : '企业数量' |
|||
}, |
|||
{ |
|||
field : 'percentage', |
|||
title : '占比' |
|||
}, |
|||
] |
|||
} |
|||
$("#bootstrap-table2").bootstrapTable(options2); |
|||
}); |
|||
|
|||
function setTab(prefix, num, total) { |
|||
console.log( document.getElementById(`${prefix}1`)) |
|||
for (let i = 1; i <= total; i++) { |
|||
document.getElementById(`${prefix}${i}`).classList.remove('actit'); |
|||
document.getElementById(`${prefix}-tab${i}`).classList.remove('active'); |
|||
} |
|||
document.getElementById(`${prefix}${num}`).classList.add('actit'); |
|||
document.getElementById(`${prefix}-tab${num}`).classList.add('active'); |
|||
} |
|||
|
|||
function eTable1(){ |
|||
/*var currentId=$('form').eq(0).attr('id') |
|||
var params = $.common.formToJSON(currentId);*/ |
|||
$.ajax({ |
|||
url: prefix + "/listQY", |
|||
method: 'GET', |
|||
success:function (response){ |
|||
console.log(response); |
|||
$('#bootstrap-table1').bootstrapTable('load', response); |
|||
},error:function (xhr,status,error){ |
|||
console.error("请求失败:",status,error); |
|||
} |
|||
}) |
|||
} |
|||
function eTable2(){ |
|||
var currentId=$('form').eq(1).attr('id') |
|||
var params = $.common.formToJSON(currentId); |
|||
$.ajax({ |
|||
url: prefix + "/type", |
|||
method: 'GET', |
|||
data:params, |
|||
success:function (response){ |
|||
$('#bootstrap-table2').bootstrapTable('load', response); |
|||
var option3 = { |
|||
color:['#1874CD','#3A5FCD','#436EEE','#4876FF','#1E90FF'], |
|||
tooltip: {}, |
|||
legend: { |
|||
data: ['投诉类型统计'] |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: '投诉类型统计', |
|||
type: 'pie', |
|||
radius: ['40%', '70%'], |
|||
data: response, |
|||
label: { |
|||
show: true, |
|||
formatter: function (arg) { |
|||
console.log(arg); |
|||
return arg.name + " " + arg.value + " " + arg.percent + "%"; |
|||
} |
|||
}, |
|||
} |
|||
] |
|||
} |
|||
myChart.setOption(option3); |
|||
debugger; |
|||
},error:function (xhr,status,error){ |
|||
console.error("请求失败:",status,error); |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function eSearch2 () { |
|||
eTable2(); |
|||
var currentId=$('form').eq(1).attr('id'); |
|||
var params = $.common.formToJSON(currentId); |
|||
$.ajax({ |
|||
url:prefix+'/searchType', |
|||
type:'GET', |
|||
data:params, |
|||
success: function (response) { |
|||
$('#enterpriseFragment').html(response); |
|||
} |
|||
}) |
|||
}; |
|||
|
|||
function jd(n){ |
|||
let nameData={}; |
|||
nameData.name=n; |
|||
console.log(n) |
|||
console.log(nameData) |
|||
$.ajax({ |
|||
url:prefix+'/listJD', |
|||
type:'GET', |
|||
data:nameData, |
|||
success:function (response){ |
|||
console.log(response) |
|||
},error:function (xhr,status,error){ |
|||
console.error("请求失败:",status,error); |
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
function timeType2() { |
|||
var dateSearch = document.getElementById("dateSearch2"); |
|||
console.log(dateSearch.value) |
|||
if(dateSearch.value=="quarter"){ |
|||
$("#quarter2").show(); |
|||
$("#month2").hide(); |
|||
document.getElementById("month2").value=""; |
|||
}else if(dateSearch.value=="month"){ |
|||
$("#quarter2").hide(); |
|||
document.getElementById("quarter2").value=""; |
|||
$("#month2").show(); |
|||
}else { |
|||
debugger |
|||
$("#quarter2").hide(); |
|||
document.getElementById("quarter2").value=""; |
|||
$("#month2").hide(); |
|||
document.getElementById("month2").value=""; |
|||
} |
|||
} |
|||
|
|||
function eRest2(){ |
|||
$('form').eq(1).trigger("reset"); |
|||
eSearch2(); |
|||
timeType2(); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,278 @@ |
|||
package com.zdxt.code.controller; |
|||
|
|||
import com.zdxt.auth.project.system.dict.service.IDictDataService; |
|||
import com.zdxt.code.domain.ComplaintStatistics; |
|||
import com.zdxt.code.domain.EnterpriseInformation; |
|||
import com.zdxt.code.domain.SearchType; |
|||
import com.zdxt.code.domain.StatisticsIndicator; |
|||
import com.zdxt.code.service.IEnterpriseInformationService; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.domain.auth.DictData; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.time.format.DateTimeFormatter; |
|||
import java.time.temporal.TemporalAdjusters; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Controller |
|||
@RequestMapping("/code/statisticsEnterprise") |
|||
public class StatisticsEnterpriseController extends BaseController |
|||
{ |
|||
private String prefix = "project/code/statisticsEnterprise"; |
|||
@Autowired |
|||
private IEnterpriseInformationService iEnterpriseInformationService; |
|||
@Autowired |
|||
private IDictDataService iDictDataService; |
|||
@RequiresPermissions("code:statisticsEnterprise:view") |
|||
@GetMapping() |
|||
public String statisticsEnterprise(Model model) { |
|||
LocalDate localDate=LocalDate.now(); |
|||
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation()); |
|||
List<EnterpriseInformation> existList= enterpriseInformationList.stream().filter(item->item.getIsDelete()==0).collect(Collectors.toList()); |
|||
List<EnterpriseInformation> logoutList= enterpriseInformationList.stream().filter(item->item.getIsDelete()==1).collect(Collectors.toList()); |
|||
model.addAttribute("yearList",yearMake()); |
|||
model.addAttribute("number",enterpriseInformationList.size());//企业总数
|
|||
model.addAttribute("exist",existList.size());//续存数量
|
|||
model.addAttribute("logout",logoutList.size());//注销数量
|
|||
model.addAttribute("year",localDate.getYear()); |
|||
model.addAttribute("number2",enterpriseInformationList.size());//企业总数--Tap2
|
|||
model.addAttribute("number3","100%"); |
|||
return prefix+"/statisticsEnterprise"; |
|||
} |
|||
@RequiresPermissions("code:statisticsEnterprise:list") |
|||
@GetMapping("/listQY") |
|||
@ResponseBody |
|||
public List<StatisticsIndicator> statisticsEnterpriseQY() { |
|||
List<DictData>dictDataList=iDictDataService.selectDictDataByType("address_type");//有序->区
|
|||
Map<String,String> dictDataMap=dictDataList.stream().collect(Collectors.toMap(DictData::getDictValue,DictData::getDictLabel)); |
|||
List<String> list=new ArrayList<>();//无序->深圳市+区
|
|||
for(String s:dictDataMap.keySet()){ |
|||
list.add("深圳市"+dictDataMap.get(s)); |
|||
} |
|||
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation()); |
|||
List<StatisticsIndicator> statisticsIndicatorList=new ArrayList<>(); |
|||
for(DictData d:dictDataList){ |
|||
StatisticsIndicator s=new StatisticsIndicator(); |
|||
String name=d.getDictLabel(); |
|||
List<EnterpriseInformation> qyList=new ArrayList<>();//有序区--企业
|
|||
if(name.equals("深圳市光明区")){ |
|||
qyList=enterpriseInformationList.stream().filter(item->item.getEnterpriseAddress().startsWith("深圳市"+name)||item.getEnterpriseAddress().startsWith("深圳市光明新区")).collect(Collectors.toList()); |
|||
}else{ |
|||
qyList=enterpriseInformationList.stream().filter(item->item.getEnterpriseAddress().startsWith("深圳市"+name)).collect(Collectors.toList()); |
|||
} |
|||
List<EnterpriseInformation> existList= qyList.stream().filter(item->item.getIsDelete()==0).collect(Collectors.toList()); |
|||
List<EnterpriseInformation> logoutList= qyList.stream().filter(item->item.getIsDelete()==1).collect(Collectors.toList()); |
|||
s.setName(name); |
|||
s.setTotalNumber(qyList.size()); |
|||
s.setNumInt(existList.size()); |
|||
s.setValue(logoutList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
List<EnterpriseInformation> qtList=enterpriseInformationList.stream().filter(item->!qyMake(list,item.getEnterpriseAddress())).collect(Collectors.toList()); |
|||
qtList = qtList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市光明新区")).collect(Collectors.toList()); |
|||
if(qtList!=null&&qtList.size()>0) { |
|||
List<EnterpriseInformation> existList = qtList.stream().filter(item -> item.getIsDelete() == 0).collect(Collectors.toList()); |
|||
List<EnterpriseInformation> logoutList = qtList.stream().filter(item -> item.getIsDelete() == 1).collect(Collectors.toList()); |
|||
StatisticsIndicator s = new StatisticsIndicator(); |
|||
s.setName("其他"); |
|||
s.setTotalNumber(qtList.size()); |
|||
s.setNumInt(existList.size()); |
|||
s.setValue(logoutList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
return statisticsIndicatorList; |
|||
} |
|||
|
|||
@RequiresPermissions("code:statisticsEnterprise:list") |
|||
@GetMapping("/listJD") |
|||
@ResponseBody |
|||
public List<StatisticsIndicator> statisticsEnterpriseJD(SearchType searchType) { |
|||
List<DictData>dictDataList=iDictDataService.selectDictDataByType("address_type"); |
|||
Map<String,String> qyMap=dictDataList.stream().collect(Collectors.toMap(DictData::getDictLabel,DictData::getDictValue)); |
|||
if(qyMap.containsKey(searchType.getName())) { |
|||
List<DictData> jdDictList = iDictDataService.selectDictDataByType(qyMap.get(searchType.getName()));//有序街道
|
|||
Map<String, String> jdMap = jdDictList.stream().collect(Collectors.toMap(DictData::getDictValue, DictData::getDictLabel)); |
|||
List<EnterpriseInformation> enterpriseInformationList = iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());//所有企业
|
|||
if (searchType.getName().equals("光明区")) {//将该区内的过滤出来
|
|||
enterpriseInformationList=enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市"+ searchType.getName())|| item.getEnterpriseAddress().startsWith("深圳市光明新区")).collect(Collectors.toList()); |
|||
} else { |
|||
enterpriseInformationList=enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市"+ searchType.getName())).collect(Collectors.toList()); |
|||
} |
|||
List<StatisticsIndicator> statisticsIndicatorList = new ArrayList<>(); |
|||
for (DictData d : jdDictList) {//遍历按序版的区域list
|
|||
StatisticsIndicator s = new StatisticsIndicator(); |
|||
String name = d.getDictLabel(); |
|||
List<EnterpriseInformation> qyList = new ArrayList<>(); |
|||
if (searchType.getName().equals("光明区")) { |
|||
qyList = enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市"+ searchType.getName() + name) || item.getEnterpriseAddress().startsWith("深圳市光明新区"+ name)).collect(Collectors.toList()); |
|||
} else { |
|||
qyList = enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市"+ searchType.getName() + name)).collect(Collectors.toList()); |
|||
} |
|||
List<EnterpriseInformation> existList = qyList.stream().filter(item -> item.getIsDelete() == 0).collect(Collectors.toList()); |
|||
List<EnterpriseInformation> logoutList = qyList.stream().filter(item -> item.getIsDelete() == 1).collect(Collectors.toList()); |
|||
s.setName(name); |
|||
s.setTotalNumber(qyList.size()); |
|||
s.setNumInt(existList.size()); |
|||
s.setValue(logoutList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
List<EnterpriseInformation> qtList=enterpriseInformationList.stream().filter(item->!jdMake(searchType.getName(),jdDictList,item.getEnterpriseAddress())).collect(Collectors.toList()); |
|||
if(qtList!=null&&qtList.size()>0) { |
|||
List<EnterpriseInformation> existList = qtList.stream().filter(item -> item.getIsDelete() == 0).collect(Collectors.toList()); |
|||
List<EnterpriseInformation> logoutList = qtList.stream().filter(item -> item.getIsDelete() == 1).collect(Collectors.toList()); |
|||
StatisticsIndicator s = new StatisticsIndicator(); |
|||
s.setName("其他"); |
|||
s.setTotalNumber(qtList.size()); |
|||
s.setNumInt(existList.size()); |
|||
s.setValue(logoutList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
return statisticsIndicatorList; |
|||
} |
|||
return null; |
|||
} |
|||
@RequiresPermissions("code:statisticsEnterprise:list") |
|||
@GetMapping("/type") |
|||
@ResponseBody |
|||
public List<StatisticsIndicator> statistics(SearchType searchType) { |
|||
EnterpriseInformation enterpriseInformation=dateMake(searchType); |
|||
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation); |
|||
List<DictData>list=iDictDataService.selectDictDataByType("enterpriseType"); |
|||
List<DictData>dictDataList=list.subList(0,4);//截取掉其他
|
|||
List<StatisticsIndicator> statisticsIndicatorList=new ArrayList<>(); |
|||
for(DictData d:dictDataList){ |
|||
List<EnterpriseInformation> type=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(d.getDictLabel())).collect(Collectors.toList()); |
|||
if(type!=null&&type.size()>0){ |
|||
StatisticsIndicator s=new StatisticsIndicator(); |
|||
s.setName(d.getDictLabel()); |
|||
s.setValue(type.size()); |
|||
s.setPercentage((double)type.size()/enterpriseInformationList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
} |
|||
List<EnterpriseInformation> qtList=enterpriseInformationList.stream().filter(item->!typeMake(dictDataList,item.getCompanyOrgType())).collect(Collectors.toList()); |
|||
if(qtList!=null&&qtList.size()>0){ |
|||
StatisticsIndicator s=new StatisticsIndicator(); |
|||
s.setName("其他"); |
|||
s.setValue(qtList.size()); |
|||
s.setPercentage((double)qtList.size()/enterpriseInformationList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
return statisticsIndicatorList; |
|||
} |
|||
@RequiresPermissions("code:statisticsEnterprise:view") |
|||
@GetMapping("/search") |
|||
public String Search(Model model,SearchType searchType) { |
|||
EnterpriseInformation enterpriseInformation=dateMake(searchType); |
|||
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation); |
|||
List<DictData>dictDataList=iDictDataService.selectDictDataByType("enterpriseType"); |
|||
List<StatisticsIndicator> statisticsIndicatorList=new ArrayList<>(); |
|||
for(DictData d:dictDataList){ |
|||
List<EnterpriseInformation> type=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(d.getDictLabel())).collect(Collectors.toList()); |
|||
if(type!=null&&type.size()>0){ |
|||
StatisticsIndicator s=new StatisticsIndicator(); |
|||
s.setName(d.getDictLabel()); |
|||
s.setValue(type.size()); |
|||
s.setPercentage((double)type.size()/enterpriseInformationList.size()); |
|||
statisticsIndicatorList.add(s); |
|||
} |
|||
} |
|||
model.addAttribute("year",searchType.getYear()); |
|||
model.addAttribute("number2",enterpriseInformationList.size());//企业总数--Tap2
|
|||
model.addAttribute("number3","100%"); |
|||
return prefix+"/enterpriseFragment"; |
|||
} |
|||
public Boolean qyMake(List<String> stringList,String s){ |
|||
for (String string : stringList) { |
|||
if (s.startsWith(string)) { |
|||
return true; |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
public Boolean jdMake(String qy,List<DictData> stringList,String s){ |
|||
if(qy.equals("光明区")){ |
|||
for(DictData d:stringList){ |
|||
if(s.startsWith("深圳市"+qy+d.getDictLabel())||s.startsWith("深圳市光明新区"+d.getDictLabel())){ |
|||
return true; |
|||
} |
|||
} |
|||
}else { |
|||
for (DictData d : stringList) { |
|||
if (s.startsWith("深圳市"+qy+d.getDictLabel())) { |
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
public Boolean typeMake(List<DictData> dictDataList,String s){ |
|||
for(DictData d:dictDataList){ |
|||
if(s.contains(d.getDictLabel())){ |
|||
return true; |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
private EnterpriseInformation dateMake(SearchType searchType){ |
|||
LocalDate localDate=LocalDate.now(); |
|||
DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|||
if(searchType.getYear()==null||"".equals(searchType.getYear())){ |
|||
searchType.setYear(localDate.getYear()+""); |
|||
} |
|||
EnterpriseInformation enterpriseInformation=new EnterpriseInformation(); |
|||
if(searchType.getMonth()!=null&&!"".equals(searchType.getMonth())){ |
|||
LocalDate beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(Integer.valueOf(searchType.getMonth())).withDayOfMonth(1); |
|||
LocalDate endTime = beginTime.with(TemporalAdjusters.lastDayOfMonth()); |
|||
enterpriseInformation.setBeginTime(str.format(beginTime)); |
|||
enterpriseInformation.setEndTime(str.format(endTime)); |
|||
}else if(searchType.getQuarter()!=null&&!"".equals(searchType.getQuarter())){ |
|||
LocalDate beginTime=LocalDate.now(); |
|||
LocalDate endTime=LocalDate.now(); |
|||
switch (searchType.getQuarter()){ |
|||
case "1": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(1).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(3).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "2": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(4).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(6).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "3": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(7).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(9).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "4": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(10).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(12).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
} |
|||
enterpriseInformation.setBeginTime(str.format(beginTime)); |
|||
enterpriseInformation.setEndTime(str.format(endTime)); |
|||
}else { |
|||
LocalDate beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(1).withDayOfMonth(1); |
|||
LocalDate endTime = localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth()); |
|||
enterpriseInformation.setBeginTime(str.format(beginTime)); |
|||
enterpriseInformation.setEndTime(str.format(endTime)); |
|||
} |
|||
return enterpriseInformation; |
|||
} |
|||
public List<Integer> yearMake(){ |
|||
int current=LocalDate.now().getYear(); |
|||
List<Integer> yearList=new ArrayList<>(); |
|||
for(int i=current;i>=2023;i--){ |
|||
yearList.add(i); |
|||
} |
|||
return yearList; |
|||
} |
|||
} |
|||
@ -0,0 +1,139 @@ |
|||
package com.zdxt.code.controller; |
|||
|
|||
import com.zdxt.code.domain.ComplaintStatistics; |
|||
import com.zdxt.code.domain.EnforcementRegistration; |
|||
import com.zdxt.code.domain.LawEnforcementWarningList; |
|||
import com.zdxt.code.domain.SearchType; |
|||
import com.zdxt.code.service.ILawEnforcementWarningListService; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
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.ResponseBody; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.time.format.DateTimeFormatter; |
|||
import java.time.temporal.TemporalAdjusters; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Controller |
|||
@RequestMapping("/code/statisticsWarning") |
|||
public class StatisticsWarningController extends BaseController { |
|||
private String prefix = "project/code/statisticsWarning"; |
|||
@Autowired |
|||
private ILawEnforcementWarningListService iLawEnforcementWarningListService; |
|||
@RequiresPermissions("code:statisticsWarning:view") |
|||
@GetMapping() |
|||
public String StatisticsWarning(Model model) |
|||
{ |
|||
LawEnforcementWarningList lawEnforcementWarningList=new LawEnforcementWarningList(); |
|||
LocalDate localDate=LocalDate.now(); |
|||
DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|||
LocalDate beginTime=localDate.withYear(Integer.valueOf(localDate.getYear())).withMonth(1).withDayOfMonth(1); |
|||
LocalDate endTime = localDate.withYear(Integer.valueOf(localDate.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth()); |
|||
lawEnforcementWarningList.setBeginTime(str.format(beginTime)); |
|||
lawEnforcementWarningList.setEndTime(str.format(endTime)); |
|||
List<LawEnforcementWarningList> lawEnforcementWarningListList=iLawEnforcementWarningListService.selectLawEnforcementWarningListList1(lawEnforcementWarningList); |
|||
int Number1=0; |
|||
for(LawEnforcementWarningList l:lawEnforcementWarningListList){ |
|||
Number1=Number1+l.getEnforcementNumber(); |
|||
} |
|||
model.addAttribute("yearList",yearMake()); |
|||
model.addAttribute("year",localDate.getYear()); |
|||
model.addAttribute("Number1",Number1); |
|||
model.addAttribute("Number2",lawEnforcementWarningListList.size()); |
|||
return prefix + "/statisticsWarning"; |
|||
} |
|||
@RequiresPermissions("code:statisticsWarning:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo statisticsWarningList(SearchType searchType) { |
|||
LawEnforcementWarningList lawEnforcementWarningList=dateMake(searchType); |
|||
if(searchType.getBureauDeptId()!=null&&!"".equals(searchType.getBureauDeptId())){ |
|||
lawEnforcementWarningList.setEnforcementDepartment(searchType.getBureauDeptId()); |
|||
} |
|||
if(searchType.getName()!=null&&!"".equals(searchType.getName())){ |
|||
lawEnforcementWarningList.setEnterpriseName(searchType.getName()); |
|||
} |
|||
startPage(); |
|||
List<LawEnforcementWarningList> lawEnforcementWarningListList=iLawEnforcementWarningListService.selectLawEnforcementWarningListList1(lawEnforcementWarningList); |
|||
return getDataTable(lawEnforcementWarningListList); |
|||
} |
|||
@RequiresPermissions("code:statisticsWarning:list") |
|||
@GetMapping("/searchType") |
|||
public String searchType(SearchType searchType,Model model){ |
|||
LawEnforcementWarningList lawEnforcementWarningList=dateMake(searchType); |
|||
if(searchType.getBureauDeptId()!=null&&!"".equals(searchType.getBureauDeptId())){ |
|||
lawEnforcementWarningList.setEnforcementDepartment(searchType.getBureauDeptId()); |
|||
} |
|||
if(searchType.getName()!=null&&!"".equals(searchType.getName())){ |
|||
lawEnforcementWarningList.setEnterpriseName(searchType.getName()); |
|||
} |
|||
List<LawEnforcementWarningList> lawEnforcementWarningListList=iLawEnforcementWarningListService.selectLawEnforcementWarningListList1(lawEnforcementWarningList); |
|||
int Number1=0; |
|||
for(LawEnforcementWarningList l:lawEnforcementWarningListList){ |
|||
Number1=Number1+l.getEnforcementNumber(); |
|||
} |
|||
model.addAttribute("year",searchType.getYear()); |
|||
model.addAttribute("Number1",Number1); |
|||
model.addAttribute("Number2",lawEnforcementWarningListList.size()); |
|||
return prefix+"/fragmentW"; |
|||
} |
|||
private LawEnforcementWarningList dateMake(SearchType searchType){ |
|||
LocalDate localDate=LocalDate.now(); |
|||
DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|||
if(searchType.getYear()==null||"".equals(searchType.getYear())){ |
|||
searchType.setYear(localDate.getYear()+""); |
|||
} |
|||
LawEnforcementWarningList lawEnforcementWarningList =new LawEnforcementWarningList(); |
|||
if(searchType.getMonth()!=null&&!"".equals(searchType.getMonth())){ |
|||
LocalDate beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(Integer.valueOf(searchType.getMonth())).withDayOfMonth(1); |
|||
LocalDate endTime = beginTime.with(TemporalAdjusters.lastDayOfMonth()); |
|||
lawEnforcementWarningList.setBeginTime(str.format(beginTime)); |
|||
lawEnforcementWarningList.setEndTime(str.format(endTime)); |
|||
}else if(searchType.getQuarter()!=null&&!"".equals(searchType.getQuarter())){ |
|||
LocalDate beginTime=LocalDate.now(); |
|||
LocalDate endTime=LocalDate.now(); |
|||
switch (searchType.getQuarter()){ |
|||
case "1": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(1).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(3).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "2": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(4).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(6).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "3": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(7).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(9).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
case "4": |
|||
beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(10).withDayOfMonth(1); |
|||
endTime=beginTime.withMonth(12).with(TemporalAdjusters.lastDayOfMonth()); |
|||
break; |
|||
} |
|||
lawEnforcementWarningList.setBeginTime(str.format(beginTime)); |
|||
lawEnforcementWarningList.setEndTime(str.format(endTime)); |
|||
}else { |
|||
LocalDate beginTime=localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(1).withDayOfMonth(1); |
|||
LocalDate endTime = localDate.withYear(Integer.valueOf(searchType.getYear())).withMonth(12).with(TemporalAdjusters.lastDayOfMonth()); |
|||
lawEnforcementWarningList.setBeginTime(str.format(beginTime)); |
|||
lawEnforcementWarningList.setEndTime(str.format(endTime)); |
|||
} |
|||
return lawEnforcementWarningList; |
|||
} |
|||
public List<Integer> yearMake(){ |
|||
int current=LocalDate.now().getYear(); |
|||
List<Integer> yearList=new ArrayList<>(); |
|||
for(int i=current;i>=2023;i--){ |
|||
yearList.add(i); |
|||
} |
|||
return yearList; |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.zdxt.code.service; |
|||
|
|||
public interface StatisticalPaneService { |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package com.zdxt.code.service.impl; |
|||
|
|||
import com.zdxt.code.service.StatisticalPaneService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class StatisticalPaneImpl implements StatisticalPaneService { |
|||
} |
|||
Loading…
Reference in new issue