Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8b84367a
authored
Apr 14, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:【优惠券需求】发放记录导出优化
1 parent
244fe6b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
131 deletions
aus-admin/src/main/java/com/glsx/usedcar/export/CouponDistributionRecordExportBean.java
aus-admin/src/main/java/com/glsx/usedcar/export/CouponDistributionRecordExportBean.java
View file @
8b84367
...
...
@@ -24,25 +24,46 @@ public class CouponDistributionRecordExportBean implements Serializable {
private
static
final
DateTimeFormatter
DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
/**
* 活动ID
/ 名称
* 活动ID
*/
@ExcelProperty
(
"活动ID/名称"
)
@ColumnWidth
(
35
)
private
String
activityInfo
;
@ExcelProperty
(
"活动ID"
)
@ColumnWidth
(
20
)
private
String
activityId
;
/**
* 活动名称
*/
@ExcelProperty
(
"活动名称"
)
@ColumnWidth
(
30
)
private
String
activityName
;
/**
* 优惠券
ID / 名称
* 优惠券
实例ID
*/
@ExcelProperty
(
"优惠券
ID/名称
"
)
@ColumnWidth
(
35
)
private
String
couponI
nfo
;
@ExcelProperty
(
"优惠券
实例ID
"
)
@ColumnWidth
(
20
)
private
String
couponI
d
;
/**
*
发放用户名 / 手机号
*
优惠券名称
*/
@ExcelProperty
(
"
发放用户名/手机号
"
)
@ExcelProperty
(
"
优惠券名称
"
)
@ColumnWidth
(
30
)
private
String
userInfo
;
private
String
couponName
;
/**
* 发放用户名
*/
@ExcelProperty
(
"发放用户名"
)
@ColumnWidth
(
20
)
private
String
accountName
;
/**
* 发放用户手机号
*/
@ExcelProperty
(
"发放用户手机号"
)
@ColumnWidth
(
20
)
private
String
mobile
;
/**
* 发放类型
...
...
@@ -59,18 +80,32 @@ public class CouponDistributionRecordExportBean implements Serializable {
private
String
couponStatus
;
/**
* 关联订单号
/ 车型
* 关联订单号
*/
@ExcelProperty
(
"关联订单号
/车型
"
)
@ColumnWidth
(
3
5
)
private
String
order
VehicleInfo
;
@ExcelProperty
(
"关联订单号"
)
@ColumnWidth
(
2
5
)
private
String
order
Code
;
/**
*
成交价 / 抵扣金额
*
关联车型名称
*/
@ExcelProperty
(
"成交价/抵扣金额"
)
@ColumnWidth
(
30
)
private
String
amountInfo
;
@ExcelProperty
(
"关联车型名称"
)
@ColumnWidth
(
40
)
private
String
vehicleInfo
;
/**
* 车辆成交价(元)
*/
@ExcelProperty
(
"车辆成交价(元)"
)
@ColumnWidth
(
20
)
private
String
transactionAmount
;
/**
* 实际抵扣金额(元)
*/
@ExcelProperty
(
"实际抵扣金额(元)"
)
@ColumnWidth
(
20
)
private
String
actualDeduction
;
/**
* 发放时间
...
...
@@ -80,11 +115,18 @@ public class CouponDistributionRecordExportBean implements Serializable {
private
String
distributionTime
;
/**
* 使用
/过期
时间
* 使用时间
*/
@ExcelProperty
(
"使用/过期时间"
)
@ColumnWidth
(
35
)
private
String
useExpireTime
;
@ExcelProperty
(
"使用时间"
)
@ColumnWidth
(
20
)
private
String
useTime
;
/**
* 过期时间
*/
@ExcelProperty
(
"过期时间"
)
@ColumnWidth
(
20
)
private
String
expireTime
;
/**
* 从VO转换为导出Bean
...
...
@@ -94,14 +136,23 @@ public class CouponDistributionRecordExportBean implements Serializable {
return
;
}
// 活动ID
/ 名称
this
.
activityI
nfo
=
formatActivityInfo
(
vo
.
getActivityId
(),
vo
.
getActivityName
()
);
// 活动ID
this
.
activityI
d
=
vo
.
getActivityId
(
);
//
优惠券ID /
名称
this
.
couponInfo
=
formatCouponInfo
(
vo
.
getCouponId
(),
vo
.
getTemplateName
()
);
//
活动
名称
this
.
activityName
=
vo
.
getActivityName
(
);
// 发放用户名 / 手机号
this
.
userInfo
=
formatUserInfo
(
vo
.
getAccountName
(),
vo
.
getMobile
());
// 优惠券实例ID
this
.
couponId
=
vo
.
getCouponId
();
// 优惠券名称
this
.
couponName
=
vo
.
getTemplateName
();
// 发放用户名
this
.
accountName
=
vo
.
getAccountName
();
// 发放用户手机号
this
.
mobile
=
vo
.
getMobile
();
// 发放类型转换
this
.
distributionType
=
convertDistributionType
(
vo
.
getDistributionType
());
...
...
@@ -109,66 +160,29 @@ public class CouponDistributionRecordExportBean implements Serializable {
// 优惠券状态转换
this
.
couponStatus
=
convertCouponStatus
(
vo
.
getCouponStatus
());
// 关联订单号
/ 车型
this
.
order
VehicleInfo
=
formatOrderVehicleInfo
(
vo
.
getOrderCode
(),
vo
.
getVehicleInfo
()
);
// 关联订单号
this
.
order
Code
=
vo
.
getOrderCode
(
);
//
成交价 / 抵扣金额
this
.
amountInfo
=
formatAmountInfo
(
vo
.
getTransactionAmount
(),
vo
.
getActualDeduction
()
);
//
关联车型名称
this
.
vehicleInfo
=
vo
.
getVehicleInfo
(
);
// 发放时间
this
.
distributionTime
=
vo
.
getDistributionTime
()
!=
null
?
vo
.
getDistributionTime
().
format
(
DATE_TIME_FORMATTER
)
:
""
;
// 车辆成交价
this
.
transactionAmount
=
formatAmount
(
vo
.
getTransactionAmount
());
// 使用/过期时间
this
.
useExpireTime
=
formatUseExpireTime
(
vo
.
getUseTime
(),
vo
.
getExpireTime
());
}
// 实际抵扣金额
this
.
actualDeduction
=
formatAmount
(
vo
.
getActualDeduction
());
/**
* 格式化活动信息
*/
private
String
formatActivityInfo
(
String
activityId
,
String
activityName
)
{
if
(
activityId
==
null
&&
activityName
==
null
)
{
return
""
;
}
if
(
activityId
==
null
)
{
return
activityName
;
}
if
(
activityName
==
null
)
{
return
activityId
;
}
return
activityId
+
"/"
+
activityName
;
}
// 发放时间
this
.
distributionTime
=
vo
.
getDistributionTime
()
!=
null
?
vo
.
getDistributionTime
().
format
(
DATE_TIME_FORMATTER
)
:
""
;
/**
* 格式化优惠券信息
*/
private
String
formatCouponInfo
(
String
couponId
,
String
templateName
)
{
if
(
couponId
==
null
&&
templateName
==
null
)
{
return
""
;
}
if
(
couponId
==
null
)
{
return
templateName
;
}
if
(
templateName
==
null
)
{
return
couponId
;
}
return
couponId
+
"/"
+
templateName
;
}
// 使用时间
this
.
useTime
=
vo
.
getUseTime
()
!=
null
?
vo
.
getUseTime
().
format
(
DATE_TIME_FORMATTER
)
:
""
;
/**
* 格式化用户信息
*/
private
String
formatUserInfo
(
String
accountName
,
String
mobile
)
{
if
(
accountName
==
null
&&
mobile
==
null
)
{
return
""
;
}
if
(
accountName
==
null
)
{
return
mobile
;
}
if
(
mobile
==
null
)
{
return
accountName
;
}
return
accountName
+
"/"
+
mobile
;
// 过期时间
this
.
expireTime
=
vo
.
getExpireTime
()
!=
null
?
vo
.
getExpireTime
().
format
(
DATE_TIME_FORMATTER
)
:
""
;
}
/**
...
...
@@ -203,56 +217,12 @@ public class CouponDistributionRecordExportBean implements Serializable {
}
/**
* 格式化
订单/车辆信息
* 格式化
金额
*/
private
String
format
OrderVehicleInfo
(
String
orderCode
,
String
vehicleInfo
)
{
if
(
orderCode
==
null
&&
vehicleInfo
==
null
)
{
private
String
format
Amount
(
BigDecimal
amount
)
{
if
(
amount
==
null
)
{
return
""
;
}
if
(
orderCode
==
null
)
{
return
vehicleInfo
;
}
if
(
vehicleInfo
==
null
)
{
return
orderCode
;
}
return
orderCode
+
"/"
+
vehicleInfo
;
}
/**
* 格式化金额信息
*/
private
String
formatAmountInfo
(
BigDecimal
transactionAmount
,
BigDecimal
actualDeduction
)
{
if
(
transactionAmount
==
null
&&
actualDeduction
==
null
)
{
return
""
;
}
String
transactionStr
=
transactionAmount
!=
null
?
transactionAmount
.
toString
()
:
""
;
String
deductionStr
=
actualDeduction
!=
null
?
actualDeduction
.
toString
()
:
""
;
if
(
transactionAmount
==
null
)
{
return
deductionStr
;
}
if
(
actualDeduction
==
null
)
{
return
transactionStr
;
}
return
transactionStr
+
"/"
+
deductionStr
;
}
/**
* 格式化使用/过期时间
*/
private
String
formatUseExpireTime
(
LocalDateTime
useTime
,
LocalDateTime
expireTime
)
{
if
(
useTime
==
null
&&
expireTime
==
null
)
{
return
""
;
}
String
useTimeStr
=
useTime
!=
null
?
useTime
.
format
(
DATE_TIME_FORMATTER
)
:
""
;
String
expireTimeStr
=
expireTime
!=
null
?
expireTime
.
format
(
DATE_TIME_FORMATTER
)
:
""
;
if
(
useTime
==
null
)
{
return
expireTimeStr
;
}
if
(
expireTime
==
null
)
{
return
useTimeStr
;
}
return
useTimeStr
+
"/"
+
expireTimeStr
;
return
amount
.
toString
();
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment