#
zjj
2024-06-20 5a2ec88cf71194456a371efda15f3cab5f6225ae
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.wcs.core.action.LiftAction;
import com.zy.asrs.wcs.core.entity.Motion;
import com.zy.asrs.wcs.core.entity.Task;
import com.zy.asrs.wcs.core.model.command.LiftAssignCommand;
import com.zy.asrs.wcs.core.model.command.LiftCommand;
import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
@@ -21,6 +22,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -59,6 +61,16 @@
                .eq(Motion::getDeviceCtg, DeviceCtgType.LIFT.val())
                .eq(Motion::getDevice, motion.getDevice())
                .eq(Motion::getMotionSts, MotionStsType.EXECUTING.val())) > 0) {
            return false;
        }
        Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskNo, motion.getTaskNo()));
        if (task == null) {
            return false;
        }
        task.setLiftNo(liftProtocol.getLiftNo());
        task.setUpdateTime(new Date());
        if (!taskService.updateById(task)) {
            return false;
        }
@@ -108,6 +120,16 @@
//                return liftThread.assignWork(command);
            case LIFT_TRANSPORT_TO_CONVEYOR:
                return false;
            case LIFT_LOCK:
                //锁定提升机
                command = liftThread.getLockCommand(motion.getTaskNo(), true);//获取提升机锁定命令
                list.addAll(command);
                return liftAction.assignWork(liftThread.getDevice(), assignCommand);
            case LIFT_UNLOCK:
                //锁定提升机
                command = liftThread.getLockCommand(motion.getTaskNo(), false);//获取提升机解定命令
                list.addAll(command);
                return liftAction.assignWork(liftThread.getDevice(), assignCommand);
            default:
                break;
@@ -191,6 +213,16 @@
            case LIFT_TRANSPORT_TO_CONVEYOR:
                break;
            case LIFT_LOCK:
                if (!liftThread.isLock(null)) {
                    return false;
                }
                break;
            case LIFT_UNLOCK:
                if (liftThread.isLock(null)) {
                    return false;
                }
                break;
            default:
                return false;
        }