#
野心家
2023-03-11 c2a92011aace16261edc4274e7308a161206d631
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -128,7 +128,7 @@
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        // led 异常显示
                        if (ledThread != null) {
                            News.error(methodName +  ":扫码失败,请重试");
                            News.error(methodName + ":扫码失败,请重试");
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                        }
                        continue;
@@ -163,8 +163,8 @@
                    if (wrkMast != null) {
                        News.error(methodName + ":工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo());
                        if (ledThread != null) {
                            News.error(methodName +  ":扫码失败,请重试");
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={"+ wrkMast.getWrkNo() + "}, 请手动取消已存在工作档"));
                            News.error(methodName + ":扫码失败,请重试");
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={" + wrkMast.getWrkNo() + "}, 请手动取消已存在工作档"));
                        }
                        continue;
                    }
@@ -201,7 +201,7 @@
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
                                News.error(methodName  + ":更新plc站点信息失败");
                                News.error(methodName + ":更新plc站点信息失败");
                                throw new CoolException("更新plc站点信息失败");
                            }
@@ -219,7 +219,7 @@
                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                                }
                            }
                            News.error(methodName  +":请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                            News.error(methodName + ":请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                        }
@@ -344,7 +344,7 @@
                            News.error(methodName + ":更新工作档失败!!! [工作号:{}]", wrkMast.getWrkNo());
                        }
                    } else {
                        News.error(methodName +":发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId());
                        News.error(methodName + ":发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId());
                    }
                }
@@ -482,7 +482,7 @@
                        locMast.setLocSts("Q");
                        locMast.setModiTime(new Date());
                        if (!locMastService.updateById(locMast)) {
                            News.error(methodName+ ":修改库位状态失败");
                            News.error(methodName + ":修改库位状态失败");
                            throw new CoolException("修改库位状态失败");
                        }
@@ -829,20 +829,33 @@
     */
    public synchronized void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol) {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) {
            // 获取工作状态为11(生成出库ID)的出库工作档
//            WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo());
            List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo());
        //按照工作档出库
        List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                .eq("crn_no", slave.getId())
                .and()
                .gt("io_type", 100)
                .orderBy("appe_time")
        );
        if (!Cools.isEmpty(wrkMasts)) {
            for (WrkMast wrkMast : wrkMasts) {
                if (wrkMast == null) {
                CrnSlave.CrnStn crnStn = null;
                for (CrnSlave.CrnStn crnStn1 : slave.getCrnOutStn()) {
                    if (crnStn1.getStaNo() == wrkMast.getSourceStaNo()) {
                        crnStn = crnStn1;
                        break;
                    } else {
                        continue;
                    }
                }
                if (Cools.isEmpty(crnStn)) {
                    continue;
                }
                // 工作档状态判断
                if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null) {
                    News.error(methodName + ":查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType());
                if (wrkMast.getSourceStaNo() == null) {
                    log.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType());
                    continue;
                }
                // 获取源库位信息
                LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo());
                if (!sourceSta.getLocSts().equals("R") && !sourceSta.getLocSts().equals("P")) {
@@ -959,6 +972,7 @@
                        break;
                    }
                }
            }
        }
    }
@@ -1104,7 +1118,7 @@
        // 获取目标库位信息
        LocMast sta = locMastService.selectById(wrkMast.getLocNo());
        if (null == sta) {
            News.error(methodName  + ":工作档库位移转失败,原因:检索目标库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo());
            News.error(methodName + ":工作档库位移转失败,原因:检索目标库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo());
            return;
        }
        // 获取堆垛机信息 并 判断是否可入出
@@ -1524,7 +1538,7 @@
                ledCommand.setIoType(wrkMast.getIoType());
                ledCommand.setTitle(wrkMast.getIoType$());
                switch (wrkMast.getIoType()){
                switch (wrkMast.getIoType()) {
                    case 10:
                    case 110:
                        ledCommand.setEmptyMk(true);
@@ -2117,7 +2131,6 @@
//
//
//    }
    public synchronized void outOfDevp() {
        List<WrkMast> wrkMasts = wrkMastMapper.selectPick();
        for (WrkMast wrkMast : wrkMasts) {