Commit 27afc1e1 authored by suhuiguang's avatar suhuiguang

1.大屏-安全追溯-隐患主体类型统计(近30天)接口调整

parent 3f6a8ead
...@@ -15,8 +15,15 @@ public interface AQZSDPStatisticsMapper { ...@@ -15,8 +15,15 @@ public interface AQZSDPStatisticsMapper {
String getOrgCodeByCompanyCode(@Param("cityCode") String cityCode); String getOrgCodeByCompanyCode(@Param("cityCode") String cityCode);
/**
* 按照问题状态、问题类型分组统计问题数量
* @param orgCode 区域对应orgCode
* @param filterParamDto 过滤日期
* @return List<CountDto>
*/
List<CountDto> selectByOrgAndMainBody(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto); List<CountDto> selectByOrgAndMainBody(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto);
List<Map<String, Object>> selectByOrgAndProblemType(@Param("orgCode") String orgCode, @Param("enumNameList") List<String> enumNameList, List<Map<String, Object>> selectByOrgAndProblemType(@Param("orgCode") String orgCode, @Param("enumNameList") List<String> enumNameList,
@Param("startDate") String startDate, @Param("sourceType") String sourceType, @Param("equipType") String equipType); @Param("startDate") String startDate, @Param("sourceType") String sourceType, @Param("equipType") String equipType);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<select id="selectByOrgAndMainBody" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto"> <select id="selectByOrgAndMainBody" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT SELECT
COUNT(1) as longValue, COUNT(1) as longValue,
source_type AS keyStr, source_type_code AS keyStr,
problem_status_code as label problem_status_code as label
FROM FROM
tzs_safety_problem_tracing tzs_safety_problem_tracing
......
...@@ -332,10 +332,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -332,10 +332,11 @@ public class AQZSDPStatisticsServiceImpl {
return resultMap; return resultMap;
} }
// 3.y轴数据设置 // 3.y轴数据设置
// 按照问题状态、问题类型分组统计问题数量
List<CountDto> countDtos = statisticsMapper.selectByOrgAndMainBody(orgCode, dpFilterParamDto); List<CountDto> countDtos = statisticsMapper.selectByOrgAndMainBody(orgCode, dpFilterParamDto);
mainBodyEnums.forEach(e->{ mainBodyEnums.forEach(e->{
Long allProblemNum = countDtos.stream().filter(c->c.getLabel().equals(e.getCode())).mapToLong(CountDto::getLongValue).sum(); Long allProblemNum = countDtos.stream().filter(c-> c.getKeyStr().equals(e.getCode())).mapToLong(CountDto::getLongValue).sum();
long handledProblemNum = countDtos.stream().filter(c->c.getLabel().equals(e.getCode()) && c.getKeyStr().equals(SafetyProblemStatusEnum.HANDLED.getCode())).mapToLong(CountDto::getLongValue).sum(); long handledProblemNum = countDtos.stream().filter(c-> c.getKeyStr().equals(e.getCode()) && c.getLabel().equals(SafetyProblemStatusEnum.HANDLED.getCode())).mapToLong(CountDto::getLongValue).sum();
BigDecimal all = new BigDecimal(allProblemNum.toString()); BigDecimal all = new BigDecimal(allProblemNum.toString());
BigDecimal handled = new BigDecimal(Long.toString(handledProblemNum)); BigDecimal handled = new BigDecimal(Long.toString(handledProblemNum));
String percent = "0"; String percent = "0";
......
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