Commit 1a3979d1 authored by suhuiguang's avatar suhuiguang

1.大屏-监管-业务办理时效新开发原有开发错误为了数量

parent 91bf30f1
......@@ -1057,11 +1057,4 @@
union all
select count(1) from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成' and date_ge(CAST(a.create_date as date),#{dto.beginDate}) and date_le(CAST(a.create_date as date),#{dto.endDate})
</select>
<select id="getOrgCodesByCompanyCodes" resultType="java.util.Map">
select P.org_code AS orgCode,P.company_code AS companyCode from privilege_company P
where P.company_code in
<foreach collection="regionCodes" item="regionCode" separator="," open="(" close=")">
#{regionCode} :: VARCHAR
</foreach>
</select>
</mapper>
package com.yeejoin.amos.boot.module.jg.api.mapper;
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface DPStatisticsMapper {
public interface JGStatisticsMapper {
List<Map<String, Object>> maintenanceCountTopTen(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto, @Param("regionCodeList") List<Integer> regionCodeList);
List<Map<String, Object>> maintenanceCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto, @Param("regionCodeList") List<Integer> regionCodeList);
List<Map<String, Object>> installEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> installEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> maintenanceEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> maintenanceEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> reformEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> reformEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> transferEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> transferEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> useEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> useEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> changeReformEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeReformEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> changeTransferEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeTransferEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> changeUnitEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> changeUnitEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> vehicleEquCount(@Param("cityCode") String cityCode,@Param("startTime") String startTime);
List<Map<String, Object>> vehicleEquCount(@Param("cityCode") String cityCode, @Param("startTime") String startTime);
List<Map<String, Object>> newRegEquCountByMonth(@Param("cityCode") String cityCode);
......@@ -40,32 +41,8 @@ public interface DPStatisticsMapper {
List<Map<String, Object>> newVehicleEquCountByYear(@Param("cityCode") String cityCode);
String newVehicleCountByYear(@Param("cityCode") String cityCode);
String newVehicleCountByMonth(@Param("cityCode") String cityCode);
List<Map<String, Object>> installCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> maintenanceNoticeCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> reformCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> transferCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> useCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> vehicleCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> changeNameCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> changeReformCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> changeTransferCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> changeUnitCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> changeVehicleCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> disableCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
List<Map<String, Object>> cancelCountByOrgCodes(@Param("orgCodes") List<String> orgCodes);
String newVehicleCountByMonth(@Param("cityCode") String cityCode);
long certificateCountByOrgCode(@Param("orgCode") String orgCode);
......@@ -80,4 +57,14 @@ public interface DPStatisticsMapper {
List<Map<String, Object>> selectNoticeList(@Param("orgCode") String orgCode, @Param("time") String time);
List<Map<String, Object>> selectNoticeCountTopTen(@Param("orgCode") String orgCode, @Param("time") String time);
List<CountDto> queryNoticeAvgDayByReceiveCompany(@Param("dto") DPFilterParamDto dpFilterParamDto,@Param("orgCode") String orgCode);
List<CountDto> queryUseAvgDayByReceiveCompany(@Param("dto") DPFilterParamDto dpFilterParamDto, @Param("orgCode") String orgCode);
List<CountDto> queryChangeAvgDayByReceiveCompany(@Param("dto") DPFilterParamDto dpFilterParamDto, @Param("orgCode") String orgCode);
List<CountDto> queryDisableAvgDayByReceiveCompany(DPFilterParamDto dpFilterParamDto, String orgCode);
List<CountDto> queryCancelAvgDayByReceiveCompany(DPFilterParamDto dpFilterParamDto, String orgCode);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.DPStatisticsMapper">
<mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper">
<select id="maintenanceCountTopTen" resultType="java.util.Map">
SELECT
......@@ -305,66 +305,6 @@
ORDER BY
ur.rec_date
</select>
<select id="installCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_installation_notice T
WHERE
T.notice_status = 6616
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="maintenanceNoticeCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_maintain_notice T
WHERE
T.notice_status = 6616
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="reformCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_reform_notice T
WHERE
T.notice_status = 6616
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="transferCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_transfer_notice T
WHERE
T.notice_status = 6616
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="useCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
......@@ -381,152 +321,7 @@
T.receive_company_org_code
</select>
<select id="vehicleCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_org_code AS orgCode
FROM
tzs_jg_vehicle_information T
WHERE
T.status = '已完成'
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_org_code
</select>
<select id="changeNameCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.org_code AS orgCode
FROM
(
SELECT
crn.sequence_nbr,
pc.org_code
FROM
privilege_company pc
INNER JOIN tzs_jg_change_registration_name crn ON crn.receive_org_code = pc.company_code
AND crn.audit_status = '已完成'
WHERE
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
pc.org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
crn.sequence_nbr
) T
GROUP BY
T.org_code
</select>
<select id="changeReformCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_change_registration_reform T
WHERE
T.audit_status = '已完成'
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="changeTransferCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_change_registration_transfer T
WHERE
T.audit_status = '已完成'
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="changeUnitCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_change_registration_unit T
WHERE
T.status = '已完成'
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="changeVehicleCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.receive_company_org_code AS orgCode
FROM
tzs_jg_change_vehicle_registration_unit T
WHERE
T.status = '已完成'
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
T.receive_company_org_code
</select>
<select id="disableCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.org_code AS orgCode
FROM
(
SELECT
crn.sequence_nbr,
pc.org_code
FROM
privilege_company pc
INNER JOIN tzs_jg_enable_disable crn ON crn.receive_org_code = pc.company_code
AND crn.audit_status = '已完成'
WHERE
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
pc.org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
crn.sequence_nbr
) T
GROUP BY
T.org_code
</select>
<select id="cancelCountByOrgCodes" resultType="java.util.Map">
SELECT COUNT
( 1 ),
T.org_code AS orgCode
FROM
(
SELECT
crn.sequence_nbr,
pc.org_code
FROM
privilege_company pc
INNER JOIN tzs_jg_scrap_cancel crn ON crn.receive_org_code = pc.company_code
AND crn.audit_status = '已完成'
WHERE
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
pc.org_code LIKE CONCAT ( #{orgCode}, '%' )
</foreach>
GROUP BY
crn.sequence_nbr
) T
GROUP BY
T.org_code
</select>
<select id="certificateCountByOrgCode" resultType="java.lang.Long">
SELECT COUNT
(1)
......@@ -743,4 +538,244 @@
COUNT DESC
limit 10
</select>
<select id="queryNoticeAvgDayByReceiveCompany" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
round(avg(T.handle_date::date - T.notice_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_installation_notice T
WHERE
T.notice_status = 6616
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.notice_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.accept_date::date - T.notice_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_maintain_notice T
WHERE
T.notice_status = 6616
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.notice_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.accept_date::date - T.notice_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_reform_notice T
WHERE
T.notice_status = 6616
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.notice_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.handle_date::date - T.notice_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_transfer_notice T
WHERE
T.notice_status = 6616
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.notice_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
</select>
<select id="queryUseAvgDayByReceiveCompany" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
round(avg(T.audit_pass_date::date - T.reg_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_use_registration T
WHERE
T.audit_status = '已完成'
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.reg_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.audit_pass_date::date - T.reg_date::date + 1),1) as strValue,
T.receive_org_code AS keyStr
FROM
tzs_jg_vehicle_information T
WHERE
T.status = '已完成'
and T.receive_org_code like(#{param1})
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.reg_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_org_code
</select>
<select id="queryChangeAvgDayByReceiveCompany" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
round(avg(T.audit_pass_date::date - T.apply_date::date + 1),1) as strValue,
T.org_code AS keyStr
FROM
(
SELECT
pc.org_code,
crn.apply_date,
crn.audit_pass_date
FROM
tzs_jg_change_registration_name crn,
privilege_company pc
WHERE
crn.receive_org_code = pc.company_code
AND crn.audit_status = '已完成'
and pc.org_code like concat(#{orgCode}, '%')
and crn.apply_date is not null
and crn.audit_pass_date is not null
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(crn.apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(crn.apply_date as date),#{dto.endDate})
</if>
) T
GROUP BY T.org_code
union all
SELECT
round(avg(T.audit_pass_date::date - T.reg_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_change_registration_reform T
WHERE
T.audit_status = '已完成'
and T.receive_company_org_code like concat(#{orgCode},'%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.reg_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.audit_pass_date::date - T.reg_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_change_registration_transfer T
WHERE
T.audit_status = '已完成'
and T.receive_company_org_code like concat(#{orgCode},'%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.reg_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.audit_pass_date::date - T.apply_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_change_registration_unit T
WHERE
T.status = '已完成'
and T.receive_company_org_code like concat(#{orgCode},'%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.apply_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
union all
SELECT
round(avg(T.audit_pass_date::date - T.apply_date::date + 1),1) as strValue,
T.receive_company_org_code AS keyStr
FROM
tzs_jg_change_vehicle_registration_unit T
WHERE
T.status = '已完成'
and T.receive_company_org_code like concat(#{orgCode},'%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.apply_date as date),#{dto.endDate})
</if>
GROUP BY T.receive_company_org_code
</select>
<select id="queryDisableAvgDayByReceiveCompany" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
round(avg(T.audit_pass_date::date - T.apply_date::date + 1),1) as strValue,
T.org_code AS keyStr
FROM
(
SELECT
crn.sequence_nbr,
pc.org_code,
crn.audit_pass_date,
crn.apply_date
FROM
tzs_jg_enable_disable crn,
privilege_company pc
WHERE
crn.receive_company_code = pc.company_code
AND crn.audit_status = '已完成'
and pc.org_code like concat(#{orgCode}, '%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.apply_date as date),#{dto.endDate})
</if>
) T
GROUP BY
T.org_code
</select>
<select id="queryCancelAvgDayByReceiveCompany" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
round(avg(T.audit_pass_date::date - T.create_date::date + 1),1) as strValue,
T.org_code AS keyStr
FROM
(
SELECT
crn.sequence_nbr,
pc.org_code,
crn.audit_pass_date,
crn.create_date
FROM
tzs_jg_scrap_cancel crn,
privilege_company pc
WHERE
crn.receive_org_code = pc.company_code
AND crn.audit_status = '已完成'
and pc.org_code like concat(#{orgCode}, '%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(T.create_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(T.create_date as date),#{dto.endDate})
</if>
) T
GROUP BY T.org_code
</select>
</mapper>
......@@ -247,6 +247,7 @@ public class JGDPStatisticsController {
}
return ResponseHelper.buildResponse(statisticsService.dataStatisticCountByReginCode(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "监管大屏-中间地图左右两侧8大类、单位、人员数量全局统计", notes = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计")
@PostMapping(value = "/centre/dataStatistic")
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.FourColorCountItemEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.FourColorEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
......@@ -44,7 +45,6 @@ import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -114,13 +114,13 @@ public class JGDPStatisticsServiceImpl {
private ZLStatisticsMapper zlStatisticsMapper;
private DPStatisticsMapper dpStatisticsMapper;
private JGStatisticsMapper jgStatisticsMapper;
private JgUseRegistrationManageMapper jgUseRegistrationManageMapper;
private StCommonServiceImpl stCommonService;
public JGDPStatisticsServiceImpl(JgUseRegistrationMapper useRegistrationMapper, JgEnableDisableMapper enableDisableMapper, JgScrapCancelMapper scrapCancelMapper, RestHighLevelClient restHighLevelClient, TzBaseEnterpriseInfoMapper enterpriseInfoMapper, CommonMapper commonMapper, TzsUserInfoMapper userInfoMapper, ZLStatisticsMapper zlStatisticsMapper, DPStatisticsMapper dpStatisticsMapper, JgUseRegistrationManageMapper jgUseRegistrationManageMapper, StCommonServiceImpl stCommonService) {
public JGDPStatisticsServiceImpl(JgUseRegistrationMapper useRegistrationMapper, JgEnableDisableMapper enableDisableMapper, JgScrapCancelMapper scrapCancelMapper, RestHighLevelClient restHighLevelClient, TzBaseEnterpriseInfoMapper enterpriseInfoMapper, CommonMapper commonMapper, TzsUserInfoMapper userInfoMapper, ZLStatisticsMapper zlStatisticsMapper, JGStatisticsMapper jgStatisticsMapper, JgUseRegistrationManageMapper jgUseRegistrationManageMapper, StCommonServiceImpl stCommonService) {
this.useRegistrationMapper = useRegistrationMapper;
this.enableDisableMapper = enableDisableMapper;
this.scrapCancelMapper = scrapCancelMapper;
......@@ -129,7 +129,7 @@ public class JGDPStatisticsServiceImpl {
this.commonMapper = commonMapper;
this.userInfoMapper = userInfoMapper;
this.zlStatisticsMapper = zlStatisticsMapper;
this.dpStatisticsMapper = dpStatisticsMapper;
this.jgStatisticsMapper = jgStatisticsMapper;
this.jgUseRegistrationManageMapper = jgUseRegistrationManageMapper;
this.stCommonService = stCommonService;
}
......@@ -411,7 +411,7 @@ public class JGDPStatisticsServiceImpl {
// 设备状态过滤
boolMust.must(QueryBuilders.termsQuery("EQU_STATE", Arrays.asList(states)));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
......@@ -469,7 +469,7 @@ public class JGDPStatisticsServiceImpl {
long currentDayAfter30DayTime = DateUtil.offsetDay(DateUtil.parse(DateUtil.today(), "yyy-MM-dd"), 30).getTime();
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
......@@ -504,7 +504,7 @@ public class JGDPStatisticsServiceImpl {
long currentDayTime = DateUtil.parse(DateUtil.now(), "yyy-MM-dd").getTime();
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").lt(currentDayTime));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
......@@ -706,7 +706,7 @@ public class JGDPStatisticsServiceImpl {
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.query(boolMust);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("EQU_STATE_COUNT").field("EQU_STATE").size(20);
......@@ -722,7 +722,7 @@ public class JGDPStatisticsServiceImpl {
long docCount = bucket.getDocCount();
dataMap.put(category, docCount);
}
resultList = Arrays.stream(EquimentEnum.values()).filter(e->e.getCode() > 0).map(e->{
resultList = Arrays.stream(EquimentEnum.values()).filter(e -> e.getCode() > 0).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put("name", e.getName());
map.put("value", dataMap.getOrDefault(e.getCode().toString(), 0L));
......@@ -736,10 +736,10 @@ public class JGDPStatisticsServiceImpl {
}
private List<Map<String, Object>> setDefaultEquStateCount() {
return Arrays.stream(EquimentEnum.values()).filter(e->e.getCode() > 0).map(e->{
return Arrays.stream(EquimentEnum.values()).filter(e -> e.getCode() > 0).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put("name", e.getName());
map.put("value", 0L);
map.put("value", 0L);
return map;
}).collect(Collectors.toList());
}
......@@ -754,7 +754,7 @@ public class JGDPStatisticsServiceImpl {
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.query(boolMust);
// 设备状态
......@@ -852,7 +852,7 @@ public class JGDPStatisticsServiceImpl {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
Map<Integer, RegionModel> regionMap = regionModels.stream().collect(Collectors.toMap(RegionModel::getRegionCode, Function.identity()));
List<Map<String, Object>> list = dpStatisticsMapper.maintenanceCountTopTen(dpFilterParamDto, regionCodeList);
List<Map<String, Object>> list = jgStatisticsMapper.maintenanceCountTopTen(dpFilterParamDto, regionCodeList);
List<Map<String, Object>> resultList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
Map<String, Object> result = new HashMap<>();
......@@ -869,7 +869,7 @@ public class JGDPStatisticsServiceImpl {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
Map<Integer, RegionModel> regionMap = regionModels.stream().collect(Collectors.toMap(RegionModel::getRegionCode, Function.identity()));
List<Map<String, Object>> list = dpStatisticsMapper.maintenanceCount(dpFilterParamDto, regionCodeList);
List<Map<String, Object>> list = jgStatisticsMapper.maintenanceCount(dpFilterParamDto, regionCodeList);
Map<String, Object> resultMap = new HashMap<>();
List xList = new ArrayList();
List yList = new ArrayList();
......@@ -885,252 +885,68 @@ public class JGDPStatisticsServiceImpl {
public Map<String, Object> cityBusinessCount(DPFilterParamDto dpFilterParamDto) {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParentAndNoAccessIf3Level(dpFilterParamDto);
Map<String, Object> resultMap = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto);
if (orgCode == null) {
String orgCodeP = stCommonService.getAndSetOrgCode(dpFilterParamDto);
if (orgCodeP == null) {
return new HashMap<>();
}
List<CountDto> countDtos = getDealDayAvgList(dpFilterParamDto, orgCodeP);
List<String> xData = new ArrayList<>();
List<String> yData = new ArrayList<>();
regionModels.forEach(r -> {
xData.add(r.getRegionName());
String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode().toString());
yData.add(this.avgAndSumDealDate(countDtos.stream().filter(c -> c.getKeyStr().contains(orgCode)).collect(Collectors.toList())));
});
resultMap.put("xdata", xData);
resultMap.put("ydata", yData);
return resultMap;
}
private String avgAndSumDealDate(List<CountDto> collect) {
BigDecimal sum = collect.stream().map(c -> new BigDecimal(c.getStrValue())).reduce(BigDecimal.ZERO, BigDecimal::add);
return sum.divide(BigDecimal.valueOf(collect.size()), 1, RoundingMode.HALF_UP).toPlainString();
}
private List<CountDto> getDealDayAvgList(DPFilterParamDto dpFilterParamDto, String orgCode) {
List<CountDto> countDtos = new ArrayList<>();
// 业务类型0告知管理,1使用登记,2变更登记,3停用启用,4注销报废
if ("0".equals(dpFilterParamDto.getBusinessKey())) {
noticeCount(resultMap, regionModels);
countDtos = noticeCount(dpFilterParamDto, orgCode);
} else if ("1".equals(dpFilterParamDto.getBusinessKey())) {
useCount(resultMap, regionModels);
countDtos = useCount(dpFilterParamDto, orgCode);
} else if ("2".equals(dpFilterParamDto.getBusinessKey())) {
changeCount(resultMap, regionModels);
countDtos = changeCount(dpFilterParamDto, orgCode);
} else if ("3".equals(dpFilterParamDto.getBusinessKey())) {
disableCount(resultMap, regionModels);
countDtos = disableCount(dpFilterParamDto, orgCode);
} else if ("4".equals(dpFilterParamDto.getBusinessKey())) {
cancelCount(resultMap, regionModels);
countDtos = cancelCount(dpFilterParamDto, orgCode);
}
return resultMap;
return countDtos;
}
private void cancelCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>();
List<Integer> regionCodeList = regionModelList.stream().map(RegionModel::getRegionCode).collect(Collectors.toList());
List<Map<String, String>> orgCodeByCompanyCodes = commonMapper.getOrgCodesByCompanyCodes(regionCodeList);
Map<String, String> companyMap = new HashMap<>();
List<String> orgCodes = new ArrayList<>();
orgCodeByCompanyCodes.forEach(t -> {
companyMap.put(t.get("companyCode") + "", t.get("orgCode"));
if (StringUtils.isNotBlank(t.get("orgCode"))) {
orgCodes.add(t.get("orgCode"));
}
});
private List<CountDto> cancelCount(DPFilterParamDto dpFilterParamDto, String orgCode) {
//注销报废
List<Map<String, Object>> cancelCoountList = dpStatisticsMapper.cancelCountByOrgCodes(orgCodes);
countByMap(countMap, cancelCoountList);
for (int i = 0; i < regionModelList.size(); i++) {
AtomicInteger count = new AtomicInteger();
xDataList.add(regionModelList.get(i).getRegionName());
if (StringUtils.isNotEmpty(companyMap.get(regionModelList.get(i).getRegionCode() + ""))) {
int finalI = i;
countMap.forEach((k, v) -> {
if (k.startsWith(companyMap.get(regionModelList.get(finalI).getRegionCode() + ""))) {
if (null != v) {
count.addAndGet(v);
}
}
});
}
yDataList.add(count);
}
return jgStatisticsMapper.queryCancelAvgDayByReceiveCompany(dpFilterParamDto, orgCode);
}
resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList);
}
private void disableCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>();
List<Integer> regionCodeList = regionModelList.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
List<Map<String, String>> orgCodeByCompanyCodes = commonMapper.getOrgCodesByCompanyCodes(regionCodeList);
Map<String, String> companyMap = new HashMap<>();
List<String> orgCodes = new ArrayList<>();
orgCodeByCompanyCodes.stream().forEach(t -> {
companyMap.put(t.get("companyCode") + "", t.get("orgCode"));
if (StringUtils.isNotBlank(t.get("orgCode"))) {
orgCodes.add(t.get("orgCode"));
}
});
private List<CountDto> disableCount(DPFilterParamDto dpFilterParamDto, String orgCode) {
//启用停用
List<Map<String, Object>> disableCountList = dpStatisticsMapper.disableCountByOrgCodes(orgCodes);
countByMap(countMap, disableCountList);
for (int i = 0; i < regionModelList.size(); i++) {
AtomicInteger count = new AtomicInteger();
xDataList.add(regionModelList.get(i).getRegionName());
if (StringUtils.isNotEmpty(companyMap.get(regionModelList.get(i).getRegionCode() + ""))) {
int finalI = i;
countMap.forEach((k, v) -> {
if (k.startsWith(companyMap.get(regionModelList.get(finalI).getRegionCode() + ""))) {
if (null != v) {
count.addAndGet(v);
}
}
});
}
yDataList.add(count);
}
resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList);
}
private void changeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>();
List<Integer> regionCodeList = regionModelList.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
List<Map<String, String>> orgCodeByCompanyCodes = commonMapper.getOrgCodesByCompanyCodes(regionCodeList);
Map<String, String> companyMap = new HashMap<>();
List<String> orgCodes = new ArrayList<>();
orgCodeByCompanyCodes.stream().forEach(t -> {
companyMap.put(t.get("companyCode") + "", t.get("orgCode"));
if (StringUtils.isNotBlank(t.get("orgCode"))) {
orgCodes.add(t.get("orgCode"));
}
});
//更名变更登记
List<Map<String, Object>> changeNameList = dpStatisticsMapper.changeNameCountByOrgCodes(orgCodes);
countByMap(countMap, changeNameList);
//改造变更登记
List<Map<String, Object>> reformList = dpStatisticsMapper.changeReformCountByOrgCodes(orgCodes);
countByMap(countMap, reformList);
//移装变更登记
List<Map<String, Object>> transferList = dpStatisticsMapper.changeTransferCountByOrgCodes(orgCodes);
countByMap(countMap, transferList);
//单位变更登记
List<Map<String, Object>> unitList = dpStatisticsMapper.changeUnitCountByOrgCodes(orgCodes);
countByMap(countMap, unitList);
//单位变更登记
List<Map<String, Object>> vehicleList = dpStatisticsMapper.changeVehicleCountByOrgCodes(orgCodes);
countByMap(countMap, vehicleList);
for (int i = 0; i < regionModelList.size(); i++) {
AtomicInteger count = new AtomicInteger();
xDataList.add(regionModelList.get(i).getRegionName());
if (StringUtils.isNotEmpty(companyMap.get(regionModelList.get(i).getRegionCode() + ""))) {
int finalI = i;
countMap.forEach((k, v) -> {
if (k.startsWith(companyMap.get(regionModelList.get(finalI).getRegionCode() + ""))) {
if (null != v) {
count.addAndGet(v);
}
}
});
}
yDataList.add(count);
}
resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList);
return jgStatisticsMapper.queryDisableAvgDayByReceiveCompany(dpFilterParamDto, orgCode);
}
private void useCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>();
List<Integer> regionCodeList = regionModelList.stream().map(RegionModel::getRegionCode).collect(Collectors.toList());
List<Map<String, String>> orgCodeByCompanyCodes = commonMapper.getOrgCodesByCompanyCodes(regionCodeList);
Map<String, String> companyMap = new HashMap<>();
List<String> orgCodes = new ArrayList<>();
orgCodeByCompanyCodes.stream().forEach(t -> {
companyMap.put(t.get("companyCode") + "", t.get("orgCode"));
if (StringUtils.isNotBlank(t.get("orgCode"))) {
orgCodes.add(t.get("orgCode"));
}
});
//使用登记
List<Map<String, Object>> useCountList = dpStatisticsMapper.useCountByOrgCodes(orgCodes);
countByMap(countMap, useCountList);
//车用气瓶使用登记
List<Map<String, Object>> vehicleCountList = dpStatisticsMapper.vehicleCountByOrgCodes(orgCodes);
countByMap(countMap, vehicleCountList);
for (int i = 0; i < regionModelList.size(); i++) {
AtomicInteger count = new AtomicInteger();
xDataList.add(regionModelList.get(i).getRegionName());
if (StringUtils.isNotEmpty(companyMap.get(regionModelList.get(i).getRegionCode() + ""))) {
int finalI = i;
countMap.forEach((k, v) -> {
if (k.startsWith(companyMap.get(regionModelList.get(finalI).getRegionCode() + ""))) {
if (null != v) {
count.addAndGet(v);
}
}
});
}
yDataList.add(count);
}
resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList);
}
private void noticeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>();
List<Integer> regionCodeList = regionModelList.stream().map(RegionModel::getRegionCode).collect(Collectors.toList());
List<Map<String, String>> orgCodeByCompanyCodes = commonMapper.getOrgCodesByCompanyCodes(regionCodeList);
Map<String, String> companyMap = new HashMap<>();
List<String> orgCodes = new ArrayList<>();
orgCodeByCompanyCodes.forEach(t -> {
companyMap.put(t.get("companyCode") + "", t.get("orgCode"));
if (StringUtils.isNotBlank(t.get("orgCode"))) {
orgCodes.add(t.get("orgCode"));
}
});
//安装告知
List<Map<String, Object>> installCountList = dpStatisticsMapper.installCountByOrgCodes(orgCodes);
countByMap(countMap, installCountList);
//维修告知
List<Map<String, Object>> maintenanceCountList = dpStatisticsMapper.maintenanceNoticeCountByOrgCodes(orgCodes);
countByMap(countMap, maintenanceCountList);
//改造告知
List<Map<String, Object>> reformCountList = dpStatisticsMapper.reformCountByOrgCodes(orgCodes);
countByMap(countMap, reformCountList);
//移装告知
List<Map<String, Object>> transferCountList = dpStatisticsMapper.transferCountByOrgCodes(orgCodes);
countByMap(countMap, transferCountList);
for (int i = 0; i < regionModelList.size(); i++) {
AtomicInteger count = new AtomicInteger();
xDataList.add(regionModelList.get(i).getRegionName());
if (StringUtils.isNotEmpty(companyMap.get(regionModelList.get(i).getRegionCode() + ""))) {
int finalI = i;
countMap.forEach((k, v) -> {
if (k.startsWith(companyMap.get(regionModelList.get(finalI).getRegionCode() + ""))) {
if (null != v) {
count.addAndGet(v);
}
}
});
}
yDataList.add(count);
}
private List<CountDto> changeCount(DPFilterParamDto dpFilterParamDto, String orgCode) {
//更名变更登记、改造变更登记、移装变更登记、单位变更登记、气瓶单位变更登记
return jgStatisticsMapper.queryChangeAvgDayByReceiveCompany(dpFilterParamDto, orgCode);
}
resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList);
private List<CountDto> useCount(DPFilterParamDto dpFilterParamDto, String orgCode) {
//使用登记、车用气瓶使用登记
return jgStatisticsMapper.queryUseAvgDayByReceiveCompany(dpFilterParamDto, orgCode);
}
private void countByMap(Map<String, Integer> countMap, List<Map<String, Object>> list) {
for (int i = 0; i < list.size(); i++) {
if (null == countMap.get(list.get(i).get("orgCode"))) {
countMap.put(list.get(i).get("orgCode").toString(), Integer.valueOf(list.get(i).get("count") + ""));
} else {
countMap.put(list.get(i).get("orgCode").toString(), countMap.get(list.get(i).get("orgCode")) + Integer.valueOf(list.get(i).get("count") + ""));
}
}
private List<CountDto> noticeCount(DPFilterParamDto dpFilterParamDto, String orgCode) {
//安装告知、维修告知、改造告知、移装告知
return jgStatisticsMapper.queryNoticeAvgDayByReceiveCompany(dpFilterParamDto, orgCode);
}
public List<Map<String, Object>> getBusinessKey(DPFilterParamDto dpFilterParamDto) {
......@@ -1166,19 +982,19 @@ public class JGDPStatisticsServiceImpl {
public Map<String, Object> getNoticeEquCount(DPFilterParamDto dpFilterParamDto) {
String startTime = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
//安装告知
List<Map<String, Object>> installlist = dpStatisticsMapper.installEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> installlist = jgStatisticsMapper.installEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> installCountMap = new HashMap<>();
countNoticEquList(installCountMap, installlist);
//维修告知
List<Map<String, Object>> maintenancelist = dpStatisticsMapper.maintenanceEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> maintenancelist = jgStatisticsMapper.maintenanceEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> maintenanceCountMap = new HashMap<>();
countNoticEquList(maintenanceCountMap, maintenancelist);
//改造告知
List<Map<String, Object>> reformlist = dpStatisticsMapper.reformEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> reformlist = jgStatisticsMapper.reformEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> reformCountMap = new HashMap<>();
countNoticEquList(reformCountMap, reformlist);
//移装告知
List<Map<String, Object>> transferlist = dpStatisticsMapper.transferEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> transferlist = jgStatisticsMapper.transferEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> transferCountMap = new HashMap<>();
countNoticEquList(transferCountMap, transferlist);
......@@ -1291,7 +1107,7 @@ public class JGDPStatisticsServiceImpl {
Map<String, Object> resultMap = new HashMap<>();
String startTime = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
//使用登记
List<Map<String, Object>> uselist = dpStatisticsMapper.useEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> uselist = jgStatisticsMapper.useEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> useCountMap = new HashMap<>();
countNoticEquList(useCountMap, uselist);
//车用气瓶使用登记-
......@@ -1299,15 +1115,15 @@ public class JGDPStatisticsServiceImpl {
// Map<String, Integer> vehicleCountMap = new HashMap<>();
// countNoticEquList(vehicleCountMap, vehicleList);
//改造变更登记
List<Map<String, Object>> changeReformList = dpStatisticsMapper.changeReformEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> changeReformList = jgStatisticsMapper.changeReformEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> changeReformCountMap = new HashMap<>();
countNoticEquList(changeReformCountMap, changeReformList);
//移装变更登记
List<Map<String, Object>> changeTransferList = dpStatisticsMapper.changeTransferEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> changeTransferList = jgStatisticsMapper.changeTransferEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> changeTransferCountMap = new HashMap<>();
countNoticEquList(changeTransferCountMap, changeTransferList);
//单位变更登记
List<Map<String, Object>> changeUnitList = dpStatisticsMapper.changeUnitEquCount(dpFilterParamDto.getCityCode(), startTime);
List<Map<String, Object>> changeUnitList = jgStatisticsMapper.changeUnitEquCount(dpFilterParamDto.getCityCode(), startTime);
Map<String, Integer> changeUnitCountMap = new HashMap<>();
countNoticEquList(changeUnitCountMap, changeUnitList);
......@@ -1430,7 +1246,7 @@ public class JGDPStatisticsServiceImpl {
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
......@@ -1469,8 +1285,8 @@ public class JGDPStatisticsServiceImpl {
Map<String, Object> useCountMap = new HashMap<>();
Map<String, Object> vehicleCountMap = new HashMap<>();
if ("month".equals(dpFilterParamDto.getSearchType())) {
List<Map<String, Object>> useCountList = dpStatisticsMapper.newRegEquCountByMonth(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleCountList = dpStatisticsMapper.newVehicleEquCountByMonth(dpFilterParamDto.getCityCode());
List<Map<String, Object>> useCountList = jgStatisticsMapper.newRegEquCountByMonth(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleCountList = jgStatisticsMapper.newVehicleEquCountByMonth(dpFilterParamDto.getCityCode());
for (int i = 0; i < useCountList.size(); i++) {
useCountMap.put(useCountList.get(i).getOrDefault("date_format", "") + "", Integer.valueOf(useCountList.get(i).getOrDefault("count", 0) + ""));
}
......@@ -1484,8 +1300,8 @@ public class JGDPStatisticsServiceImpl {
}
} else if ("year".equals(dpFilterParamDto.getSearchType())) {
List<Map<String, Object>> useCountList = dpStatisticsMapper.newRegEquCountByYear(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleCountList = dpStatisticsMapper.newVehicleEquCountByYear(dpFilterParamDto.getCityCode());
List<Map<String, Object>> useCountList = jgStatisticsMapper.newRegEquCountByYear(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleCountList = jgStatisticsMapper.newVehicleEquCountByYear(dpFilterParamDto.getCityCode());
for (int i = 0; i < useCountList.size(); i++) {
useCountMap.put(useCountList.get(i).getOrDefault("date_format", "") + "", Integer.valueOf(useCountList.get(i).getOrDefault("count", 0) + ""));
}
......@@ -1509,17 +1325,17 @@ public class JGDPStatisticsServiceImpl {
public List<Map<String, Object>> newRegCount(DPFilterParamDto dpFilterParamDto) {
List<Map<String, Object>> resultList = new ArrayList<>();
//年使用登记设备
List<Map<String, Object>> useEquCountListYear = dpStatisticsMapper.newRegEquCountByYear(dpFilterParamDto.getCityCode());
List<Map<String, Object>> useEquCountListYear = jgStatisticsMapper.newRegEquCountByYear(dpFilterParamDto.getCityCode());
//年气瓶使用登记设备
List<Map<String, Object>> vehicleEquCountListYear = dpStatisticsMapper.newVehicleEquCountByYear(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleEquCountListYear = jgStatisticsMapper.newVehicleEquCountByYear(dpFilterParamDto.getCityCode());
//月使用登记设备
List<Map<String, Object>> useEquCountListMonth = dpStatisticsMapper.newRegEquCountByMonth(dpFilterParamDto.getCityCode());
List<Map<String, Object>> useEquCountListMonth = jgStatisticsMapper.newRegEquCountByMonth(dpFilterParamDto.getCityCode());
//月气瓶使用登记设备
List<Map<String, Object>> vehicleEquCountListMonth = dpStatisticsMapper.newVehicleEquCountByMonth(dpFilterParamDto.getCityCode());
List<Map<String, Object>> vehicleEquCountListMonth = jgStatisticsMapper.newVehicleEquCountByMonth(dpFilterParamDto.getCityCode());
//年气瓶使用登记
String vehicleCountYear = dpStatisticsMapper.newVehicleCountByYear(dpFilterParamDto.getCityCode());
String vehicleCountYear = jgStatisticsMapper.newVehicleCountByYear(dpFilterParamDto.getCityCode());
//月气瓶使用登记
String vehicleCountListMonth = dpStatisticsMapper.newVehicleCountByMonth(dpFilterParamDto.getCityCode());
String vehicleCountListMonth = jgStatisticsMapper.newVehicleCountByMonth(dpFilterParamDto.getCityCode());
/**
* [ { "name": "本年新增登记", "value": 52 }, { "name": "本年新增设备", "value": 83 },
* { "name": "本月新增登记", "value": 16 }, { "name": "本月新增设备", "value": 50 } ]
......@@ -1602,29 +1418,29 @@ public class JGDPStatisticsServiceImpl {
}
private void staticsCenterMapCountDataForChange(Map<String, Object> result, String orgCode) {
Long num = dpStatisticsMapper.changeCountByOrgCode(orgCode);
Long num = jgStatisticsMapper.changeCountByOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.CHANGE_COUNT.getCode(), num);
}
private void staticsCenterMapCountDataForConstructionNotice(Map<String, Object> result, String orgCode) {
Long num = dpStatisticsMapper.constructionNoticeCount(orgCode);
Long num = jgStatisticsMapper.constructionNoticeCount(orgCode);
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_NOTICE_COUNT.getCode(), num);
}
private void staticsCenterMapCountDataForOver15Years(Map<String, Object> result, String orgCode) {
String time = LocalDate.now().minusYears(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Long num = dpStatisticsMapper.over15yearsCount(orgCode, time);
Long num = jgStatisticsMapper.over15yearsCount(orgCode, time);
result.put(DPMapStatisticsItemEnum.OVER15YEARS_ELEVATORS.getCode(), num);
}
private void staticsCenterMapCountDataForUseReg(Map<String, Object> result, String orgCode) {
//使用告知
long num = dpStatisticsMapper.useCountByOrgCode(orgCode);
long num = jgStatisticsMapper.useCountByOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.USE_REGISTRATION_COUNT.getCode(), num);
}
private void staticsCenterMapCountCertificate(Map<String, Object> result, String orgCode) {
long num = dpStatisticsMapper.certificateCountByOrgCode(orgCode);
long num = jgStatisticsMapper.certificateCountByOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.CERTIFICATE_COUNT.getCode(), num);
}
......@@ -1638,7 +1454,7 @@ public class JGDPStatisticsServiceImpl {
// 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", true));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
......@@ -1664,19 +1480,19 @@ public class JGDPStatisticsServiceImpl {
public List<Map<String, Object>> noticeList(DPFilterParamDto dpFilterParamDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode == null){
if (orgCode == null) {
return new ArrayList<>();
}
String time = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
return dpStatisticsMapper.selectNoticeList(orgCode, time);
return jgStatisticsMapper.selectNoticeList(orgCode, time);
}
public List<Map<String, Object>> noticeCountTop(DPFilterParamDto dpFilterParamDto) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode == null){
if (orgCode == null) {
return new ArrayList<>();
}
String time = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
return dpStatisticsMapper.selectNoticeCountTopTen(orgCode, time);
return jgStatisticsMapper.selectNoticeCountTopTen(orgCode, time);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment