package cn.lihongjie.coal.coalBlend.dto;

import cn.lihongjie.coal.base.dto.OrgCommonDto;
import cn.lihongjie.coal.coalBlend.entity.CoalBlendConstrainVo;
import cn.lihongjie.coal.coalBlend.entity.CoalParameterDefVo;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import lombok.Data;

import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;

import java.util.List;

@Data
@Comment("配煤记录")
public class UpdateCoalBlendDto extends OrgCommonDto {

    @NotEmpty(message = "煤参数定义不能为空")
    private List<CoalParameterDefVo> parameterDefs;

    @NotEmpty(message = "煤不能为空")
    @Size(message = "至少需要两种煤", min = 2)
    private List<CoalBlendCoalInfoDto> coals;

    @NotNull(message = "约束条件不能为空")
    private CoalBlendConstrainVo constrains;

    private List<CoalBlendResultInfoDto> results;
    private String blendTypeName;
    private String blendType;


    @Comment("煤类型")
    private String coalType;

    @Formula(
            "(select i.name\n"
            + "from t_dictionary d,\n"
            + "     t_dictionary_item i\n"
            + "where d.id = i.dictionary_id\n"
            + "  and d.code = 'coalBlend.coalType'\n"
            + "  and i.code = coal_type)")
    private String coalTypeName;
    @Comment("结果个数")
    private Integer count = 20;

    @Comment("最长等待时间")
    private Integer maxTime = 10;

    @Comment("铲车配煤 配比之和 最大值")
    private Integer type2PercentSum = 10;

    @Comment("目标参数, 比如： param1  param2")
    private String targetParam = "";

    @Comment("求目标参数最大值 -1， 最小值 1")
    private Integer targetOrder = -1;
}
