package com.storlead.sales.pojo.vo.customer;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.AnnotateEnumType;
import com.storlead.framework.annotate.Dict;
import com.storlead.framework.annotate.OrgAutoMateAnnotate;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.storlead.sales.pojo.entity.customer.BulletinEntity;
import com.storlead.sales.pojo.entity.customer.SysResourceEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "公告详情VO")
public class BulletinDetailVO extends BulletinEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公告ID")
    private Long id;

    @ApiModelProperty(value = "公告标题")
    private String title;

    @ApiModelProperty(value = "公告内容")
    private String content;

    @ApiModelProperty(value = "截止时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadlineDate;

    @ApiModelProperty(value = "所属栏目（对应字典栏目value）")
    @Dict(dictCode = "column_value",valueField = "columnName")
    private String columnValue;

    @ApiModelProperty(value = "附件")
    private List<SysResourceEntity> files;

    @ApiModelProperty(value = "通知范围 1.全员 2.部分")
    private Integer bulletinType;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "公告通知时间")
    private LocalDateTime noticeTime;

    @ApiModelProperty(value = "公告发布人")
    private String publisher;

    @ApiModelProperty(value = "允许评论(1:允许 0:不允许)")
    private Integer isTalk;

    @ApiModelProperty(value = "提醒类型：site：站内，mail：邮件,sms：短信 ： 多个逗号分割")
    @Dict(dictCode = "task_remind_mode",valueField = "remindModeName",multiple = true)
    private String remindMode;

    @ApiModelProperty(value = "公告阅读人数")
    private Integer readCount;

    @ApiModelProperty(value = "通知人员")
    @OrgAutoMateAnnotate(valueField = "noticeUserNames",multiple = true,annotateType = AnnotateEnumType.USER)
    private String noticeUserIds;

    @ApiModelProperty(value = "前拥有者")
    private Long formerOwnerBy;

    @ApiModelProperty(value = "通知人员名称")
    private String noticeUserNames;

    /**
     * 阅读对象
     */
    @ApiModelProperty(value = "阅读对象")
    private List<BulletinReadVO> readVOs;

    @ApiModelProperty(value = "评论集合")
    private List<RecordCommentVO> commentls;
}
