Commit 8b9b1c1f authored by 麻笑宇's avatar 麻笑宇

增加查询八大类未赋码数量接口

parent cccb7be9
......@@ -62,6 +62,17 @@ public class JGDPStatisticsController {
}
@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 = "大屏总览中间-地图地市统计")
@PostMapping(value = "/zl/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
......
......@@ -894,11 +894,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>();
}
// 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
//2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
//3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计
......@@ -989,11 +989,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>();
}
// 0. 气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2. 压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
// 4. 人员数量统计
......
......@@ -407,11 +407,11 @@ public class JGDPStatisticsServiceImpl {
return setDefaultCount(result);
}
// 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
//2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
//3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计
......@@ -419,6 +419,21 @@ public class JGDPStatisticsServiceImpl {
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) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
......@@ -426,11 +441,11 @@ public class JGDPStatisticsServiceImpl {
return setDefaultCount(result);
}
// 0. 气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2. 压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3. 人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
return result;
......@@ -1619,11 +1634,11 @@ public class JGDPStatisticsServiceImpl {
return new HashMap<>();
}
// 0.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 3.已纳管设备总数
this.staticsCenterMapCountDataForEquipIsManage(result);
// 4.登记证总数
......
......@@ -537,11 +537,11 @@ public class JYJCDPStatisticsServiceImpl {
return result;
}
// 1.气瓶统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode);
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true);
// 2.8大类统计
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true);
// 3.压力管道统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true);
// 4.报检数量统计
this.staticsCenterMapCountDataReporting(result, dpFilterParamDto);
// 5.检验检测临期设备数数量统计
......
......@@ -202,7 +202,7 @@ public class StCommonServiceImpl {
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;
CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all");
......@@ -211,9 +211,13 @@ public class StCommonServiceImpl {
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
if(supervisoryFlag) {
//已赋码
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 = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
......@@ -228,15 +232,19 @@ public class StCommonServiceImpl {
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();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
if(supervisoryFlag) {
//已赋码
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 = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
......@@ -281,8 +289,8 @@ public class StCommonServiceImpl {
return itemEnum.getCode();
}
public void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode);
public void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode,Boolean supervisoryFlag) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode, supervisoryFlag);
BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
// 数据库的米换算成千米
......
......@@ -20,5 +20,5 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP
* @param orgCode 区域code对应的管辖机构
* @return 数量
*/
String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode);
String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode,@Param("supervisoryFlag") Boolean supervisoryFlag);
}
......@@ -36,13 +36,19 @@
si."ORG_BRANCH_CODE" as orgBranchCode
FROM
"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
ri."EQU_LIST" = '8000'
and ri."RECORD" = ui."RECORD"
and ui.IS_INTO_MANAGEMENT =true
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
where
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