package com.bonus.common.entity.bracelet.vo;

import com.bonus.common.security.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @className:EquipmentReqDataVo
 * @author:cwchen
 * @date:2024-08-05-15:52
 * @version:1.0
 * @description:设备领用数据-vo
 */
@Data
public class EquipmentReqDataVo {

    private Long id;
    @NotNull(message = "班组ID不能为空")
    private Long teamId;
    @NotNull(message = "作业杆塔不能为空")
    private Long powerId;
    @NotNull(message = "所属工程ID不能为空")
    private Long proId;

    private List<Equipment> list;

    @Data
    public static class Equipment {
        /**
         * 设备ID
         */
        private Long devId;
        /**
         * 设备名称
         */
        private String devName;
        /**
         * 设备编码
         */
        private String devCode;
        /**
         * 设备类型
         */
        private String devType;

    }

    @Length(max = 255, message = "备注字符长度不能超过255")
    private String remarks;
    /**
     * 创建人
     */
    private Long createUser = SecurityUtils.getUserId();
    /**
     * 更新人
     */
    private Long updateUser = SecurityUtils.getUserId();
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime = new Date();
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Date updateTime = new Date();

    /**
     * 领用时间
     */
    private Date lyTime = new Date();

    /**
     * 领用人类型  0正常   1临时人员
     */
    private Integer userType = 0;

    /**
     * 班组长ID
     * */
    private Long teamLeaderId;
}
