VehicleBean.java
9.94 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
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
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.ListConverter;
import com.glsx.usedcar.module.vehicle.entity.*;
import lombok.Data;
import java.time.LocalDate;
import java.util.List;
@Data
public class VehicleBean {
@ExcelIgnore
private int vehicleId;
@ExcelProperty("车辆品牌名称")
@ColumnWidth(10)
private String carBrand;
@ExcelProperty("子品牌名字")
private String carChildsBrandName;
@ExcelProperty("车系名字")
@ColumnWidth(15)
private String carSeriesName;
@ExcelProperty("车型名称")
@ColumnWidth(30)
private String carTypeName;
// 从BaseInfo补充的属性
@ExcelIgnore
@ExcelProperty("车辆品牌id")
private int carBrandId;
@ExcelIgnore
@ExcelProperty("子品牌id")
private int carChildsBrandId;
@ExcelIgnore
@ExcelProperty("车系id")
private int carSeriesId;
@ExcelIgnore
@ExcelProperty("车型id")
private int carTypeId;
@ExcelProperty("表显里程")
private int mileage;
@ExcelProperty("车架号")
private String vin;
@ExcelProperty("车牌号")
private String licensePlate;
@ExcelProperty("车源号(平台唯一识别编号)")
private String sourceNo;
@ExcelProperty(value = "标签(如:准新车)", converter = ListConverter.class)
private List<String> tags;
@ExcelProperty("新车指导价(元)")
private double guidePrice;
// 从OwnerInfo补充的属性
@ExcelProperty("车主姓名")
private String previousOwnerName;
@ExcelProperty("车主联系方式(手机号)")
private String previousOwnerPhone;
// 从LicenseInfo补充的属性
@ExcelProperty("年检到期")
private LocalDate annualInspectionExpiry;
@ExcelProperty("交强险到期")
private LocalDate compulsoryInsuranceExpiry;
@ExcelProperty("商业险到期日")
private LocalDate commercialInsuranceExpiry;
@ExcelProperty("钥匙数")
private int keyCount;
@ExcelProperty("钥匙编码")
private String keyCode;
// 从CoreSpecs补充的属性
@ExcelProperty("出厂日期")
private LocalDate productionDate;
@ExcelProperty("排放标准(3-国3/4-国4/5-国5/6-国6)")
private int emissionStandard;
@ExcelProperty("排量(T/L)")
private String displacement;
@ExcelProperty("进气形式(自然吸气/涡轮增压等)")
private String jqxs;
@ExcelProperty("燃料形式(汽油/柴油等)")
private String rlxs;
@ExcelProperty("变速箱类型")
private String bxslx;
@ExcelProperty("驱动方式(前驱/后驱/四驱等)")
private String qdfs;
@ExcelProperty("车型分类名称(级别)")
private String vehicleClass;
@ExcelProperty("车身颜色")
private String exteriorColor;
@ExcelProperty("内饰颜色")
private String interiorColor;
@ExcelProperty("座位数")
private String seat;
@ExcelProperty("天窗:1-无天窗/2-普通天窗/3-全景天窗")
private int sunroof;
// 从Ownership补充的属性
@ExcelProperty("车辆所在地省份ID")
private int carProvinceId;
@ExcelProperty("车辆所在地省份名称")
private String carProvinceName;
@ExcelProperty("车辆所在地城市ID")
private int carCityId;
@ExcelProperty("车辆所在地城市名称")
private String carCityName;
@ExcelProperty("首次上牌时间")
private LocalDate registrationDate;
@ExcelProperty("过户次数")
private int transferCount;
@ExcelProperty("最近过户时间")
private LocalDate lastTransferDate;
@ExcelProperty("使用性质:1-非营运/2-营运/3-营转非")
private int usageType;
@ExcelProperty("所有人性质:1-个人/2-单位")
private int ownerType;
@ExcelProperty("是否有抵押:true/false")
private boolean hasMortgage;
// 从EvaluationTransaction补充的属性
@ExcelProperty("评估单编号")
private String evalOrderNo;
@ExcelProperty("评估意见")
private String evalOpinion;
@ExcelProperty("收购价格(元)")
private double purchasePrice;
@ExcelProperty("车辆来源门店")
private String sellerMerchantName;
@ExcelProperty("销售顾问")
private String sellerName;
@ExcelProperty("综合评价:1-优/2-良/3-中/4-差")
private int overallRating;
// 从CustodianInfo补充的属性
@ExcelProperty("车辆保管人姓名")
private String custodianName;
@ExcelProperty("车辆保管人联系方式")
private String custodianPhone;
@ExcelProperty("车辆停放地址信息")
private String handoverAddress;
// 从HistoryCondition补充的属性
@ExcelProperty("是否事故:1-是/0-否")
private int hasAccident;
@ExcelProperty("水泡检测:1-是/0-否")
private int floodCheck;
@ExcelProperty("火烧检测:1-是/0-否")
private int fireCheck;
@ExcelProperty("车况描述")
private String conditionDescription;
// 无参构造方法(EasyExcel需要)
public VehicleBean() {
}
// 全参构造方法
// 核心:以多个类为构造参数,提取属性赋值
public VehicleBean(Vehicle vehicle) {
// 基础属性
this.vehicleId = vehicle.getVehicleId();
BaseInfo baseInfo = vehicle.getBaseInfo();
OwnerInfo ownerInfo = vehicle.getOwnerInfo();
LicenseInfo licenseInfo = vehicle.getLicenseInfo();
CoreSpecs coreSpecs = vehicle.getCoreSpecs();
Ownership ownership = vehicle.getOwnership();
EvaluationTransaction evaluationTransaction = vehicle.getEvaluationTransaction();
CustodianInfo custodianInfo = vehicle.getCustodianInfo();
HistoryCondition historyCondition = vehicle.getHistoryCondition();
// 从BaseInfo提取
if (baseInfo != null) {
this.carBrandId = baseInfo.getCarBrandId();
this.carChildsBrandId = baseInfo.getCarChildsBrandId();
this.carSeriesId = baseInfo.getCarSeriesId();
this.carTypeId = baseInfo.getCarTypeId();
this.carBrand = baseInfo.getCarBrand();
this.carChildsBrandName = baseInfo.getCarChildsBrandName();
this.carSeriesName = baseInfo.getCarSeriesName();
this.carTypeName = baseInfo.getCarTypeName();
this.mileage = baseInfo.getMileage();
this.vin = baseInfo.getVin();
this.licensePlate = baseInfo.getLicensePlate();
this.sourceNo = baseInfo.getSourceNo();
this.tags = baseInfo.getTags();
this.guidePrice = baseInfo.getGuidePrice();
}
// 从OwnerInfo提取
if (ownerInfo != null) {
this.previousOwnerName = ownerInfo.getPreviousOwnerName();
this.previousOwnerPhone = ownerInfo.getPreviousOwnerPhone();
}
// 从LicenseInfo提取
if (licenseInfo != null) {
this.annualInspectionExpiry = licenseInfo.getAnnualInspectionExpiry();
this.compulsoryInsuranceExpiry = licenseInfo.getCompulsoryInsuranceExpiry();
this.commercialInsuranceExpiry = licenseInfo.getCommercialInsuranceExpiry();
this.keyCount = licenseInfo.getKeyCount();
this.keyCode = licenseInfo.getKeyCode();
}
// 从CoreSpecs提取
if (coreSpecs != null) {
this.productionDate = coreSpecs.getProductionDate();
this.emissionStandard = coreSpecs.getEmissionStandard();
this.displacement = coreSpecs.getDisplacement();
this.jqxs = coreSpecs.getJqxs();
this.rlxs = coreSpecs.getRlxs();
this.bxslx = coreSpecs.getBxslx();
this.qdfs = coreSpecs.getQdfs();
this.vehicleClass = coreSpecs.getVehicleClass();
this.exteriorColor = coreSpecs.getExteriorColor();
this.interiorColor = coreSpecs.getInteriorColor();
this.seat = coreSpecs.getSeat();
this.sunroof = coreSpecs.getSunroof();
}
// 从Ownership提取
if (ownership != null) {
this.carProvinceId = ownership.getCarProvinceId();
this.carProvinceName = ownership.getCarProvinceName();
this.carCityId = ownership.getCarCityId();
this.carCityName = ownership.getCarCityName();
this.registrationDate = ownership.getRegistrationDate();
this.transferCount = ownership.getTransferCount();
this.lastTransferDate = ownership.getLastTransferDate();
this.usageType = ownership.getUsageType();
this.ownerType = ownership.getOwnerType();
this.hasMortgage = ownership.isHasMortgage();
}
// 从EvaluationTransaction提取
if (evaluationTransaction != null) {
this.evalOrderNo = evaluationTransaction.getEvalOrderNo();
this.evalOpinion = evaluationTransaction.getEvalOpinion();
this.purchasePrice = evaluationTransaction.getPurchasePrice();
this.sellerMerchantName = evaluationTransaction.getSellerMerchantName();
this.sellerName = evaluationTransaction.getSellerName();
this.overallRating = evaluationTransaction.getOverallRating();
}
// 从CustodianInfo提取
if (custodianInfo != null) {
this.custodianName = custodianInfo.getCustodianName();
this.custodianPhone = custodianInfo.getCustodianPhone();
this.handoverAddress = custodianInfo.getHandoverAddress();
}
// 从HistoryCondition提取
if (historyCondition != null) {
this.hasAccident = historyCondition.getHasAccident();
this.floodCheck = historyCondition.getFloodCheck();
this.fireCheck = historyCondition.getFireCheck();
this.conditionDescription = historyCondition.getConditionDescription();
}
}
}