| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.S7objectCleaning; |
| | | import com.mes.common.S7objectMachine; |
| | | import com.mes.common.S7objectMarking; |
| | | import com.mes.device.PlcParameterInfo; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import com.mes.websocket.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author SNG-010 |
| | |
| | | List<Tasking> taskingList=taskingService.findMachineTask(machine); |
| | | jsonObject.append("taskingList", taskingList); |
| | | jsonObject.append("machine", machine); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cleaning"); |
| | | List<WebSocketServer> sendwServer = WebSocketServer.SESSIONMAP.get("cleaning"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | try { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | webserver.sendToWeb("",jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |