Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
daf90664
Commit
daf90664
authored
Dec 09, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
d96e6444
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
74 deletions
+77
-74
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+77
-74
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
daf90664
...
@@ -393,43 +393,81 @@ public class OrderCalculateBiz {
...
@@ -393,43 +393,81 @@ public class OrderCalculateBiz {
InProgressVO
inProgressVO
=
new
InProgressVO
();
InProgressVO
inProgressVO
=
new
InProgressVO
();
BigDecimal
topAmount
=
BigDecimal
.
ZERO
;
BigDecimal
topAmount
=
BigDecimal
.
ZERO
;
//缓冲取消时间(一个小时)
if
(
SYS_TRUE
.
equals
(
orderPageVO
.
getHasPay
())
&&
null
!=
orderPageVO
.
getPayTime
())
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
//缓冲取消时间(一个小时)
Long
autoCancelTime
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
CANCEL_TIME_BUFFER
).
getDetail
());
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
autoCancelTime
=
autoCancelTime
*
60L
*
1000L
;
Long
autoCancelTime
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
CANCEL_TIME_BUFFER
).
getDetail
());
autoCancelTime
=
autoCancelTime
*
60L
*
1000L
;
//判断是否支付超过缓冲取消时间(一个小时)
Long
orderCrtLag
=
System
.
currentTimeMillis
()
-
orderPageVO
.
getPayTime
();
//判断是否支付超过缓冲取消时间(一个小时)
Boolean
overCancelBuffer
=
(
orderCrtLag
>
autoCancelTime
)?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
Long
orderCrtLag
=
System
.
currentTimeMillis
()
-
orderPageVO
.
getPayTime
();
Boolean
overCancelBuffer
=
(
orderCrtLag
>
autoCancelTime
)?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
switch
(
orderTypeEnum
)
{
case
RENT_VEHICLE:
switch
(
orderTypeEnum
)
{
case
RENT_VEHICLE:
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderPageVO
.
getId
());
}}),
VehicleItemDTO
.
class
);
//融入日期价格
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
vehicleItemDTO
.
getDetail
()),
VehicleModelCalendarPriceDTO
.
class
);
if
(
timeLag
<
0
&&
overCancelBuffer
)
{
Integer
useDays
=
getIncludeDays
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
(),
DateTime
.
now
().
getMillis
());
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
inProgressVO
=
inProgressCalculate
(
orderPageVO
,
vehicleItemDTO
,
orderPageVO
.
getOrderRentVehicleDetail
(),
useDays
,
oad
,
Boolean
.
FALSE
);
topAmount
=
vehicleItemDTO
.
getTopAmount
(
useDays
);
totalDeductAmount
=
oad
.
realTotalDeduct
();
totalRefundAmount
=
oad
.
getOrderAmount
().
add
(
oad
.
getDepositAmount
());
refundDesc
=
inProgressVO
.
getViolateDesc
();
}
else
{
String
key
=
RENT_REFUND
;
BigDecimal
deductionAmount
=
orderAccountBiz
.
calculateDeduction
(
vehicleItemDTO
.
getBuyAmount
()
,
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
refundDescBuilder
);
if
(!
overCancelBuffer
)
{
deductionAmount
=
BigDecimal
.
ZERO
;
refundDescBuilder
=
new
StringBuilder
(
""
);
}
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
topAmount
=
vehicleItemDTO
.
getTopAmount
(
0
);
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
totalDeductAmount
=
(
topAmount
.
compareTo
(
deductionAmount
)
<
0
)
?
topAmount:
deductionAmount
;
setOrderId
(
orderPageVO
.
getId
());
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
totalDeductAmount
);
}}),
VehicleItemDTO
.
class
);
refundDesc
=
refundDescBuilder
.
toString
();
}
//融入日期价格
break
;
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
vehicleItemDTO
.
getDetail
()),
VehicleModelCalendarPriceDTO
.
class
);
case
TOUR:
//判断是省内还是省外
String
key
=
TOUR_IN_REFUND
;
if
(
SYS_TRUE
.
equals
(
orderPageVO
.
getOrderTourDetail
().
getIsOutside
()))
{
key
=
TOUR_REFUND
;
}
if
(
timeLag
<
0
&&
overCancelBuffer
)
{
OrderItem
adultItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){
{
Integer
useDays
=
getIncludeDays
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
(),
DateTime
.
now
().
getMillis
());
setType
(
ItemTypeEnum
.
TOUR_ADULT
.
getCode
());
OrderAccountDetail
oad
=
new
OrderAccountDetail
(
);
setOrderId
(
orderPageVO
.
getId
()
);
inProgressVO
=
inProgressCalculate
(
orderPageVO
,
vehicleItemDTO
,
orderPageVO
.
getOrderRentVehicleDetail
(),
useDays
,
oad
,
Boolean
.
FALSE
);
}}
);
topAmount
=
vehicleItemDTO
.
getTopAmount
(
useDays
);
OrderItem
childItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
totalDeductAmount
=
oad
.
realTotalDeduct
();
setType
(
ItemTypeEnum
.
TOUR_CHILD
.
getCode
());
totalRefundAmount
=
oad
.
getOrderAmount
().
add
(
oad
.
getDepositAmount
());
setOrderId
(
orderPageVO
.
getId
());
refundDesc
=
inProgressVO
.
getViolateDesc
();
}});
}
else
{
String
key
=
RENT_REFUND
;
BigDecimal
adultItemAmount
=
(
null
==
adultItem
)?
BigDecimal
.
ZERO
:
adultItem
.
getRealAmount
();
BigDecimal
childItemAmount
=
(
null
==
childItem
)?
BigDecimal
.
ZERO
:
childItem
.
getRealAmount
();
BigDecimal
deductionAmount
=
orderAccountBiz
.
calculateDeduction
(
vehicleItemDTO
.
getBuyAmount
(
)
BigDecimal
deductionAmount
=
orderAccountBiz
.
calculateDeduction
(
adultItemAmount
.
add
(
childItemAmount
)
,
orderPageVO
.
getOrder
RentVehicle
Detail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
orderPageVO
.
getOrder
Tour
Detail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
refundDescBuilder
);
,
refundDescBuilder
);
...
@@ -438,52 +476,17 @@ public class OrderCalculateBiz {
...
@@ -438,52 +476,17 @@ public class OrderCalculateBiz {
refundDescBuilder
=
new
StringBuilder
(
""
);
refundDescBuilder
=
new
StringBuilder
(
""
);
}
}
topAmount
=
vehicleItemDTO
.
getTopAmount
(
0
);
topAmount
=
adultItemAmount
.
add
(
childItemAmount
);
totalDeductAmount
=
(
topAmount
.
compareTo
(
deductionAmount
)
<
0
)
?
topAmount:
deductionAmount
;
totalDeductAmount
=
deductionAmount
;
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
totalDeduct
Amount
);
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deduction
Amount
);
refundDesc
=
refundDescBuilder
.
toString
();
refundDesc
=
refundDescBuilder
.
toString
();
}
break
;
default
:
break
;
break
;
case
TOUR:
}
//判断是省内还是省外
String
key
=
TOUR_IN_REFUND
;
if
(
SYS_TRUE
.
equals
(
orderPageVO
.
getOrderTourDetail
().
getIsOutside
()))
{
key
=
TOUR_REFUND
;
}
OrderItem
adultItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
TOUR_ADULT
.
getCode
());
setOrderId
(
orderPageVO
.
getId
());
}});
OrderItem
childItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
TOUR_CHILD
.
getCode
());
setOrderId
(
orderPageVO
.
getId
());
}});
BigDecimal
adultItemAmount
=
(
null
==
adultItem
)?
BigDecimal
.
ZERO
:
adultItem
.
getRealAmount
();
BigDecimal
childItemAmount
=
(
null
==
childItem
)?
BigDecimal
.
ZERO
:
childItem
.
getRealAmount
();
BigDecimal
deductionAmount
=
orderAccountBiz
.
calculateDeduction
(
adultItemAmount
.
add
(
childItemAmount
)
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
key
,
refundDescBuilder
);
if
(!
overCancelBuffer
)
{
deductionAmount
=
BigDecimal
.
ZERO
;
refundDescBuilder
=
new
StringBuilder
(
""
);
}
topAmount
=
adultItemAmount
.
add
(
childItemAmount
);
totalDeductAmount
=
deductionAmount
;
totalRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deductionAmount
);
refundDesc
=
refundDescBuilder
.
toString
();
break
;
default
:
break
;
}
}
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRefundAmount
(
totalRefundAmount
);
orpv
.
setRefundAmount
(
totalRefundAmount
);
...
...
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