Task.java
4.46 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package com.topdraw.business.module.task.domain;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;
/**
* @author XiangHan
* @date 2021-10-22
*/
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@Accessors(chain = true)
@Table(name="tr_task")
public class Task implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
/** 任务模板id */
@Column(name = "task_template_id", nullable = false)
private Long taskTemplateId;
/** 关联实体id */
@Column(name = "entity_id", nullable = false)
private String entityId;
@Transient
private String taskTemplateCode;
/** 任务重复类型,-1:不限次;1:单次;>1:多次 */
@Column(name = "task_repeat_type", nullable = false)
private Integer taskRepeatType;
/** 任务每日重置 0:不重置;1:重置 */
@Column(name = "task_daily_reset", nullable = false)
private Integer taskDailyReset;
/** 行为量(完成此任务需要多少次相同行为的触发) */
@Column(name = "action_amount", nullable = false)
private Integer actionAmount;
/** 任务生效时间 */
@Column(name = "valid_time")
private Timestamp validTime;
/** 任务失效时间 */
@Column(name = "expire_time")
private LocalDateTime expireTime;
/** 显示顺序 */
@Column(name = "sequence")
private Integer sequence;
/** 获得成长值 */
@Column(name = "reward_exp", nullable = false)
private Long rewardExp;
/** 获得积分 */
@Column(name = "reward_points", nullable = false)
private Long rewardPoints;
/** 积分过期时间(空为不过期) */
@Column(name = "reward_points_expire_time")
private Long rewardPointsExpireTime;
/** 积分获取类型 0:定值;1:随机 */
@Column(name = "points_type")
private Integer pointsType;
/** 随机积分最大值 */
@Column(name = "reward_max_points")
private Integer rewardMaxPoints;
/** 能够获取该任务的用户分组,为空则都能获取 */
@Column(name = "groups")
private String groups;
/** 权益发放策略 0:立即发放;1:次日发放;2:次月发放 */
@Column(name = "rights_send_strategy", nullable = false)
private Integer rightsSendStrategy;
/** 会员等级门槛(0表示无门槛) */
@Column(name = "member_level", nullable = false)
private Integer memberLevel;
/** 会员vip门槛(0表示没有门槛) */
@Column(name = "member_vip")
private Integer memberVip;
/** 权益id */
@Column(name = "rights_id")
private Long rightsId;
/** 权益数量(活动机会次数、优惠券数量、奖品数量) */
@Column(name = "rights_amount")
private Integer rightsAmount;
/** 权益2id */
@Column(name = "rights2_id")
private Long rights2Id;
/** 权益2数量 */
@Column(name = "rights2_amount")
private Integer rights2Amount;
/** 权益3id */
@Column(name = "rights3_id")
private Long rights3Id;
/** 权益3数量 */
@Column(name = "rights3_amount")
private Integer rights3Amount;
/** 会员专享 0:会员专享 1:非会员专享 */
@Column(name = "member_exclusive")
private Integer memberExclusive;
/** 状态 0:失效;1:生效 */
@Column(name = "status", nullable = false)
private Integer status;
/** 任务名称 */
@Column(name = "name", nullable = false)
private String name;
/** 编号 */
@Column(name = "code", nullable = false)
private String code;
/** 任务描述 */
@Column(name = "description", nullable = false)
private String description;
@Transient
private String attr;
/** 创建时间 */
@CreatedDate
@Column(name = "create_time")
private Timestamp createTime;
/** 更新时间 */
@LastModifiedDate
@Column(name = "update_time")
private Timestamp updateTime;
public void copy(Task source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}