#
zjj
2023-12-20 ea964162520805dd36e740f0a72fa909e78cade0
#
4个文件已修改
64 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/TaskLogScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -155,12 +155,14 @@
                        if (workNo == 0 && stano == 0){
                            continue;
                        }
                        if (!staProtocol.isPakMk()){
                            continue;
                        }
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                        staProtocol.setWorkNo(workNo);
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                        TaskWrk taskWrk = taskWrkMapper.selectByWrkNo(Integer.valueOf(workNo));
                        if (taskWrk != null) {
                            taskWrk.setMemo(errMsg);//将错误码存入备注字段进行展示
@@ -208,7 +210,7 @@
                            staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue());
                            staProtocol.setStaNo(staDesc.getCrnStn().shortValue());
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                            Thread.sleep(200);
                            Thread.sleep(500);
                        }else {
                            //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
                            toWmsDTO.setWarehouseId("1688469798893297665");
@@ -577,6 +579,13 @@
                        if (commandInfos.isEmpty()) {
                            continue;//命令空
                        }
                        //判断末端命令是否执行
                        CommandInfo commandInfo2 = commandInfos.get(commandInfos.size() - 1);
                        if (commandInfo2.getCommandStatus() != CommandStatusType.CREATE.id) {
                            continue;//指令已执行
                        }
                        CommandInfo commandInfo = commandInfos.get(commandStep);
                        CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文
                        CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
@@ -619,6 +628,24 @@
                    .eq("wrk_sts",11)
                    .eq("io_type",3));
            for (TaskWrk taskWrk : taskWrks){
                // 双深库位且浅库位有货,则需先对浅库位进行库位移转
                if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) {
                    String shallowLocNo = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint());
                    TaskWrk hallowLocNoTask = taskWrkMapper.selectByStartPoint(shallowLocNo);
                    if (!Cools.isEmpty(hallowLocNoTask)){
                        continue;
                    }
                }
                // 堆垛机控制过滤
                if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
                    continue;
                }
                // 已经存在吊车执行任务时,则过滤
                if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) {
                    continue;
                }
                if (Cools.isEmpty(taskWrk.getTargetPoint())){
                    List<Integer> list = openServiceImpl.getInEnableRoadway();
                    Map<String, Object> map = new HashMap<>();
@@ -656,7 +683,7 @@
                        continue;
                    }
                 }
                }
                if (taskWrk == null || Cools.isEmpty(taskWrk.getTargetPoint()) || taskWrk.getTargetPoint().equals("") || taskWrk.getWrkNo() == null) {
                    continue;
                }
@@ -668,15 +695,7 @@
                // 命令下发区 --------------------------------------------------------------------------
                // 堆垛机控制过滤
                if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) {
                    continue;
                }
                // 已经存在吊车执行任务时,则过滤
                if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) {
                    continue;
                }
                // 1.堆垛机开始移动
src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -72,7 +72,7 @@
                    taskOverToWms.setSourceLocationCode(taskWrk.getOriginStartPoint()); //源库位
                    //判断托盘是否走到出库站
                    BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", taskWrk.getTargetPoint()));
                    if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) && !basDevp.getOutEnable().equals("Y")){
                    if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) || !basDevp.getOutEnable().equals("Y")){
                        continue;
                    }
                } else if (taskWrk.getIoType() ==3) {
src/main/java/com/zy/asrs/utils/Utils.java
@@ -7,9 +7,7 @@
import com.zy.core.properties.SlaveProperties;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
/**
 * Created by vincent on 2020/8/27
@@ -224,10 +222,19 @@
     */
    public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
        int row = getRow(deepLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
//        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow  = getShallowRow(row);
        return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
    }
    public static int getShallowRow(Integer row){
        Map<Integer, Integer> map = new HashMap<>();
        map.put(1,2);map.put(4,3);
        map.put(7,8);map.put(10,9);
        map.put(11,12);map.put(14,13);
        map.put(15,16);map.put(18,17);
        map.put(19,20);
        return map.get(row);
    }
    /**
     * 获取 深库位排对应的浅库位排
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -573,7 +573,7 @@
            return;
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
            log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}",  slave.getId(), JSON.toJSON(staProtocol));
            //log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}",  slave.getId(), JSON.toJSON(staProtocol));
            Integer siteId = staProtocol.getSiteId();
            staProtocol = station.get(siteId);
@@ -654,7 +654,7 @@
            return;
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
            log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}",  slave.getId(), JSON.toJSON(staProtocol));
            //log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}",  slave.getId(), JSON.toJSON(staProtocol));
            Integer siteId = staProtocol.getSiteId();
            staProtocol = station.get(siteId);