Commit 27d7cb5d authored by KeYong's avatar KeYong

更新增加科技平台告警录入

parent 93b8b0b6
...@@ -64,4 +64,7 @@ public class AppAlarmExtVo { ...@@ -64,4 +64,7 @@ public class AppAlarmExtVo {
@ApiModelProperty(value = "是否拥有简报") @ApiModelProperty(value = "是否拥有简报")
private Boolean isreport = false; private Boolean isreport = false;
@ApiModelProperty(value = "客户端id")
private String client_id;
} }
\ No newline at end of file
...@@ -44,4 +44,7 @@ public class AppAlarmRportVo { ...@@ -44,4 +44,7 @@ public class AppAlarmRportVo {
@ApiModelProperty(value = "相关报告") @ApiModelProperty(value = "相关报告")
private String analysisreport = ""; private String analysisreport = "";
@ApiModelProperty(value = "客户端id")
private String client_id;
} }
\ No newline at end of file
...@@ -27,8 +27,12 @@ public interface EquipmentSpecificAlarmLogMapper extends BaseMapper<EquipmentSpe ...@@ -27,8 +27,12 @@ public interface EquipmentSpecificAlarmLogMapper extends BaseMapper<EquipmentSpe
List<AppAlarmExtVo> findByIdList(@Param("list") List<Long> idList); List<AppAlarmExtVo> findByIdList(@Param("list") List<Long> idList);
List<AppAlarmExtVo> findByIdListForNRKJ(@Param("list") List<Long> idList);
List<AppAlarmExtVo> findByIdListNoBuildId(@Param("list") List<Long> idBNullList); List<AppAlarmExtVo> findByIdListNoBuildId(@Param("list") List<Long> idBNullList);
List<AppAlarmExtVo> findByIdListNoBuildIdForNRKJ(@Param("list") List<Long> idBNullList);
List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(@Param("equipmentSpecificId") Long equipmentSpecificId List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(@Param("equipmentSpecificId") Long equipmentSpecificId
, @Param("equipmentSpecificIndexKey") String equipmentSpecificIndexKey , @Param("equipmentSpecificIndexKey") String equipmentSpecificIndexKey
, @Param("isConfirm") String isConfirm); , @Param("isConfirm") String isConfirm);
......
...@@ -65,6 +65,9 @@ public class SyncDataServiceImpl implements ISyncDataService { ...@@ -65,6 +65,9 @@ public class SyncDataServiceImpl implements ISyncDataService {
@Value("${dcs.x.hw.appKey}") @Value("${dcs.x.hw.appKey}")
private String xHwAppKey; private String xHwAppKey;
@Value("dcs.NRKJ.use")
private Boolean NRKJUse;
@Autowired @Autowired
private DcsUtil dcsUtil; private DcsUtil dcsUtil;
...@@ -427,6 +430,7 @@ public class SyncDataServiceImpl implements ISyncDataService { ...@@ -427,6 +430,7 @@ public class SyncDataServiceImpl implements ISyncDataService {
private AppAlarmRportVo getAppAlarmRportVo(AppAlarmExtVo vo) { private AppAlarmRportVo getAppAlarmRportVo(AppAlarmExtVo vo) {
AppAlarmRportVo alarmRportVo = new AppAlarmRportVo(); AppAlarmRportVo alarmRportVo = new AppAlarmRportVo();
alarmRportVo.setClient_id(clientId);
alarmRportVo.setTime(vo.getConfirmtime()); alarmRportVo.setTime(vo.getConfirmtime());
alarmRportVo.setEventdesc(vo.getEventdesc()); alarmRportVo.setEventdesc(vo.getEventdesc());
alarmRportVo.setEventreason(vo.getEventreason()); alarmRportVo.setEventreason(vo.getEventreason());
...@@ -451,11 +455,20 @@ public class SyncDataServiceImpl implements ISyncDataService { ...@@ -451,11 +455,20 @@ public class SyncDataServiceImpl implements ISyncDataService {
if (CollectionUtils.isNotEmpty(idList) || CollectionUtils.isNotEmpty(idBNullList)) { if (CollectionUtils.isNotEmpty(idList) || CollectionUtils.isNotEmpty(idBNullList)) {
List<AppAlarmExtVo> appAlarmVoList = new ArrayList<>(); List<AppAlarmExtVo> appAlarmVoList = new ArrayList<>();
List<AppAlarmExtVo> appAlarmVoList1 = new ArrayList<>(); List<AppAlarmExtVo> appAlarmVoList1 = new ArrayList<>();
if (CollectionUtils.isNotEmpty(idList)) { if (NRKJUse) {
appAlarmVoList = equipmentSpecificAlarmLogMapper.findByIdList(idList); if (CollectionUtils.isNotEmpty(idList)) {
} appAlarmVoList = equipmentSpecificAlarmLogMapper.findByIdListForNRKJ(idList);
if (CollectionUtils.isNotEmpty(idBNullList)) { }
appAlarmVoList1 = equipmentSpecificAlarmLogMapper.findByIdListNoBuildId(idBNullList); if (CollectionUtils.isNotEmpty(idBNullList)) {
appAlarmVoList1 = equipmentSpecificAlarmLogMapper.findByIdListNoBuildIdForNRKJ(idBNullList);
}
} else {
if (CollectionUtils.isNotEmpty(idList)) {
appAlarmVoList = equipmentSpecificAlarmLogMapper.findByIdList(idList);
}
if (CollectionUtils.isNotEmpty(idBNullList)) {
appAlarmVoList1 = equipmentSpecificAlarmLogMapper.findByIdListNoBuildId(idBNullList);
}
} }
appAlarmVoList.addAll(appAlarmVoList1); appAlarmVoList.addAll(appAlarmVoList1);
if (CollectionUtils.isNotEmpty(appAlarmVoList)) { if (CollectionUtils.isNotEmpty(appAlarmVoList)) {
......
...@@ -78,8 +78,10 @@ dcs.token-key=dcs_token_key ...@@ -78,8 +78,10 @@ dcs.token-key=dcs_token_key
dcs.client.secret=fire_system dcs.client.secret=fire_system
dcs.x.hw.id=io.cs dcs.x.hw.id=io.cs
dcs.x.hw.appKey=i!YmnHgJ=Ysz8V+O@ZG237inQKfixkQ.-#-P3IlR8fO%.#F!g%35Z#@tp$6G+52v dcs.x.hw.appKey=i!YmnHgJ=Ysz8V+O@ZG237inQKfixkQ.-#-P3IlR8fO%.#F!g%35Z#@tp$6G+52v
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token # \u7531\u4E8E\u76EE\u524D\u6709\u4E0D\u6B62\u4E00\u4E2A\u6570\u5B57\u7AD9\u5E73\u53F0\u5BF9\u5E94\u63A5\u53E3\u89C4\u8303\u4E0D\u4E00\u81F4\uFF0C\u6240\u4EE5\u6B64\u5904\u589E\u52A0\u914D\u7F6E\uFF0Ctrue\u8868\u793A\u9002\u7528\u4E8E\u5357\u745E\u79D1\u6280\u7684\u63A5\u53E3\u89C4\u8303
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm dcs.NRKJ.use=false
dcs.url.token=http://172.21.101.123/udaap-ddis/v1/cs/auth-service/oauth/token
dcs.url.sendalarm=http://172.21.101.101/v1/cs/alarm-service/appalarm/sendalarm
#dcs.url.token=https://192.168.4.89/v1/cs/auth-service/oauth/token #dcs.url.token=https://192.168.4.89/v1/cs/auth-service/oauth/token
#dcs.url.sendalarm=https://192.168.4.89/v1/cs/alarm-service/appalarm/sendalarm #dcs.url.sendalarm=https://192.168.4.89/v1/cs/alarm-service/appalarm/sendalarm
......
...@@ -55,6 +55,43 @@ ...@@ -55,6 +55,43 @@
GROUP BY GROUP BY
sal.id sal.id
</select> </select>
<select id="findByIdListForNRKJ" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo">
SELECT
'fire_system' AS client_id,
CONCAT(sal.create_date) AS time,
IFNULL(a.`code`,' ') AS areaid,
IFNULL(a.`name`,' ') AS areaname,
sal.station_code AS stationid,
sal.station_name AS stationname,
s.`code` AS deviceid,
s.`name` AS devicename,
sal.equipment_specific_code AS partid,
sal.equipment_specific_name AS partname,
s.`system_type_code` AS type,
IF
( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel,
CONCAT(IF(a.`name` IS NOT NULL, CONCAT('位于', a.`name`, '的'), ''), sal.equipment_specific_name, '在', sal.create_date, '发生', sal.equipment_specific_index_name, '事件,请相关人员进行核实确认现场情况!') AS eventdesc,
sal.equipment_specific_index_name AS eventaction,
IF
( sal.confirm_date IS NULL, FALSE, TRUE ) AS isreport,
CONCAT(sal.confirm_date) AS confirmtime,
sal.alarm_reason AS eventreason
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN wl_form_instance i ON sal.build_id = i.instance_id
LEFT JOIN wl_area a ON a.id = i.field_value
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET(s.id, sal.system_ids)
WHERE
i.field_name = "belongAreaId"
<if test="list != null and list.size() >0">
AND sal.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
sal.id
</select>
<select id="findByIdListNoBuildId" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo"> <select id="findByIdListNoBuildId" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo">
SELECT SELECT
CONCAT(sal.create_date) AS time, CONCAT(sal.create_date) AS time,
...@@ -69,6 +106,41 @@ ...@@ -69,6 +106,41 @@
s.`system_type_code` AS type, s.`system_type_code` AS type,
IF IF
( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel, ( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel,
CONCAT(sal.equipment_specific_name, '在', sal.create_date, '发生', sal.equipment_specific_index_name, '事件,请相关人员进行核实确认现场情况!') AS eventdesc,
sal.equipment_specific_index_name AS eventaction,
IF
( sal.confirm_date IS NULL, FALSE, TRUE ) AS isreport ,
CONCAT(sal.confirm_date) AS confirmtime,
sal.alarm_reason AS eventreason
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET(s.id, sal.system_ids),
f_station_info f
<where>
<if test="list != null and list.size() >0">
AND sal.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
sal.id
</select>
<select id="findByIdListNoBuildIdForNRKJ" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo">
SELECT
CONCAT(sal.create_date) AS time,
' ' AS areaid,
' ' AS areaname,
f.`code` AS stationid,
f.`name` AS stationname,
s.`code` AS deviceid,
s.`name` AS devicename,
sal.equipment_specific_code AS partid,
sal.equipment_specific_name AS partname,
s.`system_type_code` AS type,
IF
( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel,
-- CONCAT( sal.equipment_specific_name, ' ', sal.equipment_specific_index_name ) AS eventdesc, -- CONCAT( sal.equipment_specific_name, ' ', sal.equipment_specific_index_name ) AS eventdesc,
CONCAT(sal.equipment_specific_name, '在', sal.create_date, '发生', sal.equipment_specific_index_name, '事件,请相关人员进行核实确认现场情况!') AS eventdesc, CONCAT(sal.equipment_specific_name, '在', sal.create_date, '发生', sal.equipment_specific_index_name, '事件,请相关人员进行核实确认现场情况!') AS eventdesc,
sal.equipment_specific_index_name AS eventaction, sal.equipment_specific_index_name AS eventaction,
......
...@@ -5599,7 +5599,7 @@ ...@@ -5599,7 +5599,7 @@
</select> </select>
<select id="selectAllPressurePumpInfo" resultType="java.util.Map"> <select id="selectAllPressurePumpInfo" resultType="java.util.Map">
SELECT SELECT
ed.`name`, es.`name`,
concat_ws( '-', ws.full_name, ed.area ) area, concat_ws( '-', ws.full_name, ed.area ) area,
es.iot_code, es.iot_code,
es.id, es.id,
......
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