package com.emergency.avenue.storage.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 出库信息表
 */
@Data
@Schema(description = "出库信息表")
@EqualsAndHashCode(callSuper = true)
public class OutboundInfo extends Model<OutboundInfo> {
	/**
	 * 出库信息id
	 */
	@TableId(type = IdType.AUTO)
	@Schema(description = "出库信息id")
	private Integer outboundId;

	/**
	 * 出库类型
	 */
	@Schema(description = "出库类型")
	private String outboundType;

	/**
	 * 物资大类
	 */
	@Schema(description = "物资大类")
	private String materialGroup;

	/**
	 * 物资类别
	 */
	@Schema(description = "物资类别")
	private String materialType;

	/**
	 * 物资名称
	 */
	@Schema(description = "物资名称")
	private String materialName;

	/**
	 * 数量（注：此处为字符串类型，根据实际需求可能需要使用Integer或BigDecimal）
	 */
	@Schema(description = "数量")
	private String quantity;

	/**
	 * 调用省份
	 */
	@Schema(description = "调用省份")
	private String calledProvince;

	/**
	 * 出库日期
	 */
	@Schema(description = "出库日期")
	private String outboundTime;

	/**
	 * 是否可用（注：此处为字符串类型，根据实际需求可能需要使用Boolean）
	 */
	@Schema(description = "是否可用")
	private String isAvailable;

	/**
	 * 状态
	 */
	@Schema(description = "状态")
	private String status;

	/**
	 * 查询下发标识
	 */
	@Schema(description = "查询下发标识")
	@TableField(exist = false)
	private String lower;

	/**
	 * 提交时间
	 */
	@Schema(description = "提交时间")
	private LocalDateTime submitTime;

	/**
	 * 用户id
	 */
	@Schema(description = "用户id")
	private String userId;

	/**
	 * 部门id
	 */
	@Schema(description = "部门id")
	private String deptId;

	/**
	 * 库点简称
	 */
	@TableField(condition= SqlCondition.LIKE)
	@Schema(description = "库点简称")
	private String warehouse;

	@TableField(exist = false)
	@Schema(description = "物资信息详情-多条")
	private List<OutboundMaterialInfo> outboundMaterialInfos = new ArrayList<>();

	@TableField(exist = false)
	/** 物资名称 */
	@Schema(description = "物资名称")
	private String materialNameVo;

	@Schema(description = "总价")
	private String totalPrice;

}
