Commit d66d5e50 authored by 刘凡's avatar 刘凡

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents a8d9a5f3 0d5fca62
...@@ -30,6 +30,9 @@ public enum DPMapStatisticsItemEnum { ...@@ -30,6 +30,9 @@ public enum DPMapStatisticsItemEnum {
GAS_UNITS("充装单位 (家)", "gasUnits", ""), GAS_UNITS("充装单位 (家)", "gasUnits", ""),
OPERATORS("作业人员 (人)", "operators", ""), OPERATORS("作业人员 (人)", "operators", ""),
DEVICE_COUNT("已纳管设备数", "deviceCount", ""), DEVICE_COUNT("已纳管设备数", "deviceCount", ""),
PERSON_ISSUES_COUNT("个人问题数", "个人", ""),
COMPANY_ISSUES_COUNT("企业问题数", "企业", ""),
EQU_ISSUES_COUNT("设备数", "设备", ""),
CERTIFICATE_COUNT("登记证总量", "certificateCount", ""); CERTIFICATE_COUNT("登记证总量", "certificateCount", "");
private String label; private String label;
private String code; private String code;
......
...@@ -181,7 +181,7 @@ public class JgChangeRegistrationReformController extends BaseController { ...@@ -181,7 +181,7 @@ public class JgChangeRegistrationReformController extends BaseController {
if (!ValidationUtil.isEmpty(receiveCompanyCode)){ if (!ValidationUtil.isEmpty(receiveCompanyCode)){
String[] codes = receiveCompanyCode.split("_"); String[] codes = receiveCompanyCode.split("_");
if (!ValidationUtil.isEmpty(codes)){ if (!ValidationUtil.isEmpty(codes)){
dto.setReceiveCompanyCode("1".equals(transferType) ? null : codes[0]); dto.setReceiveCompanyCode(codes[0]);
} }
} }
dto.setCertificateStatus("1".equals(transferType) ? "已注销" : "已登记"); dto.setCertificateStatus("1".equals(transferType) ? "已注销" : "已登记");
......
...@@ -944,7 +944,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -944,7 +944,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
useInfo.setUseUnitCreditCode(registration.getNewUseUnitCreditCode()); useInfo.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
useInfoMapper.updateById(useInfo); useInfoMapper.updateById(useInfo);
} }
//es中的编号信息 //修改ES中使用单位信息和使用单位代码
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
map1.put("USE_UNIT_CREDIT_CODE", registration.getNewUseUnitCreditCode()); map1.put("USE_UNIT_CREDIT_CODE", registration.getNewUseUnitCreditCode());
...@@ -964,6 +964,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -964,6 +964,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List<String> ids = historyJson.stream().map(v -> JSON.parseObject(v.toString()).getString("sequenceNbr")).collect(Collectors.toList()); List<String> ids = historyJson.stream().map(v -> JSON.parseObject(v.toString()).getString("sequenceNbr")).collect(Collectors.toList());
List<JgUseRegistrationManage> list = useRegistrationManageService.lambdaQuery().in(BaseEntity::getSequenceNbr, ids).list(); List<JgUseRegistrationManage> list = useRegistrationManageService.lambdaQuery().in(BaseEntity::getSequenceNbr, ids).list();
for (JgUseRegistrationManage registrationManage : list) { for (JgUseRegistrationManage registrationManage : list) {
//修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
registrationManage.setUseUnitName(registration.getNewUseUnitName()); registrationManage.setUseUnitName(registration.getNewUseUnitName());
registrationManage.setUseUnitCreditCode(registration.getNewUseUnitCreditCode()); registrationManage.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
registrationManage.setReceiveOrgName(registration.getReceiveOrgName()); registrationManage.setReceiveOrgName(registration.getReceiveOrgName());
......
...@@ -67,7 +67,7 @@ import java.util.concurrent.TimeUnit; ...@@ -67,7 +67,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* 移装告知服务实现类 * 移装告知服务实现类
* *
* @author system_generator * @author system_generator
* @date 2023-12-19 * @date 2023-12-19
...@@ -114,6 +114,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -114,6 +114,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Autowired @Autowired
ESEquipmentCategory esEquipmentCategory; ESEquipmentCategory esEquipmentCategory;
@Autowired
JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
@Autowired
JgTransferNoticeEqServiceImpl jgTransferNoticeEqService;
@Autowired
ESElavtorRepository esElavtorRepository;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -450,8 +456,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -450,8 +456,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
} }
@Autowired
ESElavtorRepository esElavtorRepository;
/** /**
* 分页查询 * 分页查询
...@@ -828,7 +833,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -828,7 +833,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
// 检查实际状态是否不等于期望状态 // 检查实际状态是否不等于期望状态
commonService.checkExpectedStatus(jgTransferNotice.getNoticeStatus()); commonService.checkExpectedStatus(jgTransferNotice.getNoticeStatus());
// 执行工作流并返回组装好的工作流信息 // 执行工作流并返回组装好的工作流信息
WorkflowResultDto workflowResultDto = getWorkflowResultDto(op, opinion, jgTransferNotice); WorkflowResultDto workflowResultDto = getWorkflowResultDto(op, opinion, jgTransferNotice);
...@@ -848,8 +852,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -848,8 +852,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
jgTransferNotice.setPromoter(""); jgTransferNotice.setPromoter("");
jgTransferNotice.setHandleDate(new Date()); jgTransferNotice.setHandleDate(new Date());
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode())); jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
//修改设备ES设备使用场所和设备详细使用地址
Map<String, Map<String, Object>> objMap = new HashMap<>(); Map<String, Map<String, Object>> objMap = new HashMap<>();
for (JgTransferNoticeEq eq : jgTransferNoticeEqs) { for (JgTransferNoticeEq eq : jgTransferNoticeEqs) {
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
...@@ -966,9 +969,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -966,9 +969,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
} }
@Autowired
JgTransferNoticeEqServiceImpl jgTransferNoticeEqService;
private void updateEq(JgTransferNotice jgTransferNotice) { private void updateEq(JgTransferNotice jgTransferNotice) {
// 组装设备注册代码 // 组装设备注册代码
String ym = null; String ym = null;
...@@ -990,9 +990,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -990,9 +990,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
jgTransferNoticeEqService.updateBatchById(eqList); jgTransferNoticeEqService.updateBatchById(eqList);
} }
@Autowired
JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
private void saveHisDataBeforeUpdate(JgTransferNotice jgTransferNotice, List<JgTransferNoticeEq> jgTransferNoticeEqs) { private void saveHisDataBeforeUpdate(JgTransferNotice jgTransferNotice, List<JgTransferNoticeEq> jgTransferNoticeEqs) {
String seq = jgTransferNotice.getSequenceNbr().toString(); String seq = jgTransferNotice.getSequenceNbr().toString();
JSONObject json = (JSONObject) JSONObject.toJSON(jgTransferNotice); JSONObject json = (JSONObject) JSONObject.toJSON(jgTransferNotice);
......
...@@ -2332,7 +2332,7 @@ ...@@ -2332,7 +2332,7 @@
</w:rPr> </w:rPr>
</w:pPr> </w:pPr>
<#list installLicenseExpirationDateList as item1> <#list equipList.installLicenseExpirationDateList as item1>
<w:r> <w:r>
<w:rPr> <w:rPr>
<w:rFonts w:hint="eastAsia" w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体"/> <w:rFonts w:hint="eastAsia" w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体"/>
......
package com.yeejoin.amos.boot.module.statistics.api.dto;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class SecurityIndexCountItemDto {
private String regionCode;
private String regionName;
/**
* 充装检查率
*/
private String czjc;
/**
* 许可有效率
*/
String xuke;
/**
* 使用登记办理率
*/
String shiyongdengji;
/**
* 检验超期率
*/
String jianyanchaoqi;
/**
* 检验合格率
*/
String jianyanhege;
/**
* 充装检查率
*/
String czjchege;
}
...@@ -46,10 +46,10 @@ public interface AQZSDPStatisticsMapper { ...@@ -46,10 +46,10 @@ public interface AQZSDPStatisticsMapper {
/** /**
* 单位按照资质状态分组下的统计数量 * 单位按照资质状态分组下的统计数量
* *
* @param regionCode 区域 * @param orgCode 区域
* @return List<KeyValueDto> * @return List<KeyValueDto>
*/ */
List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "regionCode") String regionCode); List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "orgCode") String orgCode);
/** /**
* 查询单个单位的有效期信息 * 查询单个单位的有效期信息
* *
...@@ -58,8 +58,9 @@ public interface AQZSDPStatisticsMapper { ...@@ -58,8 +58,9 @@ public interface AQZSDPStatisticsMapper {
*/ */
KeyValueDto queryLicenseEfficiencyOneCompany(@Param(value = "appId") String appId); KeyValueDto queryLicenseEfficiencyOneCompany(@Param(value = "appId") String appId);
Map<String, Object> getInspectionExpiredRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId); Map<String, Object> getInspectionExpiredRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
Map<String, Object> getInspectionResultRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId); Map<String, Object> getInspectionResultRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
List<Map<String, Object>> selectByOrg(String orgCode);
} }
...@@ -13,4 +13,11 @@ import org.apache.ibatis.annotations.Param; ...@@ -13,4 +13,11 @@ import org.apache.ibatis.annotations.Param;
public interface CylinderStatisticsMapper { public interface CylinderStatisticsMapper {
Long countEnterpriseNumForCylinder(@Param("orgCode") String orgCode); Long countEnterpriseNumForCylinder(@Param("orgCode") String orgCode);
/**
* 按照管辖维度,统计充装单位使用登记证的办理率
* @param orgCode 区域对应的单位orgCode
* @return 办理率*100
*/
String queryUserRegisterCertAppPercent(@Param("orgCode") String orgCode);
} }
...@@ -246,8 +246,8 @@ ...@@ -246,8 +246,8 @@
<where> <where>
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''"> <if test="orgCode != null and orgCode != ''">
and cu.org_code like concat(#{regionCode}, '%') and cu.supervise_org_code like concat(#{orgCode}, '%')
</if> </if>
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
and cu.app_id = #{appId} and cu.app_id = #{appId}
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
<where> <where>
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''"> <if test="orgCode != null and orgCode != ''">
and cu.org_code like concat( #{regionCode}, '%') and cu.supervise_org_code like concat( #{orgCode}, '%')
</if> </if>
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
and cu.app_id = #{appId} and cu.app_id = #{appId}
...@@ -303,9 +303,21 @@ ...@@ -303,9 +303,21 @@
where where
cu.data_sources = '陕西省内企业' cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%' AND cu.unit_type LIKE '%充装单位%'
and cu.org_code like concat('%', #{regionCode}, '%') and cu.supervise_org_code like concat(#{orgCode}, '%')
GROUP BY strKey GROUP BY strKey
</select> </select>
<select id="selectByOrg" resultType="java.util.Map">
SELECT COUNT
( 1 ),
source_type AS sourceType
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
GROUP BY
source_type
</select>
</mapper> </mapper>
...@@ -10,4 +10,25 @@ ...@@ -10,4 +10,25 @@
unit_type LIKE'%充装单位%' unit_type LIKE'%充装单位%'
and supervise_org_code like concat(#{orgCode},'%') and supervise_org_code like concat(#{orgCode},'%')
</select> </select>
<select id="queryUserRegisterCertAppPercent" resultType="java.lang.String">
select
case when s2.total= 0 then 0 else round(s1.num/s2.total * 100, 2) end as percent
from
(SELECT
count(DISTINCT(a.use_unit_credit_code)) as num
FROM
"tzs_jg_use_registration_manage" a,
privilege_company c
where
a.receive_company_code = c.company_code
and a.certificate_status='已登记'
and c.org_code like concat(#{orgCode},'%')) s1,
(SELECT
count(1) as total
FROM "tz_base_enterprise_info"
where
unit_type LIKE'%充装单位%'
and supervise_org_code like concat(#{orgCode},'%')
) s2
</select>
</mapper> </mapper>
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
@Api(tags = "大屏-安全追溯统计Api") @Api(tags = "大屏-安全追溯及气瓶统计Api")
@RequestMapping(value = "/dp/aqzs") @RequestMapping(value = "/dp/aqzs")
public class AQZSDPStatisticsController { public class AQZSDPStatisticsController {
...@@ -33,34 +33,31 @@ public class AQZSDPStatisticsController { ...@@ -33,34 +33,31 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-气瓶-区域安全指数") @ApiOperation(value = "大屏-气瓶-区域安全指数")
@PostMapping(value = "/security-index") @PostMapping(value = "/security-index")
public ResponseModel<Map<String, Object>> getSecurityIndex(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> getSecurityIndex(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult bindingResult) throws Exception {
Object regionCode = map.get("cityCode"); List<FieldError> fieldErrors = bindingResult.getFieldErrors();
if (ObjectUtils.isEmpty(regionCode)) { if (!fieldErrors.isEmpty()) {
regionCode = "610000"; throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
} }
Map<String, Object> result = statisticsService.getSecurityIndex(dpFilterParamDto);
Map<String, Object> result = statisticsService.getSecurityIndex(regionCode.toString());
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "大屏-气瓶-区域安全指数统计") @ApiOperation(httpMethod = "POST", value = "大屏-气瓶-区域安全指数统计")
public ResponseModel<Map<String, Object>> getChildEarlyWarning(@RequestBody Map<String, Object> map) throws Exception { @RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
Object regionCode = map.get("cityCode"); public ResponseModel<Map<String, Object>> getChildEarlyWarning(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult bindingResult) throws Exception {
if (ObjectUtils.isEmpty(regionCode)) { List<FieldError> fieldErrors = bindingResult.getFieldErrors();
regionCode = "610000"; if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
} }
return ResponseHelper.buildResponse(statisticsService.getChildEarlyWarning(dpFilterParamDto));
return ResponseHelper.buildResponse(statisticsService.getChildEarlyWarning(regionCode.toString()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-问题类型主体统计") @ApiOperation(value = "大屏-安全追溯-左屏-问题类型主体统计")
@PostMapping(value = "/mainBodyCount") @PostMapping(value = "/mainBodyCount")
public ResponseModel<Map<String, Object>> mainBodyCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> mainBodyCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -73,7 +70,7 @@ public class AQZSDPStatisticsController { ...@@ -73,7 +70,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-设备问题近30天统计") @ApiOperation(value = "大屏-安全追溯-左屏-设备问题近30天统计")
@PostMapping(value = "/equipmentCount") @PostMapping(value = "/equipmentCount")
public ResponseModel<Map<String, Object>> equipmentCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> equipmentCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -86,7 +83,7 @@ public class AQZSDPStatisticsController { ...@@ -86,7 +83,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-企业问题近30天统计") @ApiOperation(value = "大屏-安全追溯-左屏-企业问题近30天统计")
@PostMapping(value = "/companyCount") @PostMapping(value = "/companyCount")
public ResponseModel<List<Map<String, Object>>> companyCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<List<Map<String, Object>>> companyCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -99,7 +96,7 @@ public class AQZSDPStatisticsController { ...@@ -99,7 +96,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-人员问题近30天统计") @ApiOperation(value = "大屏-安全追溯-左屏-人员问题近30天统计")
@PostMapping(value = "/personCount") @PostMapping(value = "/personCount")
public ResponseModel<Map<String, Object>> personCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> personCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -113,7 +110,7 @@ public class AQZSDPStatisticsController { ...@@ -113,7 +110,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-气瓶问题近30天统计") @ApiOperation(value = "大屏-安全追溯-左屏-气瓶问题近30天统计")
@PostMapping(value = "/cylinderCount") @PostMapping(value = "/cylinderCount")
public ResponseModel<Map<String, Object>> cylinderCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> cylinderCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -126,7 +123,7 @@ public class AQZSDPStatisticsController { ...@@ -126,7 +123,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按月统计近12个月的问题数量趋势") @ApiOperation(value = "大屏-安全追溯-右屏-按月统计近12个月的问题数量趋势")
@PostMapping(value = "/issueCountByMonth") @PostMapping(value = "/issueCountByMonth")
public ResponseModel<Map<String, Object>> issueCountByMonth(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> issueCountByMonth(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -139,7 +136,7 @@ public class AQZSDPStatisticsController { ...@@ -139,7 +136,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按月统计近30天的问题数量趋势") @ApiOperation(value = "大屏-安全追溯-右屏-按月统计近30天的问题数量趋势")
@PostMapping(value = "/issueCountByDay") @PostMapping(value = "/issueCountByDay")
public ResponseModel<Map<String, Object>> issueCountByDay(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> issueCountByDay(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -151,7 +148,7 @@ public class AQZSDPStatisticsController { ...@@ -151,7 +148,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-中屏-当前区域数据统计") @ApiOperation(value = "大屏-安全追溯-中屏-当前区域数据统计")
@PostMapping(value = "/issueCountByCityCode") @PostMapping(value = "/issueCountByCityCode")
public ResponseModel<Map<String, Object>> issueCountByCityCode(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> issueCountByCityCode(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -177,7 +174,7 @@ public class AQZSDPStatisticsController { ...@@ -177,7 +174,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-左屏-当月问题列表(主体类型、问题类型、问题时间、操作)") @ApiOperation(value = "大屏-安全追溯-左屏-当月问题列表(主体类型、问题类型、问题时间、操作)")
@PostMapping(value = "/issueMonthList") @PostMapping(value = "/issueMonthList")
public ResponseModel<List<Map<String, Object>>> issueMonthList(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<List<Map<String, Object>>> issueMonthList(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -189,7 +186,7 @@ public class AQZSDPStatisticsController { ...@@ -189,7 +186,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-当年问题等级分类统计") @ApiOperation(value = "大屏-安全追溯-右屏-当年问题等级分类统计")
@PostMapping(value = "/issueProblemLevelCount") @PostMapping(value = "/issueProblemLevelCount")
public ResponseModel<Map<String, Object>> issueProblemLevelCount(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<Map<String, Object>> issueProblemLevelCount(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -201,7 +198,7 @@ public class AQZSDPStatisticsController { ...@@ -201,7 +198,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10") @ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10")
@PostMapping(value = "/issueCompanyTop") @PostMapping(value = "/issueCompanyTop")
public ResponseModel<List<Map<String, Object>>> issueCompanyTop(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<List<Map<String, Object>>> issueCompanyTop(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -236,7 +233,7 @@ public class AQZSDPStatisticsController { ...@@ -236,7 +233,7 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10") @ApiOperation(value = "大屏-安全追溯-右屏-按问题类型排名top 10")
@PostMapping(value = "/issueCountTopByProblemType") @PostMapping(value = "/issueCountTopByProblemType")
public ResponseModel<List<Map<String, Object>>> issueCountTopByProblemType(@RequestBody Map<String, Object> map) throws Exception { public ResponseModel<List<Map<String, Object>>> issueCountTopByProblemType(@RequestBody Map<String, Object> map) {
Object regionCode = map.get("cityCode"); Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) { if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000"; regionCode = "610000";
...@@ -244,4 +241,26 @@ public class AQZSDPStatisticsController { ...@@ -244,4 +241,26 @@ public class AQZSDPStatisticsController {
List<Map<String, Object>> result = statisticsService.issueCountTopByProblemType(regionCode.toString()); List<Map<String, Object>> result = statisticsService.issueCountTopByProblemType(regionCode.toString());
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-中间地图左右两侧8大类、单位、人员数量、问题数量全局统计", notes = "大屏中间-地图左右两侧8大类、单位、人员数量、问题数量全局统计")
@PostMapping(value = "/center-map/legend")
public ResponseModel<Map<String, Object>> centerMapCountForGlobal(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForGlobal(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "安全追溯大屏-中间地图地市统计", notes = "安全追溯大屏中间-地图地市统计")
@PostMapping(value = "/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto));
}
} }
package com.yeejoin.amos.boot.module.statistcs.biz.init; package com.yeejoin.amos.boot.module.statistcs.biz.init;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.AQZSDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.JGDPStatisticsServiceImpl; import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.JGDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl; import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl;
import com.yeejoin.amos.component.robot.AmosRequestContext; import com.yeejoin.amos.component.robot.AmosRequestContext;
...@@ -16,14 +17,17 @@ public class DataInitAfterRuning implements ApplicationRunner { ...@@ -16,14 +17,17 @@ public class DataInitAfterRuning implements ApplicationRunner {
private JGDPStatisticsServiceImpl jgdpStatisticsService; private JGDPStatisticsServiceImpl jgdpStatisticsService;
private AQZSDPStatisticsServiceImpl aqzsdpStatisticsService;
private StCommonServiceImpl stCommonService; private StCommonServiceImpl stCommonService;
private AmosRequestContext amosRequestContext; private AmosRequestContext amosRequestContext;
public DataInitAfterRuning(JGDPStatisticsServiceImpl jgdpStatisticsService, StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext) { public DataInitAfterRuning(JGDPStatisticsServiceImpl jgdpStatisticsService, StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext, AQZSDPStatisticsServiceImpl aqzsdpStatisticsService) {
this.jgdpStatisticsService = jgdpStatisticsService; this.jgdpStatisticsService = jgdpStatisticsService;
this.stCommonService = stCommonService; this.stCommonService = stCommonService;
this.amosRequestContext = amosRequestContext; this.amosRequestContext = amosRequestContext;
this.aqzsdpStatisticsService = aqzsdpStatisticsService;
} }
@Override @Override
...@@ -34,5 +38,6 @@ public class DataInitAfterRuning implements ApplicationRunner { ...@@ -34,5 +38,6 @@ public class DataInitAfterRuning implements ApplicationRunner {
RequestContext.setToken(amosRequestContext.getToken()); RequestContext.setToken(amosRequestContext.getToken());
jgdpStatisticsService.init(); jgdpStatisticsService.init();
stCommonService.init(); stCommonService.init();
aqzsdpStatisticsService.init();
} }
} }
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto; import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum; import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum;
import com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum; import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum;
import com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto; import com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto;
import com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.service.ITzBaseEnterpriseInfoService; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import joptsimple.internal.Strings;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.CountRequest; import org.elasticsearch.client.core.CountRequest;
import org.elasticsearch.client.core.CountResponse; import org.elasticsearch.client.core.CountResponse;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired; import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -37,8 +45,9 @@ import java.text.NumberFormat; ...@@ -37,8 +45,9 @@ import java.text.NumberFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -54,18 +63,102 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -54,18 +63,102 @@ public class AQZSDPStatisticsServiceImpl {
private final static String NO_DATA_STR = "--"; private final static String NO_DATA_STR = "--";
@Autowired /**
RestHighLevelClient restHighLevelClient; * 压力容器设备种类
*/
private final static String EQU_LIST_CYLINDER = "2000";
/**
* 气瓶设备类别
*/
private final static String EQU_CATEGORY_CYLINDER = "2300";
/**
* 单位类型-使用单位
*/
private final static String COMPANY_TYPE_USE = "使用单位";
/**
* 单位类型-安装改造维修单位
*/
private final static String COMPANY_TYPE_MAINTENANCE = "安装改造维修单位";
/**
* 单位类型-制造单位
*/
private final static String COMPANY_TYPE_MANUFACTURE = "制造单位";
/**
* 单位类型-充装单位
*/
private final static String COMPANY_TYPE_FILLING = "充装单位";
private static List<EquipmentCategoryDto> equipmentCategoryDtos;
private static List<RegionModel> regionModels = new ArrayList<>();
private RestHighLevelClient restHighLevelClient;
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
@Resource
private AQZSDPStatisticsMapper statisticsMapper; private AQZSDPStatisticsMapper statisticsMapper;
private String getLicenseEfficiencyByRegion(String regionCode) { private EquipmentCategoryMapper equipmentCategoryMapper;
List<KeyValueDto> keyValueDtos = statisticsMapper.queryLicenseEfficiencyOfRegion(regionCode);
private EquipTechParamPipelineMapper techParamsPipelineMapper;
private TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
private TzsUserInfoMapper userInfoMapper;
private CylinderStatisticsMapper cylinderStatisticsMapper;
private StCommonServiceImpl stCommonService;
public void init() {
// 数据不变所以放到内存,提高响应时间
equipmentCategoryDtos = equipmentCategoryMapper.selectClassify();
initReginCode();
}
private void initReginCode() {
Collection<RegionModel> result = Systemctl.regionClient.queryForTree(null).getResult();
result.forEach(r -> {
regionModels.add(r);
this.loopSetChildRegin(regionModels, r.getChildren());
});
}
private void loopSetChildRegin(List<RegionModel> regionModels, Collection<RegionModel> children) {
if (children != null && children.size() > 0) {
children.forEach(c -> {
regionModels.add(c);
this.loopSetChildRegin(regionModels, c.getChildren());
});
}
}
public AQZSDPStatisticsServiceImpl(RestHighLevelClient restHighLevelClient, AQZSDPStatisticsMapper statisticsMapper, EquipmentCategoryMapper equipmentCategoryMapper, EquipTechParamPipelineMapper techParamsPipelineMapper, TzBaseEnterpriseInfoMapper enterpriseInfoMapper, TzsUserInfoMapper userInfoMapper, CylinderStatisticsMapper cylinderStatisticsMapper, StCommonServiceImpl stCommonService) {
this.restHighLevelClient = restHighLevelClient;
this.statisticsMapper = statisticsMapper;
this.equipmentCategoryMapper = equipmentCategoryMapper;
this.techParamsPipelineMapper = techParamsPipelineMapper;
this.enterpriseInfoMapper = enterpriseInfoMapper;
this.userInfoMapper = userInfoMapper;
this.cylinderStatisticsMapper = cylinderStatisticsMapper;
this.stCommonService = stCommonService;
}
private String getLicenseEfficiencyByRegion(String orgCode) {
List<KeyValueDto> keyValueDtos = statisticsMapper.queryLicenseEfficiencyOfRegion(orgCode);
int totalUnitNumber = keyValueDtos.stream().mapToInt(KeyValueDto::getIValue).sum(); int totalUnitNumber = keyValueDtos.stream().mapToInt(KeyValueDto::getIValue).sum();
int okUnitNumberNumber = keyValueDtos.stream().filter(k -> k.getStrKey().equals(LICENSE_IS_OK)).mapToInt(KeyValueDto::getIValue).sum(); int okUnitNumberNumber = keyValueDtos.stream().filter(k -> k.getStrKey().equals(LICENSE_IS_OK)).mapToInt(KeyValueDto::getIValue).sum();
if (totalUnitNumber == 0) { if (totalUnitNumber == 0) {
...@@ -79,7 +172,6 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -79,7 +172,6 @@ public class AQZSDPStatisticsServiceImpl {
private long searchEsCount(Boolean checkOk, Boolean resultOk, String regionCode, String appId) { private long searchEsCount(Boolean checkOk, Boolean resultOk, String regionCode, String appId) {
CountRequest countRequest = new CountRequest("cylinder_filling"); CountRequest countRequest = new CountRequest("cylinder_filling");
// countRequest.indices("cylinder_filling");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
if (checkOk) { if (checkOk) {
//匹配充装前检查和充装后检查都有数据 //匹配充装前检查和充装后检查都有数据
...@@ -118,82 +210,28 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -118,82 +210,28 @@ public class AQZSDPStatisticsServiceImpl {
} }
} }
public Map<String, Object> getChildEarlyWarning(String regionCode) throws Exception { public Map<String, Object> getChildEarlyWarning(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionModels = this.setRegionIfRootParent(regionCode); List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto.getCityCode());
List<String> collect = regionModels.stream().map(c -> c.getRegionCode().toString()).collect(Collectors.toList()); Map<String, SecurityIndexCountItemDto> regionCodeSecurityIndexMap = getSecurityIndexCountItemDtoMap(regionModels);
List<CompanyModel> companyModelList = Privilege.companyClient.queryListByCompanyCode(Strings.join(collect, ",")).getResult(); Set<String> legendData = getLegendForCyArea();
Map<String, CompanyModel> companyMap = companyModelList.stream().collect(Collectors.toMap(CompanyModel::getCompanyCode, c -> c));
Set<String> legendData = new HashSet<>();
List<String> xdata = new ArrayList<>();
List<String> xuke = new ArrayList<>(); List<String> xuke = new ArrayList<>();
List<String> shiyongdengji = new ArrayList<>(); List<String> shiyongdengji = new ArrayList<>();
List<String> jianyanchaoqi = new ArrayList<>(); List<String> jianyanchaoqi = new ArrayList<>();
List<String> jianyanhege = new ArrayList<>(); List<String> jianyanhege = new ArrayList<>();
List<String> czjc = new ArrayList<>(); List<String> czjc = new ArrayList<>();
List<String> czjchege = new ArrayList<>(); List<String> czjchege = new ArrayList<>();
// List<String> renyuan = new ArrayList<>(); //TODO 多线程处理后,regionCodeSecurityIndexMap顺序与regionModels的顺序不一致,需让数据和x轴的顺序保存一致
List<String> xdata = stCommonService.buildXData(regionModels);
legendData.add("许可有效率"); regionModels.forEach(r -> {
legendData.add("使用登记办理率"); SecurityIndexCountItemDto countItemDto = regionCodeSecurityIndexMap.get(r.getRegionCode().toString());
legendData.add("检验超期率"); xuke.add(countItemDto.getXuke());
legendData.add("检验合格率"); shiyongdengji.add(countItemDto.getShiyongdengji());
legendData.add("充装检查率"); jianyanchaoqi.add(countItemDto.getJianyanchaoqi());
legendData.add("充装检查合格率"); jianyanhege.add(countItemDto.getJianyanhege());
czjc.add(countItemDto.getCzjc());
for (RegionModel region : regionModels) { czjchege.add(countItemDto.getCzjchege());
});
CompanyModel companyModel = companyMap.get(region.getRegionCode().toString());
if (ObjectUtils.isEmpty(companyModel)) {
continue;
}
// 是否有充装企业在指定区域下
Boolean isHavingUnitInRegion = true;
String orgCode = companyModel.getOrgCode();
xdata.add(region.getRegionName());
// 1.许可有效率
if (!ValidationUtil.isEmpty(companyModel)) {
String value = this.getLicenseEfficiencyByRegion(orgCode);
if (NO_DATA_STR.equals(value)) {
xuke.add("0");
} else {
xuke.add(String.format("%.4f", Double.parseDouble(value) / 100.0000));
}
}
if (!ValidationUtil.isEmpty(orgCode) && !isHavingUnitInRegion) {
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
shiyongdengji.add("0");
czjc.add("0");
czjchege.add("0");
continue;
}
// 2.使用登记办理率
shiyongdengji.add("1");
// 3.检验超期率
jianyanchaoqi.add(String.format("%.4f", Double.parseDouble(statisticsMapper.getInspectionExpiredRate(orgCode, null).get("expiredRate").toString()) / 100.0000));
// 4.检验合格率
jianyanhege.add(String.format("%.4f", Double.parseDouble(statisticsMapper.getInspectionResultRate(orgCode, null).get("resultRate").toString()) / 100.0000));
// 5.充装检查率
long totalAll = searchEsCount(false, false, orgCode, null);
long totalCheck = searchEsCount(true, false, orgCode, null);
long totalResult = searchEsCount(false, true, orgCode, null);
if (totalAll != 0) {
czjc.add(new DecimalFormat("#.0000").format(((double) totalCheck / totalAll)));
} else {
czjc.add("0");
}
// 6.充装检查合格率
if (totalAll != 0) {
czjchege.add(new DecimalFormat("#.0000").format(((double) totalResult / totalAll)));
} else {
czjchege.add("0");
}
}
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put("xdata", xdata); result.put("xdata", xdata);
result.put("legendData", legendData); result.put("legendData", legendData);
result.put("xuke", xuke); result.put("xuke", xuke);
...@@ -202,144 +240,139 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -202,144 +240,139 @@ public class AQZSDPStatisticsServiceImpl {
result.put("jianyanhege", jianyanhege); result.put("jianyanhege", jianyanhege);
result.put("czjc", czjc); result.put("czjc", czjc);
result.put("czjchege", czjchege); result.put("czjchege", czjchege);
return result; return result;
} }
private List<RegionModel> setRegionIfRootParent(String regionCode) throws Exception { private Set<String> getLegendForCyArea() {
List<RegionModel> regionList = Systemctl.regionClient.queryByParentRegionCode(Integer.parseInt(regionCode)).getResult(); Set<String> legendData = new HashSet<>();
// 陕西省时需要在地图返回独立的地级市:韩城、杨凌、西咸 legendData.add("许可有效率");
if (regionCode.equals(TZSCommonConstant.SHAN_XI_REGION_CODE)) { legendData.add("使用登记办理率");
List<RegionModel> independentRegions = ReginStepEnum.enum2RegionList("map"); legendData.add("检验超期率");
regionList.addAll(independentRegions); legendData.add("检验合格率");
} legendData.add("充装检查率");
return regionList; legendData.add("充装检查合格率");
return legendData;
} }
public Map<String, Object> getSecurityIndex(String regionCode) throws Exception { public Map<String, Object> getSecurityIndex(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionModels = this.setRegionIfRootParent(regionCode); List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto.getCityCode());
List<String> collect = regionModels.stream().map(c -> c.getRegionCode().toString()).collect(Collectors.toList()); Map<String, SecurityIndexCountItemDto> regionCodeSecurityIndexMap = getSecurityIndexCountItemDtoMap(regionModels);
List<CompanyModel> companyModelList = Privilege.companyClient.queryListByCompanyCode(Strings.join(collect, ",")).getResult(); List<Map<String, String>> data = new ArrayList<>();
Map<String, CompanyModel> companyMap = companyModelList.stream().collect(Collectors.toMap(CompanyModel::getCompanyCode, c -> c)); List<Map<String, String>> finalData = data;
regionCodeSecurityIndexMap.forEach((k, v) -> {
List<String> xdata = new ArrayList<>(); Map<String, String> item = new HashMap<>();
List<String> xuke = new ArrayList<>(); item.put("name", v.getRegionName());
List<String> shiyongdengji = new ArrayList<>(); // 计算xuke的加权值
List<String> jianyanchaoqi = new ArrayList<>(); double xukeWeighted = Double.parseDouble(v.getXuke()) * 0.10;
List<String> jianyanhege = new ArrayList<>(); // 剩余权重平均分配给四个因素,每个因素大约22.5%(但为了简化,我们这里用25%的剩余权重)
List<String> czjc = new ArrayList<>(); double remainingWeightPerFactor = 0.90 / 4;
List<String> czjchege = new ArrayList<>(); // 计算其他四个因素的加权值
double jianyanchaoqiWeighted = Double.parseDouble(v.getJianyanchaoqi()) * remainingWeightPerFactor;
for (RegionModel region : regionModels) { double jianyanhegeWeighted = Double.parseDouble(v.getJianyanhege()) * remainingWeightPerFactor;
double czjcWeighted = Double.parseDouble(v.getCzjc()) * remainingWeightPerFactor;
double czjchegeWeighted = Double.parseDouble(v.getCzjchege()) * remainingWeightPerFactor;
// 计算总指数
double totalIndex = xukeWeighted + jianyanchaoqiWeighted + jianyanhegeWeighted + czjcWeighted + czjchegeWeighted;
item.put("value", String.format("%.2f", totalIndex));
finalData.add(item);
});
data = finalData.stream()
.filter(map -> map.containsKey("value"))
.sorted(Comparator.comparingDouble(map -> {
// 检查并解析值,如果失败则返回Double.MIN_VALUE(或根据需要处理)
try {
return Double.parseDouble(map.get("value"));
} catch (NumberFormatException e) {
// 处理无法解析为double的情况,这里返回Double.MIN_VALUE表示最小
// 或者可以抛出自定义异常,记录日志等
return Double.MIN_VALUE;
}
}))
.collect(Collectors.toList());
Map<String, Object> result = new HashMap<>();
List<String> name = data.stream().map(map -> map.get("name")).collect(Collectors.toList());
Collections.reverse(name);
result.put("xdata", name);
List<String> value = data.stream().map(map -> map.get("value")).collect(Collectors.toList());
Collections.reverse(value);
result.put("ydata", value);
return result;
}
CompanyModel companyModel = companyMap.get(region.getRegionCode().toString()); private Map<String, SecurityIndexCountItemDto> getSecurityIndexCountItemDtoMap(List<RegionModel> regionModels) {
if (ObjectUtils.isEmpty(companyModel)) { // 多线程处理后,顺序与regionModels的顺序不一致,故生成list
continue; List<SecurityIndexCountItemDto> countItemDtoList = getSecurityIndexCountDtoList(regionModels);
return countItemDtoList.stream().collect(Collectors.toMap(SecurityIndexCountItemDto::getRegionCode, Function.identity(), (k1, k2) -> k2));
} }
// 是否有充装企业在指定区域下
Boolean isHavingUnitInRegion = true;
String orgCode = companyModel.getOrgCode();
xdata.add(region.getRegionName()); private List<SecurityIndexCountItemDto> getSecurityIndexCountDtoList(List<RegionModel> regionModels) {
return regionModels.parallelStream().map(r -> {
String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode().toString());
SecurityIndexCountItemDto countItemDto = new SecurityIndexCountItemDto();
countItemDto.setRegionCode(r.getRegionCode().toString());
countItemDto.setRegionName(r.getRegionName());
if (ObjectUtils.isEmpty(orgCode)) {
this.setDefaultZeroData(countItemDto);
} else {
// 1.许可有效率 // 1.许可有效率
if (!ValidationUtil.isEmpty(companyModel)) {
String value = this.getLicenseEfficiencyByRegion(orgCode); String value = this.getLicenseEfficiencyByRegion(orgCode);
if (NO_DATA_STR.equals(value)) { if (NO_DATA_STR.equals(value)) {
value = "0"; value = "0";
xuke.add(value); countItemDto.setXuke(value);
} else { } else {
xuke.add(value); countItemDto.setXuke(value);
}
}
if (!ValidationUtil.isEmpty(orgCode) && !isHavingUnitInRegion) {
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
shiyongdengji.add("0");
czjc.add("0");
czjchege.add("0");
continue;
} }
// 2.使用登记办理率 // 2.使用登记办理率
shiyongdengji.add("100"); countItemDto.setShiyongdengji(cylinderStatisticsMapper.queryUserRegisterCertAppPercent(orgCode));
// 3.检验超期率 // 3.检验超期率
jianyanchaoqi.add(statisticsMapper.getInspectionExpiredRate(orgCode, null).get("expiredRate").toString()); countItemDto.setJianyanchaoqi(statisticsMapper.getInspectionExpiredRate(orgCode, null).get("expiredRate").toString());
// 4.检验合格率 // 4.检验合格率
jianyanhege.add(statisticsMapper.getInspectionResultRate(orgCode, null).get("resultRate").toString()); countItemDto.setJianyanhege(statisticsMapper.getInspectionResultRate(orgCode, null).get("resultRate").toString());
// 5.充装检查率 // 5.充装检查率
long totalAll = searchEsCount(false, false, orgCode, null); long totalAll = searchEsCount(false, false, orgCode, null);
long totalCheck = searchEsCount(true, false, orgCode, null); long totalCheck = searchEsCount(true, false, orgCode, null);
long totalResult = searchEsCount(false, true, orgCode, null); long totalResult = searchEsCount(false, true, orgCode, null);
if (totalAll != 0) { if (totalAll != 0) {
czjc.add(new DecimalFormat("#.00").format(((double) totalCheck / totalAll) * 100)); countItemDto.setCzjc(new DecimalFormat("#.00").format(((double) totalCheck / totalAll) * 100));
} else { } else {
czjc.add("0"); countItemDto.setCzjc("0");
} }
// 6.充装检查合格率 // 6.充装检查合格率
if (totalAll != 0) { if (totalAll != 0) {
czjchege.add(new DecimalFormat("#.00").format(((double) totalResult / totalAll) * 100)); countItemDto.setCzjchege(new DecimalFormat("#.00").format(((double) totalResult / totalAll) * 100));
} else { } else {
czjchege.add("0"); countItemDto.setCzjchege("0");
} }
} }
Map<String, Object> result = new HashMap<>(); return countItemDto;
}).collect(Collectors.toList());
List<Map<String, String>> data = new ArrayList<>();
// List<String> ydata = new ArrayList<>();
for (int i = 0; i < xdata.size(); i++) {
Map<String, String> item = new HashMap<>();
item.put("name", xdata.get(i));
// 计算xuke的加权值
double xukeWeighted = Double.parseDouble(xuke.get(i)) * 0.10; // 10%
// 剩余权重平均分配给四个因素,每个因素大约22.5%(但为了简化,我们这里用25%的剩余权重)
double remainingWeightPerFactor = 0.90 / 4; // 简化为每个因素25%的剩余权重
// 计算其他四个因素的加权值
double jianyanchaoqiWeighted = Double.parseDouble(jianyanchaoqi.get(i)) * remainingWeightPerFactor;
double jianyanhegeWeighted = Double.parseDouble(jianyanhege.get(i)) * remainingWeightPerFactor;
double czjcWeighted = Double.parseDouble(czjc.get(i)) * remainingWeightPerFactor;
double czjchegeWeighted = Double.parseDouble(czjchege.get(i)) * remainingWeightPerFactor;
// 计算总指数
double totalIndex = xukeWeighted + jianyanchaoqiWeighted + jianyanhegeWeighted + czjcWeighted + czjchegeWeighted;
item.put("value", String.format("%.2f", totalIndex));
data.add(item);
// ydata.add(String.format("%.2f", totalIndex));
} }
data = data.stream() private void setDefaultZeroData(SecurityIndexCountItemDto countItemDto) {
.filter(map -> map.containsKey("value")) // 确保每个Map都包含指定的键 countItemDto.setXuke("0");
.sorted(Comparator.comparingDouble(map -> { countItemDto.setShiyongdengji("0");
// 检查并解析值,如果失败则返回Double.MIN_VALUE(或根据需要处理) countItemDto.setJianyanhege("0");
try { countItemDto.setCzjc("0");
return Double.parseDouble(map.get("value")); countItemDto.setCzjchege("0");
} catch (NumberFormatException e) { countItemDto.setJianyanchaoqi("0");
// 处理无法解析为double的情况,这里返回Double.MIN_VALUE表示最小
// 或者可以抛出自定义异常,记录日志等
return Double.MIN_VALUE;
} }
}))
.collect(Collectors.toList());
List<String> name = data.stream().map(map -> map.get("name")).collect(Collectors.toList());
Collections.reverse(name);
result.put("xdata", name);
List<String> value = data.stream().map(map -> map.get("value")).collect(Collectors.toList());
Collections.reverse(value);
result.put("ydata", value);
return result; private void setDefaultZeroData(List<String> xuke, List<String> shiyongdengji, List<String> jianyanchaoqi, List<String> jianyanhege, List<String> czjc, List<String> czjchege) {
xuke.add("0");
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
czjc.add("0");
czjchege.add("0");
} }
public Map<String, Object> mainBodyCount(String cityCode) { public Map<String, Object> mainBodyCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
String startDate = LocalDate.now().minusDays(100).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<String> mainBodyNameList = IssueMainBodyEnum.getEnumNameList(); List<String> mainBodyNameList = IssueMainBodyEnum.getEnumNameList();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndMainBody(orgCode, mainBodyNameList, startDate, null); List<Map<String, Object>> list = statisticsMapper.selectByOrgAndMainBody(orgCode, mainBodyNameList, startDate, null);
List<Object> legendDataList = new ArrayList<>(); List<Object> legendDataList = new ArrayList<>();
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
...@@ -384,23 +417,13 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -384,23 +417,13 @@ public class AQZSDPStatisticsServiceImpl {
return resultMap; return resultMap;
} }
private String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = statisticsMapper.getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
public Map<String, Object> equipmentCount(String cityCode) { public Map<String, Object> equipmentCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>(); List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>(); List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), null); List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), null);
...@@ -419,7 +442,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -419,7 +442,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> companyCount(String cityCode) { public List<Map<String, Object>> companyCount(String cityCode) {
List<Map<String, Object>> resultList = new ArrayList<>(); List<Map<String, Object>> resultList = new ArrayList<>();
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.COMPANY.getName(), null); List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.COMPANY.getName(), null);
...@@ -451,7 +474,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -451,7 +474,7 @@ public class AQZSDPStatisticsServiceImpl {
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>(); List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>(); List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.PERSON.getName(), null); List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.PERSON.getName(), null);
...@@ -472,7 +495,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -472,7 +495,7 @@ public class AQZSDPStatisticsServiceImpl {
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>(); List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>(); List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), "2300"); List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), "2300");
...@@ -503,7 +526,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -503,7 +526,7 @@ public class AQZSDPStatisticsServiceImpl {
legendData.add(map); legendData.add(map);
} }
resultMap.put("legendData", legendData); resultMap.put("legendData", legendData);
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
int year = LocalDate.now().getYear(); int year = LocalDate.now().getYear();
List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), null); List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), null);
List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), "1"); List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), "1");
...@@ -557,7 +580,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -557,7 +580,7 @@ public class AQZSDPStatisticsServiceImpl {
legendData.add(map); legendData.add(map);
} }
resultMap.put("legendData", legendData); resultMap.put("legendData", legendData);
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String year = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String year = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByDate(orgCode, year, null); List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByDate(orgCode, year, null);
List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByDate(orgCode, year, "1"); List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByDate(orgCode, year, "1");
...@@ -597,7 +620,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -597,7 +620,7 @@ public class AQZSDPStatisticsServiceImpl {
} }
public Map<String, Object> issueCountByCityCode(String cityCode) { public Map<String, Object> issueCountByCityCode(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
int count = statisticsMapper.countByOrgCode(orgCode, now); int count = statisticsMapper.countByOrgCode(orgCode, now);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
...@@ -607,7 +630,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -607,7 +630,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueChildrenCityCount(String cityCode) throws Exception { public List<Map<String, Object>> issueChildrenCityCount(String cityCode) throws Exception {
List<RegionModel> regionModels = setRegionIfRootParent(cityCode); List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(cityCode);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList()); List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList); List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList);
List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList()); List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList());
...@@ -645,7 +668,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -645,7 +668,7 @@ public class AQZSDPStatisticsServiceImpl {
} }
public List<Map<String, Object>> issueMonthList(String cityCode) { public List<Map<String, Object>> issueMonthList(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<Map<String, Object>> list = statisticsMapper.issueMonthList(orgCode, time); List<Map<String, Object>> list = statisticsMapper.issueMonthList(orgCode, time);
return list; return list;
...@@ -653,7 +676,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -653,7 +676,7 @@ public class AQZSDPStatisticsServiceImpl {
public Map<String, Object> issueProblemLevelCount(String cityCode) { public Map<String, Object> issueProblemLevelCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy")); String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
List<Map<String, Object>> list = statisticsMapper.issueProblemLevelCount(orgCode, time); List<Map<String, Object>> list = statisticsMapper.issueProblemLevelCount(orgCode, time);
List<Object> xdata = new ArrayList<>(); List<Object> xdata = new ArrayList<>();
...@@ -669,7 +692,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -669,7 +692,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueCompanyTop(String cityCode) { public List<Map<String, Object>> issueCompanyTop(String cityCode) {
List<Map<String, Object>> resultList = new ArrayList<>(); List<Map<String, Object>> resultList = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy")); String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
List<Map<String, Object>> list = statisticsMapper.issueCompanyTop(orgCode, time); List<Map<String, Object>> list = statisticsMapper.issueCompanyTop(orgCode, time);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
...@@ -684,8 +707,8 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -684,8 +707,8 @@ public class AQZSDPStatisticsServiceImpl {
} }
public List<Map<String, Object>> issueChildrenCityCountTop(String cityCode) throws Exception { public List<Map<String, Object>> issueChildrenCityCountTop(String cityCode) throws Exception {
List<RegionModel> regionModels = setRegionIfRootParent(cityCode); List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(cityCode);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList()); List<Integer> regionCodeList = regionModels.stream().map(RegionModel::getRegionCode).collect(Collectors.toList());
List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList); List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList);
List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList()); List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList());
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy")); String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
...@@ -745,11 +768,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -745,11 +768,11 @@ public class AQZSDPStatisticsServiceImpl {
} }
public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) { public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> allList = statisticsMapper.issueCountTopByProblemType(orgCode, null); List<Map<String, Object>> allList = statisticsMapper.issueCountTopByProblemType(orgCode, null);
List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1"); List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1");
Map<String, Object> endIssuedataMap = new HashMap<>(); Map<String, Object> endIssuedataMap = new HashMap<>();
endList.stream().forEach(t -> { endList.forEach(t -> {
endIssuedataMap.put(t.get("problemTypeCode").toString(), t.get("count")); endIssuedataMap.put(t.get("problemTypeCode").toString(), t.get("count"));
}); });
List<Map<String, Object>> resultList = new ArrayList<>(); List<Map<String, Object>> resultList = new ArrayList<>();
...@@ -768,7 +791,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -768,7 +791,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> getEquipQuestionList(DPFilterParamDto dpFilterParamDto) { public List<Map<String, Object>> getEquipQuestionList(DPFilterParamDto dpFilterParamDto) {
this.setDefaultFilter(dpFilterParamDto); this.setDefaultFilter(dpFilterParamDto);
String orgCode = this.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) { if (StringUtils.isEmpty(orgCode)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -831,4 +854,192 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -831,4 +854,192 @@ public class AQZSDPStatisticsServiceImpl {
} }
} }
public Map<String, Object> getCenterMapCountDataForGlobal(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return new HashMap<>();
}
// 1.气瓶数量统计
long cylinderNum = this.staticsCenterMapCountDataForCylinder(result, orgCode);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
//2.压力管道长度统计
this.staticsCenterMapCountDataForPipeline(result, orgCode);
//3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
//5.问题数统计
this.staticsCenterMapCountDataForIssue(result, orgCode);
return result;
}
private void staticsCenterMapCountDataForIssue(Map<String, Object> result, String orgCode) {
List<Map<String, Object>> list = statisticsMapper.selectByOrg(orgCode);
Map<String, Object> dataMap = new HashMap<>();
AtomicReference<Long> issueCount = new AtomicReference<>(0L);
list.stream().forEach(t -> {
dataMap.put(t.get("sourceType").toString(), t.get("count"));
issueCount.updateAndGet(v -> v + Long.parseLong(t.get("count").toString()));
});
result.put("issueCount", issueCount.get());
result.put("deviceIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.EQU_ISSUES_COUNT, 0L));
result.put("companyIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.COMPANY_ISSUES_COUNT, 0L));
result.put("personIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.PERSON_ISSUES_COUNT, 0L));
}
private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode) {
long num = 0;
CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termsQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
// 且在用状态设备
boolMust.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
num = response.getCount();
} catch (IOException e) {
throw new RuntimeException(e);
}
result.put(DPMapStatisticsItemEnum.GAS.getCode(), num);
return num;
}
private void staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode) {
SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 且在用状态设备
boolMust.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.query(boolMust);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("count_by_equ_list_code").field("EQU_LIST_CODE");
builder.aggregation(aggregationBuilder);
request.source(builder);
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
Terms terms = response.getAggregations().get("count_by_equ_list_code");
Map<String, Long> countMap = new HashMap<>();
for (Terms.Bucket bucket : terms.getBuckets()) {
// 压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
if (bucket.getKeyAsString().equals(EQU_LIST_CYLINDER)) {
countMap.put(bucket.getKeyAsString(), bucket.getDocCount() - cylinderNum);
} else {
countMap.put(bucket.getKeyAsString(), bucket.getDocCount());
}
}
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
equipmentCategoryDtos.forEach(c -> {
result.put(this.castCategoryCode2WebCode(c.getCode()), countMap.getOrDefault(c.getCode(), 0L));
});
result.put(DPMapStatisticsItemEnum.TOTAL.getCode(), countMap.values().stream().mapToLong(e -> e).sum() + cylinderNum);
} catch (IOException e) {
throw new RuntimeException(e);
}
result.remove(DPMapStatisticsItemEnum.PRESSURE_PIPELINES.getCategory());
}
private String castCategoryCode2WebCode(String category) {
DPMapStatisticsItemEnum itemEnum = DPMapStatisticsItemEnum.getInstanceByCategory(category);
return itemEnum.getCode();
}
private void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode);
BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
length = lengthDecimal.divide(new BigDecimal("1000"), 3, RoundingMode.HALF_UP).toPlainString();
}
result.put(DPMapStatisticsItemEnum.PRESSURE_PIPELINES.getCode(), length);
}
private void staticsCenterMapCountDataForCompany(Map<String, Object> result, String orgCode) {
if (orgCode == null) {
setDefaultCompanyCountData(result);
return;
}
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
}
private void setDefaultCompanyCountData(Map<String, Object> m) {
m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), 0);
}
private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto, String orgCode) {
if (orgCode == null) {
result.put(DPMapStatisticsItemEnum.OPERATORS.getCode(), 0);
return;
}
Long num = userInfoMapper.countUserByPostAndAreaCode(orgCode, "6552", dpFilterParamDto.getCityCode());
result.put(DPMapStatisticsItemEnum.OPERATORS.getCode(), num);
}
public List<Map<String, Object>> getCenterMapCountDataForOverview(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto.getCityCode());
List<Map<String, Object>> result = regionModels.parallelStream().map(r -> {
DPFilterParamDto filterParamDto = new DPFilterParamDto();
filterParamDto.setCityCode(r.getRegionCode().toString());
Map<String, Object> itemResult = getCenterMapOverviewData(filterParamDto);
itemResult.put("regionCode", r.getRegionCode());
itemResult.put("regionName", r.getRegionName());
return itemResult;
}).collect(Collectors.toList());
this.setCompanyDataBatch(result);
return result;
}
private void setCompanyDataBatch(List<Map<String, Object>> result) {
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCodeNoParam();
result.forEach(m -> {
String cityCode = m.get("regionCode").toString();
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
if (orgCode != null) {
m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
} else {
setDefaultCompanyCountData(m);
}
});
}
private Map<String, Object> getCenterMapOverviewData(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return new HashMap<>();
}
// 0. 气瓶数量统计
long cylinderNum = this.staticsCenterMapCountDataForCylinder(result, orgCode);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
// 2. 压力管道长度统计
this.staticsCenterMapCountDataForPipeline(result, orgCode);
// 3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
// 4. 人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
// 5.问题统计
this.staticsCenterMapCountDataForIssue(result, orgCode);
return result;
}
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; ...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/** /**
* @author Administrator * @author Administrator
...@@ -78,4 +79,9 @@ public class StCommonServiceImpl { ...@@ -78,4 +79,9 @@ public class StCommonServiceImpl {
} }
return regionList; return regionList;
} }
public List<String> buildXData(List<RegionModel> regionList) {
return regionList.stream().map(RegionModel::getRegionName).collect(Collectors.toList());
}
} }
...@@ -2,8 +2,9 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper; ...@@ -2,8 +2,9 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamPipeline; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamPipeline;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper
public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamPipeline> { public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamPipeline> {
/** /**
* 在用的最新需求整理的技术参数--需求未出 * 在用的最新需求整理的技术参数--需求未出
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.UseUnitCreditCodeCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo; import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -19,6 +20,7 @@ import java.util.Map; ...@@ -19,6 +20,7 @@ import java.util.Map;
* @author system_generator * @author system_generator
* @date 2021-10-20 * @date 2021-10-20
*/ */
@Mapper
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')") @Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -17,6 +18,7 @@ import java.util.List; ...@@ -17,6 +18,7 @@ import java.util.List;
* @author duanwei * @author duanwei
* @date 2022-08-10 * @date 2022-08-10
*/ */
@Mapper
public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseInfo> { public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseInfo> {
/** /**
......
...@@ -4,8 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,8 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto); Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<if test="orgCodes != null and orgCodes.size > 0"> <if test="orgCodes != null and orgCodes.size > 0">
AND AND
<foreach collection="orgCodes" open="(" item="orgCode" close=")" separator=" or "> <foreach collection="orgCodes" open="(" item="orgCode" close=")" separator=" or ">
(u.org_code like concat(#{orgCode}, '%') ) (u.supervise_org_code like concat(#{orgCode}, '%') )
</foreach> </foreach>
</if> </if>
</select> </select>
......
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