| | |
| | | new QueryWrapper<DownGlassTask>()
|
| | | .select("Top 1 *")
|
| | | .eq("end_cell", Const.G13_WORK_STATION)
|
| | | .lt("task_status", Const.UNLOAD_GLASS_DOWN)
|
| | | .orderByDesc("id")
|
| | |
|
| | | );
|
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | |
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|
| | |
| | |
|
| | | @Scheduled(fixedDelay = Long.MAX_VALUE)
|
| | | public void scanCodeTask() {
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | while (true) {
|
| | | try (Socket socket = new Socket(scanIp, scanPort);
|
| | | BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
|
| | | // 接收服务器响应
|
| | | socket.setSoTimeout(1000);
|
| | | String response;
|
| | | while ((response = in.readLine()) != null) {
|
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanCode");
|
| | | List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (CollectionUtils.isNotEmpty(sendwServer)) {
|
| | | //按照玻璃id获取玻璃信息返回给前端界面,具体需要哪些数据待确认
|
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
|
| | | .eq(GlassInfo::getGlassId, response).last("limit 1"));
|
| | | .eq(GlassInfo::getGlassId, response));
|
| | | if (null == glassInfo) {
|
| | | log.info("按照玻璃id:{},无法找到玻璃信息", response);
|
| | | } else {
|
| | | sendwServer.get(0).sendMessage(glassInfo.toString());
|
| | | jsonObject.append("scanGlass",glassInfo);
|
| | | sendwServer.get(0).sendMessage(jsonObject.toString());
|
| | | }
|
| | | }
|
| | | }
|