zjj
2025-06-30 8b8a2086509e28bb902166aa35e4c287eb906621
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -23,10 +23,7 @@
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.*;
import com.zy.asrs.wcs.core.service.*;
import com.zy.asrs.wcs.core.utils.OpenUtils;
import com.zy.asrs.wcs.core.utils.RedisUtil;
import com.zy.asrs.wcs.core.utils.ShuttleDispatcher;
import com.zy.asrs.wcs.core.utils.Utils;
import com.zy.asrs.wcs.core.utils.*;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
@@ -95,6 +92,8 @@
    private OpenUtils openUtils;
    @Autowired
    private LiftAction liftAction;
    @Autowired
    private NavigateUtils navigateUtils;
    /**
     * 组托
@@ -102,6 +101,10 @@
     */
    public synchronized void generateInboundWrk() {
        try {
            List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskCtg,7));
            if (!Cools.isEmpty(tasks)){
                return;
            }
            // 根据输送线plc遍历
            List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>()
                    .eq(Device::getDeviceType, DeviceCtgType.CONVEYOR.val())
@@ -169,6 +172,7 @@
                    if (staProtocol.isAutoing() && staProtocol.isLoading()
                            && staProtocol.isInEnable()
                            && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999))
                            && staProtocol.getIsIn() == (short)1
                            && staProtocol.isPakMk()
                    ) {
@@ -779,10 +783,6 @@
     * 出库 ====>> 同一时间一台穿梭车只能有一个出库任务
     */
    public synchronized void analyzeOutBoundTask() {
        List<Task> moveTask = taskService.selectWaitAnalyzeMoveTask();
        if (!moveTask.isEmpty()) {
            return;
        }
        List<Task> tasks = taskService.selectPakOut();
        if (tasks.isEmpty()) {
            return;
@@ -815,13 +815,11 @@
//                    continue;
//                }
//                //同库位组校验
//                List<String> outerLoc = Utils.getGroupOuterLoc(wrkMast.getSourceLocNo());
//                List<LocMast> outerLocMasts = locMastService.selectNotEmptyLocNos(outerLoc);
//                if (!outerLocMasts.isEmpty()) {
//                    News.info("{}任务,浅库位存在货物,系统等待中", wrkMast.getWrkNo());
//                    continue;//浅库位存在未执行任务
//                }
                //检测货物是否可出
                boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId());
                if(!checkLocPathIsAvailable) {
                    continue;
                }
                if (Cools.isEmpty(task.getShuttleNo()) || task.getShuttleNo() ==0) {
                    //分配小车
@@ -953,12 +951,12 @@
            }
            //搜索其他楼层充电桩
            List<ShuttleChargeSta> list2 = shuttleChargeStaService.list(new LambdaQueryWrapper<ShuttleChargeSta>()
                    .notIn(ShuttleChargeSta::getDeviceLev, lev)
                    .eq(ShuttleChargeSta::getStatus, 1));
            if (!list2.isEmpty()) {
                allChargeLoc.addAll(list2);
            }
//            List<ShuttleChargeSta> list2 = shuttleChargeStaService.list(new LambdaQueryWrapper<ShuttleChargeSta>()
//                    .notIn(ShuttleChargeSta::getDeviceLev, lev)
//                    .eq(ShuttleChargeSta::getStatus, 1));
//            if (!list2.isEmpty()) {
//                allChargeLoc.addAll(list2);
//            }
            //没有找到充电桩
            if (allChargeLoc.isEmpty()) {
@@ -1312,6 +1310,12 @@
    // 解析小车载货移动工作档
    public synchronized void analyzeLadenMoveTask() {
        for (Task task : taskService.selectWaitAnalyzeLadenMoveTask()) {
            //检测货物是否可出
            boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId());
            if(!checkLocPathIsAvailable) {
                continue;
            }
            if (Cools.isEmpty(task.getShuttleNo())) {
                //分配小车
                //搜索空闲车