zxl
2 天以前 3b0516a2959e25576e4f3fda697a3b025d06c8c9
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/Notify.java
@@ -3,7 +3,10 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.platform.base.AbsEntity;
import enumeration.general.NotifyTargetTypeEnum;
import enumeration.general.NotifyTypeEnum;
import enumeration.general.UrgentLevelEnum;
import enumeration.general.YesOrNoEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@@ -36,19 +39,71 @@
    private String content;
    @ApiModelProperty("通知谁")
    @TableField("notify_who")
    private Integer notifyWho;
    @TableField("notify_user")
    private Integer notifyUser;
    @ApiModelProperty("已读")
    @TableField("readed")
    private String readed;
    private YesOrNoEnum readed;
    @ApiModelProperty("紧急")
    @TableField("urgent")
    private String urgent;
    private UrgentLevelEnum urgent;
    @ApiModelProperty("工单ID")
    @TableField("work_order_id")
    private Integer workOrderId;
    @ApiModelProperty("工单号")
    @TableField("work_order_no")
    private String workOrderNo;
    @ApiModelProperty("通知目标类型")
    @TableField("notify_target_type")
    private NotifyTargetTypeEnum notifyTargetType;
    @ApiModelProperty("通知运维单位")
    @TableField("notify_unit")
    private Integer notifyUnit;
    /**
     * 通知用户
     *
     * @param notifyType
     * @param content
     * @param notifyUser
     * @param urgent
     * @param workOrderNo
     * @return
     */
    public static Notify genEntityByPeople(NotifyTypeEnum notifyType, String content, Integer notifyUser, UrgentLevelEnum urgent, String workOrderNo) {
        Notify notify = new Notify();
        notify.setNotifyType(notifyType);
        notify.setContent(content);
        notify.setNotifyUser(notifyUser);
        notify.setUrgent(urgent);
        notify.setWorkOrderNo(workOrderNo);
        notify.setNotifyTargetType(NotifyTargetTypeEnum.USER);
        notify.setReaded(YesOrNoEnum.NO);
        return notify;
    }
    /**
     * 通知单位
     *
     * @param notifyType
     * @param content
     * @param notifyUnit
     * @param urgent
     * @param workOrderNo
     * @return
     */
    public static Notify genEntityByUnit(NotifyTypeEnum notifyType, String content, Integer notifyUnit, UrgentLevelEnum urgent, String workOrderNo) {
        Notify notify = new Notify();
        notify.setNotifyType(notifyType);
        notify.setContent(content);
        notify.setUrgent(urgent);
        notify.setNotifyUnit(notifyUnit);
        notify.setWorkOrderNo(workOrderNo);
        notify.setNotifyTargetType(NotifyTargetTypeEnum.UNIT);
        notify.setReaded(YesOrNoEnum.NO);
        return notify;
    }
}