| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public void plcScanQrVerify() { |
| | | //获取当前任务表最新的一块任务状态 |
| | | //扫码确认线程 |
| | | //电气去根据上一个任务传递下来的状态自己判断需不需要扫码,如果需要扫码直接传输扫码id |
| | | String scanId = plcParameterObject.getPlcParameter("scanId").getValue(); |
| | | Tasking tasking =new Tasking(); |
| | | tasking.setScanId(scanId); |
| | | if(!Objects.equals(scanId, "")){ |
| | | boolean result = taskingService.updateTasking(scanId); |
| | | //更新任务表状态 |
| | | boolean result = taskingService.updateTaskingState(tasking); |
| | | if (result){ |
| | | //添加成功时发送过片信号 |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("scan").getAddress(), Integer.parseInt("1")); |
| | | } |
| | | log.info("扫描定制二维码:"+scanId); |
| | | }else { |
| | | //扫码失败时发送警告,二维码消失 |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("deficiency").getAddress(), Integer.parseInt("1")); |
| | | log.info("标准模式扫描二维码:无"); |
| | | } |
| | | |