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
85a107d5
Commit
85a107d5
authored
Jul 23, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改退款描述bug
parent
21641c58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
26 deletions
+32
-26
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+5
-5
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+27
-21
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
85a107d5
...
@@ -316,20 +316,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -316,20 +316,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//计算退款金额
//计算退款金额
// 1、押金 + 租金(规则扣除)
// 1、押金 + 租金(规则扣除)
//BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
//BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
String
refundDesc
=
"取消订单退款:"
;
String
Builder
refundDescBuilder
=
new
StringBuilder
(
"取消订单退款:"
)
;
if
(
null
==
depositAmount
)
{
if
(
null
==
depositAmount
)
{
depositAmount
=
BigDecimal
.
ZERO
;
depositAmount
=
BigDecimal
.
ZERO
;
}
}
//商品价格 - 优惠券减免的价格
//商品价格 - 优惠券减免的价格
BigDecimal
refundGoodsAmount
=
calculateRefund
(
baseOrder
.
getGoodsAmount
().
subtract
(
baseOrder
.
getCouponAmount
()),
timeLag
,
dicParentKey
,
refundDesc
);
BigDecimal
refundGoodsAmount
=
calculateRefund
(
baseOrder
.
getGoodsAmount
().
subtract
(
baseOrder
.
getCouponAmount
()),
timeLag
,
dicParentKey
,
refundDesc
Builder
);
//退款金额
//退款金额
BigDecimal
refundAmount
=
depositAmount
.
add
(
refundGoodsAmount
);
BigDecimal
refundAmount
=
depositAmount
.
add
(
refundGoodsAmount
);
//退款子流程: 订单基础,退款描述,退款金额
//退款子流程: 订单基础,退款描述,退款金额
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
refundSubProcess
(
baseOrder
,
refundDesc
Builder
.
toString
()
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
}
}
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
String
refundDesc
)
{
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
String
Builder
refundDescBuilder
)
{
BigDecimal
refundGoodsAmount
=
goodsAmount
;
BigDecimal
refundGoodsAmount
=
goodsAmount
;
//根据时间处理goodsAmount
//根据时间处理goodsAmount
...
@@ -354,7 +354,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -354,7 +354,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//ga : goodsAmount
//ga : goodsAmount
set
(
"ga"
,
goodsAmount
);
set
(
"ga"
,
goodsAmount
);
}})).
toString
());
}})).
toString
());
refundDesc
=
names
[
1
]+
","
+
refundDesc
;
refundDesc
Builder
=
refundDescBuilder
.
insert
(
0
,
names
[
1
]+
","
)
;
break
;
break
;
}
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
85a107d5
...
@@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -24,6 +24,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
TOUR_IN_REFUND
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
TOUR_REFUND
;
@Controller
@Controller
@RequestMapping
(
"orderRefund"
)
@RequestMapping
(
"orderRefund"
)
...
@@ -40,10 +43,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -40,10 +43,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
return
userFeign
;
return
userFeign
;
}
}
@RequestMapping
(
value
=
"/price/calculate/{
type}/{
no}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/price/calculate/{no}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
@IgnoreClientToken
@IgnoreClientToken
public
ObjectRestResponse
getPriceCalculate
(
@PathVariable
(
value
=
"type"
)
String
type
,
@PathVariable
(
value
=
"no"
)
String
no
)
{
public
ObjectRestResponse
<
BigDecimal
>
getPriceCalculate
(
@PathVariable
(
value
=
"no"
)
String
no
)
{
checkAppUser
();
checkAppUser
();
//根据no 查订单
//根据no 查订单
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
...
@@ -51,36 +54,38 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -51,36 +54,38 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
setPage
(
1
);
setPage
(
1
);
}}){{
put
(
"no"
,
no
);
}}.
getSuper
()).
get
(
0
);
}}){{
put
(
"no"
,
no
);
}}.
getSuper
()).
get
(
0
);
OrderRefundPriceVO
orp
=
new
OrderRefundPriceVO
(){{
setRealAmount
(
orderPageVO
.
getRealAmount
());
}};
OrderTypeEnum
orderTypeEnum
=
OrderTypeEnum
.
get
(
orderPageVO
.
getType
());
OrderTypeEnum
orderTypeEnum
=
OrderTypeEnum
.
get
(
orderPageVO
.
getType
());
BigDecimal
orderRefundAmount
=
BigDecimal
.
ZERO
;
StringBuilder
refundDescBuilder
=
new
StringBuilder
(
""
);
switch
(
orderTypeEnum
)
{
switch
(
orderTypeEnum
)
{
case
RENT_VEHICLE:
case
RENT_VEHICLE:
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
(
)
orderRefundAmount
=
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
().
subtract
(
orderPageVO
.
getCouponAmount
()
)
,
System
.
currentTimeMillis
()
-
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
,
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
,
"取消订单退款:"
);
,
refundDescBuilder
);
break
;
break
;
case
TOUR:
case
TOUR:
// String dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_REFUND;
//判断是省内还是省外
// //不是省外,
String
key
=
TOUR_IN_REFUND
;
// if(SYS_FALS
E.equals(orderPageVO.getOrderTourDetail().getIsOutside())) {
if
(
SYS_TRU
E
.
equals
(
orderPageVO
.
getOrderTourDetail
().
getIsOutside
()))
{
// dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_IN
_REFUND;
key
=
TOUR
_REFUND
;
//
}
}
// orp.setRefundAmount(
baseOrderBiz.calculateRefund(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
orderRefundAmount
=
baseOrderBiz
.
calculateRefund
(
orderPageVO
.
getGoodsAmount
().
subtract
(
orderPageVO
.
getCouponAmount
())
// , System.currentTimeMillis() - orderPageVO.getOrderRentVehicleDetail().getStartTime
()
,
orderPageVO
.
getOrderTourDetail
().
getStartTime
()
-
System
.
currentTimeMillis
()
//
, DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.RENT_REFUND
,
DictionaryKey
.
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_REFUND
// , "取消订单退款:")
);
,
refundDescBuilder
);
break
;
break
;
default
:
default
:
// orp.setRefundAmount(orderPageVO);
break
;
break
;
}
}
return
null
;
OrderRefundPriceVO
orpv
=
new
OrderRefundPriceVO
();
orpv
.
setRealAmount
(
orderPageVO
.
getRealAmount
());
orpv
.
setRefundAmount
(
orderRefundAmount
);
orpv
.
setRefundDesc
(
refundDescBuilder
.
toString
());
return
ObjectRestResponse
.
succ
(
orpv
);
}
}
@Data
@Data
...
@@ -88,10 +93,11 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -88,10 +93,11 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
BigDecimal
refundAmount
;
BigDecimal
refundAmount
;
BigDecimal
realAmount
;
BigDecimal
realAmount
;
BigDecimal
cutAmount
;
BigDecimal
cutAmount
;
String
refundDesc
;
public
void
setRefundAmount
(
BigDecimal
refundAmount
)
{
public
void
setRefundAmount
(
BigDecimal
refundAmount
)
{
this
.
refundAmount
=
refundAmount
;
this
.
refundAmount
=
refundAmount
;
this
.
cutAmount
=
realAmount
.
multiply
(
refundAmount
);
this
.
cutAmount
=
realAmount
.
subtract
(
refundAmount
);
}
}
}
}
}
}
\ No newline at end of file
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