AppealBean.java
3.91 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
package com.glsx.usedcar.export;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.glsx.usedcar.export.converter.AppealStateConverter;
import com.glsx.usedcar.export.converter.DictionConverter;
import com.glsx.usedcar.export.converter.SolutionConverter;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.auction.entity.Appeal;
import com.glsx.usedcar.module.auction.entity.AuctionOrder;
import com.glsx.usedcar.module.security.entity.User;
import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.summerframework.orm.dictionary.Diction;
import org.summerframework.orm.dictionary.DictionaryConverter;
import org.summerframework.orm.validator.CreateValidGroup;
import org.summerframework.orm.validator.UpdateValidGroup;
import org.summerframework.storage.converter.FileInfosConverter;
import org.summerframework.storage.domain.FileInfo;
import java.util.List;
import java.util.Objects;
import static jakarta.persistence.GenerationType.IDENTITY;
@Data
public class AppealBean {
/**
* APPEAL_ID
*/
@ExcelIgnore
private int appealId;
@ExcelProperty("申诉单号")
@ColumnWidth(20)
private String appealCode;
/**
* ORDER_ID
*/
@ExcelProperty("关联订单编号")
@ColumnWidth(20)
private String orderCode;
@ExcelProperty("车系名字")
@ColumnWidth(15)
private String carSeriesName;
@ExcelProperty("车型名称")
@ColumnWidth(30)
private String carTypeName;
@ExcelProperty("用户名")
private String accountName;
@ExcelProperty("手机号")
private String mobile;
@ExcelProperty(value = "申诉原因", converter = DictionConverter.class)
@ColumnWidth(30)
private Diction appealReason;
@ExcelProperty("补充描述")
@ColumnWidth(30)
private String appealContent;
/**
* 附件
*/
@ExcelIgnore
private List<FileInfo> attachments;
@ExcelProperty(value = "申诉状态", converter = AppealStateConverter.class)
private Appeal.AppealState appealState;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("处理专员")
private String realName;
@ExcelProperty("处理专员手机号")
private String userMobile;
@ExcelProperty(value = "解决方案", converter = SolutionConverter.class)
private Appeal.Solution solution;
@ExcelProperty("解决方案说明")
private String solutionDesc;
@ExcelProperty("补偿金额")
private int compensationAmount;
public AppealBean(Appeal appeal) {
User user = appeal.getUser();
AuctionOrder auctionOrder = appeal.getAuctionOrder();
Vehicle vehicle = auctionOrder.getVehicle();
Account account = auctionOrder.getAccount();
this.appealId = appeal.getAppealId();
this.appealCode = appeal.getAppealCode();
this.orderCode = auctionOrder.getOrderCode();
this.carSeriesName = vehicle.getBaseInfo().getCarSeriesName();
this.carTypeName = vehicle.getBaseInfo().getCarTypeName();
this.accountName = account.getAccountName();
this.mobile = account.getMobile();
this.appealContent = appeal.getAppealContent();
this.appealReason = appeal.getAppealReason();
this.attachments = appeal.getAttachments();
this.appealState = appeal.getAppealState();
this.remark = appeal.getRemark();
if (Objects.nonNull(user)) {
this.realName = user.getRealName();
this.userMobile = user.getMobile();
}
this.solution = appeal.getSolution();
this.solutionDesc = appeal.getSolutionDesc();
this.compensationAmount = appeal.getCompensationAmount();
}
}