Commit ca27f25f authored by KeYong's avatar KeYong

修改物联报表

parent 9e0491c4
...@@ -234,4 +234,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -234,4 +234,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
void updateStatusByAlarm(); void updateStatusByAlarm();
void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId); void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId);
List<Map<String, Object>> getAlarmDetailByDate(@Param("bizOrgCode") String bizOrgCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sysId") Long sysId);
} }
...@@ -34,7 +34,6 @@ import com.yeejoin.equipmanage.fegin.JcsFeign; ...@@ -34,7 +34,6 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import liquibase.pro.packaged.O;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
...@@ -90,6 +89,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -90,6 +89,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired @Autowired
private FormInstanceMapper formInstanceMapper; private FormInstanceMapper formInstanceMapper;
@Autowired @Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
@Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
@Value("${equipment.fire.systemid}") @Value("${equipment.fire.systemid}")
private String fireSystemId; private String fireSystemId;
...@@ -1601,6 +1602,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1601,6 +1602,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 系统循环数据填充 // 系统循环数据填充
ArrayList<Map<String, Object>> systemList = new ArrayList<>(); ArrayList<Map<String, Object>> systemList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
if (!CollectionUtils.isEmpty(system)) { if (!CollectionUtils.isEmpty(system)) {
// 换流站信息 // 换流站信息
if (!ObjectUtils.isEmpty(system.get(0).get("stationName"))){ if (!ObjectUtils.isEmpty(system.get(0).get("stationName"))){
...@@ -1617,6 +1619,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1617,6 +1619,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map> collect = indicatorConfiguration.stream(). List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(sys.get("typeCode")))).collect(Collectors.toList()); filter(item -> item.get("code").equals(String.valueOf(sys.get("typeCode")))).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) { if (!CollectionUtils.isEmpty(collect)) {
// 附件告警数据
List<Map<String, Object>> sysAlarmList = equipmentSpecificAlarmMapper.getAlarmDetailByDate(bizOrgCode, startDate, endDate, Long.valueOf(String.valueOf(sys.get("id"))));
attachAlarmList.addAll(sysAlarmList);
// 系统名称 // 系统名称
systemData.put("systemName", ObjectUtils.isEmpty(sys.get("name")) ? "" : String.valueOf(sys.get("name"))); systemData.put("systemName", ObjectUtils.isEmpty(sys.get("name")) ? "" : String.valueOf(sys.get("name")));
// 系统对应指标 // 系统对应指标
...@@ -1711,10 +1717,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1711,10 +1717,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
systemList.add(systemData); systemList.add(systemData);
map.put("datalist", systemList); map.put("datalist", systemList);
} }
} }
map.put("attachAlarmList", attachAlarmList);
}else { }else {
return null; return null;
} }
...@@ -1808,12 +1812,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1808,12 +1812,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("time", startDate + "至" + endDate); map.put("time", startDate + "至" + endDate);
// 系统循环数据填充 // 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>(); ArrayList<Map<String, Object>> dataList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
for (Map<String, Object> system : systemList) { for (Map<String, Object> system : systemList) {
HashMap<String, Object> systemData = new HashMap<>(); HashMap<String, Object> systemData = new HashMap<>();
List<Map> collect = indicatorConfiguration.stream(). List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList()); filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) { if (!CollectionUtils.isEmpty(collect)) {
// 附件告警数据
List<Map<String, Object>> sysAlarmList = equipmentSpecificAlarmMapper.getAlarmDetailByDate(bizOrgCode, startDate, endDate, Long.valueOf(String.valueOf(system.get("id"))));
attachAlarmList.addAll(sysAlarmList);
// 系统名称 // 系统名称
systemData.put("systemName", ObjectUtils.isEmpty(system.get("name")) ? "" : String.valueOf(system.get("name"))); systemData.put("systemName", ObjectUtils.isEmpty(system.get("name")) ? "" : String.valueOf(system.get("name")));
...@@ -1924,9 +1933,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1924,9 +1933,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
dataList.add(systemData); dataList.add(systemData);
map.put("data", dataList); map.put("data", dataList);
} }
} }
map.put("attachAlarmList", attachAlarmList);
}else { }else {
return null; return null;
} }
...@@ -2003,14 +2011,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2003,14 +2011,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("station", ""); map.put("station", "");
} }
map.put("time", startDate); map.put("time", startDate);
// 系统循环数据填充 // 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>(); ArrayList<Map<String, Object>> dataList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
for (Map<String, Object> system : systemList) { for (Map<String, Object> system : systemList) {
HashMap<String, Object> systemData = new HashMap<>(); HashMap<String, Object> systemData = new HashMap<>();
List<Map> collect = indicatorConfiguration.stream(). List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList()); filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) { if (!CollectionUtils.isEmpty(collect)) {
// 附件告警数据
List<Map<String, Object>> sysAlarmList = equipmentSpecificAlarmMapper.getAlarmDetailByDate(bizOrgCode, startDate, endDate, Long.valueOf(String.valueOf(system.get("id"))));
attachAlarmList.addAll(sysAlarmList);
// 系统名称 // 系统名称
systemData.put("systemName", ObjectUtils.isEmpty(system.get("name")) ? "" : String.valueOf(system.get("name"))); systemData.put("systemName", ObjectUtils.isEmpty(system.get("name")) ? "" : String.valueOf(system.get("name")));
...@@ -2122,9 +2136,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2122,9 +2136,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
dataList.add(systemData); dataList.add(systemData);
map.put("data", dataList); map.put("data", dataList);
} }
} }
map.put("attachAlarmList", attachAlarmList);
}else { }else {
return null ; return null ;
} }
......
...@@ -1595,4 +1595,28 @@ ...@@ -1595,4 +1595,28 @@
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{equipmentSpecificId}; DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId}; DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId};
</delete> </delete>
<select id="getAlarmDetailByDate" resultType="Map">
SELECT
wlesa.equipment_specific_id,
wlesa.equipment_specific_name AS specificName,
wlesa.location AS location,
wlesa.equipment_specific_index_name,
concat(wlesa.equipment_specific_name, wlesa.equipment_specific_index_name) AS alamContent,
wlesa.frequency AS alarmNum,
DATE_FORMAT(wlesa.create_date, '%Y-%m-%d %H:%i:%s') AS createDate
FROM
`wl_equipment_specific_alarm` `wlesa`
LEFT JOIN f_fire_fighting_system AS sys ON FIND_IN_SET(sys.id, wlesa.system_ids)
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">AND
wlesa.biz_org_code like concat (#{bizOrgCode},'%')
</if>
<if test="startDate!=null">AND wlesa.create_date <![CDATA[>=]]> #{startDate}</if>
<if test="endDate!=null">AND wlesa.create_date <![CDATA[<=]]> #{endDate}</if>
<if test="sysId != null">
AND find_in_set(#{sysId}, wlesa.system_ids)
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
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