Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
24e6e673
Commit
24e6e673
authored
Dec 14, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/coco-payGift-刘鹏飞' into qa
parents
cc57b13e
89151fa7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
+15
-2
No files found.
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
View file @
24e6e673
...
...
@@ -28,6 +28,7 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSendC
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
import
com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType
;
import
com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto
;
import
com.freemud.sdk.api.assortment.order.response.order.QueryOrderByIdResponse
;
import
com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse
;
import
io.swagger.models.auth.In
;
...
...
@@ -109,7 +110,14 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
Map
<
String
,
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
>
productMap
=
new
HashMap
<>();
List
<
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
>
productList
=
response
.
getData
().
getProductList
();
if
(
productList
!=
null
&&
!
productList
.
isEmpty
()){
productMap
=
productList
.
stream
().
collect
(
Collectors
.
toMap
(
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
::
getCartGoodsUid
,
g
->
g
,(
k1
,
k2
)->
k1
));
for
(
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
:
productList
){
if
(
StringUtils
.
isEmpty
(
productBean
.
getExtInfo
())){
continue
;
}
OrderProductAddInfoDto
orderProductAddInfoDto
=
JSONObject
.
parseObject
(
productBean
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
productMap
.
put
(
orderProductAddInfoDto
.
getCartGoodsUid
(),
productBean
);
}
}
...
...
@@ -129,6 +137,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
});
}
List
<
ProductVo
>
productVos
=
new
ArrayList
<>();
if
(
null
!=
masterProducts
&&
!
masterProducts
.
isEmpty
()){
for
(
ProductVo
product
:
masterProducts
){
Integer
giftQty
=
giftMap
.
get
(
product
.
getCid
())
==
null
?
0
:
giftMap
.
get
(
product
.
getCid
());
...
...
@@ -141,7 +151,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
boolean
halfFlag
=
false
;
List
<
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
.
ProductDiscount
>
discountList
=
productBean
.
getDiscountList
();
for
(
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
.
ProductDiscount
productDiscount
:
discountList
){
if
(
ObjectUtils
.
equals
(
productDiscount
.
getDiscountType
(),
20
)){
if
(
ObjectUtils
.
equals
(
productDiscount
.
getDiscountType
(),
OldOrderAccountType
.
SECOND_DISCOUNT
.
getCode
()
)){
halfFlag
=
true
;
break
;
}
...
...
@@ -151,6 +161,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for
(
int
i
=
0
;
i
<
num
-
1
;
i
++){
ProductVo
newProduct
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
product
),
ProductVo
.
class
);
newProduct
.
setQty
(
1
);
productVos
.
add
(
newProduct
);
}
product
.
setQty
(
1
);
...
...
@@ -159,6 +170,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
}
masterProducts
.
addAll
(
productVos
);
queryOrderResponseVo
.
setProducts
(
masterProducts
);
}
}
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