change - 处理异常数据

main
yinq 4 months ago
parent 14bf709535
commit b704541bf3

@ -103,4 +103,16 @@ public class EmsRecordAlarmDataController extends BaseController
{ {
return toAjax(emsRecordAlarmDataService.deleteEmsRecordAlarmDataByObjIds(objIds)); return toAjax(emsRecordAlarmDataService.deleteEmsRecordAlarmDataByObjIds(objIds));
} }
/**
*
* @param objIds
* @return
*/
@PostMapping("/handleExceptions/{objIds}")
public AjaxResult handleExceptions(@PathVariable Long[] objIds)
{
return toAjax(emsRecordAlarmDataService.handleExceptionsAlarmData(objIds));
}
} }

@ -23,13 +23,19 @@ public class EmsRecordAlarmData extends BaseEntity
/** 计量设备编号 */ /** 计量设备编号 */
@Excel(name = "计量设备编号") @Excel(name = "计量设备编号")
private String monitorId; private String monitorId;
private String monitorCode;
/** 计量设备名称 */
@Excel(name = "计量设备名称")
private String monitorName; private String monitorName;
/** 采集设备编号 */ /** 采集设备编号 */
@Excel(name = "采集设备编号") @Excel(name = "采集设备编号")
private String collectDeviceId; private String collectDeviceId;
/** 采集设备名称 */
@Excel(name = "采集设备名称")
private String collectDeviceName;
/** 记录时间 */ /** 记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -67,7 +73,8 @@ public class EmsRecordAlarmData extends BaseEntity
@Excel(name = "通知用户") @Excel(name = "通知用户")
private String notifyUser; private String notifyUser;
private String nickName; /** 统一设备名称 */
private String deviceName;
public String getBeginOperationTime() { public String getBeginOperationTime() {
return beginOperationTime; return beginOperationTime;
@ -85,14 +92,6 @@ public class EmsRecordAlarmData extends BaseEntity
this.endOperationTime = endOperationTime; this.endOperationTime = endOperationTime;
} }
public String getMonitorCode() {
return monitorCode;
}
public void setMonitorCode(String monitorCode) {
this.monitorCode = monitorCode;
}
public String getMonitorName() { public String getMonitorName() {
return monitorName; return monitorName;
} }
@ -101,12 +100,20 @@ public class EmsRecordAlarmData extends BaseEntity
this.monitorName = monitorName; this.monitorName = monitorName;
} }
public String getNickName() { public String getCollectDeviceName() {
return nickName; return collectDeviceName;
}
public void setCollectDeviceName(String collectDeviceName) {
this.collectDeviceName = collectDeviceName;
}
public String getDeviceName() {
return deviceName;
} }
public void setNickName(String nickName) { public void setDeviceName(String deviceName) {
this.nickName = nickName; this.deviceName = deviceName;
} }
public void setObjId(Long objId) public void setObjId(Long objId)

@ -58,4 +58,11 @@ public interface IEmsRecordAlarmDataService
* @return * @return
*/ */
public int deleteEmsRecordAlarmDataByObjId(Long objId); public int deleteEmsRecordAlarmDataByObjId(Long objId);
/**
*
* @param objIds
* @return
*/
public int handleExceptionsAlarmData(Long[] objIds);
} }

@ -8,6 +8,8 @@ import com.os.ems.record.mapper.EmsRecordAlarmDataMapper;
import com.os.ems.record.domain.EmsRecordAlarmData; import com.os.ems.record.domain.EmsRecordAlarmData;
import com.os.ems.record.service.IEmsRecordAlarmDataService; import com.os.ems.record.service.IEmsRecordAlarmDataService;
import static com.os.common.utils.SecurityUtils.getUsername;
/** /**
* Service * Service
* *
@ -93,4 +95,22 @@ public class EmsRecordAlarmDataServiceImpl implements IEmsRecordAlarmDataService
{ {
return emsRecordAlarmDataMapper.deleteEmsRecordAlarmDataByObjId(objId); return emsRecordAlarmDataMapper.deleteEmsRecordAlarmDataByObjId(objId);
} }
/**
*
* @param objIds
* @return
*/
@Override
public int handleExceptionsAlarmData(Long[] objIds) {
for (Long objId : objIds) {
EmsRecordAlarmData alarmData = new EmsRecordAlarmData();
alarmData.setObjId(objId);
alarmData.setAlarmStatus(0L);
alarmData.setOperationName(getUsername());
alarmData.setOperationTime(DateUtils.getNowDate());
emsRecordAlarmDataMapper.updateEmsRecordAlarmData(alarmData);
}
return 1;
}
} }

@ -22,33 +22,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="notifyUser" column="notify_user" /> <result property="notifyUser" column="notify_user" />
<result property="nickName" column="nick_name" /> <result property="collectDeviceName" column="collect_device_name" />
<result property="deviceName" column="device_name" />
</resultMap> </resultMap>
<sql id="selectEmsRecordAlarmDataVo"> <sql id="selectEmsRecordAlarmDataVo">
SELECT SELECT rad.obj_id,
RAD.obj_id, rad.monitor_id,
RAD.monitor_id, rad.collect_device_id,
RAD.collect_device_id, rad.collect_time,
RAD.collect_time, rad.alarm_type,
RAD.alarm_type, rad.alarm_status,
RAD.alarm_status, rad.alarm_data,
RAD.alarm_data, rad.operation_name,
RAD.operation_name, rad.operation_time,
RAD.operation_time, rad.cause,
RAD.cause, rad.create_by,
RAD.create_by, rad.create_time,
RAD.create_time, rad.update_by,
RAD.update_by, rad.update_time,
RAD.update_time, rad.notify_user,
RAD.notify_user, bmi.monitor_name,
BMI.monitor_code, ebcdi.collect_device_name,
BMI.monitor_name, IIF(rad.monitor_id is null, ebcdi.collect_device_name, bmi.monitor_name) device_name
SUSER.nick_name FROM ems_record_alarm_data rad
FROM LEFT JOIN ems_base_monitor_info bmi ON rad.monitor_id = bmi.monitor_code
ems_record_alarm_data AS RAD LEFT JOIN ems_base_collect_device_info ebcdi on rad.collect_device_id = ebcdi.collect_device_id
LEFT JOIN ems_base_monitor_info AS BMI ON RAD.monitor_id = BMI.obj_id </sql>
LEFT JOIN sys_user AS SUSER ON RAD.notify_user = SUSER.user_id</sql>
<select id="selectEmsRecordAlarmDataList" parameterType="EmsRecordAlarmData" resultMap="EmsRecordAlarmDataResult"> <select id="selectEmsRecordAlarmDataList" parameterType="EmsRecordAlarmData" resultMap="EmsRecordAlarmDataResult">
<include refid="selectEmsRecordAlarmDataVo"/> <include refid="selectEmsRecordAlarmDataVo"/>

Loading…
Cancel
Save