Commit 759b2387 authored by maoying's avatar maoying

Merge branch 'develop_station' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_station

parents ac7ea879 57ddb0ad
......@@ -57,6 +57,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("confirm_type")
private String confirmType;
@ApiModelProperty(value = "确认类型名称,前端已确认时回填用")
private String confirmTypeName;
@ApiModelProperty(value = "报警原因")
@TableField("alarm_reason")
private String alarmReason;
......
......@@ -45,7 +45,6 @@ public class ConfirmAlarmController extends AbstractBaseController {
public void confirmAlam(@RequestBody EquipmentSpecificAlarmLog ent) {
String appKey = getAppKey();
String product = getProduct();
String token = getToken();
iConfirmAlarmService.confirmAlam(ent, appKey, product, getToken(), getUserId());
}
......
......@@ -138,7 +138,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param);
int count(CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param);
......
......@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -12,6 +14,7 @@ import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.enums.AlarmCleanTypeEnum;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
......@@ -81,6 +84,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
private IEquipmentSpecificSerivce equipmentSpecificSerivce;
@Autowired
private IEquipmentSpecificIndexSerivce iEquipmentSpecificIndexSerivce;
@Autowired
private IVideoService videoService;
@Value("${systemctl.jcs.switch}")
......@@ -110,7 +116,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video";
final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
......@@ -127,10 +132,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
videoBySpeId = videoMapper.getVideoBySpeId(equipId);
} else {
videoBySpeId = videoMapper.getVideoBySpeId(specificAlarm.getEquipmentSpecificId());
List<DictionarieValueModel> dict = remoteSecurityService.listDictionaryByDictCode(alarmType);
Map<String, String> dictMap = dict.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
//specificAlarm.getEquipmentSpecificIndexKey() 取值为告警类型type,兼容之前的页面取值
specificAlarm.setEquipmentSpecificIndexName(dictMap.get(specificAlarm.getEquipmentSpecificIndexKey()));
}
videoBySpeId.forEach(action -> {
......@@ -160,6 +161,13 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId());
alarm.setStatus(AlarmStatusEnum.HF.getCode());
equipmentSpecificAlarmMapper.updateById(alarm);
// 警情处理确认后消除更新value 为false,否则灯还在闪
LambdaUpdateWrapper<EquipmentSpecificIndex> updateWrapper =new LambdaUpdateWrapper<EquipmentSpecificIndex>().
set(EquipmentSpecificIndex::getValue,"false").
set(EquipmentSpecificIndex::getUpdateDate,new Date()).
eq(EquipmentSpecificIndex::getEquipmentSpecificId,alarm.getEquipmentSpecificId()).
eq(EquipmentSpecificIndex::getEquipmentIndexKey,alarm.getEquipmentSpecificIndexKey());
iEquipmentSpecificIndexSerivce.update(updateWrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), equipmentSpecificAlarmLogService);
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
......
......@@ -177,11 +177,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) {
Object type = x.get("type");
if (AlarmTypeEnum.HZGJ.getCode().equals(type) || AlarmTypeEnum.GZGJ.getCode().equals(type)) {
x.put("typeCode", type);
x.put("type", AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
}
LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType"))));
......@@ -209,11 +204,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
e.printStackTrace();
}
dataVO.setAlarmEquip(String.valueOf(x.get("fireEquipmentName")));
Object type = x.get("type");
if (AlarmTypeEnum.HZGJ.getCode().equals(type) || AlarmTypeEnum.GZGJ.getCode().equals(type)
|| AlarmTypeEnum.PB.getCode().equals(type)) {
dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
}
Object alarmType = x.get("alarmType");
dataVO.setAlarmType(StringUtil.isNotEmpty(alarmType) ? alarmType.toString() : "");
dataVO.setType(String.valueOf(x.get("type")));
dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType());
dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId"))));
......
......@@ -161,8 +161,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
List<DynamicFormInstance> formInstance = vo.getFormInstances();
// 验证必填项 BUG 2725 by kongfm 2021-09-09
formInstance.stream().forEach(item -> {
if (item.getNotNull() == true && StringUtils.isEmpty(item.getFieldValue())) {
formInstance.forEach(item -> {
if (item.getNotNull() && StringUtils.isEmpty(item.getFieldValue())) {
throw new BadRequest(item.getFieldLabel() + "为必填项,请确认");
}
});
......@@ -770,7 +770,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if (SystemTypeEnum.fireAlarmSys.getCode().equals(systemCode)) {
data = fireFightingSystemMapper.fireAlarmSysEquipmentNumber();
this.putAll(data, fireFightingSystemMapper.fireAlarmSysIndexNumber());
this.putAll(data, fireFightingSystemMapper.fireWaterSysHydrant());
} else if (SystemTypeEnum.fireCAFSSys.getCode().equals(systemCode)) {
data = fireFightingSystemMapper.getFireCafsSystem();
} else if (SystemTypeEnum.fireONLSys.getCode().equals(systemCode)) {
......@@ -786,6 +785,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
data = fireFightingSystemMapper.fireWaterSysCollectingDevice();
this.putAll(data, fireFightingSystemMapper.fireWaterSysPool());
this.putAll(data, fireFightingSystemMapper.fireWaterSysWaterPump());
this.putAll(data, fireFightingSystemMapper.fireWaterSysHydrant());
} else {
data = fireFightingSystemMapper.otherSysIndexNumAndTotal();
}
......
......@@ -75,9 +75,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.ICarPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
......
......@@ -446,7 +446,7 @@ public class SyncDataServiceImpl implements ISyncDataService {
private void sendMessage(SyncDataMessage message) {
try {
emqKeeper.getMqttClient().publish(message.getType().getMqTopic(), message.message2Bytes(), 1, false);
emqKeeper.getMqttClient().publish(message.getType().getMqTopic(), message.message2Bytes(), 2, false);
} catch (MqttException e) {
e.printStackTrace();
}
......
......@@ -2343,4 +2343,15 @@
where sd.description is null;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1646291252942-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific_alarm_log" columnName="confirm_type_name"/>
</not>
</preConditions>
<comment>wl_equipment_specific_alarm_log add column confirm_type_name 确认类型名称前端回显用</comment>
<sql>
ALTER TABLE wl_equipment_specific_alarm_log ADD COLUMN `confirm_type_name` varchar(255) DEFAULT NULL COMMENT '确认类型名称前端回显用';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -17,6 +17,7 @@
ala.equipment_specific_id,
spe.code AS equipmentSpecificCode,
ala.equipment_specific_index_name,
(select type_name from wl_signal_classify sc where sc.type_code = ala.type limit 1) as equipmentSpecificIndexName,
ala.type as equipment_specific_index_key,
concat(ala.equipment_specific_name,ala.equipment_specific_index_name) as alarmContent,
ala.location AS alarmPlace,
......@@ -31,6 +32,7 @@
) as protectName,
if(confirm_type is null,'去确认','已处理') isConfirm,
confirm_type,
(select type_name from wl_signal_classify sc where sc.type_code = ala.confirm_type limit 1) as confirmTypeName,
alarm_reason,
resolve_result,
confirm_user,
......@@ -60,6 +62,7 @@
set
confirm_date = now(),
confirm_type = #{confirmType},
confirm_type_name = #{confirmTypeName},
alarm_reason = #{alarmReason},
resolve_result = #{resolveResult},
confirm_user = #{confirmUser},
......
......@@ -197,7 +197,8 @@
WHEN 'false' THEN '否'
ELSE wlesal.equipment_specific_index_value END
AS fireEquipmentPointValue,
wlesal.type AS type,
wlesal.type AS typeCode,
(select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as type,
wlesal.create_date AS createDate,
CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/
(select
......@@ -223,10 +224,10 @@
</if>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.typeCode = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.typeCode = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if>
<if test="param.type != null and param.type != ''">AND d.typeCode = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND
d.handleStatus = '已处理'
</if>
......@@ -250,43 +251,11 @@
d.cleanStatus = '未消除'
</if>
<if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND
d.type != 'SHIELD'
d.typeCode != 'SHIELD'
</if>
</where>
ORDER BY d.createDate DESC
</select>
<select id="count" resultType="java.lang.Integer">
SELECT
count(1) AS total_num
FROM
(
SELECT
wlesa.id,
wlesa.equipment_specific_id AS fireEquipmentId,
wles.code AS fireEquipmentCode,
wlesa.equipment_index_id AS fireEquipmentIndexId,
wlesa.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesa.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesa.type AS type,
wlesa.create_date AS createDate,
wlesa.location AS warehouseStructureName
FROM wl_equipment_specific_alarm_log wlesa
left join wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''"> d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{equipCode}),"%")
</if>
<if test="beginDate!=null">AND d.createDate >= #{beginDate}</if>
<if test="endDate!=null">AND d.createDate <![CDATA[<=]]> #{endDate}</if>
<if test="alarmType == 'BREAKDOWN'">AND d.type = #{alarmType}</if>
<if test="alarmType == 'FIREALARM'">AND d.type = #{alarmType}</if>
</where>
</select>
<select id="pageAlarmsInfo" resultType="Map">
SELECT
d.*
......@@ -335,6 +304,7 @@
wlesa.frequency AS frequency,
wlesal.status AS status,
wlesal.type AS type,
(select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as alarmType,
wlesal.create_date AS createDate,
wlesal.build_id AS buildId,
wlesa.recovery_date AS recoveryDate,
......
......@@ -768,7 +768,7 @@
fs.`name` AS aliasname,
fs.`code`,
fg.group_name AS systemtype,
fs.install_date AS installdate,
IFNULL(fs.install_date, CURRENT_TIMESTAMP) AS installdate,
IFNULL(p.`name`,'') AS chargeperson,
IFNULL(fs.charge_person_phone,'') AS chargepersonphone,
IFNULL(mi.`name`,'') AS constructionunit,
......@@ -777,7 +777,7 @@
fs.maintenance_frequency AS maintenancefrequency,
fs.maintenance_phone AS maintenancephone,
fs.rec_date AS createdate,
NOW( ) AS updatedate,
NOW() AS updatedate,
fs.`code` AS mrid,
fs.remark AS description
FROM
......@@ -963,7 +963,15 @@
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_UltravioletLight_FireAlarm') as zwhynum
si.equipment_index_key = 'FAS_UltravioletLight_FireAlarm') as zwhynum,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'SCS_FireDamper_FireAlarm'
) AS fhznum
</select>
<select id="fireAlarmSysIndexNumber" resultType="java.util.Map">
SELECT
......@@ -1187,14 +1195,6 @@
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'SCS_FireDamper_FireAlarm'
) AS fhznum,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` s
WHERE
s.equipment_index_key = 'SCS_FireDamper_Shield'
......@@ -1222,14 +1222,6 @@
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'FES_FireBroadcast_Start'
) AS yjgbnum,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` s
WHERE
s.equipment_index_key = 'FES_FireBroadcast_Shield'
......@@ -1252,7 +1244,15 @@
WHERE
s.equipment_index_key = 'FES_FireBroadcast_Start'
AND s.`value` = 'true'
) AS yjgbqd
) AS yjgbqd,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'FES_FireBroadcast_Start'
) AS yjgbnum
</select>
<select id="fireWaterSysHydrant" resultType="java.util.Map">
SELECT
......
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