Browse Source

统计修改

v4
zouyx 2 years ago
parent
commit
58a3279e1c
  1. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/complaintStatic/complaintStatic.html
  2. 56
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/staticRegistration.html
  3. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html
  4. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/ComplaintStaticController.java
  5. 44
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementCheckStatisticsController.java
  6. 46
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java
  7. 170
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SearchType.java
  8. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/EnforcementCheckStatisticsService.java
  9. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java
  10. 277
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementCheckStatisticsImpl.java
  11. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  12. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/Zfryjdm2405301Mapper.xml

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

@ -620,6 +620,7 @@
function downloadC1(){
var currentId=$('form').eq(0).attr('id');
var params = $.common.formToJSON(currentId);
delete params.dateSearch;
$.ajax({
type: "POST",
data: JSON.stringify(params),
@ -642,6 +643,7 @@
function downloadC2(){
var currentId=$('form').eq(1).attr('id');
var params = $.common.formToJSON(currentId);
delete params.dateSearch;
$.ajax({
type: "POST",
data: JSON.stringify(params),

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

@ -90,7 +90,9 @@
<a class="btn btn-success btn-sm" onclick="search1()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="resetR()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-warning btn-sm" onclick="downloadR()"><i class="fa fa-share-square-o"></i> 导出</a>
<!--<a class="btn btn-warning btn-sm" onclick="downloadzf1()"><i class="fa fa-share-square-o"></i> 根据自定义时间导出执法监督码使用情况</a>-->
</li>
<!--<a class="btn btn-warning btn-sm" onclick="download2()"><i class="fa fa-share-square-o"></i> 导出企业信息</a>-->
</ul>
</div>
</form>
@ -443,6 +445,60 @@
document.getElementById("jd").value='';
}
}
function downloadzf1(){
let params={
beginTime:$('#startTime').val(),
endTime:$('#endTime').val()
}
if($('#startTime').val()==null||$('#startTime').val()==""){
params.beginTime="2024-08-24";
}
if($('#endTime').val()==null||$('#endTime').val()==""){
let now=new Date();
params.endTime=now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate();
}
console.log(params);
$.ajax({
type: "POST",
contentType: 'application/json',
data: JSON.stringify(params),
//设置响应类型
xhrFields: {responseType: "blob"},
url: prefix+"/zfjdm",
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', "执法监督码"+params.beginTime+"至"+params.endTime+"使用情况.xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link)
}
})
}
function download2(){
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+"/export",
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>
</body>
</html>

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

@ -188,7 +188,7 @@
<li>
<a class="btn btn-success btn-sm" onclick="searchP()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="restP()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-warning btn-sm" onclick="download1()"><i class="fa fa-share-square-o"></i> 导出</a>
<!--<a class="btn btn-warning btn-sm" onclick="download1()"><i class="fa fa-share-square-o"></i> 导出</a>-->
</li>
</ul>
</div>

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

@ -67,8 +67,8 @@ public class ComplaintStaticController extends BaseController {
public String searchType1(SearchType searchType,Model model){
model.addAttribute("year",searchType.getYear());
ComplaintStatistics complaintStatistics=dateMake(searchType);
if(searchType.getCType()!=null&&!"".equals(searchType.getCType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getCType()));
if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getcType()));
}
Map<String, Dept> deptMap=new HashMap<>();
if(searchType.getName()!=null&&!"".equals(searchType.getName())){//搜索条件内有投诉对象时
@ -105,8 +105,8 @@ public class ComplaintStaticController extends BaseController {
@ResponseBody
public TableDataInfo list(SearchType searchType) {
ComplaintStatistics complaintStatistics=dateMake(searchType);
if(searchType.getCType()!=null&&!"".equals(searchType.getCType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getCType()));
if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getcType()));
}
if(searchType.getName()!=null&&!"".equals(searchType.getName())){//搜索条件内有投诉对象时
complaintStatistics.setComplaintDepartmentId(searchType.getName());

44
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementCheckStatisticsController.java

@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@ -223,4 +224,47 @@ public class EnforcementCheckStatisticsController extends BaseController {
List<StatisticsIndicatorPart> statisticsIndicatorPartList =enforcementCheckStatisticsService.statisticsIndicatorPart3(searchType);
return ZDResponse.success("成功",statisticsIndicatorPartList);
}
@PostMapping("/zfjdm")
@ResponseBody
public void exportZFJDM(HttpServletResponse httpServletResponse,@RequestBody SearchType searchType) throws IOException, ParseException {
EnforcementCheckStatistics enforcementCheckStatistics=new EnforcementCheckStatistics();
/* String month1=StringUtils.join(month,",");
enforcementCheckStatistics.setYear(year);
enforcementCheckStatistics.setMonth(month1);*/
enforcementCheckStatistics.setStartTime(searchType.getBeginTime());
enforcementCheckStatistics.setEndTime(searchType.getEndTime());
enforcementCheckStatistics.setNowTime(new Date());
List<EnforcementCheckStatistics> enforcementCheckStatisticsList=enforcementCheckStatisticsService.selectAllStatisticsList(enforcementCheckStatistics);
List<String> inOrderList=new ArrayList<>();
Collections.addAll(inOrderList,"福田区","罗湖区","盐田区","南山区","宝安区","龙岗区","龙华区",
"坪山区","光明区","大鹏新区","深汕特别合作区");
Map<String,List<EnforcementCheckStatistics>> enforcementCheckStatisticsMap=new HashMap<>();
for(int i=0;i<inOrderList.size();i++){
String area=inOrderList.get(i);
//List<EnforcementCheckStatistics> e1=enforcementCheckStatisticsList.stream().filter(item->item.getEnterpriseAddress().contains(area)).collect(Collectors.toList());
List<EnforcementCheckStatistics> e1=new ArrayList<>();
if(area.equals("光明区")){//光明区特殊处理
//e1 = enforcementCheckStatisticsList.stream().collect(Collectors.groupingBy(item -> ((item.getEnterpriseAddress().contains(area)||(item.getEnterpriseAddress().contains("光明新区")))? area : "其他")));
e1=enforcementCheckStatisticsList.stream().filter(item->(item.getEnterpriseAddress().contains(area)||item.getEnterpriseAddress().contains("光明新区"))).collect(Collectors.toList());
}else {
// e1 = enforcementCheckStatisticsList.stream().collect(Collectors.groupingBy(item -> (item.getEnterpriseAddress().contains(area)? area : "其他")));
e1=enforcementCheckStatisticsList.stream().filter(item->item.getEnterpriseAddress().contains(area)).collect(Collectors.toList());
}
enforcementCheckStatisticsMap.put(area,e1);
}
//将地址不属于各个区的筛出来放入执法记录map
List<EnforcementCheckStatistics> qt=enforcementCheckStatisticsList.stream().filter(item->!(
item.getEnterpriseAddress().contains("福田区")||item.getEnterpriseAddress().contains("罗湖区")||
item.getEnterpriseAddress().contains("盐田区")||item.getEnterpriseAddress().contains("南山区")||
item.getEnterpriseAddress().contains("宝安区")||item.getEnterpriseAddress().contains("龙岗区")||
item.getEnterpriseAddress().contains("龙华区")||item.getEnterpriseAddress().contains("坪山区")||
item.getEnterpriseAddress().contains("大鹏新区")||item.getEnterpriseAddress().contains("深汕特别合作区")||
item.getEnterpriseAddress().contains("光明区")||item.getEnterpriseAddress().contains("光明新区")))
.collect(Collectors.toList());
enforcementCheckStatisticsMap.put("其他",qt);
List<EnterpriseStreet> enterpriseStreet=enforcementCheckStatisticsService.selectEnterpriseStreetList();
inOrderList.add("其他");
enforcementCheckStatisticsService.ZFJDM(httpServletResponse,enforcementCheckStatistics,inOrderList,enforcementCheckStatisticsMap,enterpriseStreet);
}
}

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

@ -3,6 +3,7 @@ package com.zdxt.code.controller;
import java.io.IOException;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
@ -17,6 +18,7 @@ import com.zdxt.code.domain.EnterpriseLawEnforcement;
import com.zdxt.code.domain.LinkageDict;
import com.zdxt.code.domain.dto.EnforcementRegistrationDto;
import com.zdxt.code.domain.*;
import com.zdxt.code.service.EnforcementCheckStatisticsService;
import com.zdxt.code.service.ILinkageDictService;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController;
@ -58,6 +60,8 @@ public class EnforcementRegistrationController extends BaseController
@Autowired private IDictDataService iDictDataService;
@Autowired
private IDeptService iDeptService;
@Autowired
private EnforcementCheckStatisticsService enforcementCheckStatisticsService;
@RequiresPermissions("code:registration:view")
@GetMapping()
@ -706,4 +710,46 @@ public class EnforcementRegistrationController extends BaseController
workbook.write(httpServletResponse.getOutputStream());
workbook.close();
}
@PostMapping("/zfjdm")
@ResponseBody
public void exportZFJDM(HttpServletResponse httpServletResponse,@RequestBody SearchType searchType) throws IOException, ParseException {
EnforcementCheckStatistics enforcementCheckStatistics=new EnforcementCheckStatistics();
/* String month1=StringUtils.join(month,",");
enforcementCheckStatistics.setYear(year);
enforcementCheckStatistics.setMonth(month1);*/
enforcementCheckStatistics.setStartTime(searchType.getBeginTime());
enforcementCheckStatistics.setEndTime(searchType.getEndTime());
enforcementCheckStatistics.setNowTime(new Date());
List<EnforcementCheckStatistics> enforcementCheckStatisticsList=enforcementCheckStatisticsService.selectAllStatisticsList(enforcementCheckStatistics);
List<String> inOrderList=new ArrayList<>();
Collections.addAll(inOrderList,"福田区","罗湖区","盐田区","南山区","宝安区","龙岗区","龙华区",
"坪山区","光明区","大鹏新区","深汕特别合作区");
Map<String,List<EnforcementCheckStatistics>> enforcementCheckStatisticsMap=new HashMap<>();
for(int i=0;i<inOrderList.size();i++){
String area=inOrderList.get(i);
//List<EnforcementCheckStatistics> e1=enforcementCheckStatisticsList.stream().filter(item->item.getEnterpriseAddress().contains(area)).collect(Collectors.toList());
List<EnforcementCheckStatistics> e1=new ArrayList<>();
if(area.equals("光明区")){//光明区特殊处理
//e1 = enforcementCheckStatisticsList.stream().collect(Collectors.groupingBy(item -> ((item.getEnterpriseAddress().contains(area)||(item.getEnterpriseAddress().contains("光明新区")))? area : "其他")));
e1=enforcementCheckStatisticsList.stream().filter(item->(item.getEnterpriseAddress().contains(area)||item.getEnterpriseAddress().contains("光明新区"))).collect(Collectors.toList());
}else {
// e1 = enforcementCheckStatisticsList.stream().collect(Collectors.groupingBy(item -> (item.getEnterpriseAddress().contains(area)? area : "其他")));
e1=enforcementCheckStatisticsList.stream().filter(item->item.getEnterpriseAddress().contains(area)).collect(Collectors.toList());
}
enforcementCheckStatisticsMap.put(area,e1);
}
//将地址不属于各个区的筛出来放入执法记录map
List<EnforcementCheckStatistics> qt=enforcementCheckStatisticsList.stream().filter(item->!(
item.getEnterpriseAddress().contains("福田区")||item.getEnterpriseAddress().contains("罗湖区")||
item.getEnterpriseAddress().contains("盐田区")||item.getEnterpriseAddress().contains("南山区")||
item.getEnterpriseAddress().contains("宝安区")||item.getEnterpriseAddress().contains("龙岗区")||
item.getEnterpriseAddress().contains("龙华区")||item.getEnterpriseAddress().contains("坪山区")||
item.getEnterpriseAddress().contains("大鹏新区")||item.getEnterpriseAddress().contains("深汕特别合作区")||
item.getEnterpriseAddress().contains("光明区")||item.getEnterpriseAddress().contains("光明新区")))
.collect(Collectors.toList());
enforcementCheckStatisticsMap.put("其他",qt);
List<EnterpriseStreet> enterpriseStreet=enforcementCheckStatisticsService.selectEnterpriseStreetList();
inOrderList.add("其他");
enforcementCheckStatisticsService.ZFJDM(httpServletResponse,enforcementCheckStatistics,inOrderList,enforcementCheckStatisticsMap,enterpriseStreet);
}
}

170
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SearchType.java

@ -5,7 +5,7 @@ import lombok.Data;
import java.util.List;
@Data
public class SearchType {
private List<String> areaStreet;
private List<String> deptId;
@ -30,6 +30,174 @@ public class SearchType {
private String checkTypeStr;
private String complaintTypeStr;
public List<String> getAreaStreet() {
return areaStreet;
}
public void setAreaStreet(List<String> areaStreet) {
this.areaStreet = areaStreet;
}
public List<String> getDeptId() {
return deptId;
}
public void setDeptId(List<String> deptId) {
this.deptId = deptId;
}
public List<String> getEnterpriseType() {
return enterpriseType;
}
public void setEnterpriseType(List<String> enterpriseType) {
this.enterpriseType = enterpriseType;
}
public List<Integer> getCheckType() {
return checkType;
}
public void setCheckType(List<Integer> checkType) {
this.checkType = checkType;
}
public List<Integer> getComplaintType() {
return complaintType;
}
public void setComplaintType(List<Integer> complaintType) {
this.complaintType = complaintType;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getBureauDeptId() {
return bureauDeptId;
}
public void setBureauDeptId(String bureauDeptId) {
this.bureauDeptId = bureauDeptId;
}
public String getcType() {
return cType;
}
public void setcType(String cType) {
this.cType = cType;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getDateType() {
return dateType;
}
public void setDateType(Integer dateType) {
this.dateType = dateType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getNameId() {
return nameId;
}
public void setNameId(Integer nameId) {
this.nameId = nameId;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getQuarter() {
return quarter;
}
public void setQuarter(String quarter) {
this.quarter = quarter;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getQy() {
return qy;
}
public void setQy(String qy) {
this.qy = qy;
}
public String getJd() {
return jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public String getEnterpriseTypeStr() {
return enterpriseTypeStr;
}
public void setEnterpriseTypeStr(String enterpriseTypeStr) {
this.enterpriseTypeStr = enterpriseTypeStr;
}
public String getCheckTypeStr() {
return checkTypeStr;
}
public void setCheckTypeStr(String checkTypeStr) {
this.checkTypeStr = checkTypeStr;
}
public String getComplaintTypeStr() {
return complaintTypeStr;
}
public void setComplaintTypeStr(String complaintTypeStr) {
this.complaintTypeStr = complaintTypeStr;
}
public SearchType(){}
public SearchType(SearchType searchType){
this.areaStreet=searchType.getAreaStreet();

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

@ -3,6 +3,7 @@ package com.zdxt.code.service;
import com.zdxt.code.domain.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
@ -51,6 +52,7 @@ public interface EnforcementCheckStatisticsService {
*excel导出(执法监督码使用情况)
*/
public void excelExport(HttpServletResponse response, EnforcementCheckStatistics enforcementCheckStatistics, List<String> areaAllList, Map<String, List<EnforcementCheckStatistics>> list, List<EnterpriseStreet> enterpriseStreet) throws ParseException;
public void ZFJDM(HttpServletResponse response, EnforcementCheckStatistics enforcementCheckStatistics, List<String> areaAllList, Map<String, List<EnforcementCheckStatistics>> list, List<EnterpriseStreet> enterpriseStreet) throws IOException, ParseException;
/**
*excel导出(企业信息)

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

@ -156,8 +156,8 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
}
@Override
public List<ComplaintStatistics> list1(SearchType searchType,ComplaintStatistics complaintStatistics){
if(searchType.getCType()!=null&&!"".equals(searchType.getCType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getCType()));
if(searchType.getcType()!=null&&!"".equals(searchType.getcType())) {
complaintStatistics.setComplaintType(Integer.parseInt(searchType.getcType()));
}
Map<String, Dept> deptMap=new HashMap<>();
if(searchType.getName()!=null&&!"".equals(searchType.getName())){//搜索条件内有投诉对象时

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

@ -2205,4 +2205,281 @@ public class EnforcementCheckStatisticsImpl implements EnforcementCheckStatistic
}
return searchType;
}
@Override
public void ZFJDM(HttpServletResponse response, EnforcementCheckStatistics enforcementCheckStatistics, List<String> inOrderList, Map<String, List<EnforcementCheckStatistics>> list,List<EnterpriseStreet> enterpriseStreet) throws ParseException, IOException {
//创建HSSFWorkbook对象(excel文档对象)
HSSFWorkbook wb=new HSSFWorkbook();
//建立新的sheet对象(sheet:表单)
HSSFSheet sheet= wb.createSheet("行政执法检查统计");
//自适应列宽
sheet.setDefaultColumnWidth(20);//全局
sheet.setColumnWidth(0,2500);//某列
sheet.setColumnWidth(1,2500);
//在sheet里创建第一行,参数为excel行数,0~65535
HSSFRow row1=sheet.createRow(0);
row1.setHeightInPoints(60);
//字体样式
HSSFFont font1=wb.createFont();
font1.setFontName("微软雅黑");
font1.setBold(true);
font1.setFontHeightInPoints((short) 16);
HSSFFont font2=wb.createFont();
font2.setFontName("微软雅黑");
font2.setBold(true);
font2.setFontHeightInPoints((short) 11);
HSSFFont font3=wb.createFont();
font3.setFontName("微软雅黑");
font3.setFontHeightInPoints((short) 11);
//第一行样式
HSSFCellStyle styleRow1=wb.createCellStyle();
styleRow1.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
styleRow1.setWrapText(true);//换行
styleRow1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
styleRow1.setAlignment(HorizontalAlignment.CENTER);
styleRow1.setVerticalAlignment(VerticalAlignment.CENTER);
styleRow1.setBorderTop(BorderStyle.THIN);//边框默认黑色
styleRow1.setBorderRight(BorderStyle.THIN);
styleRow1.setBorderBottom(BorderStyle.THIN);
styleRow1.setBorderLeft(BorderStyle.THIN);
styleRow1.setFont(font1);
//第二行样式
HSSFCellStyle styleRow2=wb.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);
//内容样式
HSSFCellStyle styleRow3=wb.createCellStyle();
styleRow3.setAlignment(HorizontalAlignment.CENTER);
styleRow3.setVerticalAlignment(VerticalAlignment.CENTER);
styleRow3.setBorderTop(BorderStyle.THIN);
styleRow3.setBorderRight(BorderStyle.THIN);
styleRow3.setBorderBottom(BorderStyle.THIN);
styleRow3.setBorderLeft(BorderStyle.THIN);
styleRow3.setFont(font3);
//创建单元格,参数为列数,0~255
HSSFCell cell1=row1.createCell(0);
//修改单元格内容
//(统计范围:8月14日至9月23日 统计时间:2024年9月23日 11时30分 企业赋码总数量:10697家)
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sYear=new SimpleDateFormat("yyyy");
SimpleDateFormat sMonther=new SimpleDateFormat("MM");
SimpleDateFormat sDay=new SimpleDateFormat("dd");
String strStart=sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getStartTime()))+"日";
String strEnd=sMonther.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"月"+sDay.format(simpleDateFormat.parse(enforcementCheckStatistics.getEndTime()))+"日";
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.setCellStyle(styleRow1);
//合并单元格--CellRangeAddress(起始行,结束行,起始列,结束列)
sheet.addMergedRegion(new CellRangeAddress(0,0,0,11));
//在sheet里创建第二行
HSSFRow row2=sheet.createRow(1);
List<String> headRow2List=new ArrayList<>();
Collections.addAll(headRow2List,"序号","区域","企业","执法主体","执法人员","检查事项","执法检查次数",
"2次及以下","3至4次\n(黄色)","5至6次\n(橙色)","7次及以上\n(红色)","备注");
setStyle(headRow2List,row2,styleRow2);
int rowNum=1;
//遍历地区list
for(int i=0;i<inOrderList.size();i++){
String area=inOrderList.get(i);//取出地区名
if((list.get(area)!=null) && (!list.get(area).isEmpty())){//判断该区执法记录是否为空
List<EnforcementCheckStatistics> e=list.get(area);
if(e.size()>1){//当该区执法记录大于两条时才合并序号、区列
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+e.size(),0,0));
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, rowNum+e.size(),1,1));
hbStyle(rowNum+1, rowNum+e.size(),0,0,sheet);
hbStyle(rowNum+1, rowNum+e.size(),1,1,sheet);
}
//非空时将执法以企业划分<企业税号,合计>
Map<String,Long> qyGroup1=e.stream().collect(Collectors.groupingBy((m -> m.getEnterpriseNumber()== null ?
"" : m.getEnterpriseNumber()),Collectors.counting()));
//将以企业分好组的数据取出
Map<String,List<EnforcementCheckStatistics>> qyGroup2=e.stream().collect(Collectors.groupingBy(m -> m.getEnterpriseNumber()== null ?
"" : m.getEnterpriseNumber()));
for(String k:qyGroup2.keySet()){//同企业内遍历执法
//if分组数<2则后续无需遍历
if(qyGroup1.get(k)<2){
HSSFRow row = sheet.createRow(++rowNum);
List<String> cellList=new ArrayList<>();
Collections.addAll(cellList,""+(i+1),area,qyGroup2.get(k).get(0).getEnterpriseName(),qyGroup2.get(k).get(0).getBureauDeptName(),
qyGroup2.get(k).get(0).getLawEnforcerTwo(),qyGroup2.get(k).get(0).getLawEnforcementItem(),"1",
"1","","","",qyGroup2.get(k).get(0).getRemark());
//setStyle(cellList,row,styleRow3);
setStyle1(i+1,area,qyGroup2.get(k).get(0).getEnterpriseName(),qyGroup2.get(k).get(0).getBureauDeptName(),
qyGroup2.get(k).get(0).getLawEnforcerTwo(),qyGroup2.get(k).get(0).getLawEnforcementItem(),1,1,0,0,0,
qyGroup2.get(k).get(0).getRemark(),row,styleRow3);
}else {
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+qyGroup1.get(k)),2,2));//合并企业
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+qyGroup1.get(k)),7,7));
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+qyGroup1.get(k)),8,8));
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+qyGroup1.get(k)),9,9));
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+qyGroup1.get(k)),10,10));
hbStyle(rowNum+1, (int) (rowNum+qyGroup1.get(k)),2,2,sheet);
hbStyle(rowNum+1, (int) (rowNum+qyGroup1.get(k)),7,7,sheet);
hbStyle(rowNum+1, (int) (rowNum+qyGroup1.get(k)),8,8,sheet);
hbStyle(rowNum+1, (int) (rowNum+qyGroup1.get(k)),9,9,sheet);
hbStyle(rowNum+1, (int) (rowNum+qyGroup1.get(k)),10,10,sheet);
//以同企业内,以执法分组
Map<String, Long> zfGroup1 = qyGroup2.get(k).stream().collect(Collectors.groupingBy((m -> m.getBureauDeptId()== null ?
"" : m.getBureauDeptId()), Collectors.counting()));
Map<String, List<EnforcementCheckStatistics>> zfGroup2 = qyGroup2.get(k).stream().collect(Collectors.groupingBy(m -> m.getBureauDeptId()== null ?
"" : m.getBureauDeptId()));
for (String zf : zfGroup2.keySet()) {
//if 分组数<2则后续无需遍历
if(zfGroup1.get(zf)<2){
HSSFRow row = sheet.createRow(++rowNum);
List<String> cellList=new ArrayList<>();
if(qyGroup1.get(k)<3){
Collections.addAll(cellList,""+(i+1),area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),"1",
""+qyGroup1.get(k),"","","",zfGroup2.get(zf).get(0).getRemark());
setStyle1(i+1,area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),1,qyGroup1.get(k),
0,0,0,zfGroup2.get(zf).get(0).getRemark(),row,styleRow3);
} else if (3<=qyGroup1.get(k)&&qyGroup1.get(k)<=4) {
Collections.addAll(cellList,""+(i+1),area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),"1",
"",""+qyGroup1.get(k),"","",zfGroup2.get(zf).get(0).getRemark());
setStyle1(i+1,area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),1,
0,qyGroup1.get(k),0,0,zfGroup2.get(zf).get(0).getRemark(),row,styleRow3);
} else if (5<=qyGroup1.get(k)&&qyGroup1.get(k)<=6) {
Collections.addAll(cellList,""+(i+1),area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),"1",
"","",""+qyGroup1.get(k),"",zfGroup2.get(zf).get(0).getRemark());
setStyle1(i+1,area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),1,
0,0,qyGroup1.get(k),0,zfGroup2.get(zf).get(0).getRemark(),row,styleRow3);
}else {
Collections.addAll(cellList,""+(i+1),area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),"1",
"","","",""+qyGroup1.get(k),zfGroup2.get(zf).get(0).getRemark());
setStyle1(i+1,area,zfGroup2.get(zf).get(0).getEnterpriseName(),zfGroup2.get(zf).get(0).getBureauDeptName(),
zfGroup2.get(zf).get(0).getLawEnforcerTwo(),zfGroup2.get(zf).get(0).getLawEnforcementItem(),1,
0,0,0,qyGroup1.get(k),zfGroup2.get(zf).get(0).getRemark(),row,styleRow3);
}
//setStyle(cellList,row,styleRow3);
}else{
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+zfGroup1.get(zf)),3,3));//合并执法
hbStyle(rowNum+1, (int) (rowNum+zfGroup1.get(zf)),3,3,sheet);
//以同企业、执法内,以执法人员分组
Map<String, Long> ryGroup1 = zfGroup2.get(zf).stream().collect(Collectors.groupingBy((m -> m.getLawEnforcerTwo()== null ?
"" : m.getLawEnforcerTwo()), Collectors.counting()));
Map<String, List<EnforcementCheckStatistics>> ryGroup2 = zfGroup2.get(zf).stream().collect(Collectors.groupingBy(m -> m.getLawEnforcerTwo()== null ?
"" : m.getLawEnforcerTwo()));
for (String ry : ryGroup2.keySet()) {
if(ryGroup1.get(ry)<2){
HSSFRow row = sheet.createRow(++rowNum);
List<String> cellList=new ArrayList<>();
if(qyGroup1.get(k)<3){
Collections.addAll(cellList,""+(i+1),area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),"1",
""+qyGroup1.get(k),"","","",ryGroup2.get(ry).get(0).getRemark());
setStyle1(i+1,area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),1,
qyGroup1.get(k),0,0,0,ryGroup2.get(ry).get(0).getRemark(),row,styleRow3);
} else if (3<=qyGroup1.get(k)&&qyGroup1.get(k)<=4) {
Collections.addAll(cellList,""+(i+1),area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),"1",
"",""+qyGroup1.get(k),"","",ryGroup2.get(ry).get(0).getRemark());
setStyle1(i+1,area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),1,
0,qyGroup1.get(k),0,0,ryGroup2.get(ry).get(0).getRemark(),row,styleRow3);
} else if (5<=qyGroup1.get(k)&&qyGroup1.get(k)<=6) {
Collections.addAll(cellList,""+(i+1),area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),"1",
"","",""+qyGroup1.get(k),"",ryGroup2.get(ry).get(0).getRemark());
setStyle1(i+1,area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),1,
0,0,qyGroup1.get(k),0,ryGroup2.get(ry).get(0).getRemark(),row,styleRow3);
}else {
Collections.addAll(cellList,""+(i+1),area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),"1",
"","","",""+qyGroup1.get(k),ryGroup2.get(ry).get(0).getRemark());
setStyle1(i+1,area,ryGroup2.get(ry).get(0).getEnterpriseName(),ryGroup2.get(ry).get(0).getBureauDeptName(),
ryGroup2.get(ry).get(0).getLawEnforcerTwo(),ryGroup2.get(ry).get(0).getLawEnforcementItem(),1,
0,0,0,qyGroup1.get(k),ryGroup2.get(ry).get(0).getRemark(),row,styleRow3);
}
//setStyle(cellList,row,styleRow3);
}else {
sheet.addMergedRegion(new CellRangeAddress(rowNum+1, (int) (rowNum+ryGroup1.get(ry)),4,4));//合并人员
hbStyle(rowNum+1, (int) (rowNum+ryGroup1.get(ry)),4,4,sheet);
//以同企业、执法、执法人员内,以执法事项分组
Map<String, Long> sxGroup1 = ryGroup2.get(ry).stream().collect(Collectors.groupingBy((m -> m.getLawEnforcementItem()== null ?
"" : m.getLawEnforcementItem()), Collectors.counting()));
Map<String, List<EnforcementCheckStatistics>> sxGroup2 = ryGroup2.get(ry).stream().collect(Collectors.groupingBy(m -> m.getLawEnforcementItem()== null ?
"" : m.getLawEnforcementItem()));
for (String sx : sxGroup2.keySet()) {
HSSFRow row = sheet.createRow(++rowNum);
List<String> cellList=new ArrayList<>();
if(qyGroup1.get(k)<3){
Collections.addAll(cellList,""+(i+1),area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx)+"",
""+qyGroup1.get(k),"","","",sxGroup2.get(sx).get(0).getRemark());
setStyle1(i+1,area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx),
qyGroup1.get(k),0,0,0,sxGroup2.get(sx).get(0).getRemark(),row,styleRow3);
} else if (3<=qyGroup1.get(k)&&qyGroup1.get(k)<=4) {
Collections.addAll(cellList,""+(i+1),area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx)+"",
"",""+qyGroup1.get(k),"","",sxGroup2.get(sx).get(0).getRemark());
setStyle1(i+1,area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx),
0,qyGroup1.get(k),0,0,sxGroup2.get(sx).get(0).getRemark(),row,styleRow3);
} else if (5<=qyGroup1.get(k)&&qyGroup1.get(k)<=6) {
Collections.addAll(cellList,""+(i+1),area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx)+"",
"","",""+qyGroup1.get(k),"",sxGroup2.get(sx).get(0).getRemark());
setStyle1(i+1,area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx),
0,0,qyGroup1.get(k),0,sxGroup2.get(sx).get(0).getRemark(),row,styleRow3);
}else {
Collections.addAll(cellList,""+(i+1),area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx)+"",
"","","",""+qyGroup1.get(k),sxGroup2.get(sx).get(0).getRemark());
setStyle1(i+1,area,sxGroup2.get(sx).get(0).getEnterpriseName(),sxGroup2.get(sx).get(0).getBureauDeptName(),
sxGroup2.get(sx).get(0).getLawEnforcerTwo(),sxGroup2.get(sx).get(0).getLawEnforcementItem(),sxGroup1.get(sx),
0,0,0,qyGroup1.get(k),sxGroup2.get(sx).get(0).getRemark(),row,styleRow3);
}
//setStyle(cellList,row,styleRow3);
if (sxGroup1.get(sx) >= 2) {
sheet.addMergedRegion(new CellRangeAddress(rowNum, (int) (rowNum - 1 + sxGroup1.get(sx)), 5, 5));//合并事项
sheet.addMergedRegion(new CellRangeAddress(rowNum, (int) (rowNum - 1 + sxGroup1.get(sx)), 6, 6));
hbStyle(rowNum, (int) (rowNum - 1 + sxGroup1.get(sx)), 5, 5,sheet);
hbStyle(rowNum, (int) (rowNum - 1 + sxGroup1.get(sx)), 6, 6,sheet);
hbStyle(rowNum, (int) (rowNum - 1 + sxGroup1.get(sx)), 11, 11,sheet);
rowNum = (int) (rowNum - 1 + sxGroup1.get(sx));
}
}
}
}
}
}
}
}
}else{
rowNum++;
HSSFRow row=sheet.createRow(rowNum);
List<String> cellList=new ArrayList<>();
Collections.addAll(cellList,""+(i+1),area,"","","","","","","","","","");
setStyle(cellList,row,styleRow3);
}
}
String fileName="执法监督码"+strStart+"至"+strEnd+"使用情况.xls";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
response.flushBuffer();
wb.write(response.getOutputStream());
wb.close();
}
}

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

@ -237,8 +237,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isComplaint != null "> and r.is_complaint = #{isComplaint}</if>
<if test="uniteCheck == '0'.toString()"> and r.unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and r.unite_check is null</if>
<if test="enforce == '0'.toString()"> and r.check_css is not null</if>
<if test="enforce == '1'.toString()"> and r.check_css is null</if>
<if test="enforce == '0'.toString()"> and r.check_css is null</if>
<if test="enforce == '1'.toString()"> and r.check_css is not null</if>
<if test="checkCategory != null and checkCategory != ''"> and r.check_category = #{checkCategory}</if>
<if test="checkCss != null and checkCss != ''"> and r.check_css = #{checkCss}</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->

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

@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="zfdw != null and zfdw != ''">and zfdw like concat('%',#{zfdw},'%')</if>
<if test="zfcode != null and zfcode != ''">and zfcode like concat('%',#{zfcode},'%')</if>
</where>) z
left join (select phoneNumber, certificateNumber from sys_user where law_certificate_num &lt;&gt; null and user_source = 0 and status='0' and del_flag='0' group by certificateNumber) s
left join (select phoneNumber, certificateNumber from sys_user where law_certificate_num is not null and user_source = 0 and status='0' and del_flag='0' group by certificateNumber) s
on z.sfzcode_encrypt=s.certificateNumber
group by z.sfzcode
</select>

Loading…
Cancel
Save