#
lsh
2024-03-07 2534c069e82ec81119eb9f2477075e389dadf625
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -190,7 +190,7 @@
                            continue;
                        }
                        String barcode = barcodeThread.getBarcode();
                        if(!Cools.isEmpty(barcode)) {
                        if(!Cools.isEmpty(barcode) && !barcode.equals("99999999")) {
                            // 请求wms接口,获取工作号和目标库位
                            ToWmsDTO toWmsDTO = new ToWmsDTO(barcode,staProtocol.getSiteId(),staProtocol.isHigh() ? 2 : 1);
                            TaskWrk taskWrk1=taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode",barcode));
@@ -1132,7 +1132,38 @@
        }
    }
    //自动完成任务
    //agv取放货任务完成
    public synchronized void autoCompleteAGV() {
        List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>());
        for (BasDevp basDevp:basDevps){
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo());
            if (staProtocol == null) {
                continue;
            } else {
                staProtocol = staProtocol.clone();
            }
            if (basDevp.getWrkNo()!=0){
                if (basDevp.getAgvTargetPick()!=0){//取货
                    staProtocol.setAgvTypeSign((short)0);
                    staProtocol.setStaNo(basDevp.getDevNo().shortValue());
                    MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol));
                }else if (basDevp.getAgvTargetPlace()!=0){
                    staProtocol.setAgvTypeSign((short)1);
                    staProtocol.setStaNo(basDevp.getDevNo().shortValue());
                    MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol));
                }
            }else {
                if (basDevp.getAgvTargetPick()!=0){
                    basDevp.setAgvStartPick(0);
                    basDevpService.updateById(basDevp);
                }else if (basDevp.getAgvTargetPlace()!=0){
                    basDevp.setAgvStartPlace(0);
                    basDevpService.updateById(basDevp);
                }
            }
        }
    }
    public synchronized void autoCompleteTask() {
        List<TaskWrk> taskWrks = taskWrkMapper.selectWorkingTask();
        for (TaskWrk taskWrk : taskWrks) {