package com.zt.plat.module.qms.resource.material.controller.vo;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import com.alibaba.excel.annotation.*;

@Schema(description = "管理后台 - 物料批次 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialBatchRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9716")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "父id,为0时是批次，不为0时是工段", example = "1035")
    @ExcelProperty("父id,为0时是批次，不为0时是工段")
    private Long parentId;

    @Schema(description = "物料大类id", example = "9381")
    @ExcelProperty("物料大类id")
    private Long productId;

    @Schema(description = "关联的样品大类id")
    private String productSampleIds;

    @Schema(description = "分类自定义配置")
    @ExcelProperty("分类自定义配置")
    private JSONObject categoryCustomConfig;

    @Schema(description = "物料大类名称")
    @ExcelProperty("物料大类名称")
    private String productName;

    @Schema(description = "物料大类编码")
    @ExcelProperty("物料大类编码")
    private String productCode;

    @Schema(description = "物料大类规格")
    @ExcelProperty("物料大类规格")
    private String productSpecification;

    @Schema(description = "物料大类型号")
    @ExcelProperty("物料大类型号")
    private String productModelNo;

    @Schema(description = "单位")
    @ExcelProperty("单位")
    private String unit;

    @Schema(description = "额定容量")
    @ExcelProperty("额定容量")
    private BigDecimal standardCapacity;

    @Schema(description = "标签模板key")
    @ExcelProperty("标签模板key")
    private String labelTemplateKey;

    @Schema(description = "批次编号")
    @ExcelProperty("批次编号")
    private String batchNo;

    @Schema(description = "总数量")
    @ExcelProperty("总数量")
    private BigDecimal inboundQuantity;

    @Schema(description = "可用数量")
    @ExcelProperty("可用数量")
    private BigDecimal remaineQuantity;

    @Schema(description = "退货数量")
    @ExcelProperty("退货数量")
    private BigDecimal returnQuantity;

    @Schema(description = "换货数量")
    @ExcelProperty("换货数量")
    private BigDecimal replaceQuantity;

    @Schema(description = "已入库数量")
    @ExcelProperty("已入库数量")
    private BigDecimal inboundEndQuantity;

    @Schema(description = "检定/校准数量")
    @ExcelProperty("检定/校准数量")
    private BigDecimal verificationQuantity;

    @Schema(description = "锁定数量")
    @ExcelProperty("锁定数量")
    private BigDecimal lockQuantity;

    @Schema(description = "存放位置描述")
    @ExcelProperty("存放位置描述")
    private String location;

    @Schema(description = "供应商id", example = "3737")
    @ExcelProperty("供应商id")
    private Long supplierId;

    @Schema(description = "供应商")
    @ExcelProperty("供应商")
    private String supplierName;

    @Schema(description = "生产日期")
    @ExcelProperty("生产日期")
    private LocalDateTime manufacturerDate;

    @Schema(description = "到期日期")
    @ExcelProperty("到期日期")
    private LocalDateTime dueDate;

    @Schema(description = "分配部门id")
    @ExcelProperty("分配部门id")
    private Long assignDepartmentId;

    @Schema(description = "分配部门名称")
    @ExcelProperty("分配部门名称")
    private String assignDepartmentName;

    @Schema(description = "提交状态,0-未提交，1-已提交", example = "1")
    @ExcelProperty("提交状态,0-未提交，1-已提交")
    private Integer submitStatus;

    @Schema(description = "提交日期")
    @ExcelProperty("提交日期")
    private LocalDateTime submitDate;

    @Schema(description = "验收状态", example = "1")
    @ExcelProperty("验收状态")
    private String acceptanceStatus;

    @Schema(description = "是否检化验,1-是，0-否")
    @ExcelProperty("是否检化验,1-是，0-否")
    private Integer assayFlag;

    @Schema(description = "检化验状态,NOT_STARTED-未开始，IN_PROGRESS-进行中，PASSED-通过，NOT_PASSED-未通过", example = "2")
    @ExcelProperty("检化验状态,NOT_STARTED-未开始，IN_PROGRESS-进行中，PASSED-通过，NOT_PASSED-未通过")
    private String assayStatus;

    @Schema(description = "检化验结果")
    @ExcelProperty("检化验结果")
    private String assayResult;

    @Schema(description = "所属部门")
    @ExcelProperty("所属部门")
    private String systemDepartmentCode;

    @Schema(description = "备注")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "子批次-工段")
    private List<MaterialBatchRespVO> children;

}