| | |
| | | package com.mes.job; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public class PlcTemperingGlassTask { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService temperingAgoService; |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 2000) |
| | | public void temperingGlassHome(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | |
| | | jsonObject.append("outGlass", outGlass); |
| | | //过旋转台钢化后的玻璃 |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | |
| | | jsonObject.append("overGlass", overGlass); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |