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
1d8b68b1
Commit
1d8b68b1
authored
Sep 23, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-modify-cutAmount' into dev
parents
9b927dd2
ff0873bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
43 deletions
+85
-43
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+27
-27
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+25
-2
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+33
-14
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
1d8b68b1
...
@@ -252,31 +252,31 @@ public class BaseOrder implements Serializable {
...
@@ -252,31 +252,31 @@ public class BaseOrder implements Serializable {
@Column
(
name
=
"member_level"
)
@Column
(
name
=
"member_level"
)
private
Integer
memberLevel
;
private
Integer
memberLevel
;
//
/**
/**
//
* 违约金
* 违约金
//
*/
*/
//
@ApiModelProperty(value = "违约金")
@ApiModelProperty
(
value
=
"违约金"
)
//
@Column(name = "violate_amount")
@Column
(
name
=
"violate_amount"
)
//
BigDecimal ViolateAmount;
BigDecimal
ViolateAmount
;
//
//
/**
/**
//
* 赔偿金
* 赔偿金
//
*/
*/
//
@ApiModelProperty(value = "赔偿金")
@ApiModelProperty
(
value
=
"赔偿金"
)
//
@Column(name = "damages_amount")
@Column
(
name
=
"damages_amount"
)
//
BigDecimal damagesAmount;
BigDecimal
damagesAmount
;
//
//
/**
/**
//
* 额外费用
* 额外费用
//
*/
*/
//
@ApiModelProperty(value = "额外费用")
@ApiModelProperty
(
value
=
"额外费用"
)
//
@Column(name = "extra_amount")
@Column
(
name
=
"extra_amount"
)
//
BigDecimal extraAmount;
BigDecimal
extraAmount
;
//
//
/**
/**
//
* 返还的优惠券
* 返还的优惠券
//
*/
*/
//
@ApiModelProperty(value = "返回的优惠券")
@ApiModelProperty
(
value
=
"返回的优惠券"
)
//
@Column(name = "back_coupon")
@Column
(
name
=
"back_coupon"
)
//
String backCoupon;
String
backCoupon
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
1d8b68b1
package
com
.
xxfc
.
platform
.
order
.
biz
.
inner
;
package
com
.
xxfc
.
platform
.
order
.
biz
.
inner
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.StrUtil
;
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.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
...
@@ -191,6 +193,10 @@ public class OrderCancelBiz {
...
@@ -191,6 +193,10 @@ public class OrderCancelBiz {
}
}
}
}
//设置订单数据
baseOrder
.
setViolateAmount
(
csv
.
getViolateAmount
());
baseOrder
.
setExtraAmount
(
inProgressVO
.
getExtraAmount
());
csv
.
initParamJson
();
csv
.
initParamJson
();
//orderTemplateBiz.handleCostDetailExtend(csv);
//orderTemplateBiz.handleCostDetailExtend(csv);
orvd
.
handelCostDetailExtend
(
csv
);
orvd
.
handelCostDetailExtend
(
csv
);
...
@@ -208,6 +214,11 @@ public class OrderCancelBiz {
...
@@ -208,6 +214,11 @@ public class OrderCancelBiz {
//退款流程
//退款流程
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
orderItem
.
getRealAmount
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
freeDayAmount
,
oad
,
topAmount
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
orderItem
.
getRealAmount
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
freeDayAmount
,
oad
,
topAmount
);
//设置订单数据
//baseOrder.setDamagesAmount(csv.getDamagesAmount());
//baseOrder.setExtraAmount(inProgressVO.getExtraAmount());
baseOrder
.
setBackCoupon
(
baseOrder
.
getCouponTickerNos
());
//如果有扣款项,则生成额外的费用明细
//如果有扣款项,则生成额外的费用明细
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
if
(
oad
.
getDeductions
().
size
()
>
0
)
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
...
@@ -217,10 +228,14 @@ public class OrderCancelBiz {
...
@@ -217,10 +228,14 @@ public class OrderCancelBiz {
setViolateDesc
(
deduction
.
getName
());
setViolateDesc
(
deduction
.
getName
());
}};
}};
//设置订单数据
baseOrder
.
setViolateAmount
(
cnsv
.
getViolateAmount
());
cnsv
.
initParamJson
();
cnsv
.
initParamJson
();
//orderTemplateBiz.handleCostDetailExtend(cnsv);
//orderTemplateBiz.handleCostDetailExtend(cnsv);
orvd
.
handelCostDetailExtend
(
cnsv
);
orvd
.
handelCostDetailExtend
(
cnsv
);
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
orvd
);
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
orvd
);
break
;
}
}
}
}
}
}
...
@@ -273,7 +288,9 @@ public class OrderCancelBiz {
...
@@ -273,7 +288,9 @@ public class OrderCancelBiz {
setViolateDesc
(
deduction
.
getName
());
setViolateDesc
(
deduction
.
getName
());
}};
}};
cnsv
.
initParamJson
();
//设置订单数据
baseOrder
.
setViolateAmount
(
cnsv
.
getViolateAmount
());
//orderTemplateBiz.handleCostDetailExtend(cnsv);
//orderTemplateBiz.handleCostDetailExtend(cnsv);
otd
.
handelCostDetailExtend
(
cnsv
);
otd
.
handelCostDetailExtend
(
cnsv
);
orderTourDetailBiz
.
updateSelectiveByIdRe
(
otd
);
orderTourDetailBiz
.
updateSelectiveByIdRe
(
otd
);
...
@@ -322,12 +339,18 @@ public class OrderCancelBiz {
...
@@ -322,12 +339,18 @@ public class OrderCancelBiz {
//返还优惠券
//返还优惠券
if
(
StrUtil
.
isNotBlank
(
baseOrder
.
getCouponTickerNos
()))
{
if
(
StrUtil
.
isNotBlank
(
baseOrder
.
getCouponTickerNos
()))
{
List
<
String
>
backCoupons
=
(
null
!=
inProgressVO
)?
inProgressVO
.
getBackCoupons
():
Convert
.
convert
(
List
.
class
,
baseOrder
.
getCouponTickerNos
().
split
(
","
));
List
<
String
>
backCoupons
=
(
null
==
inProgressVO
)?
Convert
.
convert
(
List
.
class
,
baseOrder
.
getCouponTickerNos
().
split
(
","
)):
inProgressVO
.
getBackCoupons
();
//设置订单参数
baseOrder
.
setBackCoupon
(
ArrayUtil
.
join
(
backCoupons
,
","
));
for
(
String
backCoupon
:
backCoupons
)
{
for
(
String
backCoupon
:
backCoupons
)
{
activityFeign
.
cancelUse
(
backCoupon
);
activityFeign
.
cancelUse
(
backCoupon
);
}
}
}
}
//更新baseOrder
BeanUtil
.
copyProperties
(
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
),
baseOrder
);
//发送队列消息
//发送队列消息
baseOrderBiz
.
sendOrderMq
(
orvd
,
otd
,
omd
,
baseOrder
,
OrderMQDTO
.
ORDER_CANCEL
);
baseOrderBiz
.
sendOrderMq
(
orvd
,
otd
,
omd
,
baseOrder
,
OrderMQDTO
.
ORDER_CANCEL
);
}
else
{
}
else
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
1d8b68b1
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