DeliveryOrderBean.java
5.23 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
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.AuctionOrderStateConverter;
import com.glsx.usedcar.export.converter.BooleanConverter;
import com.glsx.usedcar.export.converter.DeliveryOrderStateConverter;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.auction.entity.AuctionOrder;
import com.glsx.usedcar.module.auction.entity.DeliveryOrder;
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 lombok.Data;
import org.summerframework.storage.converter.FileInfosConverter;
import org.summerframework.storage.domain.FileInfo;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import static jakarta.persistence.GenerationType.IDENTITY;
@Data
public class DeliveryOrderBean {
/**
* ORDER_ID
*/
@ExcelIgnore
private int deliveryOrderId;
@ExcelProperty("工单编号")
@ColumnWidth(20)
private String orderCode;
@ExcelProperty("车源号(平台唯一识别编号)")
private String sourceNo;
@ExcelProperty("车系名字")
@ColumnWidth(15)
private String carSeriesName;
@ExcelProperty("车型名称")
@ColumnWidth(30)
private String carTypeName;
@ExcelProperty("车架号")
private String vin;
@ExcelProperty("车牌号")
private String licensePlate;
@ExcelProperty("所属门店")
@ColumnWidth(30)
private String venueName;
@ExcelProperty("中拍人姓名")
private String accountName;
@ExcelProperty("中拍人电话")
private String accountMobile;
@ExcelProperty("交付专员")
private String realName;
@ExcelProperty("交付专员联系方式")
private String mobile;
@ExcelProperty("备注")
private String remark;
// @ExcelIgnore
// @ExcelProperty("预约时间")
// private LocalDateTime appointmentTime;
// @ExcelProperty("指派时间")
// private LocalDateTime assignedTime;
@ExcelProperty("中拍时间")
private LocalDateTime orderCreateTime;
@ExcelProperty("订单更新时间")
private LocalDateTime orderUpdateTime;
@ExcelProperty(value = "订单状态", converter = AuctionOrderStateConverter.class)
private AuctionOrder.OrderState auctionOrderState;
/**
* 工单状态
*/
@ExcelProperty(value = "工单状态", converter = DeliveryOrderStateConverter.class)
private DeliveryOrder.OrderState orderState;
/**
* 凭证
*/
@ExcelIgnore
private List<FileInfo> vouchers;
// @ExcelProperty(value = "核验买家身份证原件", converter = BooleanConverter.class)
// private boolean checkIdCard;
//
//
// @ExcelProperty(value = "签署车辆交接确认单", converter = BooleanConverter.class)
// private boolean checkHandover;
//
//
// @ExcelProperty(value = "交付车辆钥匙", converter = BooleanConverter.class)
// private boolean checkKey;
//
//
// @ExcelProperty(value = "交付车辆所有权证及登记证", converter = BooleanConverter.class)
// private boolean checkCertificate;
/**
* 交付工单的当前状态:准备交付/交付中/过户中/已完成/已取消
*/
// @ExcelProperty("状态")
// private int orderStatus;
@ExcelProperty("状态描述")
private String statusText;
@ExcelProperty("交付过程中的备注信息")
private String remarks;
@ExcelProperty("取消原因")
private String cancelReason;
public DeliveryOrderBean(DeliveryOrder deliveryOrder) {
AuctionOrder auctionOrder = deliveryOrder.getAuctionOrder();
Vehicle vehicle = auctionOrder.getVehicle();
User user = deliveryOrder.getUser();
Account account = auctionOrder.getAccount();
this.deliveryOrderId = deliveryOrder.getDeliveryOrderId();
this.orderCode = auctionOrder.getOrderCode();
this.carSeriesName = vehicle.getBaseInfo().getCarSeriesName();
this.carTypeName = vehicle.getBaseInfo().getCarTypeName();
if (Objects.nonNull(user)) {
this.realName = user.getRealName();
this.mobile = user.getMobile();
}
this.orderState = deliveryOrder.getOrderState();
this.remark = deliveryOrder.getRemark();
this.vouchers = deliveryOrder.getVouchers();
// this.orderStatus = deliveryOrder.getOrderStatus();
this.statusText = deliveryOrder.getStatusText();
this.remarks = deliveryOrder.getRemarks();
this.cancelReason = deliveryOrder.getCancelReason();
this.orderCreateTime = auctionOrder.getCreateTime();
this.orderUpdateTime = auctionOrder.getUpdateTime();
this.accountMobile = account.getMobile();
this.accountName = account.getAccountName();
this.venueName = vehicle.getVenue().getVenueName();
this.vin = vehicle.getBaseInfo().getVin();
this.licensePlate = vehicle.getBaseInfo().getLicensePlate();
this.sourceNo = vehicle.getBaseInfo().getSourceNo();
this.orderCode = auctionOrder.getOrderCode();
}
}