pang.jiabao
2024-12-09 96c02a0f71f1f42db5f235bc380103bb667ba30a
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -270,7 +270,7 @@
                        param.setLocType1(locTypeDto.getLocType1());
                        if (inSta.getStaNo() == 102) {
                            param.setLocType2((short) 3);
                        } else if (inSta.getStaNo() == 211) {
                        } else if (inSta.getStaNo() == 211 || inSta.getStaNo() == 104) {
                            param.setLocType1((short) 5);
                            param.setLocType2((short) 4);
                        } else if (inSta.getStaNo() == 201) {
@@ -310,16 +310,17 @@
                            staProtocol.setWorkNo((short) 9999);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
                                throw new CoolException("更新plc站点信息失败");
                            }
                            // led 异常显示
                            if (ledThread != null) {
                                String errorMsg = jsonObject.getString("msg");
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
                            }
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
                                throw new CoolException("更新plc站点信息失败");
                            }
                        }
                    } catch (Exception e) {
@@ -417,10 +418,20 @@
                    staProtocol = staProtocol.clone();
                }
                if (barcodeThread == null) {
                String barcode = "";
                if (barcodeThread == null && staProtocol.getSiteId() != 104) {
                    continue;
                } else if (staProtocol.getSiteId() == 104) {
                    if (staProtocol.getWorkNo() == 9996) {
                        // 获取到拣料任务的托盘码
                        WrkMast wrkMast = wrkMastMapper.selectOne(new QueryWrapper<WrkMast>().eq("wrk_sts", 14).eq("io_type", 103).eq("source_sta_no", 104));
                        if (wrkMast != null) {
                            barcode = wrkMast.getBarcode();
                        }
                    }
                } else {
                    barcode = barcodeThread.getBarcode();
                }
                String barcode = barcodeThread.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
@@ -909,6 +920,9 @@
                crnCommand.setDestinationPosXTwo(locMast.getRow1().shortValue());     // 目标库位排
                crnCommand.setDestinationPosYTwo(locMast.getBay1().shortValue());     // 目标库位列
                crnCommand.setDestinationPosZTwo(locMast.getLev1().shortValue());     // 目标库位层
                if (crnStn.getStaNo() == 202) {
                    crnCommand.setSourcePosYTwo((short) 6);     // 源库位列
                }
            } else {
                if (workMode == 1) {
                    crnCommand.setTaskMode(CrnTaskModeType.PAKIN);
@@ -921,6 +935,9 @@
                crnCommand.setDestinationPosX(locMast.getRow1().shortValue());     // 目标库位排
                crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列
                crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层
                if (workMode == 1 && crnStn.getStaNo() == 202) {
                    crnCommand.setSourcePosY((short) 6);     // 源库位列
                }
            }
//            crnCommand.setAckFinish((short) 0);  // 任务完成确认位
@@ -1087,6 +1104,9 @@
                        crnCommand.setDestinationPosXTwo(crnStn.getRow().shortValue());     // 目标库位排
                        crnCommand.setDestinationPosYTwo(crnStn.getBay().shortValue());     // 目标库位列
                        crnCommand.setDestinationPosZTwo(crnStn.getLev().shortValue());     // 目标库位层
                        if (crnStn.getStaNo() == 202) {
                            crnCommand.setDestinationPosYTwo((short) 6);     // 源库位列
                        }
                    } else {
                        if (workMode == 1) {
                            crnCommand.setTaskMode(CrnTaskModeType.PAKIN);
@@ -1099,6 +1119,9 @@
                        crnCommand.setDestinationPosX(crnStn.getRow().shortValue());     // 目标库位排
                        crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                        crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                        if (workMode == 1 && crnStn.getStaNo() == 202) {
                            crnCommand.setDestinationPosY((short) 6);     // 源库位列
                        }
                    }
                    if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
@@ -1539,10 +1562,10 @@
                    staProtocol = staProtocol.clone();
                }
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
//                if (barcodeThread == null) {
//                    continue;
//                }
//                String barcode = barcodeThread.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
@@ -1617,7 +1640,7 @@
                        param.setLocType1(locTypeDto.getLocType1());
                        if (emptyInSta.getStaNo() == 102) {
                            param.setLocType2((short) 3);
                        } else if (emptyInSta.getStaNo() == 211) {
                        } else if (emptyInSta.getStaNo() == 211 || emptyInSta.getStaNo() == 104) {
                            param.setLocType1((short) 5);
                            param.setLocType2((short) 4);
                        } else if (emptyInSta.getStaNo() == 201) {