package com.ruoyi.app.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 【请填写功能名称】对象 app_task
 *
 * @author ruoyi
 * @date 2025-01-15
 */
public class AppTask extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 任务号 */
    private String taskId;

    private String orderId;

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /** 任务类型 */
    @Excel(name = "任务类型")
    private Integer taskType;

    /** 任务状态 */
    @Excel(name = "任务状态")
    private Integer taskStatus;

    /** 任务优先级，默认为1 */
    @Excel(name = "任务优先级，默认为1")
    private Integer taskPriority;

    /** 载具号 */
    @Excel(name = "载具号")
    private String vehicleId;

    /** 起点 */
    @Excel(name = "起点")
    private String origin;

    /** 终点 */
    @Excel(name = "终点")
    private String destination;

    /** 发送给wcs的任务号 */
    @Excel(name = "发送给wcs的任务号")
    private String wcsTaskId;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date finishTime;

    /** 物料编号 */
    @Excel(name = "物料编号")
    private String goodsId;

    /** 操作数量 */
    @Excel(name = "操作数量")
    private BigDecimal opNum;

    /** 库存数量 */
    @Excel(name = "库存数量")
    private BigDecimal stockNum;

    /** 操作用户 */
    @Excel(name = "操作用户")
    private String opUser;

    /** 前置任务 */
    @Excel(name = "前置任务")
    private String preTask;
    /** PLC任务号 */
    @Excel(name = "PLC任务号")
    private Long plcId;

    @Excel(name = "库位号")
    private String locationId;

    //1.零捡 2：全量
    private Integer ckType;

    public Long getPlcId() {
        return plcId;
    }

    public void setPlcId(Long plcId) {
        this.plcId = plcId;
    }

    public String getLocationId() {
        return locationId;
    }

    public void setLocationId(String locationId) {
        this.locationId = locationId;
    }

    public Integer getCkType() {
        return ckType;
    }

    public void setCkType(Integer ckType) {
        this.ckType = ckType;
    }

    public void setTaskId(String taskId)
    {
        this.taskId = taskId;
    }

    public String getTaskId()
    {
        return taskId;
    }
    public void setTaskType(Integer taskType)
    {
        this.taskType = taskType;
    }

    public Integer getTaskType()
    {
        return taskType;
    }
    public void setTaskStatus(Integer taskStatus)
    {
        this.taskStatus = taskStatus;
    }

    public Integer getTaskStatus()
    {
        return taskStatus;
    }
    public void setTaskPriority(Integer taskPriority)
    {
        this.taskPriority = taskPriority;
    }

    public Integer getTaskPriority()
    {
        return taskPriority;
    }
    public void setVehicleId(String vehicleId)
    {
        this.vehicleId = vehicleId;
    }

    public String getVehicleId()
    {
        return vehicleId;
    }
    public void setOrigin(String origin)
    {
        this.origin = origin;
    }

    public String getOrigin()
    {
        return origin;
    }
    public void setDestination(String destination)
    {
        this.destination = destination;
    }

    public String getDestination()
    {
        return destination;
    }
    public void setWcsTaskId(String wcsTaskId)
    {
        this.wcsTaskId = wcsTaskId;
    }

    public String getWcsTaskId()
    {
        return wcsTaskId;
    }
    public void setFinishTime(Date finishTime)
    {
        this.finishTime = finishTime;
    }

    public Date getFinishTime()
    {
        return finishTime;
    }
    public void setGoodsId(String goodsId)
    {
        this.goodsId = goodsId;
    }

    public String getGoodsId()
    {
        return goodsId;
    }
    public void setOpNum(BigDecimal opNum)
    {
        this.opNum = opNum;
    }

    public BigDecimal getOpNum()
    {
        return opNum;
    }
    public void setStockNum(BigDecimal stockNum)
    {
        this.stockNum = stockNum;
    }

    public BigDecimal getStockNum()
    {
        return stockNum;
    }
    public void setOpUser(String opUser)
    {
        this.opUser = opUser;
    }

    public String getOpUser()
    {
        return opUser;
    }

    public String getPreTask() {
        return preTask;
    }

    public void setPreTask(String preTask) {
        this.preTask = preTask;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("taskId", getTaskId())
                .append("taskType", getTaskType())
                .append("taskStatus", getTaskStatus())
                .append("taskPriority", getTaskPriority())
                .append("vehicleId", getVehicleId())
                .append("origin", getOrigin())
                .append("destination", getDestination())
                .append("wcsTaskId", getWcsTaskId())
                .append("createTime", getCreateTime())
                .append("finishTime", getFinishTime())
                .append("goodsId", getGoodsId())
                .append("opNum", getOpNum())
                .append("stockNum", getStockNum())
                .append("opUser", getOpUser())
                .append("preTask", getPreTask())
                .toString();
    }

    /**
     * 转换为AppTaskBak
     * @return appTaskBak
     */
    public AppTaskBak toAppTaskBak() {
        AppTaskBak appTaskBak = new AppTaskBak();
        appTaskBak.setTaskId(getTaskId());
        appTaskBak.setTaskType(getTaskType());
        appTaskBak.setTaskStatus(getTaskStatus());
        appTaskBak.setTaskPriority(getTaskPriority());
        appTaskBak.setVehicleId(getVehicleId());
        appTaskBak.setOrigin(getOrigin());
        appTaskBak.setDestination(getDestination());
        appTaskBak.setWcsTaskId(getWcsTaskId());
        appTaskBak.setFinishTime(getFinishTime());
        appTaskBak.setGoodsId(getGoodsId());
        appTaskBak.setOpNum(getOpNum());
        appTaskBak.setStockNum(getStockNum());
        appTaskBak.setOpUser(getOpUser());
        appTaskBak.setPreTask(getPreTask());
        return appTaskBak;
    }
}
