Commit 4714eced authored by tianyiming's avatar tianyiming

fix(api): 修正压力管道长度统计逻辑并添加设备代码和出场编号枚举

parent 980204b2
...@@ -40,6 +40,8 @@ public enum EquipAdvanceSearchEnum { ...@@ -40,6 +40,8 @@ public enum EquipAdvanceSearchEnum {
AZUSC_UNIT_NAME("安装改造维修单位名称", "USC_UNIT_NAME", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Text), AZUSC_UNIT_NAME("安装改造维修单位名称", "USC_UNIT_NAME", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Text),
CODE96333("96333识别码", "CODE96333", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword), CODE96333("96333识别码", "CODE96333", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword),
SUPERVISORY_CODE("监管码", "SUPERVISORY_CODE", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword), SUPERVISORY_CODE("监管码", "SUPERVISORY_CODE", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword),
EQU_CODE("设备代码", "EQU_CODE", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword),
FACTORY_NUM("出场编号", "FACTORY_NUM", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Keyword),
EQU_TYPE("设备型号", "EQU_TYPE", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Text), EQU_TYPE("设备型号", "EQU_TYPE", TechnicalParameter.ParamType.STRING, "", null, null, FieldType.Text),
PRODUCE_DATE("制造日期", "PRODUCE_DATE", TechnicalParameter.ParamType.DATE, "", null, null, FieldType.Date), PRODUCE_DATE("制造日期", "PRODUCE_DATE", TechnicalParameter.ParamType.DATE, "", null, null, FieldType.Date),
designDate("设计日期", "designDate", TechnicalParameter.ParamType.DATE, "", null, null, FieldType.Date), designDate("设计日期", "designDate", TechnicalParameter.ParamType.DATE, "", null, null, FieldType.Date),
......
...@@ -19,7 +19,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -19,7 +19,6 @@ 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.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -193,6 +192,6 @@ public class ZLDPStatisticsController { ...@@ -193,6 +192,6 @@ public class ZLDPStatisticsController {
@GetMapping(value = "/getTree") @GetMapping(value = "/getTree")
@ApiOperation(httpMethod = "GET", value = "查询监管部门树", notes = "查询监管部门树") @ApiOperation(httpMethod = "GET", value = "查询监管部门树", notes = "查询监管部门树")
public ResponseModel<Object> getTree(){ public ResponseModel<Object> getTree(){
return ResponseHelper.buildResponse(Collections.singletonList(statisticsService.getRegulatorUnitTree())); return ResponseHelper.buildResponse(statisticsService.getAllRegulatorUnitTree());
} }
} }
...@@ -910,7 +910,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -910,7 +910,7 @@ public class AQZSDPStatisticsServiceImpl {
result.put("total", hasSupervisoryCodeEquipCount); result.put("total", hasSupervisoryCodeEquipCount);
//2.压力管道长度统计 //2.压力管道长度统计
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false); // stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode); jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode, true);
//3.单位数量统计 //3.单位数量统计
// 单位统计修改为查询es // 单位统计修改为查询es
// this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode()); // this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode());
...@@ -1024,7 +1024,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -1024,7 +1024,7 @@ public class AQZSDPStatisticsServiceImpl {
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true, false); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true, false);
// 2. 压力管道长度统计 // 2. 压力管道长度统计
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false); // stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode); jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode, true);
//3.单位数量统计 //3.单位数量统计
// 单位统计修改为查询es // 单位统计修改为查询es
// this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode()); // this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode());
......
...@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.*; ...@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.*; import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils; import com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.QueryBuilderUtils; import com.yeejoin.amos.boot.module.statistcs.biz.utils.QueryBuilderUtils;
import com.yeejoin.amos.boot.module.statistcs.factory.EnhancedDynamicQueryBuilder;
import com.yeejoin.amos.boot.module.statistics.api.dto.*; import com.yeejoin.amos.boot.module.statistics.api.dto.*;
import com.yeejoin.amos.boot.module.statistics.api.enums.RegulatoryUnitLevelEnum; import com.yeejoin.amos.boot.module.statistics.api.enums.RegulatoryUnitLevelEnum;
import com.yeejoin.amos.boot.module.statistics.api.enums.StatisticalAnalysisEnum; import com.yeejoin.amos.boot.module.statistics.api.enums.StatisticalAnalysisEnum;
...@@ -396,7 +397,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -396,7 +397,7 @@ public class JGDPStatisticsServiceImpl {
//2.压力管道长度统计 //2.压力管道长度统计
// 修改为查询es // 修改为查询es
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false); // stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
this.staticsCenterMapCountPipLine(result, orgCode); this.staticsCenterMapCountPipLine(result, orgCode, true);
//3.单位数量统计 //3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode()); this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode());
//4.人员数量统计 //4.人员数量统计
...@@ -415,6 +416,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -415,6 +416,7 @@ public class JGDPStatisticsServiceImpl {
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 //1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode, false, true, false); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode, false, true, false);
//2.压力管道长度统计 //2.压力管道长度统计
this.staticsCenterMapCountPipLine(result, orgCode, false);
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, false, false); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, false, false);
return result; return result;
} }
...@@ -432,7 +434,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -432,7 +434,7 @@ public class JGDPStatisticsServiceImpl {
// 2. 压力管道长度统计 // 2. 压力管道长度统计
// 修改为查询es // 修改为查询es
//stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false); //stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
this.staticsCenterMapCountPipLine(result, orgCode); this.staticsCenterMapCountPipLine(result, orgCode, true);
// 3. 人员数量统计 // 3. 人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode); this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
return result; return result;
...@@ -490,7 +492,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -490,7 +492,7 @@ public class JGDPStatisticsServiceImpl {
} }
public void staticsCenterMapCountPipLine(Map<String, Object> result, String orgCode) { public void staticsCenterMapCountPipLine(Map<String, Object> result, String orgCode, Boolean isMatchSupervisoryCode) {
SearchRequest request = new SearchRequest(); SearchRequest request = new SearchRequest();
SearchSourceBuilder builder = new SearchSourceBuilder(); SearchSourceBuilder builder = new SearchSourceBuilder();
request.indices(StatisticalAnalysisEnum.equip.getKey()); request.indices(StatisticalAnalysisEnum.equip.getKey());
...@@ -498,8 +500,16 @@ public class JGDPStatisticsServiceImpl { ...@@ -498,8 +500,16 @@ public class JGDPStatisticsServiceImpl {
BoolQueryBuilder pipeLengthQuery = new BoolQueryBuilder(); BoolQueryBuilder pipeLengthQuery = new BoolQueryBuilder();
pipeLengthQuery.must(QueryBuilders.prefixQuery("ORG_BRANCH_CODE", orgCode)); pipeLengthQuery.must(QueryBuilders.prefixQuery("ORG_BRANCH_CODE", orgCode));
pipeLengthQuery.must(QueryBuilders.existsQuery("pipeLength")); pipeLengthQuery.must(QueryBuilders.existsQuery("pipeLength"));
pipeLengthQuery.must(QueryBuilders.prefixQuery("ORG_BRANCH_CODE", orgCode));
if (isMatchSupervisoryCode) {
pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE")); pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE"));
pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", "")); pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", ""));
} else {
EnhancedDynamicQueryBuilder enhancedDynamicQueryBuilder = new EnhancedDynamicQueryBuilder();
enhancedDynamicQueryBuilder.add(QueryBuilders.boolQuery().mustNot(existsQuery("SUPERVISORY_CODE")), "or");
enhancedDynamicQueryBuilder.add(QueryBuilders.termQuery("SUPERVISORY_CODE", ""), "or");
pipeLengthQuery.must(enhancedDynamicQueryBuilder.build());
}
pipeLengthQuery.mustNot(QueryBuilders.termsQuery("STATUS", Arrays.asList("草稿", "已拒领", "待认领"))); pipeLengthQuery.mustNot(QueryBuilders.termsQuery("STATUS", Arrays.asList("草稿", "已拒领", "待认领")));
SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum("pipeLengthSum").field("pipeLength").missing(0); SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum("pipeLengthSum").field("pipeLength").missing(0);
builder.query(pipeLengthQuery); builder.query(pipeLengthQuery);
...@@ -1834,7 +1844,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -1834,7 +1844,7 @@ public class JGDPStatisticsServiceImpl {
result.put("total", hasSupervisoryCodeEquipCount); result.put("total", hasSupervisoryCodeEquipCount);
// 2.压力管道长度统计 // 2.压力管道长度统计
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false); // stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
this.staticsCenterMapCountPipLine(result, orgCode); this.staticsCenterMapCountPipLine(result, orgCode, true);
// 3.已纳管设备总数 // 3.已纳管设备总数
this.staticsCenterMapCountDataForEquipIsManage(result); this.staticsCenterMapCountDataForEquipIsManage(result);
// 4.登记证总数 // 4.登记证总数
......
...@@ -548,7 +548,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -548,7 +548,7 @@ public class JYJCDPStatisticsServiceImpl {
result.put("total", hasSupervisoryCodeEquipCount); result.put("total", hasSupervisoryCodeEquipCount);
// 3.压力管道统计 // 3.压力管道统计
// stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false); // stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode); jgDPStatisticsService.staticsCenterMapCountPipLine(result, orgCode, true);
// 4.报检数量统计 // 4.报检数量统计
this.staticsCenterMapCountDataReporting(result, dpFilterParamDto); this.staticsCenterMapCountDataReporting(result, dpFilterParamDto);
// 5.检验检测临期设备数数量统计 // 5.检验检测临期设备数数量统计
......
...@@ -1278,5 +1278,8 @@ public class ZLDPStatisticsServiceImpl { ...@@ -1278,5 +1278,8 @@ public class ZLDPStatisticsServiceImpl {
return null; return null;
} }
public List<LinkedHashMap> getAllRegulatorUnitTree() {
return (List<LinkedHashMap>)redisUtils.get("REGULATOR_UNIT_TREE");
}
} }
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