| | |
| | | |
| | | } |
| | | }else {//自动工位 |
| | | //所有进站将进站时间写给PLC |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String currentDate = dateFormat.format(new Date()); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build()); |
| | | Object snCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".SNCode").getValue(); |
| | | if (ObjectUtil.isNull(snCodeObject)){ |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build()); |
| | | }else{ |
| | | //所有进站将进站时间写给PLC |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String currentDate = dateFormat.format(new Date()); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build()); |
| | | |
| | | Integer recordDataDone = 11; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build()); |
| | | Integer recordDataDone = 11; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build()); |
| | | } |
| | | |
| | | } |
| | | |
| | | } else if(Constants.TWO.equals(valueString)){//出站 |
| | |
| | | } |
| | | } |
| | | if(Constants.OP230.equals(device)){ |
| | | WebSocketUsers.sendMessageToUserByText(map.get(device), "twoHundredAndThirtyEND"); |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | updateOrderStatus(snCode, "5","");//OP230工位更新工单状态为已完成 |
| | | reportFactoryMes(snCode, "OP240", format.format(new Date()));//工厂MES报工 //暂时 OP240工位还没有好,在230报240的工 |
| | | }); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SNCode").value("").build()); |
| | | } |
| | | if(result == 21){ |
| | | result = savePassingStation(thoroughfare, device, snCode, orderNumber, stationStatus);//保存过站 |