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
ff0873bb
Commit
ff0873bb
authored
Sep 23, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
cb328043
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+33
-14
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
ff0873bb
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
...
@@ -78,13 +79,15 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -78,13 +79,15 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
BigDecimal
orderRefundAmount
=
BigDecimal
.
ZERO
;
BigDecimal
orderRefundAmount
=
BigDecimal
.
ZERO
;
StringBuilder
refundDescBuilder
=
new
StringBuilder
(
""
);
StringBuilder
refundDescBuilder
=
new
StringBuilder
(
""
);
String
refundDesc
=
""
;
String
refundDesc
=
""
;
InProgressVO
inProgressVO
=
new
InProgressVO
();
switch
(
orderTypeEnum
)
{
switch
(
orderTypeEnum
)
{
case
RENT_VEHICLE:
case
RENT_VEHICLE:
DateTime
nowTime
=
DateTime
.
parse
(
DateTime
.
now
().
toString
(
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
),
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
);
DateTime
nowTime
=
DateTime
.
parse
(
DateTime
.
now
().
toString
(
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
),
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
);
DateTime
startTime
=
DateTime
.
parse
(
new
DateTime
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()).
toString
(
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
),
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
);
DateTime
startTime
=
DateTime
.
parse
(
new
DateTime
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()).
toString
(
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
),
CommonConstants
.
YMR_SLASH_FORMATTER_JODA
);
InProgressVO
inProgressVO
=
orderCalculateBiz
.
inProgressCalculate
(
orderPageVO
,
baseOrderBiz
.
getDaysBetweenDateTime
(
startTime
,
nowTime
));
inProgressVO
=
orderCalculateBiz
.
inProgressCalculate
(
orderPageVO
,
baseOrderBiz
.
getDaysBetweenDateTime
(
startTime
,
nowTime
));
refundDesc
=
inProgressVO
.
getViolateDesc
();
// orderRefundAmount = orderAccountBiz.calculateDeduction(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// orderRefundAmount = orderAccountBiz.calculateDeduction(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// , orderPageVO.getOrderRentVehicleDetail().getStartTime() - System.currentTimeMillis()
// , orderPageVO.getOrderRentVehicleDetail().getStartTime() - System.currentTimeMillis()
// , DictionaryKey.APP_ORDER+ "_"+ RENT_REFUND
// , DictionaryKey.APP_ORDER+ "_"+ RENT_REFUND
...
@@ -105,9 +108,9 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -105,9 +108,9 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
// }
// }
// BigDecimal residueAmount = orderRefundBiz.calculateDeduction(originalDeductAmount, timeLag, APP_ORDER+ "_"+ RENT_REFUND, refundDescBuilder);
// BigDecimal residueAmount = orderRefundBiz.calculateDeduction(originalDeductAmount, timeLag, APP_ORDER+ "_"+ RENT_REFUND, refundDescBuilder);
//扣款 = 违约金 + 消费金额
//扣款 = 违约金 + 消费金额
BigDecimal
residueAmount
=
BigDecimal
.
ZERO
;
//
BigDecimal residueAmount = BigDecimal.ZERO;
//inProgressVO.get
//
//inProgressVO.get
residueAmount
=
residueAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
//
residueAmount = residueAmount.setScale(2, RoundingMode.HALF_UP);
//押金剩余款 :押金 - (原扣除款 - 剩余款)
//押金剩余款 :押金 - (原扣除款 - 剩余款)
//退款金额 :订单剩余款 + 押金剩余款
//退款金额 :订单剩余款 + 押金剩余款
...
@@ -116,15 +119,31 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -116,15 +119,31 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
break
;
break
;
case
TOUR:
case
TOUR:
//判断是省内还是省外
//判断是省内还是省外
// String key = TOUR_IN_REFUND;
String
key
=
TOUR_IN_REFUND
;
// if(SYS_TRUE.equals(orderPageVO.getOrderTourDetail().getIsOutside())) {
if
(
SYS_TRUE
.
equals
(
orderPageVO
.
getOrderTourDetail
().
getIsOutside
()))
{
// key = TOUR_REFUND;
key
=
TOUR_REFUND
;
// }
}
// orderRefundAmount = orderRefundBiz.calculateDeduction(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
// , orderPageVO.getOrderTourDetail().getStartTime() - System.currentTimeMillis()
OrderItem
adultItem
=
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
// , DictionaryKey.APP_ORDER+ "_"+ key
setType
(
ItemTypeEnum
.
TOUR_ADULT
.
getCode
());
// , refundDescBuilder);
setOrderId
(
orderPageVO
.
getId
());
// break;
}});
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
);
orderRefundAmount
=
orderPageVO
.
getRealAmount
().
subtract
(
deductionAmount
);
refundDesc
=
refundDescBuilder
.
toString
();
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -132,7 +151,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -132,7 +151,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRefundAmount
(
orderRefundAmount
);
orpv
.
setRefundAmount
(
orderRefundAmount
);
orpv
.
setRefundDesc
(
"取消操作可能会产生额外费用,是否确定取消订单"
);
orpv
.
setRefundDesc
(
StrUtil
.
format
(
"取消操作可能会产生额外费用{},是否确定取消订单"
,
refundDesc
)
);
return
ObjectRestResponse
.
succ
(
orpv
);
return
ObjectRestResponse
.
succ
(
orpv
);
}
}
...
...
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