Commit 3b3e9989 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_bugfix' into develop_tzs_register

parents dace1529 c943f153
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
WHERE LENGTH(t.use_registration_code) = 14 WHERE LENGTH(t.use_registration_code) = 14
AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车') AND SUBSTR(t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车')
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')') AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
AND (tjur.reg_type IS NULL OR tjur.reg_type = 2) AND (tjur.reg_type IS NULL OR tjur.reg_type = '2' OR tjur.reg_type = '0')
AND tjur.is_delete = 0 AND tjur.is_delete = 0
GROUP BY SUBSTR(t.use_registration_code, 1, 5) GROUP BY SUBSTR(t.use_registration_code, 1, 5)
HAVING code <![CDATA[ <> ]]> '00000' HAVING code <![CDATA[ <> ]]> '00000'
......
...@@ -33,8 +33,11 @@ ...@@ -33,8 +33,11 @@
<if test="problemModel.problemTypeCode != null and problemModel.problemTypeCode != ''"> <if test="problemModel.problemTypeCode != null and problemModel.problemTypeCode != ''">
and spt.problem_type_code = #{problemModel.problemTypeCode} and spt.problem_type_code = #{problemModel.problemTypeCode}
</if> </if>
<if test="problemModel.problemTimeStart != null and problemModel.problemTimeEnd != null"> <if test="problemModel.problemTimeStart != null">
and to_char(spt.problem_time, 'YYYY-MM-DD') >= to_char(#{problemModel.problemTimeStart}::timestamp, 'YYYY-MM-DD') and to_char(spt.problem_time, 'YYYY-MM-DD') <![CDATA[<=]]> to_char(#{problemModel.problemTimeEnd}::timestamp, 'YYYY-MM-DD') and to_char(spt.problem_time, 'YYYY-MM-DD') <![CDATA[>=]]> to_char(#{problemModel.problemTimeStart}::timestamp, 'YYYY-MM-DD')
</if>
<if test="problemModel.problemTimeEnd != null">
and to_char(spt.problem_time, 'YYYY-MM-DD') <![CDATA[<=]]> to_char(#{problemModel.problemTimeEnd}::timestamp, 'YYYY-MM-DD')
</if> </if>
<if test="problemModel.problemDesc != null and problemModel.problemDesc != ''"> <if test="problemModel.problemDesc != null and problemModel.problemDesc != ''">
and spt.problem_desc like CONCAT('%', #{problemModel.problemDesc}, '%') and spt.problem_desc like CONCAT('%', #{problemModel.problemDesc}, '%')
......
...@@ -757,7 +757,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -757,7 +757,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String useRegistrationCode = String.valueOf(equipmentInfoForm.get("useRegistrationCode")).trim(); String useRegistrationCode = String.valueOf(equipmentInfoForm.get("useRegistrationCode")).trim();
String equipId = String.valueOf(equipmentInfoForm.get("RECORD")); String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
// 校验使用登记证编号的唯一性 // 校验使用登记证编号的唯一性
if (commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) { if (!CylinderTypeEnum.CYLINDER.getCode().equals(equipmentInfoForm.get("EQU_CATEGORY")) && commonService.useRegistrationCertificateAccountUnique(useRegistrationCode, equipId)) {
throw new BadRequest("使用登记证编号已存在!"); throw new BadRequest("使用登记证编号已存在!");
} }
String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST")) String regType = Optional.ofNullable(equipmentInfoForm.get("EQU_LIST"))
...@@ -2301,7 +2301,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2301,7 +2301,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 历史设备且做过历史登记 // 历史设备且做过历史登记
BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery();
hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his")); hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his"));
hisBuilder.mustNot(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his_ymt"));// 排除一码通设备
hisBuilder.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", Boolean.TRUE)); hisBuilder.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", Boolean.TRUE));
dBuilder.should(hisBuilder); dBuilder.should(hisBuilder);
// 或新设备 // 或新设备
......
...@@ -1748,7 +1748,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1748,7 +1748,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
dto.setResultCode("approvalStatus"); dto.setResultCode("approvalStatus");
map.put("approvalStatus", "10"); map.put("approvalStatus", "10");
operate = "2"; operate = "2";
}else if(WorkFlowStatusEnum.USE_SAFETY_CHECK.getPass().equals(jgUseRegistration.getStatus())|| WorkFlowStatusEnum.USE_SAFETY_CHECK.getReject().equals(jgUseRegistration.getStatus())){ }else if(WorkFlowStatusEnum.USE_SAFETY_CHECK.getPass().equals(jgUseRegistration.getStatus())
|| WorkFlowStatusEnum.USE_SAFETY_CHECK.getReject().equals(jgUseRegistration.getStatus())
|| WorkFlowStatusEnum.USE_SAFETY_CHECK.getRollBack().equals(jgUseRegistration.getStatus())){
//安全监察驳回到一级 //安全监察驳回到一级
dto.setNextExecuteUserCompanyCode(jgUseRegistration.getReceiveCompanyCode()); dto.setNextExecuteUserCompanyCode(jgUseRegistration.getReceiveCompanyCode());
map.put("nextExecuteUserOrgCode", ""); map.put("nextExecuteUserOrgCode", "");
......
...@@ -62,6 +62,17 @@ public class JGDPStatisticsController { ...@@ -62,6 +62,17 @@ public class JGDPStatisticsController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-中间地图左右两侧8大类、单位、人员数量全局统计/无监管码", notes = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计/无监管码")
@PostMapping(value = "/zl/center-map/legendNoSupervisoryCode")
public ResponseModel<Map<String, Object>> centerMapCountForGlobalNoSupervisoryCode(@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.centerMapCountForGlobalNoSupervisoryCode(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-中间地图地市统计", notes = "大屏总览中间-地图地市统计") @ApiOperation(httpMethod = "POST", value = "大屏总览-中间地图地市统计", notes = "大屏总览中间-地图地市统计")
@PostMapping(value = "/zl/center-map/overview") @PostMapping(value = "/zl/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) { public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
......
...@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -181,4 +182,11 @@ public class ZLDPStatisticsController { ...@@ -181,4 +182,11 @@ public class ZLDPStatisticsController {
public ResponseModel<List<Map<String, String>>> personType(@RequestParam(value = "companyType",required = false) String companyType) { public ResponseModel<List<Map<String, String>>> personType(@RequestParam(value = "companyType",required = false) String companyType) {
return ResponseHelper.buildResponse(statisticsService.getPersonType(companyType)); return ResponseHelper.buildResponse(statisticsService.getPersonType(companyType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getRegulatorUnitTree")
@ApiOperation(httpMethod = "GET", value = "查询监管部门树", notes = "查询监管部门树")
public ResponseModel<Object> getRegulatorUnitTree(){
return ResponseHelper.buildResponse(statisticsService.getRegulatorUnitTree());
}
} }
...@@ -894,11 +894,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -894,11 +894,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>(); return new HashMap<>();
} }
// 1.气瓶数量统计 // 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 //1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
//2.压力管道长度统计 //2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
//3.单位数量统计 //3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode); this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计 //4.人员数量统计
...@@ -989,11 +989,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -989,11 +989,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>(); return new HashMap<>();
} }
// 0. 气瓶数量统计 // 0. 气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 // 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2. 压力管道长度统计 // 2. 压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3.单位数量统计 // 3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode); this.staticsCenterMapCountDataForCompany(result, orgCode);
// 4. 人员数量统计 // 4. 人员数量统计
......
...@@ -407,11 +407,11 @@ public class JGDPStatisticsServiceImpl { ...@@ -407,11 +407,11 @@ public class JGDPStatisticsServiceImpl {
return setDefaultCount(result); return setDefaultCount(result);
} }
// 1.气瓶数量统计 // 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 //1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
//2.压力管道长度统计 //2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
//3.单位数量统计 //3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode); this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计 //4.人员数量统计
...@@ -419,6 +419,21 @@ public class JGDPStatisticsServiceImpl { ...@@ -419,6 +419,21 @@ public class JGDPStatisticsServiceImpl {
return result; return result;
} }
public Map<String, Object> centerMapCountForGlobalNoSupervisoryCode(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return setDefaultCount(result);
}
// 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,false);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,false);
//2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,false);
return result;
}
private Map<String, Object> getCenterMapOverviewData(DPFilterParamDto dpFilterParamDto) { private Map<String, Object> getCenterMapOverviewData(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
...@@ -426,11 +441,11 @@ public class JGDPStatisticsServiceImpl { ...@@ -426,11 +441,11 @@ public class JGDPStatisticsServiceImpl {
return setDefaultCount(result); return setDefaultCount(result);
} }
// 0. 气瓶数量统计 // 0. 气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 // 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2. 压力管道长度统计 // 2. 压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3. 人员数量统计 // 3. 人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode); this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
return result; return result;
...@@ -1619,11 +1634,11 @@ public class JGDPStatisticsServiceImpl { ...@@ -1619,11 +1634,11 @@ public class JGDPStatisticsServiceImpl {
return new HashMap<>(); return new HashMap<>();
} }
// 0.气瓶数量统计 // 0.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 // 1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2.压力管道长度统计 // 2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3.已纳管设备总数 // 3.已纳管设备总数
this.staticsCenterMapCountDataForEquipIsManage(result); this.staticsCenterMapCountDataForEquipIsManage(result);
// 4.登记证总数 // 4.登记证总数
......
...@@ -537,11 +537,11 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -537,11 +537,11 @@ public class JYJCDPStatisticsServiceImpl {
return result; return result;
} }
// 1.气瓶统计 // 1.气瓶统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 2.8大类统计 // 2.8大类统计
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 3.压力管道统计 // 3.压力管道统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 4.报检数量统计 // 4.报检数量统计
this.staticsCenterMapCountDataReporting(result, dpFilterParamDto); this.staticsCenterMapCountDataReporting(result, dpFilterParamDto);
// 5.检验检测临期设备数数量统计 // 5.检验检测临期设备数数量统计
......
...@@ -202,7 +202,7 @@ public class StCommonServiceImpl { ...@@ -202,7 +202,7 @@ public class StCommonServiceImpl {
return regionList.stream().map(RegionModel::getRegionName).collect(Collectors.toList()); return regionList.stream().map(RegionModel::getRegionName).collect(Collectors.toList());
} }
public long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode) { public long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode,Boolean supervisoryFlag) {
long num = 0; long num = 0;
CountRequest request = new CountRequest(); CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all"); request.indices("idx_biz_view_jg_all");
...@@ -211,9 +211,13 @@ public class StCommonServiceImpl { ...@@ -211,9 +211,13 @@ public class StCommonServiceImpl {
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶 // 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER)); boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
if(supervisoryFlag) {
//已赋码 //已赋码
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE")); boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null")); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", "null"));
}else{
boolMust.mustNot(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
}
//状态为已认领 //状态为已认领
String[] status = {"草稿","已拒领","待认领"}; String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status))); boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
...@@ -228,15 +232,19 @@ public class StCommonServiceImpl { ...@@ -228,15 +232,19 @@ public class StCommonServiceImpl {
return num; return num;
} }
public void staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode) { public void staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode,Boolean supervisoryFlag) {
SearchRequest request = new SearchRequest(); SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all"); request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询 // 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
if(supervisoryFlag) {
//已赋码 //已赋码
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE")); boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null")); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", "null"));
}else{
boolMust.mustNot(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
}
//状态为已认领 //状态为已认领
String[] status = {"草稿","已拒领","待认领"}; String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status))); boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
...@@ -281,8 +289,8 @@ public class StCommonServiceImpl { ...@@ -281,8 +289,8 @@ public class StCommonServiceImpl {
return itemEnum.getCode(); return itemEnum.getCode();
} }
public void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode) { public void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode,Boolean supervisoryFlag) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode); String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode, supervisoryFlag);
BigDecimal lengthDecimal = new BigDecimal(length); BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) { if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
// 数据库的米换算成千米 // 数据库的米换算成千米
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.CountDto; import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.dto.DPFilterParamForDetailDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics;
...@@ -26,6 +30,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; ...@@ -26,6 +30,7 @@ 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.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.catalina.security.SecurityUtil;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.QueryParser;
...@@ -49,6 +54,7 @@ import org.springframework.core.io.Resource; ...@@ -49,6 +54,7 @@ import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.io.IOException; import java.io.IOException;
...@@ -65,6 +71,7 @@ public class ZLDPStatisticsServiceImpl { ...@@ -65,6 +71,7 @@ public class ZLDPStatisticsServiceImpl {
private static final String EQU_STATE = "EQU_STATE"; private static final String EQU_STATE = "EQU_STATE";
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
private final ZLStatisticsMapper screenMapper; private final ZLStatisticsMapper screenMapper;
...@@ -80,6 +87,8 @@ public class ZLDPStatisticsServiceImpl { ...@@ -80,6 +87,8 @@ public class ZLDPStatisticsServiceImpl {
// 设备纳管 纳管:true 未纳管:false // 设备纳管 纳管:true 未纳管:false
public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT"; public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT";
// 是否赋码0全部1已赋码2未赋码
public static final String IS_SUPERVISORY = "IS_SUPERVISORY";
// 信信息化管理情况:1-二维码;2-电子标签;99-无 // 信信息化管理情况:1-二维码;2-电子标签;99-无
public static final String INFORMATION_SITUATION = "INFORMATION_SITUATION"; public static final String INFORMATION_SITUATION = "INFORMATION_SITUATION";
...@@ -87,6 +96,9 @@ public class ZLDPStatisticsServiceImpl { ...@@ -87,6 +96,9 @@ public class ZLDPStatisticsServiceImpl {
private Resource equipCategory; private Resource equipCategory;
@Autowired @Autowired
private RedisUtils redisUtils;
@Autowired
private TzsServiceFeignClient tzsServiceFeignClient; private TzsServiceFeignClient tzsServiceFeignClient;
public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, EquipmentCategoryMapper equipmentCategoryMapper) { public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, EquipmentCategoryMapper equipmentCategoryMapper) {
...@@ -928,12 +940,25 @@ public class ZLDPStatisticsServiceImpl { ...@@ -928,12 +940,25 @@ public class ZLDPStatisticsServiceImpl {
pBuilder.must(QueryBuilders.matchQuery(IS_INTO_MANAGEMENT, param)); pBuilder.must(QueryBuilders.matchQuery(IS_INTO_MANAGEMENT, param));
boolMust.must(pBuilder); boolMust.must(pBuilder);
}else{ }else{
if("1".equals(map.getString("IS_SUPERVISORY"))){
//已赋码 //已赋码
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE")); boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null")); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null"));
//状态为已认领 //状态为已认领
String[] status = {"草稿","已拒领","待认领"}; String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status))); boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
}else if("2".equals(map.getString("IS_SUPERVISORY"))){
//未赋码
boolMust.mustNot(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
//状态为已认领
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
}else{
//状态为已认领
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
}
} }
builder.query(boolMust); builder.query(boolMust);
...@@ -1143,4 +1168,26 @@ public class ZLDPStatisticsServiceImpl { ...@@ -1143,4 +1168,26 @@ public class ZLDPStatisticsServiceImpl {
public List<Map<String, Object>> getInformationManageType() { public List<Map<String, Object>> getInformationManageType() {
return InformationManageTypeEnum.getEnumList(); return InformationManageTypeEnum.getEnumList();
} }
public Object getRegulatorUnitTree() {
List<LinkedHashMap> data = (List<LinkedHashMap>)redisUtils.get("REGULATOR_UNIT_TREE");
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
return findCompanyByCode(data,reginParams.getCompany().getCompanyCode());
}
private LinkedHashMap findCompanyByCode(List<LinkedHashMap> tree, String companyCode) {
for (LinkedHashMap node : tree) {
if (companyCode.equals(node.get("companyCode"))) {
return node;
}
if (node.containsKey("children") && node.get("children") instanceof List) {
LinkedHashMap foundNode = findCompanyByCode((List<LinkedHashMap>) node.get("children"), companyCode);
if (foundNode != null) {
return foundNode;
}
}
}
return null;
}
} }
...@@ -20,5 +20,5 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP ...@@ -20,5 +20,5 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP
* @param orgCode 区域code对应的管辖机构 * @param orgCode 区域code对应的管辖机构
* @return 数量 * @return 数量
*/ */
String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode); String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode,@Param("supervisoryFlag") Boolean supervisoryFlag);
} }
...@@ -36,13 +36,19 @@ ...@@ -36,13 +36,19 @@
si."ORG_BRANCH_CODE" as orgBranchCode si."ORG_BRANCH_CODE" as orgBranchCode
FROM FROM
"idx_biz_jg_register_info" ri, "idx_biz_jg_register_info" ri,
idx_biz_jg_use_info ui, idx_biz_jg_supervision_info si,
idx_biz_jg_supervision_info si idx_biz_jg_other_info oi
where where
ri."EQU_LIST" = '8000' ri."EQU_LIST" = '8000'
and ri."RECORD" = ui."RECORD"
and ui.IS_INTO_MANAGEMENT =true
and ri."RECORD" = si."RECORD" and ri."RECORD" = si."RECORD"
and ri."RECORD" = oi."RECORD"
<if test="supervisoryFlag == true">
AND oi.SUPERVISORY_CODE IS NOT NULL
</if>
<if test="supervisoryFlag == false">
AND (oi.SUPERVISORY_CODE IS NULL OR oi.SUPERVISORY_CODE='')
</if>
and oi.CLAIM_STATUS = '已认领'
) a ) a
where where
p."RECORD" = a."RECORD" and a.orgBranchCode like concat(#{orgCode}, '%') p."RECORD" = a."RECORD" and a.orgBranchCode like concat(#{orgCode}, '%')
......
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