Pu Zhibing
2025-03-26 7f26677ab7f9b83697370fa142dd1686cdf4082a
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
package com.ruoyi.account.api.model;
 
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
 
/**
 * <p>
 * 
 * </p>
 *
 * @author luodangjia
 * @since 2024-11-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_app_user")
@ApiModel(value="AppUser对象", description="")
public class AppUser implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    @ApiModelProperty(value = "主键")
    @TableId("id")
    private Long id;
 
    @ApiModelProperty(value = "用户类型(1-普通用户,2-门店员工)")
    private Integer userType;
 
    @ApiModelProperty(value = "用户")
    @TableField("name")
    private String name;
    @ApiModelProperty("会员名称")
    @TableField(exist = false)
    private String vipName;
 
    @ApiModelProperty(value = "手机号")
    @TableField("phone")
    private String phone;
 
    @ApiModelProperty(value = "头像")
    @TableField("avatar")
    private String avatar;
 
    @ApiModelProperty(value = "会员id")
    @TableField("vip_id")
    private Integer vipId;
 
    @ApiModelProperty(value = "微信openid")
    @TableField("wx_openid")
    private String wxOpenid;
 
    @ApiModelProperty(value = "支付宝openid")
    @TableField("ali_openid")
    private String aliOpenid;
 
    @ApiModelProperty(value = "状态(1=正常,2=冻结,3=注销)")
    @TableField("status")
    private Integer status;
 
    @ApiModelProperty(value = "添加时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
 
    @ApiModelProperty(value = "删除(0=否,1=是)")
    @TableField("del_flag")
    private Boolean delFlag;
 
    @ApiModelProperty(value = "0否1是第一次添加")
    @TableField("first_add")
    private Integer firstAdd;
 
    @ApiModelProperty(value = "最后一次登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;
    
    @ApiModelProperty(value = "顶级推广人id")
    @TableField("top_invite_id")
    private Long topInviteId;
 
    @ApiModelProperty(value = "推广人id")
    @TableField("invite_user_id")
    private Long inviteUserId;
    @ApiModelProperty(value = "推广人姓名")
    @TableField(exist = false)
    private String inviteUserName;
    @ApiModelProperty(value = "指导老师")
    @TableField(exist = false)
    private String teacher;
    @TableField(exist = false)
    private String teacherPhone;
 
    @ApiModelProperty(value = "绑定门店id")
    @TableField("shop_id")
    private Integer shopId;
    @ApiModelProperty(value = "绑定门店名称")
    @TableField(exist = false)
    private String shopName;
    @ApiModelProperty(value = "绑定门店列表")
    @TableField(exist = false)
    private List<String> shopNames;
    @ApiModelProperty(value = "绑定门店封面")
    @TableField(exist = false)
    private String shopCover;
    @ApiModelProperty(value = "绑定门店地址")
    @TableField(exist = false)
    private String shopAddress;
    @ApiModelProperty(value = "上级人员信息")
    @TableField(exist = false)
    private AppUser topUser;
    @ApiModelProperty(value = "下级人员列表")
    @TableField(exist = false)
    private List<AppUser> bottomUsers;
 
    @TableField(exist = false)
    private Page<AppUser> bottomUsersPage;
 
    @ApiModelProperty(value = "合伙人积分数")
    @TableField("part_point")
    private Integer partPoint;
 
    @ApiModelProperty(value = "合伙人培育积分数")
    @TableField("part_grow_point")
    private Integer partGrowPoint;
 
    @ApiModelProperty(value = "消费积分数")
    @TableField("shop_point")
    private Integer shopPoint;
 
    @ApiModelProperty(value = "返佣积分数")
    @TableField("share_point")
    private Integer sharePoint;
 
    @ApiModelProperty(value = "消费总金额")
    @TableField("shop_amount")
    private BigDecimal shopAmount;
 
    @ApiModelProperty(value = "最后消费时间")
    @TableField("last_shop_time")
    private LocalDateTime lastShopTime;
 
    @ApiModelProperty(value = "账户余额")
    @TableField("balance")
    private BigDecimal balance;
 
    @ApiModelProperty(value = "可提现金额")
    @TableField("withdrawable_amount")
    private BigDecimal withdrawableAmount;
 
    @ApiModelProperty(value = "已提现金额")
    @TableField("withdrawn_amount")
    private BigDecimal withdrawnAmount;
 
    @ApiModelProperty(value = "充值总金额")
    @TableField("total_recharge_amount")
    private BigDecimal totalRechargeAmount;
 
    @ApiModelProperty(value = "红包总金额")
    @TableField("total_red_packet_amount")
    private BigDecimal totalRedPacketAmount;
 
    @ApiModelProperty(value = "分销总金额")
    @TableField("total_distribution_amount")
    private BigDecimal totalDistributionAmount;
 
    @ApiModelProperty(value = "冻结分佣金额")
    @TableField("freeze_commission_amount")
    private BigDecimal freezeCommissionAmount;
 
    @ApiModelProperty(value = "冻结分佣积分")
    @TableField("freeze_commission_point")
    private Integer freezeCommissionPoint;
 
    @ApiModelProperty(value = "拉新人积分总数")
    @TableField("total_invite_point")
    private Integer totalInvitePoint;
 
    @ApiModelProperty(value = "注册积分总数")
    @TableField("total_register_point")
    private Integer totalRegisterPoint;
    
    @ApiModelProperty(value = "绑定下级门店分佣积分")
    @TableField("lower_level_share_point")
    private Integer lowerLevelSharePoint;
 
    @ApiModelProperty(value = "门店返佣积分")
    @TableField("shop_share_point")
    private Integer shopSharePoint;
    
    @ApiModelProperty(value = "门店业绩积分")
    @TableField("shop_achievement_point")
    private Integer shopAchievementPoint;
 
    @ApiModelProperty(value = "门店服务费(门店核销获得)")
    @TableField("shop_service_fee")
    private BigDecimal shopServiceFee;
 
    @ApiModelProperty(value = "门店返佣金额(绑定用户消费后返佣)")
    @TableField("shop_commission")
    private BigDecimal shopCommission;
 
//    @ApiModelProperty(value = "做工积分总数")
//    @TableField("total_work_point")
//    private Integer totalWorkPoint;
 
    @ApiModelProperty(value = "每日分享积分")
    @TableField("total_share_point")
    private Integer totalSharePoint;
 
    @ApiModelProperty(value = "每日签到积分")
    @TableField("total_sign_point")
    private Integer totalSignPoint;
 
    @ApiModelProperty(value = "使用时长积分")
    @TableField("total_hour_point")
    private Integer totalHourPoint;
 
    @ApiModelProperty(value = "技师业绩积分总数")
    @TableField("total_performance_point")
    private Integer totalPerformancePoint;
 
    @ApiModelProperty(value = "总积分")
    @TableField("total_point")
    private Integer totalPoint;
 
    @ApiModelProperty(value = "剩余积分")
    @TableField("lave_point")
    private Integer lavePoint;
    
    @ApiModelProperty(value = "可用积分")
    @TableField("available_point")
    private Integer availablePoint;
    
    @ApiModelProperty(value = "可用总积分数")
    @TableField("total_available_point")
    private Integer totalAvailablePoint;
 
    @ApiModelProperty(value = "可转增积分")
    @TableField("transferable_point")
    private Integer transferablePoint;
    
    @ApiModelProperty(value = "是否可更换推广人(0=否,1=是)")
    @TableField("change_promoter")
    private Integer changePromoter;
    
    @ApiModelProperty(value = "经度")
    @TableField("longitude")
    private String longitude;
    
    @ApiModelProperty(value = "纬度")
    @TableField("latitude")
    private String latitude;
    
    @ApiModelProperty(value = "省")
    @TableField("province")
    private String province;
    
    @ApiModelProperty(value = "省编号")
    @TableField("province_code")
    private String provinceCode;
    
    @ApiModelProperty(value = "市")
    @TableField("city")
    private String city;
    
    @ApiModelProperty(value = "市编号")
    @TableField("city_code")
    private String cityCode;
    
    @ApiModelProperty(value = "区")
    @TableField("district")
    private String district;
    
    @ApiModelProperty(value = "区编号")
    @TableField("district_code")
    private String districtCode;
    @ApiModelProperty(value = "区编号")
    @TableField("qr_code")
    private String qrCode;
 
    @ApiModelProperty("等级1会员数")
    @TableField(exist = false)
    private Long count1;
 
    @ApiModelProperty("等级2会员数")
    @TableField(exist = false)
    private Long count2;
 
    @ApiModelProperty("等级3会员数")
    @TableField(exist = false)
    private Long count3;
 
    @ApiModelProperty("等级4会员数")
    @TableField(exist = false)
    private Long count4;
 
    @ApiModelProperty("等级5会员数")
    @TableField(exist = false)
    private Long count5;
 
    @ApiModelProperty("等级6会员数")
    @TableField(exist = false)
    private Long count6;
 
    @ApiModelProperty("等级7会员数")
    @TableField(exist = false)
    private Long count7;
 
    @ApiModelProperty("是否签到1是0否")
    @TableField(exist = false)
    private Integer isSign;
 
    @ApiModelProperty("绑定门店id列表")
    @TableField(exist = false)
    private Set<Integer> shopIds;
 
    @ApiModelProperty(value = "降级预警(0=否,1=是)")
    @TableField("is_danger")
    private Integer isDanger;
 
    @ApiModelProperty(value = "最后下单时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastOrderTime;
 
    @TableField(exist = false)
    private Set<Long> userIds;
 
    @TableField(exist = false)
    private Integer excludeStatus;
 
    public String getIdStr(){
        return String.valueOf(id);
    }
 
 
    public Integer getUserTotalPoint(){
        if (totalPoint == null){
            totalPoint = 0;
        }
        if (lowerLevelSharePoint == null){
            lowerLevelSharePoint = 0;
        }
        if (shopSharePoint == null){
            shopSharePoint = 0;
        }
        if (shopAchievementPoint == null){
            shopAchievementPoint = 0;
        }
        return totalPoint - lowerLevelSharePoint - shopSharePoint - shopAchievementPoint;
    }
 
 
 
}