package com.jjt.rz.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 工艺比对视图
 *
 * @author wukai
 * @date 2025/6/3 23:47
 */
@Data
@ApiModel(value = "CompareVo", description = "工艺比对视图")
public class CompareVO {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("产线")
    private Integer line;
    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime start;
    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime end;
    @ApiModelProperty("前整车间")
    private Qz qz;
    @ApiModelProperty("后整车间")
    private Hz hz;
    @ApiModelProperty("印染车间")
    private Yr yr;
    @ApiModelProperty("电")
    private BigDecimal elect;
    @ApiModelProperty("热油")
    private BigDecimal oil;
    @ApiModelProperty("产能")
    private Integer length;
    @ApiModelProperty("白坯投放量")
    private Integer bp;
    @Data
    public static class Qz {
        @ApiModelProperty("定型次数")
        private Integer dx;
        @ApiModelProperty("定型参数")
        private List<Para> dxPara;
        @ApiModelProperty("高梳次数")
        private Integer gs;
        @ApiModelProperty("高梳参数")
        private List<Para> gsPara;
        @ApiModelProperty("双棍烫光次数")
        private Integer tg;
        @ApiModelProperty("双棍烫光参数")
        private List<Para> tgPara;
        @ApiModelProperty("双棍刷毛次数")
        private Integer sm;
        @ApiModelProperty("双棍刷毛参数")
        private List<Para> smPara;
        @ApiModelProperty("电")
        private BigDecimal elect;
        @ApiModelProperty("热油")
        private BigDecimal oil;
        @ApiModelProperty("烘箱平均温度")
        private BigDecimal hxAvgTemp;
        @ApiModelProperty("烫辊平均温度")
        private BigDecimal tgAvgTemp;
        @ApiModelProperty("烫光平均速度")
        private BigDecimal tgAvgSpeed;

        public Qz() {
            this.elect = BigDecimal.ZERO;
            this.oil = BigDecimal.ZERO;
            this.dx = 0;
            this.gs = 0;
            this.tg = 0;
            this.sm = 0;
            this.dxPara = new ArrayList<>();
            this.gsPara = new ArrayList<>();
            this.tgPara = new ArrayList<>();
            this.smPara = new ArrayList<>();
        }

        public void addDxPara(Para para) {
            this.dxPara.add(para);
        }

        public void addGsPara(Para para) {
            this.gsPara.add(para);
        }

        public void addTgPara(Para para) {
            this.tgPara.add(para);
        }

        public void addSmPara(Para para) {
            this.smPara.add(para);
        }
    }

    @Data
    public static class Yr {
        @ApiModelProperty("印花次数")
        private Integer yh;
        @ApiModelProperty("烘固参数")
        private List<Para> hgPara;

        public Yr() {
            this.hgPara = new ArrayList<>();
        }

        public void addHgPara(Para para) {
            this.hgPara.add(para);
        }

    }

    @Data
    public static class Hz {
        @ApiModelProperty("定型次数")
        private Integer dx;
        @ApiModelProperty("定型参数")
        private List<Para> dxPara;
        @ApiModelProperty("高梳次数")
        private Integer gs;
        @ApiModelProperty("高梳参数")
        private List<Para> gsPara;
        @ApiModelProperty("双棍烫光次数")
        private Integer tg;
        @ApiModelProperty("双棍烫光参数")
        private List<Para> tgPara;
        @ApiModelProperty("双棍刷毛次数")
        private Integer sm;
        @ApiModelProperty("双棍刷毛参数")
        private List<Para> smPara;
        @ApiModelProperty("起毛次数")
        private Integer qm;
        @ApiModelProperty("起毛参数")
        private List<Para> qmPara;
        @ApiModelProperty("烫剪次数")
        private Integer tj;
        @ApiModelProperty("烫剪参数")
        private List<Para> tjPara;
        @ApiModelProperty("电")
        private BigDecimal elect;
        @ApiModelProperty("热油")
        private BigDecimal oil;
        @ApiModelProperty("烘箱平均温度")
        private BigDecimal hxAvgTemp;
        @ApiModelProperty("烫辊平均温度")
        private BigDecimal tgAvgTemp;
        @ApiModelProperty("烫光平均速度")
        private BigDecimal tgAvgSpeed;

        public Hz() {
            this.elect = BigDecimal.ZERO;
            this.oil = BigDecimal.ZERO;
            this.dx = 0;
            this.gs = 0;
            this.tg = 0;
            this.sm = 0;
            this.qm = 0;
            this.tj = 0;
            this.dxPara = new ArrayList<>();
            this.gsPara = new ArrayList<>();
            this.tgPara = new ArrayList<>();
            this.smPara = new ArrayList<>();
            this.qmPara = new ArrayList<>();
            this.tjPara = new ArrayList<>();
        }

        public void addDxPara(Para para) {
            this.dxPara.add(para);
        }

        public void addGsPara(Para para) {
            this.gsPara.add(para);
        }

        public void addTgPara(Para para) {
            this.tgPara.add(para);
        }

        public void addSmPara(Para para) {
            this.smPara.add(para);
        }

        public void addQmPara(Para para) {
            this.qmPara.add(para);
        }

        public void addTjPara(Para para) {
            this.tjPara.add(para);
        }
    }

    @Data
    public static class Para {
        @ApiModelProperty("名称")
        private String name;
        @ApiModelProperty("参数")
        private Map<String, Object> para;
    }

    public CompareVO() {
        this.qz = new Qz();
        this.hz = new Hz();
        this.yr = new Yr();
    }
}
