记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
155d757c
Commit
155d757c
authored
Sep 16, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isRefundVoucher chargesRatio chargesPrice
parent
827eaf50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
47 deletions
+67
-47
KylinOrderTicketEntitiesVo.java
...ervice/kylin/dto/vo/mongo/KylinOrderTicketEntitiesVo.java
+2
-0
KylinOrderTicketEntitiesPreRefundVo.java
...n/dto/vo/returns/KylinOrderTicketEntitiesPreRefundVo.java
+5
-0
KylinOrderTicketPreVo.java
...t/service/kylin/dto/vo/returns/KylinOrderTicketPreVo.java
+2
-0
KylinOrderTicketsRefundServiceImpl.java
...ylin/service/impl/KylinOrderTicketsRefundServiceImpl.java
+58
-47
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/mongo/KylinOrderTicketEntitiesVo.java
View file @
155d757c
...
...
@@ -49,6 +49,8 @@ public class KylinOrderTicketEntitiesVo implements Serializable, Cloneable {
private
LocalDateTime
changeDate
;
private
BigDecimal
canRefundedPrice
;
private
BigDecimal
chargesRatio
;
private
BigDecimal
chargesPrice
;
public
BigDecimal
getRefundPrice
()
{
return
refundPrice
==
null
?
BigDecimal
.
valueOf
(
0.00
):
refundPrice
;
...
...
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/returns/KylinOrderTicketEntitiesPreRefundVo.java
View file @
155d757c
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
returns
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -22,6 +23,10 @@ public class KylinOrderTicketEntitiesPreRefundVo implements Serializable, Clonea
private
BigDecimal
priceCanRefund
;
private
String
ticketTitle
;
private
Integer
isPayment
;
@ApiModelProperty
(
value
=
"退款手续费比例 *100%"
)
private
BigDecimal
chargesRatio
;
@ApiModelProperty
(
value
=
"退款手续费金额"
)
private
BigDecimal
chargesPrice
;
private
static
final
KylinOrderTicketEntitiesPreRefundVo
obj
=
new
KylinOrderTicketEntitiesPreRefundVo
();
public
static
KylinOrderTicketEntitiesPreRefundVo
getNew
()
{
...
...
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/returns/KylinOrderTicketPreVo.java
View file @
155d757c
...
...
@@ -83,6 +83,8 @@ public class KylinOrderTicketPreVo implements Serializable, Cloneable {
private
String
performanceImg
;
@ApiModelProperty
(
value
=
"是否开启退款手续费 0关闭 1开启"
)
private
Integer
isRefundPoundage
;
@ApiModelProperty
(
value
=
"是否开启是否退优惠券 0关闭 1开启"
)
private
Integer
isRefundVoucher
;
@ApiModelProperty
(
value
=
"手续费规则列表"
)
private
ArrayList
<
OrderRefundPoundage
>
refundPoundageList
;
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinOrderTicketsRefundServiceImpl.java
View file @
155d757c
...
...
@@ -97,9 +97,14 @@ public class KylinOrderTicketsRefundServiceImpl {
if
(
item
.
getEnterMobile
().
length
()
==
11
)
{
item
.
setEnterMobile
(
item
.
getEnterMobile
().
substring
(
0
,
3
)
+
"****"
+
item
.
getEnterMobile
().
substring
(
7
));
}
// setScale(2, BigDecimal.ROUND_HALF_UP)
item
.
setPriceActual
(
orderTicketVo
.
getPriceActual
().
subtract
(
orderTicketVo
.
getPriceExpress
()).
divide
(
BigDecimal
.
valueOf
(
orderTicketVo
.
getNumber
()),
2
,
BigDecimal
.
ROUND_HALF_UP
));
item
.
setPriceCanRefund
(
dataUtils
.
getCanRefundOrderEntitiesPrice
(
orderTicketVo
,
kylinOrderRefundsVoBaseList
,
item
.
getOrderTicketEntitiesId
()));
// 手续费处理
BigDecimal
chargesRatio
=
getChargesRatio
(
item
.
getUseStart
(),
performanceVo
.
getIsRefundPoundage
());
BigDecimal
chargesPrice
=
item
.
getPriceCanRefund
().
multiply
(
chargesRatio
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
item
.
setChargesRatio
(
chargesRatio
);
item
.
setChargesPrice
(
chargesPrice
);
// 手续费处理
BeanUtils
.
copyProperties
(
item
,
refundVo
);
kylinOrderTicketEntitiesPreRefundVos
.
add
(
refundVo
);
}
...
...
@@ -118,6 +123,7 @@ public class KylinOrderTicketsRefundServiceImpl {
// 整理返回数据
BeanUtils
.
copyProperties
(
orderTicketVo
,
vo
);
vo
.
setIsRefundPoundage
(
performanceVo
.
getIsRefundPoundage
());
vo
.
setIsRefundVoucher
(
performanceVo
.
getIsRefundVoucher
());
vo
.
setRefundPoundageList
(
refundPoundage
);
vo
.
setOrderCouponList
(
orderCoupon
);
vo
.
setRefundAddress
(
refundAddress
);
...
...
@@ -221,52 +227,11 @@ public class KylinOrderTicketsRefundServiceImpl {
}
// 手续费处理
ArrayList
<
OrderRefundPoundage
>
refundPoundage
=
dataUtils
.
getRefundPoundage
(
performanceVo
.
getIsRefundPoundage
());
BigDecimal
priceCharges
=
BigDecimal
.
valueOf
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
refundPoundage
))
{
// 手续费比例
BigDecimal
chargesNum
=
BigDecimal
.
valueOf
(
0
);
// 票种演出开始时间
String
useStart
=
orderTicketVo
.
getUseStart
();
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
useStartD
=
LocalDateTime
.
parse
(
useStart
,
df
);
// 3、15天之前的时间 时间可变
int
oneDay
=
refundPoundage
.
get
(
0
).
getDay
();
int
twoDay
=
refundPoundage
.
get
(
1
).
getDay
();
LocalDateTime
useStartD15Before
=
useStartD
.
minusDays
(
oneDay
);
LocalDateTime
useStartD3Before
=
useStartD
.
minusDays
(
twoDay
);
// 当前时间
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
if
(
useStartD15Before
.
isAfter
(
nowTime
))
{
// 15天以前的时间大于当前时间 距离演出开始日期>15天
int
isCanRefund
=
refundPoundage
.
get
(
0
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesNum
=
refundPoundage
.
get
(
0
).
getPresent
();
}
else
{
return
ResponseDto
.
failure
(
"当前日期不支持退票"
);
}
}
else
if
(
useStartD3Before
.
isAfter
(
nowTime
))
{
// 3天以前的时间大于当前时间 距离演出开始日期>3天-15天 含15天
int
isCanRefund
=
refundPoundage
.
get
(
1
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesNum
=
refundPoundage
.
get
(
1
).
getPresent
();
}
else
{
return
ResponseDto
.
failure
(
"当前日期不支持退票"
);
}
}
else
{
// 三天以内 <=3
int
isCanRefund
=
refundPoundage
.
get
(
2
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesNum
=
refundPoundage
.
get
(
2
).
getPresent
();
}
else
{
return
ResponseDto
.
failure
(
"当前日期不支持退票"
);
}
}
priceCharges
=
refundSinglePrice
.
multiply
(
chargesNum
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
refundSinglePrice
=
refundSinglePrice
.
subtract
(
priceCharges
);
if
(
refundSinglePrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
return
ResponseDto
.
failure
(
"申请金额不得小于0哦~"
);
}
}
else
{
log
.
info
(
"演出id1111 {}"
,
orderTicketVo
.
getPerformanceId
());
BigDecimal
chargesRatio
=
getChargesRatio
(
orderTicketVo
.
getUseStart
(),
performanceVo
.
getIsRefundPoundage
());
BigDecimal
priceCharges
=
refundSinglePrice
.
multiply
(
chargesRatio
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
refundSinglePrice
=
refundSinglePrice
.
subtract
(
priceCharges
);
if
(
refundSinglePrice
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
return
ResponseDto
.
failure
(
"申请金额不得小于0哦~"
);
}
// 快递费 现在只有到付 不作处理
...
...
@@ -294,6 +259,52 @@ public class KylinOrderTicketsRefundServiceImpl {
}
}
// 返回手续费比例
private
BigDecimal
getChargesRatio
(
String
useStart
,
Integer
isRefundPoundage
)
{
ArrayList
<
OrderRefundPoundage
>
refundPoundage
=
dataUtils
.
getRefundPoundage
(
isRefundPoundage
);
// 手续费比例
BigDecimal
chargesRatio
=
BigDecimal
.
valueOf
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
refundPoundage
))
{
// 票种演出开始时间
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
useStartD
=
LocalDateTime
.
parse
(
useStart
,
df
);
// 3、15天之前的时间 时间可变
int
oneDay
=
refundPoundage
.
get
(
0
).
getDay
();
int
twoDay
=
refundPoundage
.
get
(
1
).
getDay
();
LocalDateTime
useStartD15Before
=
useStartD
.
minusDays
(
oneDay
);
LocalDateTime
useStartD3Before
=
useStartD
.
minusDays
(
twoDay
);
// 当前时间
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
if
(
useStartD15Before
.
isAfter
(
nowTime
))
{
// 15天以前的时间大于当前时间 距离演出开始日期>15天
int
isCanRefund
=
refundPoundage
.
get
(
0
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesRatio
=
refundPoundage
.
get
(
0
).
getPresent
();
}
else
{
chargesRatio
=
BigDecimal
.
valueOf
(
Long
.
parseLong
(
"-1"
));
}
}
else
if
(
useStartD3Before
.
isAfter
(
nowTime
))
{
// 3天以前的时间大于当前时间 距离演出开始日期>3天-15天 含15天
int
isCanRefund
=
refundPoundage
.
get
(
1
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesRatio
=
refundPoundage
.
get
(
1
).
getPresent
();
}
else
{
chargesRatio
=
BigDecimal
.
valueOf
(
Long
.
parseLong
(
"-1"
));
}
}
else
{
// 三天以内 <=3
int
isCanRefund
=
refundPoundage
.
get
(
2
).
getIsCanRefund
();
if
(
isCanRefund
>
0
)
{
chargesRatio
=
refundPoundage
.
get
(
2
).
getPresent
();
}
else
{
chargesRatio
=
BigDecimal
.
valueOf
(
Long
.
parseLong
(
"-1"
));
// return ResponseDto.failure("当前日期不支持退票");
}
}
return
chargesRatio
;
}
else
{
// 无手续费
return
chargesRatio
;
}
}
@Async
public
void
expressPlace
(
Integer
sendExpressType
,
String
expressNumber
,
String
expressContacts
,
String
expressPhone
,
String
sendExpressAddress
,
String
appointmentTime
,
KylinOrderTicketVo
orderTicketVo
,
KylinPerformanceVo
performanceVo
)
{
if
(
sendExpressType
==
1
)
{
// 上门取件
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment