Commit 238d38bc authored by suhuiguang's avatar suhuiguang

1.大屏-检验检测修改

parent 5b184cd0
...@@ -139,7 +139,5 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -139,7 +139,5 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
* @return 统计数量数组 * @return 统计数量数组
*/ */
List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<Long> countAllInFlowingForDPNoFinishedBizData(@Param("orgCode")String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<Map<String, String>> getOrgCodesByCompanyCodes(@Param("regionCodes") List<Integer> regionCodes);
} }
...@@ -76,8 +76,6 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -76,8 +76,6 @@ public class JYJCDPStatisticsServiceImpl {
*/ */
private final static String EQU_CATEGORY_CYLINDER = "2300"; private final static String EQU_CATEGORY_CYLINDER = "2300";
private EquipmentCategoryMapper equipmentCategoryMapper;
private JyjcInspectionApplicationEquipMapper inspectionApplicationEquipMapper; private JyjcInspectionApplicationEquipMapper inspectionApplicationEquipMapper;
private JyjcInspectionApplicationMapper inspectionApplicationMapper; private JyjcInspectionApplicationMapper inspectionApplicationMapper;
...@@ -100,8 +98,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -100,8 +98,7 @@ public class JYJCDPStatisticsServiceImpl {
@Value("${jyjc.legal.companyCode:12610100750228848W,12610300MB2943942F,12610400435630992M,12610200435252143F,126105007326878566,12610600MB29845683,126108004366752362,12610700MB296441XY,12610900353680128G,126110004363154256,126100004352004822}") @Value("${jyjc.legal.companyCode:12610100750228848W,12610300MB2943942F,12610400435630992M,12610200435252143F,126105007326878566,12610600MB29845683,126108004366752362,12610700MB296441XY,12610900353680128G,126110004363154256,126100004352004822}")
private String legalCompanyCodes; private String legalCompanyCodes;
public JYJCDPStatisticsServiceImpl(EquipmentCategoryMapper equipmentCategoryMapper, JyjcInspectionApplicationEquipMapper inspectionApplicationEquipMapper, JyjcInspectionApplicationMapper inspectionApplicationMapper, TzsUserInfoMapper tzsUserInfoMapper, JyjcInspectionResultMapper inspectionResultMapper, JyjcOpeningApplicationMapper openingApplicationMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, JYJCStatisticsMapper jyjcStatisticsMapper) { public JYJCDPStatisticsServiceImpl(JyjcInspectionApplicationEquipMapper inspectionApplicationEquipMapper, JyjcInspectionApplicationMapper inspectionApplicationMapper, TzsUserInfoMapper tzsUserInfoMapper, JyjcInspectionResultMapper inspectionResultMapper, JyjcOpeningApplicationMapper openingApplicationMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, JYJCStatisticsMapper jyjcStatisticsMapper) {
this.equipmentCategoryMapper = equipmentCategoryMapper;
this.inspectionApplicationEquipMapper = inspectionApplicationEquipMapper; this.inspectionApplicationEquipMapper = inspectionApplicationEquipMapper;
this.inspectionApplicationMapper = inspectionApplicationMapper; this.inspectionApplicationMapper = inspectionApplicationMapper;
this.tzsUserInfoMapper = tzsUserInfoMapper; this.tzsUserInfoMapper = tzsUserInfoMapper;
...@@ -122,7 +119,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -122,7 +119,7 @@ public class JYJCDPStatisticsServiceImpl {
List<BizTypeEnum> bizTypeEnums = getBizTypeList(); List<BizTypeEnum> bizTypeEnums = getBizTypeList();
result.put("legendData", this.getLegendData(bizTypeEnums)); result.put("legendData", this.getLegendData(bizTypeEnums));
// 8大类设备种类 // 8大类设备种类
List<EquipmentCategoryDto> equipmentCategoryDtos = equipmentCategoryMapper.selectClassify(); List<EquipmentCategoryDto> equipmentCategoryDtos = StCommonServiceImpl.getEquipmentCategory();
//2.2 x轴数据构造 //2.2 x轴数据构造
result.put("xdata", this.getXData(equipmentCategoryDtos)); result.put("xdata", this.getXData(equipmentCategoryDtos));
//2.3 y轴数据构造 //2.3 y轴数据构造
...@@ -272,12 +269,11 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -272,12 +269,11 @@ public class JYJCDPStatisticsServiceImpl {
return result; return result;
} }
//2.3 y轴数据构造 //2.3 y轴数据构造
this.buildYDataForPendingResultInspectApp(result, jyjcTypeEnums, dpFilterParamDto); this.buildYDataForPendingResultInspectApp(result, jyjcTypeEnums, dpFilterParamDto, orgCode);
return result; return result;
} }
private void buildYDataForPendingResultInspectApp(Map<String, Object> result, JYJCTypeEnum[] jyjcTypeEnums, DPFilterParamDto dpFilterParamDto) { private void buildYDataForPendingResultInspectApp(Map<String, Object> result, JYJCTypeEnum[] jyjcTypeEnums, DPFilterParamDto dpFilterParamDto, String orgCode) {
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
List<CountDto> countDtoList = inspectionApplicationMapper.queryAllPendingResultInspectApp(orgCode, dpFilterParamDto); List<CountDto> countDtoList = inspectionApplicationMapper.queryAllPendingResultInspectApp(orgCode, dpFilterParamDto);
fillJYJCYData(result, jyjcTypeEnums, countDtoList); fillJYJCYData(result, jyjcTypeEnums, countDtoList);
} }
...@@ -323,18 +319,18 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -323,18 +319,18 @@ public class JYJCDPStatisticsServiceImpl {
this.setDefaultFilter(dpFilterParamDto); this.setDefaultFilter(dpFilterParamDto);
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
// 2.x轴数据构建 // 2.x轴数据构建
List<EquipmentCategoryDto> equipmentCategoryDtos = equipmentCategoryMapper.selectClassify(); List<EquipmentCategoryDto> equipmentCategoryDtos = StCommonServiceImpl.getEquipmentCategory();
this.setXDataForInspectionEquipByEquList(result, equipmentCategoryDtos); this.setXDataForInspectionEquipByEquList(result, equipmentCategoryDtos);
// 3.图列数据设置
this.setLegendDataForInspectionEquipByEquList(result);
if(orgCode == null){ if(orgCode == null){
return result; return result;
} }
// 3.y轴数据设置 // 4.y轴数据设置
// 目前都单设备报检故统计主表即可 // 目前都单设备报检故统计主表即可
List<CountDto> countDtos = inspectionApplicationMapper.queryAppByEquListForDP(orgCode, dpFilterParamDto); List<CountDto> countDtos = inspectionApplicationMapper.queryAppByEquListForDP(orgCode, dpFilterParamDto);
Map<String, List<CountDto>> groupByMap = countDtos.stream().collect(Collectors.groupingBy(CountDto::getLabel)); Map<String, List<CountDto>> groupByMap = countDtos.stream().collect(Collectors.groupingBy(CountDto::getLabel));
this.setYDataForInspectionEquipByEquList(result, groupByMap, equipmentCategoryDtos); this.setYDataForInspectionEquipByEquList(result, groupByMap, equipmentCategoryDtos);
// 4.图列数据设置
this.setLegendDataForInspectionEquipByEquList(result);
return result; return result;
} }
...@@ -490,7 +486,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -490,7 +486,7 @@ public class JYJCDPStatisticsServiceImpl {
// 1.1 图列数据构造 // 1.1 图列数据构造
result.put("legendData", this.getLegendDataForJyTime()); result.put("legendData", this.getLegendDataForJyTime());
// 8大类设备种类 // 8大类设备种类
List<EquipmentCategoryDto> equipmentCategoryDtos = equipmentCategoryMapper.selectClassify(); List<EquipmentCategoryDto> equipmentCategoryDtos = StCommonServiceImpl.getEquipmentCategory();
// 2.x轴数据构造 // 2.x轴数据构造
result.put("xdata", this.getEquListXDataCommon(equipmentCategoryDtos)); result.put("xdata", this.getEquListXDataCommon(equipmentCategoryDtos));
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
...@@ -519,7 +515,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -519,7 +515,7 @@ public class JYJCDPStatisticsServiceImpl {
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_STATE", EquimentEnum.ZAIYONG.getCode())); boolMust.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
// 且下次检验日期大于等于当天 且查询 下次检验日期 <= 当前天+30天 为临期 // 且下次检验日期大于等于当天 且查询 下次检验日期 <= 当前天+30天 为临期
long currentDayTime = DateUtil.parse(DateUtil.today(), "yyy-MM-dd").getTime(); long currentDayTime = DateUtil.parse(DateUtil.today(), "yyy-MM-dd").getTime();
long currentDayAfter30DayTime = DateUtil.offsetDay(DateUtil.parse(DateUtil.today(), "yyy-MM-dd"), 30).getTime(); long currentDayAfter30DayTime = DateUtil.offsetDay(DateUtil.parse(DateUtil.today(), "yyy-MM-dd"), 30).getTime();
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime)); boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime));
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
tz_base_enterprise_info bi tz_base_enterprise_info bi
WHERE WHERE
tui.unit_code = bi.use_code tui.unit_code = bi.use_code
and tui.post LIKE concat ( '%', #{post}, '%' ) and tui.post LIKE concat ('%', #{post}, '%')
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%'))) and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%')))
and tui.is_delete=false and tui.is_delete=false
</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