package com.cf.imes.module.plan.controller.admin.orderImport.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import jakarta.validation.constraints.NotNull;

/**
 * 生产单 Excel 导入 VO
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免生产单导入有问题
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderPlateImportExcelVO {

    @JsonIgnore
    private String ordinal;

    @JsonIgnore
    private String goodType;

    @JsonIgnore
    private String goodsId;

    @JsonIgnore
    private Long goodId; // 商品id

    @JsonIgnore
    private String goodsName;

    @JsonIgnore
    private String material;

    @JsonIgnore
    private String wave;

    @JsonIgnore
    private String color;

    @JsonIgnore
    private String isComposite;

    @JsonIgnore
    private String category;

    @JsonIgnore
    private String type;

    @JsonIgnore
    private String factory;

    @JsonIgnore
    private String brand;

    @JsonIgnore
    private String model;

    @JsonIgnore
    private String goodsHeight;

    @JsonIgnore
    private String goodsWidth;

    @JsonIgnore
    private String goodsThickness;

    @JsonIgnore
    private String spec;

    @JsonIgnore
    private String unit;

    @NotNull
    @JsonIgnore
    private String goodsNumber;

    @JsonIgnore
    private String roomsName;

    @JsonIgnore
    private String cabinetsName;

    @JsonIgnore
    private String synthesisTypeName; // 加工组类型的名称

    @JsonIgnore
    private String combinationName;

    @JsonIgnore
    private String name;

    @JsonIgnore
    private String plateNo;

    @JsonIgnore
    private String height;

    @JsonIgnore
    private String width;

    @JsonIgnore
    private String splitHeight;

    @JsonIgnore
    private String splitWidth;

    @JsonIgnore
    private String thickness;

    @JsonIgnore
    private String sealLeft;

    @JsonIgnore
    private String sealRight;

    @JsonIgnore
    private String sealUp;

    @JsonIgnore
    private String sealDown;

    @JsonIgnore
    private String typographicFace;

    @JsonIgnore
    private String texture;

    @JsonIgnore
    private String openDoorType;

    @JsonIgnore
    private String result;

    private String remark1;

    private String remark2;

    private String remark3;

    private String remark4;

    private String remark5;

    private String remark6;

    private String remark7;

    private String remark8;

    private String remark9;

    private String remark10;

    private String remark;

    @JsonIgnore
    private Double area; // 面积

    // 备注转json数据
    public String remarkJSON() {
        ObjectMapper objectMapper = new ObjectMapper();
        // 设置实体类字段的值
        try {
            String json = objectMapper.writeValueAsString(this);
            return json;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
}

