package cn.iocoder.yudao.module.system.controller.admin.robot.vo;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
@Schema(description = "子列表")
public class RobotTaskDetailAddVO {
    private Long id;
    @Schema(description = "任务类型（1：取放货、2：停车、 3：充电、4：移动、5：仅取货、6：仅放货、7：扫描码、8：检测托盘类型、9:移动到点位）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "任务类型（1：取放货、2：停车、 3：充电、4：移动、5：仅取货、6：仅放货、7：扫描码、8：检测托盘类型、9:移动到点位）不能为空")
    private Integer taskType;

    @Schema(description = "放货类型（1：库位、2：线库、 3：区域、 4:点位）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "放货类型（1：库位、2：线库、 3：区域、 4:点位）不能为空")
    private Integer releaseType;

    @Schema(description = "取货类型（1：库位、2：线库、 3：区域、 4:点位）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "取货类型（1：库位、2：线库、 3：区域、4:点位）不能为空")
    private Integer takeType;

    @Schema(description = "放货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "6223")
    @NotNull(message = "放货库位/线库/区域不能为空")
    private Long releaseId;

    @Schema(description = "取货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "24801")
    @NotNull(message = "取货库位/线库/区域不能为空")
    private Long takeId;

    @Schema(description = "AGV编号")
    private String robotNo;

    @Schema(description = "停车后是否锁定(0:否、1:是)")
    private Integer needLock;
    @Schema(description = "所选车辆电量(充电模式)")
    private Integer electricity;

    @Schema(description = "取货线库id")
    private Long fromLaneId;

    @Schema(description = "放货线库id")
    private Long toLaneId;

    @Schema(description = "计算后的来源库位编号(前端不用传此字段)")
    private String fromLocationNo;
    @Schema(description = "计算后的来源库位id(前端不用传此字段)")
    private Long fromLocationId;
    @Schema(description = "计算后的目标库位编号(前端不用传此字段)")
    private String toLocationNo;
    @Schema(description = "计算后的目标库位id(前端不用传此字段)")
    private Long toLocationId;
    @Schema(description = "机器人任务主表id(前端不用传此字段)")
    private Long robotTaskId;
    @Schema(description = "取货层数(前端不用传此字段)")
    private Integer fromLocationStorey;
    @Schema(description = "放货层数(前端不用传此字段)")
    private Integer toLocationStorey;
    @Schema(description = "优先级(前端不用传此字段)")
    private Long priority;

    @Schema(description = "取货库位的排序")
    private Long fromLocationNumber;

    @Schema(description = "放货库位的排序")
    private Long toLocationNumber;

    @Schema(description = "取货库位ware_position_map_item的id")
    private Long fromMapItemId;

    @Schema(description = "放货库位ware_position_map_item的id")
    private Long toMapItemId;

    public Long getPriority() {
        if (ObjectUtil.isEmpty(priority)) {
            priority = 0l;
        }
        return priority;
    }
}
