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
6148bdca
Commit
6148bdca
authored
Sep 20, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
7a40ce24
2a705e1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
OrderPriceVO.java
...java/com/xxfc/platform/order/pojo/price/OrderPriceVO.java
+2
-0
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+16
-4
OrderTourService.java
...ava/com/xxfc/platform/order/service/OrderTourService.java
+19
-3
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/price/OrderPriceVO.java
View file @
6148bdca
...
@@ -16,6 +16,8 @@ public class OrderPriceVO {
...
@@ -16,6 +16,8 @@ public class OrderPriceVO {
public
BigDecimal
realAmount
=
BigDecimal
.
ZERO
;
public
BigDecimal
realAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
value
=
"优惠券扣除的费用"
)
@ApiModelProperty
(
value
=
"优惠券扣除的费用"
)
public
BigDecimal
couponAmount
=
BigDecimal
.
ZERO
;
public
BigDecimal
couponAmount
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
value
=
"优惠券扣除的费用"
)
public
String
couponDesc
=
""
;
@ApiModelProperty
(
value
=
"参数json"
)
@ApiModelProperty
(
value
=
"参数json"
)
public
String
paramJson
=
""
;
public
String
paramJson
=
""
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
6148bdca
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.order.service;
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.order.service;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
...
@@ -154,7 +155,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -154,7 +155,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//如果有使用优惠券,则扣减
//如果有使用优惠券,则扣减
if
(
BigDecimal
.
ZERO
.
compareTo
(
bo
.
getOrder
().
getCouponAmount
())
<
0
)
{
if
(
BigDecimal
.
ZERO
.
compareTo
(
bo
.
getOrder
().
getCouponAmount
())
<
0
)
{
activityFeign
.
use
(
bo
.
getAppUserDTO
().
getUserid
(),
bo
.
getTickerNo
(
),
bo
.
getOrder
().
getNo
(),
channel
,
amount
,
ActivityFeign
.
TYPE_USE
);
activityFeign
.
use
(
bo
.
getAppUserDTO
().
getUserid
(),
Convert
.
toList
(
String
.
class
,
bo
.
getOrder
().
getCouponTickerNos
()
),
bo
.
getOrder
().
getNo
(),
channel
,
amount
,
ActivityFeign
.
TYPE_USE
);
}
}
//插入随声物品item
//插入随声物品item
...
@@ -309,12 +310,23 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -309,12 +310,23 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//vehicleAmount 优惠券处理
//vehicleAmount 优惠券处理
if
(
null
!=
detail
.
getTickerNo
()
&&
detail
.
getTickerNo
().
size
()
>
0
)
{
if
(
null
!=
detail
.
getTickerNo
()
&&
detail
.
getTickerNo
().
size
()
>
0
)
{
couponAmount
=
activityFeign
.
use
(
dto
.
getUserid
(),
detail
.
getTickerNo
(),
detail
.
getOrder
().
getNo
(),
channel
,
vehicleAmount
,
ActivityFeign
.
TYPE_NO_USE
);
List
<
String
>
usedTickerNos
=
CollUtil
.
newArrayList
();
for
(
String
no
:
detail
.
getTickerNo
())
{
BigDecimal
tempCouponAmount
=
activityFeign
.
use
(
dto
.
getUserid
(),
CollUtil
.
newArrayList
(
no
),
detail
.
getOrder
().
getNo
(),
channel
,
vehicleAmount
,
ActivityFeign
.
TYPE_NO_USE
);
if
(
tempCouponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//加入总couponAmount
couponAmount
=
couponAmount
.
add
(
tempCouponAmount
);
usedTickerNos
.
add
(
no
);
//设置描述
couponDesc
+=
activityFeign
.
info
(
no
).
getTitle
();
}
}
if
(
couponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
couponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
detail
.
getOrder
().
setCouponTickerNos
(
detail
.
getTickerNo
()
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
detail
.
getOrder
().
setCouponTickerNos
(
usedTickerNos
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
detail
.
getOrder
().
setHasDiscount
(
SYS_TRUE
);
detail
.
getOrder
().
setHasDiscount
(
SYS_TRUE
);
vehicleOrderItem
.
handleCouponAmount
(
couponAmount
);
vehicleOrderItem
.
handleCouponAmount
(
couponAmount
);
couponDesc
+=
activityFeign
.
info
(
detail
.
getTickerNo
().
get
(
0
)).
getTitle
();
}
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderTourService.java
View file @
6148bdca
package
com
.
xxfc
.
platform
.
order
.
service
;
package
com
.
xxfc
.
platform
.
order
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
...
@@ -155,7 +157,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
...
@@ -155,7 +157,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//如果有使用优惠券,则扣减
//如果有使用优惠券,则扣减
if
(
BigDecimal
.
ZERO
.
compareTo
(
bo
.
getOrder
().
getCouponAmount
())
<
0
)
{
if
(
BigDecimal
.
ZERO
.
compareTo
(
bo
.
getOrder
().
getCouponAmount
())
<
0
)
{
activityFeign
.
use
(
bo
.
getAppUserDTO
().
getUserid
(),
bo
.
getTickerNo
(
),
bo
.
getOrder
().
getNo
(),
channel
,
amount
,
ActivityFeign
.
TYPE_USE
);
activityFeign
.
use
(
bo
.
getAppUserDTO
().
getUserid
(),
Convert
.
toList
(
String
.
class
,
bo
.
getOrder
().
getCouponTickerNos
()
),
bo
.
getOrder
().
getNo
(),
channel
,
amount
,
ActivityFeign
.
TYPE_USE
);
}
}
super
.
handleDetail
(
bo
);
super
.
handleDetail
(
bo
);
...
@@ -178,6 +180,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
...
@@ -178,6 +180,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
BigDecimal
tourAmount
=
BigDecimal
.
ZERO
;
BigDecimal
tourAmount
=
BigDecimal
.
ZERO
;
BigDecimal
couponAmount
=
BigDecimal
.
ZERO
;
BigDecimal
couponAmount
=
BigDecimal
.
ZERO
;
String
couponDesc
=
""
;
BigDecimal
insureAmount
=
BigDecimal
.
ZERO
;
BigDecimal
insureAmount
=
BigDecimal
.
ZERO
;
//当前用户
//当前用户
...
@@ -249,9 +252,21 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
...
@@ -249,9 +252,21 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//优惠券处理
//优惠券处理
//待完成
//待完成
if
(
null
!=
detail
.
getTickerNo
()
&&
detail
.
getTickerNo
().
size
()
>
0
)
{
if
(
null
!=
detail
.
getTickerNo
()
&&
detail
.
getTickerNo
().
size
()
>
0
)
{
couponAmount
=
activityFeign
.
use
(
dto
.
getUserid
(),
detail
.
getTickerNo
(),
detail
.
getOrder
().
getNo
(),
channel
,
tourAmount
,
ActivityFeign
.
TYPE_NO_USE
);
List
<
String
>
usedTickerNos
=
CollUtil
.
newArrayList
();
for
(
String
no
:
detail
.
getTickerNo
())
{
BigDecimal
tempCouponAmount
=
activityFeign
.
use
(
dto
.
getUserid
(),
CollUtil
.
newArrayList
(
no
),
detail
.
getOrder
().
getNo
(),
channel
,
tourAmount
,
ActivityFeign
.
TYPE_NO_USE
);
if
(
tempCouponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
//加入总couponAmount
couponAmount
=
couponAmount
.
add
(
tempCouponAmount
);
usedTickerNos
.
add
(
no
);
//设置描述
couponDesc
+=
activityFeign
.
info
(
no
).
getTitle
();
}
}
if
(
couponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
couponAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
detail
.
getOrder
().
setCouponTickerNos
(
detail
.
getTickerNo
()
detail
.
getOrder
().
setCouponTickerNos
(
usedTickerNos
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
detail
.
getOrder
().
setHasDiscount
(
SYS_TRUE
);
detail
.
getOrder
().
setHasDiscount
(
SYS_TRUE
);
BigDecimal
residueCouponAmount
=
tourAdultItem
.
handleCouponAmount
(
couponAmount
);
BigDecimal
residueCouponAmount
=
tourAdultItem
.
handleCouponAmount
(
couponAmount
);
...
@@ -271,6 +286,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
...
@@ -271,6 +286,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//生成订单明细
//生成订单明细
TourPriceVO
tpv
=
BeanUtil
.
toBean
(
tourSpePriceVo
,
TourPriceVO
.
class
);
TourPriceVO
tpv
=
BeanUtil
.
toBean
(
tourSpePriceVo
,
TourPriceVO
.
class
);
tpv
.
setCouponAmount
(
couponAmount
);
tpv
.
setCouponAmount
(
couponAmount
);
tpv
.
setCouponDesc
(
couponDesc
);
tpv
.
setOrderAmount
(
orderAmount
);
tpv
.
setOrderAmount
(
orderAmount
);
tpv
.
setGoodsAmount
(
goodsAmount
);
tpv
.
setGoodsAmount
(
goodsAmount
);
tpv
.
setRealAmount
(
realAmount
);
tpv
.
setRealAmount
(
realAmount
);
...
...
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