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
9bbd71c9
Commit
9bbd71c9
authored
Dec 13, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/coco-payGift-刘鹏飞' into qa
parents
7e6c2517
1bee447e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
order-application-service/src/main/java/cn/freemud/service/order/OrderRelationService.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
+36
-2
No files found.
order-application-service/src/main/java/cn/freemud/service/order/OrderRelationService.java
View file @
9bbd71c9
...
@@ -27,7 +27,7 @@ public interface OrderRelationService {
...
@@ -27,7 +27,7 @@ public interface OrderRelationService {
/**
/**
*
创建订单的时间检查
*
订单详情编辑
* @param
* @param
*/
*/
void
queryOrdrBuild
(
QueryOrderResponseVo
queryOrderResponseVo
,
QueryOrderByIdResponse
response
);
void
queryOrdrBuild
(
QueryOrderResponseVo
queryOrderResponseVo
,
QueryOrderByIdResponse
response
);
...
...
order-application-service/src/main/java/cn/freemud/service/order/impl/CocoOrderRelationServiceImpl.java
View file @
9bbd71c9
...
@@ -17,17 +17,22 @@ import cn.freemud.entities.dto.order.BusinessDate;
...
@@ -17,17 +17,22 @@ import cn.freemud.entities.dto.order.BusinessDate;
import
cn.freemud.entities.vo.CreateOrderVo
;
import
cn.freemud.entities.vo.CreateOrderVo
;
import
cn.freemud.entities.vo.ProductVo
;
import
cn.freemud.entities.vo.ProductVo
;
import
cn.freemud.entities.vo.QueryOrderResponseVo
;
import
cn.freemud.entities.vo.QueryOrderResponseVo
;
import
cn.freemud.enums.ActivityTypeEnum
;
import
cn.freemud.enums.CreateOrderType
;
import
cn.freemud.enums.CreateOrderType
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.impl.CheckOrder
;
import
cn.freemud.service.impl.CheckOrder
;
import
cn.freemud.service.order.OrderRelationService
;
import
cn.freemud.service.order.OrderRelationService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSendCouponResp
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSendCouponResp
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
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.response.order.QueryOrderByIdResponse
;
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
;
import
io.swagger.models.auth.In
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -101,6 +106,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
...
@@ -101,6 +106,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
queryOrderResponseVo
.
setChooseGoods
(
chooseGoods
);
queryOrderResponseVo
.
setChooseGoods
(
chooseGoods
);
}
}
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
));
}
// 赠品合并到主商品
// 赠品合并到主商品
List
<
ProductVo
>
products
=
queryOrderResponseVo
.
getProducts
();
List
<
ProductVo
>
products
=
queryOrderResponseVo
.
getProducts
();
...
@@ -119,10 +130,33 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
...
@@ -119,10 +130,33 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
}
}
if
(
null
!=
masterProducts
&&
!
masterProducts
.
isEmpty
()){
if
(
null
!=
masterProducts
&&
!
masterProducts
.
isEmpty
()){
masterProducts
.
forEach
(
product
->
{
for
(
ProductVo
product
:
masterProducts
)
{
Integer
giftQty
=
giftMap
.
get
(
product
.
getCid
())
==
null
?
0
:
giftMap
.
get
(
product
.
getCid
());
Integer
giftQty
=
giftMap
.
get
(
product
.
getCid
())
==
null
?
0
:
giftMap
.
get
(
product
.
getCid
());
product
.
setQty
(
product
.
getQty
()
+
giftQty
);
product
.
setQty
(
product
.
getQty
()
+
giftQty
);
});
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
productMap
.
get
(
product
.
getCid
());
if
(
productBean
==
null
||
productBean
.
getDiscountList
()
==
null
||
productBean
.
getDiscountList
().
isEmpty
()){
continue
;
}
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
(),
OldOrderAccountType
.
SECOND_DISCOUNT
.
getCode
())){
halfFlag
=
true
;
break
;
}
}
if
(
halfFlag
){
Integer
num
=
product
.
getQty
();
for
(
int
i
=
0
;
i
<
num
-
1
;
i
++){
ProductVo
newProduct
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
product
),
ProductVo
.
class
);
newProduct
.
setQty
(
1
);
}
product
.
setQty
(
1
);
}
}
}
}
queryOrderResponseVo
.
setProducts
(
masterProducts
);
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