package com.jjt.calc.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jjt.common.annotation.Excel;
import com.jjt.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 按配方1小时统计数据对象 TWIN_CALC_HOUR_SPEC
 *
 * @author wukai
 * @date 2025-01-18
 */
@ApiModel(value = "TwinCalcHourSpec", description = "按配方1小时统计数据")
@Data
public class TwinCalcHourSpec extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @ApiModelProperty("ID")
    @TableId
    private Long id;

    /**
     * 日期
     */
    @ApiModelProperty("日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date dataDate;

    /**
     * 小时;0-23
     */
    @ApiModelProperty("小时;0-23")
    @Excel(name = "小时;0-23")
    private Integer hour;

    /**
     * 设备ID
     */
    @ApiModelProperty("设备ID")
    @Excel(name = "设备ID")
    private Long deviceId;

    /**
     * 织造米数
     */
    @ApiModelProperty("织造米数")
    @Excel(name = "织造米数")
    private BigDecimal length;

    /**
     * 规格
     */
    @ApiModelProperty("规格")
    @Excel(name = "规格")
    private String spec;

    /**
     * 毛高
     */
    @ApiModelProperty("毛高")
    @Excel(name = "毛高")
    private BigDecimal height;

    /**
     * 米克重
     */
    @ApiModelProperty("米克重")
    @Excel(name = "米克重")
    private Integer mick;

    /**
     * 密度
     */
    @ApiModelProperty("密度")
    @Excel(name = "密度")
    private BigDecimal density;

    /**
     * 单价
     */
    @ApiModelProperty("单价")
    @Excel(name = "单价")
    private BigDecimal price;

    @ApiModelProperty("班组")
    private String team;

    @ApiModelProperty("员工号")
    private String empId;

    @ApiModelProperty("员工姓名")
    private String empName;
    public void setTeam() {
        if (this.hour >= 7 && this.hour < 19) {
            //A班
            this.team = "A";
        } else {
            //B班
            this.team = "B";
        }
    }
}
