chen.llin
4 天以前 0a4438e34d8f726b9cf6251a5b447883b0b8da36
src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -159,7 +159,7 @@
                    back = true;
                }
                // 退回
                if (back && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9998)  && staProtocol.isInEnable() && staProtocol.isLoading() && staProtocol.isPakMk()) {
                if (back   && staProtocol.isInEnable() && staProtocol.isLoading() && staProtocol.isPakMk()  && !staProtocol.isEmptyMk()  ) {
                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
                    staProtocol.setWorkNo(wrkNo);
                    wrkNo++;
@@ -172,11 +172,12 @@
                }
                // 判断是否满足入库条件
                if (staProtocol.isAutoing()
                        && staProtocol.isLoading()
                        && staProtocol.isInEnable()
                        && !staProtocol.isEmptyMk()
                        && staProtocol.isPakMk() && staProtocol.getWorkNo() == 9999) {
                if (staProtocol.isAutoing() //自动
                        && staProtocol.isLoading() //有物
                        && staProtocol.isInEnable() //可入
                        && !staProtocol.isEmptyMk() // 非空板
                        && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true
                ) {
                    if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                        News.info("{}条码扫描错误:{}",barcodeThread.getSlave().getId(),barcode);
                        continue;
@@ -227,6 +228,7 @@
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            String errorMsg = jsonObject.getString("msg");
                            log.error("全版入库回退,"+wrkNo+","+errorMsg);
                            if (!Cools.isEmpty(errorMsg)) {
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
@@ -676,9 +678,25 @@
//                    continue;
                }
                // 判断堆垛机出库站状态
                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
                        && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
                boolean outStationAvailable = true;
                // 是否检查堆垛机出库站状态(true: 检查,false: 不检查)
                if (slaveProperties.isCheckOutStationStatus()) {
                    // 检查出库站状态
                    outStationAvailable =
                            //自动
                            staProtocol.isAutoing()
                            //!有物
                            && !staProtocol.isLoading()
                            //能出
                            && staDetl.getCanouting() != null
                            && staDetl.getCanouting().equals("Y")
                            //工作号
                            && staProtocol.getWorkNo() == 0
                            //可出
                            && staProtocol.isOutEnable();
                }
                // 出库站可用时继续执行
                if (outStationAvailable) {
                    // 堆垛机控制过滤
                    if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
//                        continue;
@@ -1047,13 +1065,13 @@
                }
                // 站点条件判断
                if (staProtocol.isAutoing()
                        && staProtocol.isLoading()
                        && staProtocol.isInEnable()
                        && staProtocol.isEmptyMk()
                        && staProtocol.isPakMk()
                        && staProtocol.getWorkNo() == 9998 // 9997 回退 9998 空 9999 满
                        ) {
                if (staProtocol.isAutoing()  //自动
                        && staProtocol.isLoading() //有物
                        && staProtocol.isInEnable() //可入
                        && staProtocol.isEmptyMk()// 空板
                        && staProtocol.isPakMk() //防止重复下发信号 站点无物 无任务号会自动变成true
                ) {
                    News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货");
                    try {
@@ -1091,7 +1109,7 @@
                                LedCommand ledCommand = new LedCommand();
                                ledCommand.setWorkNo(dto.getWorkNo());
                                ledCommand.setIoType(1);
                                ledCommand.setTitle("全板入库");
                                ledCommand.setTitle("空板入库");
                                ledCommand.setLocNo(dto.getLocNo());
                                ledCommand.setStaNo(dto.getStaNo());
                                commands.add(ledCommand);
@@ -1104,13 +1122,15 @@
                            staProtocol.setStaNo(emptyInSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            String errorMsg = jsonObject.getString("msg");
                            log.error("空板入库回退"+wrkNo+","+errorMsg);
                            if (!result) {
                                News.errorNoLog(""+mark+" - 2"+" - 更新plc站点信息失败");
                                throw new CoolException("更新plc站点信息失败");
                            }
                            if (ledThread != null) {
                                String errorMsg = jsonObject.getString("msg");
                                if (!Cools.isEmpty(errorMsg)) {
                                    MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(3, errorMsg));
                                }