Browse Source

补充综合分析执法部门数量统计,检查计划数量接口

v4
chenrui 2 years ago
parent
commit
cb9be5e236
  1. 42
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java
  2. 44
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/dto/StatisticalPanelDto.java
  3. 17
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java
  4. 113
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
  5. 74
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/statisticalPanelServiceImpl.java
  6. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/statisticalPanelService.java
  7. 17
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

42
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java

@ -1,13 +1,14 @@
package com.zdxt.code.controller;
import com.zdxt.code.domain.StatisticsIndicator;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import com.zdxt.code.service.StatisticalPaneService;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@ -20,26 +21,57 @@ public class StatisticalPanelController extends BaseController {
@Autowired
private StatisticalPaneService statisticalPaneService;
/*@RequestMapping("/")
public ZDResponse home(){
return ZDResponse.success();
}*/
@RequestMapping("/statisticalPanelDeptAndUser")
@ResponseBody
public ZDResponse statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart){
StatisticalPanelDto statisticalPanelDto =
statisticalPaneService.statisticalPanelDeptAndUser(statisticsIndicatorPart);
return ZDResponse.success("执法部门统计",statisticalPanelDto);
}
/**
* 企业
* @param statisticsIndicatorPart
* @return
*/
@GetMapping("/enterprise")
@ResponseBody
public ZDResponse qy(StatisticsIndicatorPart statisticsIndicatorPart){
return ZDResponse.success("成功",statisticalPaneService.enterprise(statisticsIndicatorPart));
}
/**
* 登记
* @param statisticsIndicatorPart
* @return
*/
@GetMapping("/registration")
@ResponseBody
public ZDResponse registration(StatisticsIndicatorPart statisticsIndicatorPart){
return ZDResponse.success("成功",statisticalPaneService.registration(statisticsIndicatorPart));
}
/**
* 预警
* @param statisticsIndicatorPart
* @return
*/
@GetMapping("/warning")
@ResponseBody
public ZDResponse warning(StatisticsIndicatorPart statisticsIndicatorPart){
return ZDResponse.success("成功",statisticalPaneService.warning(statisticsIndicatorPart));
}
/**
* 投诉
* @param statisticsIndicatorPart
* @return
*/
@GetMapping("/complaint")
@ResponseBody
public ZDResponse complaint(StatisticsIndicatorPart statisticsIndicatorPart){

44
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/dto/StatisticalPanelDto.java

@ -0,0 +1,44 @@
package com.zdxt.code.domain.dto;
public class StatisticalPanelDto {
/**
* 执法部门数量
*/
private Integer deptTotal;
/**
* 执法人员数量
*/
private Integer userTotal;
/**
* 本单位执法人员数量
*/
private Integer oneselfUserTotal;
public Integer getDeptTotal() {
return deptTotal;
}
public void setDeptTotal(Integer deptTotal) {
this.deptTotal = deptTotal;
}
public Integer getUserTotal() {
return userTotal;
}
public void setUserTotal(Integer userTotal) {
this.userTotal = userTotal;
}
public Integer getOneselfUserTotal() {
return oneselfUserTotal;
}
public void setOneselfUserTotal(Integer oneselfUserTotal) {
this.oneselfUserTotal = oneselfUserTotal;
}
}

17
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java

@ -1,6 +1,7 @@
package com.zdxt.code.service;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
public interface StatisticalPaneService {
@ -11,4 +12,20 @@ public interface StatisticalPaneService {
StatisticsIndicatorPart warning(StatisticsIndicatorPart statisticsIndicatorPart);
StatisticsIndicatorPart complaint(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* 执法部门数量
* @param statisticsIndicatorPart
* @return
*/
StatisticalPanelDto statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* 统计执法计
* @param statisticsIndicatorPart
* @return
*/
StatisticsIndicatorPart statisticProgram(StatisticsIndicatorPart statisticsIndicatorPart);
}

113
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneImpl.java → lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java

@ -1,8 +1,14 @@
package com.zdxt.code.service.impl;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.DeptApi;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.project.system.dept.service.IDeptService;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.auth.project.system.user.service.IUserService;
import com.zdxt.code.domain.*;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import com.zdxt.code.mapper.StatisticalPanelMapper;
import com.zdxt.code.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -20,7 +26,7 @@ import java.util.stream.Collectors;
* 月度year!==null,quarter!==null,month!==null
*/
@Service
public class StatisticalPaneImpl implements StatisticalPaneService {
public class StatisticalPaneServiceImpl implements StatisticalPaneService {
@Autowired
private ComplaintStatisticsService complaintStatisticsService;
@Autowired
@ -38,6 +44,22 @@ public class StatisticalPaneImpl implements StatisticalPaneService {
@Autowired
private IDeptService iDeptService;
@Autowired
private StatisticalPanelMapper statisticalPanelMapper;
@Autowired
private UserApi userApi;
@Autowired
private DeptApi deptApi;
@Autowired
private IDictDataService dictDataService;
@Autowired
private IUserService userService;
@Autowired
private IZfryjdm2405301Service iZfryjdm2405301Service;
/**
* 企业--无权限
* @param statisticsIndicatorPart
@ -216,6 +238,89 @@ public class StatisticalPaneImpl implements StatisticalPaneService {
return p;
}
@Override
public StatisticalPanelDto statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart) {
//统计执法部门数量
Integer deptTotal = statisticalPanelMapper.statisticalPanelDept(statisticsIndicatorPart);
//执法人员数量
Integer userTotal = statisticalPanelMapper.statisticalPanelUser(statisticsIndicatorPart);
UserBean user = userApi.getCurrentUser();
//查询双系统执法人员信息
Zfryjdm2405301 zfryjdm2405301 =
iZfryjdm2405301Service.selectZfryByZfCode(user.getLawCertificateNum());
//通过机构代码查询执法主体信息
statisticsIndicatorPart.setCreditCode(zfryjdm2405301.getZzjgdm());
//本单位执法人员数量
Integer oneselfUserTotal = statisticalPanelMapper.statisticalPanelOneselfDeptUser(statisticsIndicatorPart);
//默认今年 同比 对比上一年 上一个季度 上一个月
StatisticalPanelDto statisticalPanelDto = new StatisticalPanelDto();
/**
* 部门总数
*/
statisticalPanelDto.setDeptTotal(deptTotal);
/**
* 执法人员数量
*/
statisticalPanelDto.setUserTotal(userTotal);
/**
* 本单位执法人员
*/
statisticalPanelDto.setOneselfUserTotal(oneselfUserTotal);
return statisticalPanelDto;
}
@Override
public StatisticsIndicatorPart statisticProgram(StatisticsIndicatorPart statisticsIndicatorPart) {
//获取参数传递过来的查询条件转换为开始时间与结束时间
StatisticsIndicatorPart statisticsIndicatorPart1 = nowDataMake(statisticsIndicatorPart);
//获取参数传递的查询时间转换为 同比时间
StatisticsIndicatorPart statisticsIndicatorPart2 =
lastDataMake(statisticsIndicatorPart, statisticsIndicatorPart1.getBeginTime());
//查询筛选条件-时间
statisticsIndicatorPart.setBeginTime(statisticsIndicatorPart1.getBeginTime());
statisticsIndicatorPart.setEndTime(statisticsIndicatorPart1.getEndTime());
//统计执法计划总数
Integer allTotal = statisticalPanelMapper.statisticalPanelProgramTotal(statisticsIndicatorPart);
//统计本单位执法计划总数
Integer deptTotal = statisticalPanelMapper.statisticalPanelProgramWithDept(statisticsIndicatorPart);
//同比查询执法数据
//统计执法计划总数
Integer lastAllTotal = statisticalPanelMapper.statisticalPanelProgramTotal(statisticsIndicatorPart);
//统计本单位执法计划总数
Integer lastDeptTotal = statisticalPanelMapper.statisticalPanelProgramWithDept(statisticsIndicatorPart);
List<StatisticsIndicatorPart> statisticsIndicatorParts = new ArrayList<>();
//返回结果
//总检查计划数量结果
StatisticsIndicatorPart statisticsIndicatorPart3 = new StatisticsIndicatorPart();
statisticsIndicatorPart3.setTotal(allTotal);
statisticsIndicatorPart3.setHuan((allTotal-lastAllTotal));
statisticsIndicatorParts.add(statisticsIndicatorPart3);
//本单位检查计划统计
StatisticsIndicatorPart statisticsIndicatorPart4 = new StatisticsIndicatorPart();
statisticsIndicatorPart4.setTotal(deptTotal);
statisticsIndicatorPart4.setHuan((deptTotal-lastDeptTotal));
return null;
}
/**
* 当前时间处理--转换成beginTime和endTime的形式
*/
@ -303,4 +408,10 @@ public class StatisticalPaneImpl implements StatisticalPaneService {
}
return null;
}
public static int getQuarter(int year, int month) {
return (month + 2) / 3;
}
}

74
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/statisticalPanelServiceImpl.java

@ -1,74 +0,0 @@
package com.zdxt.code.service.impl;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.DeptApi;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.auth.project.system.user.service.IUserService;
import com.zdxt.code.domain.StatisticsIndicatorPart;
import com.zdxt.code.domain.Zfryjdm2405301;
import com.zdxt.code.mapper.StatisticalPanelMapper;
import com.zdxt.code.service.IZfryjdm2405301Service;
import com.zdxt.code.service.statisticalPanelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.YearMonth;
@Service
public class statisticalPanelServiceImpl implements statisticalPanelService {
@Autowired
private StatisticalPanelMapper statisticalPanelMapper;
@Autowired
private UserApi userApi;
@Autowired
private DeptApi deptApi;
@Autowired
private IDictDataService dictDataService;
@Autowired
private IUserService userService;
@Autowired
private IZfryjdm2405301Service iZfryjdm2405301Service;
@Override
public void statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart) {
//统计执法部门数量
Integer deptTotal = statisticalPanelMapper.statisticalPanelDept(statisticsIndicatorPart);
//执法人员数量
Integer userTotal = statisticalPanelMapper.statisticalPanelUser(statisticsIndicatorPart);
UserBean user = userApi.getCurrentUser();
//查询双系统执法人员信息
Zfryjdm2405301 zfryjdm2405301 =
iZfryjdm2405301Service.selectZfryByZfCode(user.getLawCertificateNum());
//通过机构代码查询执法主体信息
statisticsIndicatorPart.setCreditCode(zfryjdm2405301.getZzjgdm());
//本单位执法人员数量
Integer oneselfUserTotal = statisticalPanelMapper.statisticalPanelOneselfDeptUser(statisticsIndicatorPart);
//默认今年 同比 对比上一年 上一个季度 上一个月
//TODO 没有选择
}
public static YearMonth getPreviousQuarter(int year, int quarter) {
if (quarter == 1) {
return YearMonth.of(year - 1, 4);
} else {
return YearMonth.of(year, getFirstMonthOfQuarter(quarter - 1));
}
}
private static int getFirstMonthOfQuarter(int quarter) {
return 3 * (quarter - 1) + 1;
}
public static void main(String[] args) {
System.out.println(getPreviousQuarter(2024, 4));
}
}

8
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/statisticalPanelService.java

@ -1,8 +0,0 @@
package com.zdxt.code.service;
import com.zdxt.code.domain.StatisticsIndicatorPart;
public interface statisticalPanelService {
void statisticalPanelDeptAndUser(StatisticsIndicatorPart statisticsIndicatorPart);
}

17
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

@ -35,6 +35,13 @@
<if test="month != null and month != '' ">
AND DATE_FORMAT(create_time, '%Y-%m') = #{month}
</if>
<if test="beginTime != null and beginTime != '' ">
<![CDATA[ AND create_time > #{beginTime} ]]>
</if>
<if test="endTime != null and endTime != '' ">
<![CDATA[ AND create_time < #{endTime} ]]>
</if>
AND time_type is not null
</where>
</select>
@ -54,6 +61,16 @@
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
<if test="bureauDeptId != null and bureauDeptId != '' ">
AND bureau_dept_id = #{bureauDeptId}
</if>
<if test="beginTime != null and beginTime != '' ">
<![CDATA[ AND create_time >= #{beginTime} ]]>
</if>
<if test="endTime != null and endTime != '' ">
<![CDATA[ AND create_time <= #{endTime} ]]>
</if>
AND time_type is not null
</where>
</select>

Loading…
Cancel
Save