设备配置表新增work_status字段
This commit is contained in:
@ -108,6 +108,10 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
@Excel(name = "设备运行状态:0-离线、1-在线")
|
||||
private String deviceStatus;
|
||||
|
||||
/** 设备运行状态:0-离线、1-在线 */
|
||||
@Excel(name = "工作状态:0-运行 1-停机 2-故障")
|
||||
private String workStatus;
|
||||
|
||||
/** 设备图像地址 */
|
||||
@Excel(name = "设备图像地址")
|
||||
private String pictureUrl;
|
||||
@ -330,6 +334,14 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
this.deviceStatus = deviceStatus;
|
||||
}
|
||||
|
||||
public String getWorkStatus() {
|
||||
return workStatus;
|
||||
}
|
||||
|
||||
public void setWorkStatus(String workStatus) {
|
||||
this.workStatus = workStatus;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl)
|
||||
{
|
||||
this.pictureUrl = pictureUrl;
|
||||
|
||||
@ -17,6 +17,8 @@ public class SiteDeviceListVo {
|
||||
private String deviceType;
|
||||
/** 运行状态 */
|
||||
private String deviceStatus;
|
||||
/** 工作状态 */
|
||||
private String workStatus;
|
||||
/** 设备类型 */
|
||||
private String deviceCategory;
|
||||
/** 设备类型 */
|
||||
@ -86,6 +88,14 @@ public class SiteDeviceListVo {
|
||||
this.deviceStatus = deviceStatus;
|
||||
}
|
||||
|
||||
public String getWorkStatus() {
|
||||
return workStatus;
|
||||
}
|
||||
|
||||
public void setWorkStatus(String workStatus) {
|
||||
this.workStatus = workStatus;
|
||||
}
|
||||
|
||||
public String getDeviceCategory() {
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
@ -395,6 +395,8 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
||||
|
||||
redisCache.setCacheObject(RedisKeyConstants.STACK + siteId + "_" + deviceId, dataStack);
|
||||
|
||||
// 同步更新设备工作状态
|
||||
saveDeviceWorkStatus(deviceId, siteId, dataStack.getWorkStatus());
|
||||
}
|
||||
|
||||
private void batteryGroupDataProcess(String siteId, String deviceId, String jsonData) {
|
||||
@ -686,6 +688,8 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
||||
|
||||
redisCache.setCacheObject(RedisKeyConstants.CLUSTER + siteId + "_" + deviceId, data);
|
||||
|
||||
// 同步更新设备工作状态
|
||||
saveDeviceWorkStatus(deviceId, siteId, data.getWorkStatus());
|
||||
}
|
||||
|
||||
private String getStackDeviceId(String deviceId) {
|
||||
@ -829,11 +833,8 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
||||
emsPcsDataMapper.insertEmsPcsData(pcsData);
|
||||
redisCache.setCacheObject(RedisKeyConstants.PCS + siteId + "_" + deviceId, pcsData);
|
||||
|
||||
// 同步更新PCS设备状态
|
||||
// EmsDevicesSetting emsDevicesSetting = emsDevicesSettingMapper.getDeviceBySiteAndDeviceId(deviceId, siteId);
|
||||
// emsDevicesSetting.setDeviceStatus(pcsData.getDeviceStatus());
|
||||
// emsDevicesSetting.setUpdatedAt(DateUtils.getNowDate());
|
||||
// emsDevicesSettingMapper.updateEmsDevicesSetting(emsDevicesSetting);
|
||||
// 同步更新PCS设备工作状态
|
||||
saveDeviceWorkStatus(deviceId, siteId, pcsData.getWorkStatus());
|
||||
|
||||
// if (SiteEnum.FX.getCode().equals(siteId)) {
|
||||
// //更新每日充放电数据
|
||||
@ -960,10 +961,23 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
||||
emsBatteryClusterMapper.insertEmsBatteryCluster(data);
|
||||
redisCache.setCacheObject(RedisKeyConstants.CLUSTER + siteId + "_" + deviceId, data);
|
||||
|
||||
// 同步更新设备工作状态
|
||||
saveDeviceWorkStatus(deviceId, siteId, data.getWorkStatus());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void saveDeviceWorkStatus(String deviceId, String siteId, String workStatus) {
|
||||
if (StringUtils.isBlank(workStatus)) {
|
||||
return;
|
||||
}
|
||||
EmsDevicesSetting emsDevicesSetting = emsDevicesSettingMapper.getDeviceBySiteAndDeviceId(deviceId, siteId);
|
||||
emsDevicesSetting.setWorkStatus(workStatus);
|
||||
emsDevicesSetting.setUpdatedAt(DateUtils.getNowDate());
|
||||
emsDevicesSettingMapper.updateEmsDevicesSetting(emsDevicesSetting);
|
||||
}
|
||||
|
||||
private String getDeviceParent(String siteId, String deviceId) {
|
||||
Map<String, List<EmsDevicesSetting>> map = redisCache.getCacheObject(RedisKeyConstants.INIT_DEVICE_INFO);
|
||||
if (map == null || map.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user