Commit de492e90 authored by 麻笑宇's avatar 麻笑宇

修改纵览安全追溯/风险监测预警接口逻辑

parent 58393186
......@@ -28,4 +28,6 @@ public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTrac
List<String> getBusinessType(@Param("sourceTypeCode") String sourceTypeCode, @Param("orgCode") String orgCode);
List<Map<String, Object>> getBusinessCount(@Param("sourceTypeCode") String sourceTypeCode, @Param("orgCode") String orgCode);
Long countByTypeListAndOrgCode(@Param("typeList") List<String> typeList, @Param("orgCode") String orgCode, @Param("mainBody") String mainBody);
}
......@@ -179,4 +179,24 @@
problem_type,
problem_status_code;
</select>
<select id="countByTypeListAndOrgCode" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
tzs_safety_problem_tracing
WHERE
is_delete = '0'
<if test="orgCode != null and orgCode != ''">
and governing_body_org_code like CONCAT(#{orgCode}, '%')
</if>
<if test="typeList != null and typeList.size > 0">
and problem_type in
<foreach collection="typeList" item="type" open="(" separator="," close=")">
#{type}
</foreach>
</if>
<if test="mainBody != null and mainBody != ''">
and source_type_code = #{mainBody}
</if>
</select>
</mapper>
......@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto;
import com.yeejoin.amos.boot.module.common.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum;
import com.yeejoin.amos.boot.module.common.api.enums.JgBusinessTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.NoticBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto;
......@@ -640,11 +641,21 @@ public class JGDPStatisticsServiceImpl {
private CountDto getRedStatusEquip(DPFilterParamDto dpFilterParamDto) {
CountDto countDto = new CountDto();
countDto.setLongValue(this.staticsCenterMapCountDateOverdue(dpFilterParamDto));
countDto.setLongValue(this.staticsCenterMapCountDateOverdueNew(dpFilterParamDto));
countDto.setLabel("超期未检");
return countDto;
}
private Long staticsCenterMapCountDateOverdueNew(DPFilterParamDto dpFilterParamDto) {
Long num = 0L;
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
List<String> typeList = new ArrayList<>();
typeList.add("维保超期");
typeList.add("检验超期");
num = safetyProblemTracingMapper.countByTypeListAndOrgCode(typeList,orgCode, IssueMainBodyEnum.EQUIPMENT.getCode());
return num;
}
private Map<String, Map<String, CountDto>> getAllDataMap(DPFilterParamDto dpFilterParamDto) {
Map<String, Map<String, CountDto>> countMap = new HashMap<>();
countMap.put(FourColorCountItemEnum.EQUIP.getKey(), this.countEquipNum(dpFilterParamDto));
......@@ -757,11 +768,20 @@ public class JGDPStatisticsServiceImpl {
private CountDto getRedStatusCompany(DPFilterParamDto dpFilterParamDto) {
CountDto countDto = new CountDto();
countDto.setLongValue(this.countCompanyForCertDateTimeOut(dpFilterParamDto));
countDto.setLongValue(this.countCompanyForCertDateTimeOutNew(dpFilterParamDto));
countDto.setLabel("许可超期");
return countDto;
}
private Long countCompanyForCertDateTimeOutNew(DPFilterParamDto dpFilterParamDto) {
Long num = 0L;
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
List<String> typeList = new ArrayList<>();
typeList.add("许可超期");
num = safetyProblemTracingMapper.countByTypeListAndOrgCode(typeList,orgCode, IssueMainBodyEnum.COMPANY.getCode());
return num;
}
private CountDto getYellowStatusCompany(DPFilterParamDto dpFilterParamDto) {
CountDto countDto = new CountDto();
countDto.setLongValue(this.countCompanyForCertDateTemporary(dpFilterParamDto));
......@@ -821,10 +841,14 @@ public class JGDPStatisticsServiceImpl {
}
private CountDto getRedStatusUser(DPFilterParamDto dpFilterParamDto) {
// TODO 需求不明确
CountDto countDto = new CountDto();
countDto.setLongValue(0L);
countDto.setLabel("许可超期");
countDto.setLabel("资质超期");
Long num = 0L;
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
List<String> typeList = new ArrayList<>();
typeList.add("资质超期");
num = safetyProblemTracingMapper.countByTypeListAndOrgCode(typeList,orgCode, IssueMainBodyEnum.PERSON.getCode());
countDto.setLongValue(num);
return countDto;
}
......
......@@ -679,8 +679,8 @@ public class ZLDPStatisticsServiceImpl {
JSONObject jsonObject9 = new JSONObject();
jsonObject9.put("key", "csjsynx");
jsonObject9.put("value", orgCode == null ? 0L: this.getQuestionNumber("超设计使用年限",params, orgCode));
jsonObject9.put("name", "超设计使用年限");
jsonObject9.put("value", orgCode == null ? 0L: this.getQuestionNumber("超设计年限",params, orgCode));
jsonObject9.put("name", "超设计年限");
JSONObject jsonObject10 = new JSONObject();
jsonObject10.put("key", "zzlq");
......@@ -689,9 +689,14 @@ public class ZLDPStatisticsServiceImpl {
JSONObject jsonObject11 = new JSONObject();
jsonObject11.put("key", "zzcq");
jsonObject11.put("value", orgCode == null ? 0L: stCommonService.getRedStatusCompany(params).getLongValue());
jsonObject11.put("value", orgCode == null ? 0L: this.getQuestionNumber("许可超期",params, orgCode));
jsonObject11.put("name", "许可超期");
JSONObject jsonObject12 = new JSONObject();
jsonObject12.put("key", "jyzzcq");
jsonObject12.put("value", orgCode == null ? 0L: this.getQuestionNumber("资质超期",params, orgCode));
jsonObject12.put("name", "资质超期");
jsonArray.add(jsonObject0);
jsonArray.add(jsonObject1);
jsonArray.add(jsonObject2);
......@@ -704,6 +709,7 @@ public class ZLDPStatisticsServiceImpl {
jsonArray.add(jsonObject9);
jsonArray.add(jsonObject10);
jsonArray.add(jsonObject11);
jsonArray.add(jsonObject12);
}
return jsonArray;
......
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