Commit 57ddb0ad authored by suhuiguang's avatar suhuiguang

1.确警确认类型落库,确警页面及故障告警及火灾告警使用到

parent a71e276f
...@@ -57,6 +57,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity { ...@@ -57,6 +57,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("confirm_type") @TableField("confirm_type")
private String confirmType; private String confirmType;
@ApiModelProperty(value = "确认类型名称,前端已确认时回填用")
private String confirmTypeName;
@ApiModelProperty(value = "报警原因") @ApiModelProperty(value = "报警原因")
@TableField("alarm_reason") @TableField("alarm_reason")
private String alarmReason; private String alarmReason;
......
...@@ -45,7 +45,6 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -45,7 +45,6 @@ public class ConfirmAlarmController extends AbstractBaseController {
public void confirmAlam(@RequestBody EquipmentSpecificAlarmLog ent) { public void confirmAlam(@RequestBody EquipmentSpecificAlarmLog ent) {
String appKey = getAppKey(); String appKey = getAppKey();
String product = getProduct(); String product = getProduct();
String token = getToken();
iConfirmAlarmService.confirmAlam(ent, appKey, product, getToken(), getUserId()); iConfirmAlarmService.confirmAlam(ent, appKey, product, getToken(), getUserId());
} }
......
...@@ -138,7 +138,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -138,7 +138,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param); Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param);
int count(CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param); List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param);
......
...@@ -116,7 +116,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -116,7 +116,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Override @Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) { public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video"; final String videoType = "video";
final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
......
...@@ -177,11 +177,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -177,11 +177,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param); Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) { if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) { 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"); LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant())); x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")))); x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType"))));
......
...@@ -2343,4 +2343,15 @@ ...@@ -2343,4 +2343,15 @@
where sd.description is null; where sd.description is null;
</sql> </sql>
</changeSet> </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> </databaseChangeLog>
\ No newline at end of file
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
) as protectName, ) as protectName,
if(confirm_type is null,'去确认','已处理') isConfirm, if(confirm_type is null,'去确认','已处理') isConfirm,
confirm_type, confirm_type,
(select type_name from wl_signal_classify sc where sc.type_code = ala.confirm_type limit 1) as confirmTypeName,
alarm_reason, alarm_reason,
resolve_result, resolve_result,
confirm_user, confirm_user,
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
set set
confirm_date = now(), confirm_date = now(),
confirm_type = #{confirmType}, confirm_type = #{confirmType},
confirm_type_name = #{confirmTypeName},
alarm_reason = #{alarmReason}, alarm_reason = #{alarmReason},
resolve_result = #{resolveResult}, resolve_result = #{resolveResult},
confirm_user = #{confirmUser}, confirm_user = #{confirmUser},
......
...@@ -197,7 +197,8 @@ ...@@ -197,7 +197,8 @@
WHEN 'false' THEN '否' WHEN 'false' THEN '否'
ELSE wlesal.equipment_specific_index_value END ELSE wlesal.equipment_specific_index_value END
AS fireEquipmentPointValue, 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, wlesal.create_date AS createDate,
CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/ CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/
(select (select
...@@ -223,10 +224,10 @@ ...@@ -223,10 +224,10 @@
</if> </if>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</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.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType == 'BREAKDOWN'">AND d.typeCode = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{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.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 <if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND
d.handleStatus = '已处理' d.handleStatus = '已处理'
</if> </if>
...@@ -250,43 +251,11 @@ ...@@ -250,43 +251,11 @@
d.cleanStatus = '未消除' d.cleanStatus = '未消除'
</if> </if>
<if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND <if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND
d.type != 'SHIELD' d.typeCode != 'SHIELD'
</if> </if>
</where> </where>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </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 id="pageAlarmsInfo" resultType="Map">
SELECT SELECT
d.* d.*
......
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