zxl
6 小时以前 3b0516a2959e25576e4f3fda697a3b025d06c8c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.ycl.platform.domain.entity;
 
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;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
 
/**
 * 通知
 *
 * @author xp
 * @since 2024-04-07
 */
@Data
@Accessors(chain = true)
@TableName("t_notify")
@ApiModel(value = "Notify对象", description = "通知")
@AllArgsConstructor
@NoArgsConstructor
public class Notify extends AbsEntity {
 
    private static final long serialVersionUID = 1L;
 
    @ApiModelProperty("通知类型")
    @TableField("notify_type")
    private NotifyTypeEnum notifyType;
 
    @ApiModelProperty("通知内容")
    @TableField("content")
    private String content;
 
    @ApiModelProperty("通知谁")
    @TableField("notify_user")
    private Integer notifyUser;
 
    @ApiModelProperty("已读")
    @TableField("readed")
    private YesOrNoEnum readed;
 
    @ApiModelProperty("紧急")
    @TableField("urgent")
    private UrgentLevelEnum urgent;
 
    @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;
    }
 
}