package com.casic.missiles.model.meter;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.casic.missiles.annotation.DictCodeField;
import com.casic.missiles.constants.MeterDictCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 计量管理-计量组织-部门管理/科室管理/工程组管理
 * </p>
 *
 * @author wangpeng
 * @since 2022-11-27
 */
@ColumnWidth(30)
@HeadRowHeight(15)
@ContentRowHeight(20)
@ContentStyle(borderLeft = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ExcelIgnoreUnannotated
@ApiModel
@Data
@TableName("meter_organize")
public class MeterOrganize implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    @ApiModelProperty(value = "主键id", dataType = "Long", required = true)
    private Long id;

    /**
     * 组织部门id-系统组织表
     */
    @ApiModelProperty(value = "组织部门id", dataType = "Long", required = true)
    @NotNull(message = "系统组织部门id不能为空")
    @TableField("dept_id")
    private Long deptId;

    /**
     * 父组织部门id
     */
    @ApiModelProperty(value = "父组织id", dataType = "Long", required = true)
    @TableField("p_dept_id")
    private Long pDeptId;

    @ApiModelProperty(value = "父组织名称", dataType = "String", required = true)
    @TableField(exist = false)
    private String pDeptName;

    /**
     * 部门/科室/工程组编号
     */
    @ExcelProperty("组织编号")
    @ApiModelProperty(hidden = true)
    @TableField("organize_no")
    private String organizeNo;

    /**
     * 部门/科室/工程组名称
     */
    @ExcelProperty("组织名称")
    @ApiModelProperty(value = "计量组织名称", dataType = "String", required = true)
    @NotBlank(message = "计量组织名称不能为空")
    @TableField("organize_name")
    private String organizeName;

    /**
     * 组织类型-对标dept_type
     */
    @ApiModelProperty(value = "计量组织类型", dataType = "String", required = true)
    @NotBlank(message = "计量组织类型不能为空")
    @TableField("organize_type")
    private String organizeType;

    /**
     * 负责人
     */
    @ExcelProperty("负责人")
    @ApiModelProperty(value = "负责人", dataType = "String")
    @TableField("director")
    private String director;

    @ExcelProperty("父部门负责人")
    @ApiModelProperty(value = "父部门负责人", dataType = "String")
    @TableField(exist = false)
    private String pDeptDirector;

    /**
     * 计量专业
     */
    @DictCodeField(message = "计量专业不合法", cacheName = MeterDictCode.MEASURE_MAJOR)
    @ApiModelProperty(value = "计量专业（字典code）", dataType = "String")
    @TableField(value = "meter_major", updateStrategy = FieldStrategy.IGNORED)
    private String meterMajor;

    @ExcelProperty("专业")
    @ApiModelProperty(value = "计量专业（字典value）", dataType = "String")
    @TableField(exist = false)
    private String meterMajorName;

    /**
     * 技术职务-字典code
     */
    @ApiModelProperty(value = "技术职务（字典code）", dataType = "String")
    @DictCodeField(message = "技术职务不合法", cacheName = MeterDictCode.TECHNOLOGY_JOB)
    @TableField(value = "technology_job", updateStrategy = FieldStrategy.IGNORED)
    private String technologyJob;

    @ExcelProperty("技术职务")
    @ApiModelProperty(value = "技术职务（字典value）", dataType = "String")
    @TableField(exist = false)
    private String technologyJobName;

    /**
     * 行政职务-字典code
     */
    @ApiModelProperty(value = "行政职务（字典code）", dataType = "String")
    @DictCodeField(message = "行政职务不合法", cacheName = MeterDictCode.ADMINISTRATION_JOB)
    @TableField(value = "administration_job", updateStrategy = FieldStrategy.IGNORED)
    private String administrationJob;

    @ExcelProperty("行政职务")
    @ApiModelProperty(value = "行政职务（字典value）", dataType = "String")
    @TableField(exist = false)
    private String administrationJobName;

    /**
     * 联系方式
     */
    @ExcelProperty("联系方式")
    @ApiModelProperty(value = "联系方式", dataType = "String")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "是否为实验室", dataType = "Integer")
    @TableField("is_lab")
    private Integer isLab;

    @ApiModelProperty(value = "实验室能力", dataType = "String")
    @TableField("lab_capacity")
    private String labCapacity;

    /**
     * 备注
     */
    @ExcelProperty("备注")
    @ApiModelProperty(value = "备注", dataType = "String")
    @TableField("remark")
    private String remark;

    /**
     * 删除标记
     */
    @ApiModelProperty(hidden = true)
    @TableField("is_del")
    private Integer isDel;

    /**
     * 创建时间
     */
    @ExcelProperty("创建时间")
    @ApiModelProperty(hidden = true)
    @TableField("create_time")
    private String createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(hidden = true)
    @TableField("update_time")
    private String updateTime;

}
