| | |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.InSta inSta : devp.getInSta()) { |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // 获取条码 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | String barcode = barcodeThread.getBarcode(); |
| | |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | |
| | | // 下发plc命令 |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNO(workNo); |
| | | staProtocol.setStaNo(startupDto.getStaNo()); |
| | | staProtocol.setPakMk(false); |
| | | staProtocol.setInreq1(false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task<>(4, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 拣料、并板、盘点再入库 |
| | | */ |
| | | public void stnToCrnStnPick(){ |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历拣料入库口 |
| | | for (DevpSlave.Sta pickSta : devp.getPickSta()) { |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |