Commit 291504ba authored by 王果's avatar 王果

36242 子 【验收优化】消防告警列表-添加物联日志页签 / 接口调整

parent b997bc55
...@@ -222,4 +222,16 @@ public class BigScreenController extends AbstractBaseController { ...@@ -222,4 +222,16 @@ public class BigScreenController extends AbstractBaseController {
return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime)); return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "消防告警列表-物联日志")
@GetMapping("/fireAlarm/iot/log")
public ResponseModel getFireAlarmIotLog(CommonPageable commonPageable,
@RequestParam(value = "fireEquipmentName", required = false) String fireEquipmentName,
@RequestParam(value = "systemCode",required = false)String systemCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(iFireFightingSystemService.getFireAlarmIotLog(page, fireEquipmentName, systemCode));
}
} }
...@@ -785,6 +785,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -785,6 +785,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode, Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode,
@Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime); @Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime);
Page<Map<String, Object>> getFireAlarmIotLog(Page page, @Param("fireEquipmentName") String fireEquipmentName,
@Param("systemCode") String systemCode);
List<LinkedHashMap<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode); List<LinkedHashMap<String, Object>> getFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
List<LinkedHashMap<String, Object>> getOtherFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode); List<LinkedHashMap<String, Object>> getOtherFireEquipStatistic(@Param("collect") List<String> collect, @Param("bizOrgCode")String bizOrgCode);
......
...@@ -377,4 +377,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -377,4 +377,6 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, Object>> getSystemAlarmNum(String bizOrgCode, String startDate, String endDate); List<Map<String, Object>> getSystemAlarmNum(String bizOrgCode, String startDate, String endDate);
Page<Map<String, Object>> getFireAlarmIotLog(Page page, String fireEquipmentName, String systemCode);
} }
...@@ -2907,6 +2907,25 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2907,6 +2907,25 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime) { public Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime) {
return fireFightingSystemMapper.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime); return fireFightingSystemMapper.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime);
} }
@Override
public Page<Map<String, Object>> getFireAlarmIotLog(Page page, String fireEquipmentName, String systemCode) {
Page<Map<String, Object>> fireAlarmIotLog = fireFightingSystemMapper.getFireAlarmIotLog(page, fireEquipmentName, systemCode);
// for (Map<String, Object> record : fireAlarmIotLog.getRecords()) {
// if (record.containsKey("signalValue") && !ObjectUtils.isEmpty(record.get("signalValue"))
// && record.containsKey("valueEnum") && !ObjectUtils.isEmpty(record.get("valueEnum"))) {
// JSONArray jsonArray = JSONArray.parseArray(record.get("valueEnum").toString());
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject jsonObject = jsonArray.getJSONObject(i);
// if (jsonObject.containsKey("key") && ObjectUtils.isEmpty(jsonObject.get("key"))
// && jsonObject.containsKey("label") && ObjectUtils.isEmpty(jsonObject.get("label"))
// && record.get("signalValue").toString().equals(jsonObject.get("key").toString())) {
// record.put("valueEnum", jsonObject.get("label"));
// }
// }
// }
// }
return fireAlarmIotLog;
}
public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) { public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) {
List<OrgMenuDto> menuList = list.stream() List<OrgMenuDto> menuList = list.stream()
......
...@@ -7352,6 +7352,55 @@ ...@@ -7352,6 +7352,55 @@
ORDER BY d.create_date desc ORDER BY d.create_date desc
</select> </select>
<select id="getFireAlarmIotLog" resultType="Map">
SELECT
d.bizOrgName,
d.fireEquipmentCode,
d.fireEquipmentName, -- 设备名称
d.eqPointName,
d.signalValue, -- 信号值
d.unit, -- 单位
d.sourceName, -- 所在位置
d.updateDate,
d.equipmentIndexName, -- 信号名称
d.systemName, -- 所属系统
d.valueEnum
FROM
(
SELECT
spe.biz_org_name AS bizOrgName,
spe.biz_org_code AS bizOrgCode,
s.`system_type_code` AS systemTypeCode,
s.`name` AS systemName,
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eqPointName,
ind.equipment_index_name equipmentIndexName,
ind.value_enum valueEnum,
ind.value_label signalValue,
ein.unit as unit,
CONCAT(IFNULL(str.full_name,''),' ',IFNULL(sto.description,'')) as sourceName,
DATE_FORMAT(ind.update_date, '%Y-%m-%d %H:%i:%S') as updateDate
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id, spe.system_id) > 0
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
WHERE det.`name` IS NOT NULL AND ind.`value` IS NOT NULL AND ind.`value` != '' AND ein.is_iot = 1
) d
<where>
<if test="fireEquipmentName!=null and fireEquipmentName != ''">
d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="systemCode != null and systemCode != ''">
AND d.systemTypeCode = #{systemCode}
</if>
</where>
ORDER BY d.updateDate desc
</select>
<select id="getFireEquipStatistic" resultType="java.util.LinkedHashMap"> <select id="getFireEquipStatistic" resultType="java.util.LinkedHashMap">
SELECT SELECT
a.`name` AS `name`, a.`name` AS `name`,
...@@ -7389,7 +7438,6 @@ ...@@ -7389,7 +7438,6 @@
GROUP BY GROUP BY
wes.equipment_code wes.equipment_code
</select> </select>
<select id="getOtherFireEquipStatistic" resultType="java.util.LinkedHashMap"> <select id="getOtherFireEquipStatistic" resultType="java.util.LinkedHashMap">
SELECT SELECT
'其他' AS `name`, '其他' AS `name`,
......
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