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
f07cd9f5
Commit
f07cd9f5
authored
Nov 26, 2020
by
yu.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::fixbug::fix bug about material
parent
45acdbb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+14
-13
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+1
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
f07cd9f5
...
@@ -944,19 +944,20 @@ public class ShoppingCartConvertAdapter {
...
@@ -944,19 +944,20 @@ public class ShoppingCartConvertAdapter {
*/
*/
private
void
checkSkuMaterialProductForMccafe
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
cartGoods
,
ProductTypeBeanDTO
spuProduct
)
{
private
void
checkSkuMaterialProductForMccafe
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
cartGoods
,
ProductTypeBeanDTO
spuProduct
)
{
if
(
CollectionUtils
.
isNotEmpty
(
spuProduct
.
getSkuList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
spuProduct
.
getSkuList
()))
{
for
(
ProductTypeBeanDTO
.
SkuProductBean
skuProductBean
:
spuProduct
.
getSkuList
())
{
spuProduct
.
getSkuList
().
stream
().
filter
(
sku
->
sku
.
getSkuId
().
equals
(
cartGoods
.
getGoodsId
())).
collect
(
Collectors
.
toList
()).
forEach
(
if
(
CollectionUtils
.
isNotEmpty
(
skuProductBean
.
getAdditionalGroupList
()))
{
skuProductBean
->
{
for
(
ProductTypeBeanDTO
.
ProductGroupType
productGroupType
:
skuProductBean
.
getAdditionalGroupList
())
{
if
(
CollectionUtils
.
isNotEmpty
(
skuProductBean
.
getAdditionalGroupList
())){
if
(
skuProductBean
.
getSkuId
().
equals
(
cartGoods
.
getGoodsId
())
&&
null
!=
productGroupType
){
//提取加料信息
List
<
String
>
materialSpu
=
new
ArrayList
<>();
List
<
String
>
materialSpu
=
new
ArrayList
<>();
List
<
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
groupDetail
=
new
ArrayList
<>();
groupDetail
.
addAll
(
productGroupType
.
getGroupDetail
());
HashMap
<
String
,
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
materialHash
=
new
HashMap
<>();
HashMap
<
String
,
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
materialHash
=
new
HashMap
<>();
for
(
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
groupDetailType
:
groupDetail
)
{
for
(
ProductTypeBeanDTO
.
ProductGroupType
productGroupType
:
skuProductBean
.
getAdditionalGroupList
())
{
materialHash
.
put
(
groupDetailType
.
getProductId
(),
groupDetailType
);
//提取加料信息
materialSpu
.
add
(
groupDetailType
.
getProductId
());
List
<
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
groupDetail
=
new
ArrayList
<>();
groupDetail
.
addAll
(
productGroupType
.
getGroupDetail
());
for
(
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
groupDetailType
:
groupDetail
)
{
materialHash
.
put
(
groupDetailType
.
getProductId
(),
groupDetailType
);
materialSpu
.
add
(
groupDetailType
.
getProductId
());
}
}
}
//加车小料和商品小料没有交集则提示商品信息有异常
//加车小料和商品小料没有交集则提示商品信息有异常
...
@@ -994,14 +995,14 @@ public class ShoppingCartConvertAdapter {
...
@@ -994,14 +995,14 @@ public class ShoppingCartConvertAdapter {
cartGoods
.
setMaterialAmount
(
materialAmount
);
cartGoods
.
setMaterialAmount
(
materialAmount
);
//加料行记录原价总价
//加料行记录原价总价
cartGoods
.
setOriginalMaterialAmount
(
originalMaterAmount
);
cartGoods
.
setOriginalMaterialAmount
(
originalMaterAmount
);
}
else
{
}
else
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
EXCEPTION_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
EXCEPTION_GOODS
.
getGoodsType
());
cartGoods
.
setProductMaterialList
(
new
ArrayList
<>());
cartGoods
.
setProductMaterialList
(
new
ArrayList
<>());
return
;
return
;
}
}
}
}
}
);
}
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
f07cd9f5
...
@@ -34,6 +34,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
...
@@ -34,6 +34,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.service.thirdparty.ProductClient
;
import
cn.freemud.service.thirdparty.ProductClient
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
...
@@ -170,7 +171,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -170,7 +171,6 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
oldCartGoodsList
=
new
ArrayList
<>();
oldCartGoodsList
=
new
ArrayList
<>();
}
}
//商品券已添加情况校验
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
...
@@ -1483,7 +1483,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1483,7 +1483,6 @@ public class ShoppingCartMCoffeeServiceImpl {
try
{
try
{
ValidateShopProductRequest
validateShopProductRequest
=
shoppingCartConvertAdapter
.
getValidateShopProductRequest
(
checkCartRequest
);
ValidateShopProductRequest
validateShopProductRequest
=
shoppingCartConvertAdapter
.
getValidateShopProductRequest
(
checkCartRequest
);
ProductBaseResponse
<
ValiadShopProductResponse
>
valiadResponse
=
productClient
.
validateShopProductAboutReason
(
validateShopProductRequest
);
ProductBaseResponse
<
ValiadShopProductResponse
>
valiadResponse
=
productClient
.
validateShopProductAboutReason
(
validateShopProductRequest
);
if
(
valiadResponse
==
null
||
!
CartResponseConstant
.
SUCCESS
.
getCode
().
equals
(
valiadResponse
.
getErrcode
().
toString
())
||
valiadResponse
.
getData
()==
null
)
{
if
(
valiadResponse
==
null
||
!
CartResponseConstant
.
SUCCESS
.
getCode
().
equals
(
valiadResponse
.
getErrcode
().
toString
())
||
valiadResponse
.
getData
()==
null
)
{
checkCartRequest
.
getCartGoodsList
().
clear
();
checkCartRequest
.
getCartGoodsList
().
clear
();
checkCartRequest
.
getShoppingCartGoodsResponseVo
().
setChanged
(
true
);
checkCartRequest
.
getShoppingCartGoodsResponseVo
().
setChanged
(
true
);
...
...
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