#
Junjie
2026-01-14 aa151079c2d02047f6cb5f8ad56ff92b98544e99
src/main/java/com/zy/core/model/command/CrnCommand.java
@@ -1,12 +1,9 @@
package com.zy.core.model.command;
import com.alibaba.fastjson.annotation.JSONField;
import com.zy.core.enums.CrnTaskModeType;
import lombok.Data;
/**
 * 堆垛机命令报文
 * Created by vincent on 2020/8/11
 */
@Data
public class CrnCommand {
@@ -15,10 +12,10 @@
    private Integer crnNo = 0;
    // 任务完成确认位
    private Short ackFinish = 0;
    private Integer ackFinish = 0;
    // 任务号
    private Short taskNo = 0;
    private Integer taskNo = 0;
    /**
     * 任务模式:
@@ -29,43 +26,31 @@
     * 4 = 站位移转 源和目标都发
     * 5 = 回原点  不用发
     * 6 = 去反原点 目标发
     * 7 = 坐标移行 目标发
     * 7 = 坐标移行 取货发
     * 90 = 设置时间
     * 99 = 取消当前任务
     */
    private Short taskMode = 0;
    @JSONField(serialize = false)
    private CrnTaskModeType taskModeType;
    private Integer taskMode = 0;
    // 源位置排号
    private Short sourcePosX = 0;
    private Integer sourcePosX = 0;
    // 源位置列号
    private Short sourcePosY = 0;
    private Integer sourcePosY = 0;
    // 源位置层号
    private Short sourcePosZ = 0;
    private Integer sourcePosZ = 0;
    // 目标位置排号
    private Short destinationPosX = 0;
    private Integer destinationPosX = 0;
    // 目标位置列号
    private Short destinationPosY = 0;
    private Integer destinationPosY = 0;
    // 目标位置层号
    private Short destinationPosZ = 0;
    private Integer destinationPosZ = 0;
    private Short taskSend = 0;
    public void setTaskMode(Short taskMode){
        this.taskMode = taskMode;
        this.taskModeType = CrnTaskModeType.get(taskModeType);
    }
    public void setTaskMode(CrnTaskModeType type) {
        this.taskModeType = type;
        this.taskMode = CrnTaskModeType.get(type).id.shortValue();
    }
    // 任务确认 0:未确认 1:已确认
    private Integer command = 0;
}