Commit ca27f25f authored by KeYong's avatar KeYong

修改物联报表

parent 9e0491c4
......@@ -234,4 +234,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
void updateStatusByAlarm();
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;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import liquibase.pro.packaged.O;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.io.IOUtils;
......@@ -90,6 +89,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired
private FormInstanceMapper formInstanceMapper;
@Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
@Autowired
private SourceSceneMapper sourceSceneMapper;
@Value("${equipment.fire.systemid}")
private String fireSystemId;
......@@ -1601,6 +1602,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// 系统循环数据填充
ArrayList<Map<String, Object>> systemList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
if (!CollectionUtils.isEmpty(system)) {
// 换流站信息
if (!ObjectUtils.isEmpty(system.get(0).get("stationName"))){
......@@ -1617,6 +1619,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(sys.get("typeCode")))).collect(Collectors.toList());
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")));
// 系统对应指标
......@@ -1711,10 +1717,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
systemList.add(systemData);
map.put("datalist", systemList);
}
}
map.put("attachAlarmList", attachAlarmList);
}else {
return null;
}
......@@ -1808,12 +1812,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("time", startDate + "至" + endDate);
// 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
for (Map<String, Object> system : systemList) {
HashMap<String, Object> systemData = new HashMap<>();
List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList());
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")));
......@@ -1924,9 +1933,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
dataList.add(systemData);
map.put("data", dataList);
}
}
map.put("attachAlarmList", attachAlarmList);
}else {
return null;
}
......@@ -2003,14 +2011,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("station", "");
}
map.put("time", startDate);
// 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>();
List<Map<String, Object>> attachAlarmList = new ArrayList<>();
for (Map<String, Object> system : systemList) {
HashMap<String, Object> systemData = new HashMap<>();
List<Map> collect = indicatorConfiguration.stream().
filter(item -> item.get("code").equals(String.valueOf(system.get("typeCode")))).collect(Collectors.toList());
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")));
......@@ -2122,9 +2136,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
dataList.add(systemData);
map.put("data", dataList);
}
}
map.put("attachAlarmList", attachAlarmList);
}else {
return null ;
}
......
......@@ -1595,4 +1595,28 @@
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>
<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>
\ 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