package com.gci.boot.modules.customer.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.annotation.Query.SelectQuery;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 客户反馈意见
 * </p>
 *
 * @author xushuhan
 * @since 2023-10-16
 */
@Getter
@Setter
@TableName("tb_customer_opinion")
@ApiModel(value = "TbCustomerOpinion对象", description = "客户反馈意见")
@ColumnWidth(20)
public class TbCustomerOpinion implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String id;
    
    @ApiModelProperty("所属项目")
    @ExcelProperty(value = "所属项目", converter = DictConverter.class, index = 3)
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @Dict(dictTable = "tb_projects", dicText = "project_name", dicCode = "id")
    private String projectId;

    @ApiModelProperty("登记时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat("yyyy-MM-dd HH:mm")
    @ExcelIgnore
    private Date registerTime;

    @ApiModelProperty("意见标题")
    @SelectQuery
    @ExcelProperty(value = "意见标题", index = 0)
    private String name;

    @ApiModelProperty("意见分类（1客户服务，2服务需求，3其他）")
    @ExcelProperty(value = "意见分类", converter = DictConverter.class, index = 1)
    @Dict(dicCode = "opinion_type")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String opinionType;

    @ApiModelProperty("提议人")
    @SelectQuery
    @ExcelProperty(value = "提议人", index = 4)
    private String proposeName;

    @ApiModelProperty("联系电话")
    @ExcelProperty(value = "联系电话", index = 5)
    private String phone;

    @ApiModelProperty("登记人")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
    @ExcelIgnore
    private String registrant;

    @ApiModelProperty("意见内容")
    @SelectQuery
    @ExcelProperty(value = "意见内容", index = 2)
    private String content;

    @ApiModelProperty("处理人")
    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
    @ExcelProperty(value = "处理人", converter = DictConverter.class, index = 6)
    private String handleId;

    @ApiModelProperty("附件")
    @ExcelIgnore
    private String fileUrl;

    @ApiModelProperty("客户回访id")
    @ExcelProperty(value = "关联回访", converter = DictConverter.class, index = 8)
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @Dict(dictTable = "tb_customer_follow", dicText = "follow_no", dicCode = "id")
    private String followId;

    @ApiModelProperty("状态（1未完成，2已完成）")
    @ExcelProperty(value = "状态", converter = DictConverter.class, index = 7)
    @Dict(dicCode = "result_status")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String opinionStatus;

    @ApiModelProperty("备注")
    @ExcelIgnore
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String remark;

    @ApiModelProperty("所属机构")
    @ExcelIgnore
    private String sysOrgCode;

    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date updateTime;

    @ApiModelProperty("创建人")
    @ExcelIgnore
    private String createBy;

    @ApiModelProperty("更新人")
    @ExcelIgnore
    private String updateBy;

    @TableField(exist = false)
    @ExcelIgnore
    private List<TbCustomerOpinionHandle> handleList;

    @ApiModelProperty("日期开始")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date registerTimeStart;

    @ApiModelProperty("日期结束")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date registerTimeEnd;


}
