Browse Source

开发综合统计分析接口

v4
chenrui 2 years ago
parent
commit
d8ac8fdca4
  1. 16
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java
  2. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java
  3. 5
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticsIndicatorPart.java
  4. 16
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.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. 39
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

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

@ -118,14 +118,14 @@ public class EnforcementRegistrationController extends BaseController
* @param enforcementRegistrationDto
* @return
*/
@PostMapping("/staticEnforcementRegistrationDetail")
@ResponseBody
public ZDResponse staticListDetail(EnforcementRegistrationDto enforcementRegistrationDto){
List<EnforcementRegistrationDto> enforcementRegistrationDtos = enforcementRegistrationService.
staticEnforcementRegistrationDetail(enforcementRegistrationDto);
return ZDResponse.success("获取执法分析详细清单",enforcementRegistrationDtos);
}
/**
@PostMapping("/staticEnforcementRegistrationDetail")
@ResponseBody
public ZDResponse staticListDetail(EnforcementRegistrationDto enforcementRegistrationDto){
List<EnforcementRegistrationDto> enforcementRegistrationDtos = enforcementRegistrationService.
staticEnforcementRegistrationDetail(enforcementRegistrationDto);
return ZDResponse.success("获取执法分析详细清单",enforcementRegistrationDtos);
}
/**
* 查询执法端-执法登记列表
*/
@RequiresPermissions("code:registration:list")

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

@ -18,7 +18,6 @@ public class StatisticalPanelController extends BaseController {
private StatisticalPaneService statisticalPaneService;
@RequestMapping("/")
public ZDResponse home(){
return ZDResponse.success();
}

5
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticsIndicatorPart.java

@ -38,6 +38,11 @@ public class StatisticsIndicatorPart extends BaseDomain {
*/
private String month;
/**
* 机构统一信用代码
*/
private String creditCode;
private String beginTime;
private String endTime;

16
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java

@ -23,6 +23,20 @@ public interface StatisticalPanelMapper {
* @param statisticsIndicatorPart
* @return
*/
Integer statisticalPanelOwerDept(StatisticsIndicatorPart statisticsIndicatorPart);
Integer statisticalPanelOneselfDeptUser(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* 查询检查计划总数量
* @param statisticsIndicatorPart
* @return
*/
Integer statisticalPanelProgramTotal(StatisticsIndicatorPart statisticsIndicatorPart);
/**
* 查询本单位检查计划数量
* @param statisticsIndicatorPart
* @return
*/
Integer statisticalPanelProgramWithDept(StatisticsIndicatorPart statisticsIndicatorPart);
}

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

@ -0,0 +1,74 @@
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

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

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

@ -19,5 +19,44 @@
select count(id) from ZFRYJDM2405301 where CODE_STATE = '01'
</select>
<select id="statisticalPanelOneselfDeptUser" resultType="integer" parameterType="StatisticsIndicatorPart">
select count(id) from ZFRYJDM2405301 where CODE_STATE = '01' where ZZJGDM = #{creditCode}
</select>
<select id="statisticalPanelProgramTotal" resultType="integer" parameterType="StatisticsIndicatorPart">
select count(id) from enforcement_inspection_program
<where>
<if test="year != null and year != ''">
AND YEAR(create_time) = #{year}
</if>
<if test="quarter != null and quarter != '' ">
AND QUARTER(create_time) = #{quarter}
</if>
<if test="month != null and month != '' ">
AND DATE_FORMAT(create_time, '%Y-%m') = #{month}
</if>
</where>
</select>
<select id="statisticalPanelProgramWithDept" resultType="integer" parameterType="StatisticsIndicatorPart">
select count(id) from enforcement_inspection_program
<where>
<if test="year != null and year != ''">
AND YEAR(create_time) = #{year}
</if>
<if test="quarter != null and quarter != '' ">
AND QUARTER(create_time) = #{quarter}
</if>
<if test="month != null and month != '' ">
AND DATE_FORMAT(create_time, '%Y-%m') = #{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save