DeliveryOrderBean.java
4.13 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
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.BooleanConverter;
import com.glsx.usedcar.export.converter.DeliveryOrderStateConverter;
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("车系名字")
@ColumnWidth(15)
private String carSeriesName;
@ExcelProperty("车型名称")
@ColumnWidth(30)
private String carTypeName;
@ExcelProperty("指派专员")
private String realName;
@ExcelProperty("指派专员手机号")
private String mobile;
/**
* 工单状态
*/
@ExcelProperty(value = "工单状态", converter = DeliveryOrderStateConverter.class)
private DeliveryOrder.OrderState orderState;
@ExcelProperty("备注")
private String remark;
@ExcelIgnore
@ExcelProperty("预约时间")
private LocalDateTime appointmentTime;
@ExcelProperty("指派时间")
private LocalDateTime assignedTime;
/**
* 凭证
*/
@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();
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.appointmentTime = deliveryOrder.getAppointmentTime();
this.assignedTime = deliveryOrder.getAssignedTime();
this.vouchers = deliveryOrder.getVouchers();
this.checkIdCard = deliveryOrder.isCheckIdCard();
this.checkHandover = deliveryOrder.isCheckHandover();
this.checkKey = deliveryOrder.isCheckKey();
this.checkCertificate = deliveryOrder.isCheckCertificate();
this.orderStatus = deliveryOrder.getOrderStatus();
this.statusText = deliveryOrder.getStatusText();
this.remarks = deliveryOrder.getRemarks();
this.cancelReason = deliveryOrder.getCancelReason();
}
}