| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.alarm.entity.ProductAlarmInfo; |
| | | import com.mes.alarm.service.ProductAlarmInfoService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | |
| | | EngineeringService engineeringService; |
| | | @Resource |
| | | LargenScreenService largenScreenService; |
| | | @Resource |
| | | private ProductAlarmInfoService productAlarmInfoService; |
| | | |
| | | private static final String ALARM_MODULE = "磨边"; |
| | | private static final String ALARM_TYPE1 = "一线卧式理片笼"; |
| | | private static final String ALARM_TYPE2 = "二线卧式理片笼"; |
| | | private static final String ALARM_CODE_NOGLASS = "noGlass"; |
| | | |
| | | @Resource |
| | | private WebSocketUtils webSocketUtils; |
| | |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1")); |
| | | jsonObject.append("taskMessage", taskHistory); |
| | | |
| | | //推送报警信息 |
| | | if (deviceId == 1) { |
| | | jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() |
| | | .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW) |
| | | .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE) |
| | | .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE1))); |
| | | } else { |
| | | |
| | | jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() |
| | | .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW) |
| | | .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE) |
| | | .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE2))); |
| | | } |
| | | webSocketUtils.sendToWeb(webSocketName, jsonObject); |
| | | } |
| | | |