#
zjj
2024-03-15 398e04033f6a1dc44ce017a913a1c56121b1764f
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -369,7 +369,7 @@
                        && staProtocol.isLoading()
                        && staProtocol.isInEnable()
                        && staProtocol.isPakMk()
                        && staProtocol.getWorkNo() == 9991) {
                        && staProtocol.getWorkNo() == 9999) {
//                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
                    LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed());
                    if (barcode.equals("") || barcode.equals("99999999")) {
@@ -389,8 +389,9 @@
                        continue;
                    }
                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                    ledThread.errorReset();
//                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                    WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode));
                    if (wrkMast == null) {
                        wrkMast = wrkMastMapper.selectPickStep(barcode);
                    }
@@ -474,6 +475,8 @@
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    if (!result) {
                        log.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId());
                    }else {
                        ledThread.errorReset();
                    }
                }
@@ -1293,6 +1296,7 @@
                // 获取空板入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo());
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed());
                if (staProtocol == null) {
                    continue;
                } else {
@@ -1303,6 +1307,13 @@
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
                        && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() >= 9990
                        && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) {
                    List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                            .eq("sta_no", emptyInSta.getStaNo())
                            .eq("io_type", 10)
                            .eq("wrk_sts", 2));
                    if (!Cools.isEmpty(wrkMasts)){
                        continue;
                    }
                    try {
                        LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
@@ -1319,7 +1330,7 @@
                        JSONObject jsonObject = JSON.parseObject(response);
                        if (jsonObject.getInteger("code").equals(200)) {
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            ledThread.errorReset();
                            // 更新站点信息 且 下发plc命令
                            staProtocol.setWorkNo(dto.getWorkNo().shortValue());
                            staProtocol.setStaNo(dto.getStaNo().shortValue());
@@ -2280,12 +2291,18 @@
                        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", staDesc.getCrnStn()));
                        staDesc.getCrnNo();
                        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("crn_no", staDesc.getCrnNo()).gt("io_type", 100));
                        if (!Cools.isEmpty(wrkMast)){
                            continue;
                        }
                        if (basDevp.getAutoing().equals("Y") && basDevp.getLoading().equals("N")
                                && basDevp.getWrkNo() == 0 && basDevp.getCanining().equals("Y")){
//                             更新站点信息 且 下发plc命令
                            staProtocol.setWorkNo((short) 9997);
//                            staProtocol.setStaNo(basDevp.getDevNo().shortValue());
                            staProtocol.setStaNo((short) 1013);
                            staProtocol.setStaNo(basDevp.getDevNo().shortValue());
//                            staProtocol.setStaNo((short) 1013);
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocol));
                            if (!result) {