Commit 1e8a4553 authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_dl_bugfix_0723' into develop_dl_bugfix_0723

parents c4e05ba1 e25c7f00
......@@ -54,6 +54,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexService;
@Autowired
private IEquipmentSpecificSerivce equipmentSpecificService;
@Autowired
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
......@@ -628,12 +631,15 @@ public class SupervisionConfigureController extends AbstractBaseController {
Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId);
String name = "";
String code = "";
String type = "";
if (String.valueOf(map.get("equipment_code")).indexOf("92011000") != -1) {
name = "管网压力";
code = "gwyl";
type = "PipePressure";
} else if (String.valueOf(map.get("equipment_code")).indexOf("92011100") != -1) {
name = "水池液位";
code = "scyw";
type = "PoolLevel";
}
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null);
......@@ -688,11 +694,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
// }
// return item;
// }).collect(Collectors.toList());
List<Map<String, Object>> resList = new ArrayList<>();
Map<String, Object> threshold = equipmentSpecificService.getThreshold(type, equipmentSpecificId);
Map<String, Object> map1 = new HashMap<>();
map1.put("name", name);
map1.put("xData", res.stream().map(x -> x.get("time")).collect(Collectors.toList()));
map1.put("yData", res.stream().map(x -> x.get("value")).collect(Collectors.toList()));
map1.put("threshold", threshold);
Map<String, Object> resMap = new HashMap<>();
resMap.put(code, map1);
return CommonResponseUtil.success(resMap);
......
......@@ -346,4 +346,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId);
Map<String, Object> getThreshold(@Param("type") String type, @Param("equipmentSpecificId") String equipmentSpecificId);
}
......@@ -329,4 +329,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
Page<Map<String, Object>> getFireEquipListByDefineCode(String code, String equipStatus, String bizOrgCode, Page<Map<String, Object>> pageBean);
void updateCarStatus(String status, String carId);
Map<String, Object> getThreshold(String type, String equipmentSpecificId);
}
......@@ -2306,4 +2306,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return pageBean;
}
@Override
public Map<String, Object> getThreshold(String type, String equipmentSpecificId) {
return equipmentSpecificMapper.getThreshold(type, equipmentSpecificId);
}
}
......@@ -2144,8 +2144,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
// 今日漏查率 = 今日漏查点位(JRLCDW) / 今日应巡查点(JRYXCD)
resultMap.put("JRLCL", getPercent(resultMap.get("JRLCDW").floatValue(), resultMap.get("JRYXCD").floatValue()));
// 今日巡查点位合格占比 = 合格(HG) / 今日应巡查点(JRYXCD)
resultMap.put("JRHGZB", getPercent(resultMap.get("HG").floatValue(), resultMap.get("JRYXCD").floatValue()));
// 今日巡查点位合格占比 = 合格(HG) / 今日应巡查点(JRYXCD) 今日巡查点位合格占比 = 合格(HG) / 今日已巡查点(HG + BHG)
resultMap.put("JRHGZB", getPercent(resultMap.get("HG").floatValue(), resultMap.get("HG").floatValue() + resultMap.get("BHG").floatValue()));
return resultMap;
}
@Override
......
......@@ -2999,4 +2999,21 @@
</if>
</select>
<select id="getThreshold" resultType="java.util.Map">
SELECT
<if test="type == 'PipePressure'">
MAX( CASE WHEN b.field_name = 'maxPressure' THEN b.field_value END ) AS maxThreshold,
MAX( CASE WHEN b.field_name = 'minPressure' THEN b.field_value END ) AS minThreshold
</if>
<if test="type == 'PoolLevel'">
MAX( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxThreshold,
MAX( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minThreshold
</if>
FROM
wl_equipment_specific AS a
LEFT JOIN wl_form_instance_equip b ON a.id = b.instance_id
WHERE
a.id = #{equipmentSpecificId}
</select>
</mapper>
\ No newline at end of file
......@@ -1476,7 +1476,7 @@
UNION ALL
SELECT
IFNULL(SUM(point_num), 0) AS value,
count( pptd.id) AS value,
'合格' AS name,
'HG' AS code
FROM
......@@ -1492,7 +1492,7 @@
UNION ALL
SELECT
IFNULL(SUM(point_num), 0) AS value,
count( pptd.id) AS value,
'不合格' AS name,
'BHG' AS code
FROM
......
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