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
82530220
Commit
82530220
authored
Dec 22, 2020
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
af2b013b
dacf64bf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
6 deletions
+95
-6
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/OrderConditionsReq.java
+2
-1
shopping-cart-application-service/pom.xml
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+88
-4
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+1
-0
No files found.
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/OrderConditionsReq.java
View file @
82530220
...
@@ -119,5 +119,6 @@ public class OrderConditionsReq {
...
@@ -119,5 +119,6 @@ public class OrderConditionsReq {
private
String
appId
;
private
String
appId
;
//是否删除
//是否删除
private
Integer
isDeleted
;
private
Integer
isDeleted
;
//营销活动类型
private
Integer
marketingType
;
}
}
shopping-cart-application-service/pom.xml
View file @
82530220
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<dependency>
<dependency>
<groupId>
cn.freemud
</groupId>
<groupId>
cn.freemud
</groupId>
<artifactId>
assortment-shoppingcart-sdk
</artifactId>
<artifactId>
assortment-shoppingcart-sdk
</artifactId>
<version>
2.0.1
3
-SNAPSHOT
</version>
<version>
2.0.1
5
-SNAPSHOT
</version>
</dependency>
</dependency>
<!-- 再来一单查询订单信息 -->
<!-- 再来一单查询订单信息 -->
<dependency>
<dependency>
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
82530220
...
@@ -726,7 +726,7 @@ public class ShoppingCartConvertAdapter {
...
@@ -726,7 +726,7 @@ public class ShoppingCartConvertAdapter {
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
//
TODO:
2020/10/22 套餐内可选商品加料,暂无
//2020/10/22 套餐内可选商品加料,暂无
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
materialGoods
=
new
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
();
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
materialGoods
=
new
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
();
...
@@ -735,6 +735,89 @@ public class ShoppingCartConvertAdapter {
...
@@ -735,6 +735,89 @@ public class ShoppingCartConvertAdapter {
}
}
}
}
/**
* 更新套餐可选商品加料信息
*/
private
void
updateComboxGoodsInfoForMCoffeeProductGroup
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
comboxGoods
,
ProductTypeBeanDTO
parentProductBean
,
Map
<
String
,
ProductTypeBeanDTO
>
subProductTypeMap
,
boolean
isComboxGoods
)
{
if
(
"0"
.
equals
(
comboxGoods
.
getGoodsId
())){
return
;
}
ProductTypeBeanDTO
.
ProductComboType
productComboType
=
new
ProductTypeBeanDTO
.
ProductComboType
();
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
groupDetailType
=
new
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
();
if
(
isComboxGoods
)
{
productComboType
=
parentProductBean
.
getProductComboList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
comboxGoods
.
getGoodsId
(),
p
.
getProductId
())).
findFirst
().
orElse
(
new
ProductTypeBeanDTO
.
ProductComboType
());
}
else
{
Map
<
String
,
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
map
=
new
HashMap
<>();
// subProductTypeMap.get(comboxGoods.getSkuId()).getAdditionalGroupList().stream().map(t->t.getGroupDetail()).forEach(group->group.forEach(detailType-> map.put(detailType.getProductId(),detailType)));
parentProductBean
.
getProductGroupList
().
stream
().
map
(
t
->
t
.
getGroupDetail
()).
forEach
(
group
->
group
.
forEach
(
detailType
->
map
.
put
(
detailType
.
getProductId
(),
detailType
)));
groupDetailType
=
map
.
get
(
comboxGoods
.
getGoodsId
());
}
// 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice
Long
finalPrice
=
isComboxGoods
?
(
null
!=
productComboType
.
getFinalPrice
()
?
productComboType
.
getFinalPrice
().
longValue
()
:
0L
)
:
(
null
!=
groupDetailType
.
getMarkUpPrice
()
?
groupDetailType
.
getMarkUpPrice
().
longValue
()
:
0L
);
// 设置商品详情
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
comboxGoods
.
getExtra
());
comboxGoods
.
setSpuId
(
comboxGoods
.
getSpuId
());
comboxGoods
.
setName
(
isComboxGoods
?
productComboType
.
getProductName
()
:
groupDetailType
.
getProductName
());
comboxGoods
.
setSpuName
(
comboxGoods
.
getName
());
comboxGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
comboxGoods
.
setSubName
(
attributes
.
get
(
ATTRIBUTENAME
));
comboxGoods
.
setPic
(
isComboxGoods
?
productComboType
.
getPicture
()
:
groupDetailType
.
getPicture
());
comboxGoods
.
setOriginalPrice
(
isComboxGoods
?
(
null
!=
productComboType
.
getFinalPrice
()
?
productComboType
.
getFinalPrice
().
longValue
()
:
0L
)
:
(
null
!=
groupDetailType
.
getProductFinalPrice
()
?
groupDetailType
.
getProductFinalPrice
().
longValue
()
:
0L
));
comboxGoods
.
setOriginalAmount
(
comboxGoods
.
getOriginalPrice
()
*
comboxGoods
.
getQty
());
comboxGoods
.
setAmount
(
finalPrice
*
comboxGoods
.
getQty
());
comboxGoods
.
setCustomerCode
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getCustomerCode
())
?
productComboType
.
getCustomerCode
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getCustomerCode
())
?
groupDetailType
.
getCustomerCode
()
:
""
));
comboxGoods
.
setFinalPrice
(
finalPrice
);
comboxGoods
.
setWeightType
(
isComboxGoods
?
CommonsConstant
.
WEIGHT_PRODUCT
.
equals
(
productComboType
.
getWeightType
())
:
CommonsConstant
.
WEIGHT_PRODUCT
.
equals
(
groupDetailType
.
getWeightType
()));
comboxGoods
.
setUnit
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getUnit
())
?
productComboType
.
getUnit
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getUnit
())
?
groupDetailType
.
getUnit
()
:
""
));
comboxGoods
.
setWeight
(
isComboxGoods
?
(
null
==
productComboType
.
getWeight
()
?
0
:
productComboType
.
getWeight
())
:
(
null
==
groupDetailType
.
getWeight
()
?
0
:
groupDetailType
.
getWeight
()));
comboxGoods
.
setTax
(
isComboxGoods
?
(
null
==
productComboType
.
getTax
()
?
0
:
productComboType
.
getTax
())
:
(
null
==
groupDetailType
.
getTax
()
?
0
:
groupDetailType
.
getTax
()));
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
//2020/10/22 套餐内可选商品加料,暂无
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
Map
<
String
,
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
materialMap
=
new
HashMap
<>();
subProductTypeMap
.
get
(
comboxGoods
.
getSkuId
()).
getAdditionalGroupList
().
stream
().
map
(
t
->
t
.
getGroupDetail
()).
forEach
(
group
->
group
.
forEach
(
detailType
->
materialMap
.
put
(
detailType
.
getProductId
(),
detailType
)));
List
<
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
materialList
=
new
ArrayList
<>();
comboxGoods
.
getProductMaterialList
().
stream
().
forEach
(
materialGood
->
materialList
.
add
(
materialMap
.
get
(
materialGood
.
getSpuId
())));
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
materialList
)){
for
(
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
detailType
:
materialList
)
{
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
materialGoods
=
new
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
();
materialGoods
.
setCustomerCode
(
StringUtils
.
isNotEmpty
(
detailType
.
getCustomerCode
())
?
detailType
.
getCustomerCode
()
:
""
);
materialGoods
.
setAmount
(
null
!=
detailType
.
getMarkUpPrice
()
?
detailType
.
getMarkUpPrice
().
longValue
()
:
0
);
materialGoods
.
setFinalPrice
(
null
!=
detailType
.
getProductFinalPrice
()
?
detailType
.
getProductFinalPrice
().
longValue
()
:
0
);
materialGoods
.
setSpuName
(
StringUtils
.
isNotEmpty
(
detailType
.
getProductName
())
?
detailType
.
getProductName
()
:
""
);
materialGoods
.
setSpuId
(
StringUtils
.
isNotEmpty
(
detailType
.
getProductId
())
?
detailType
.
getProductId
()
:
""
);
materialGoods
.
setOriginalPrice
(
null
!=
detailType
.
getProductFinalPrice
()
?
detailType
.
getProductFinalPrice
().
longValue
()
:
0
);
materialGoods
.
setOriginalAmount
(
null
!=
detailType
.
getProductFinalPrice
()
?
detailType
.
getProductFinalPrice
().
longValue
()
:
0
);
productMaterialList
.
add
(
materialGoods
);
}
}
comboxGoods
.
setProductMaterialList
(
productMaterialList
);
}
}
private
Map
<
String
,
String
>
getAttributesNew
(
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
CartGoodsExtra
>
extra
)
{
private
Map
<
String
,
String
>
getAttributesNew
(
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
CartGoodsExtra
>
extra
)
{
if
(
CollectionUtils
.
isEmpty
(
extra
))
{
if
(
CollectionUtils
.
isEmpty
(
extra
))
{
return
new
HashMap
<>();
return
new
HashMap
<>();
...
@@ -864,7 +947,9 @@ public class ShoppingCartConvertAdapter {
...
@@ -864,7 +947,9 @@ public class ShoppingCartConvertAdapter {
}
}
}
else
{
}
else
{
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
productGroup
:
cartGoods
.
getProductGroupList
())
{
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
productGroup
:
cartGoods
.
getProductGroupList
())
{
updateComboxGoodsInfoForMCoffee
(
productGroup
,
spuProduct
,
false
);
// updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false);
updateComboxGoodsInfoForMCoffeeProductGroup
(
productGroup
,
spuProduct
,
subProductTypeMap
,
false
);
}
}
}
}
}
}
...
@@ -1055,4 +1140,4 @@ public class ShoppingCartConvertAdapter {
...
@@ -1055,4 +1140,4 @@ public class ShoppingCartConvertAdapter {
}
}
}
}
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
82530220
...
@@ -421,6 +421,9 @@ public class CartGoods {
...
@@ -421,6 +421,9 @@ public class CartGoods {
if
(
CollectionUtils
.
isNotEmpty
(
productGroupList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
productGroupList
))
{
for
(
ComboxGoods
goods
:
productGroupList
)
{
for
(
ComboxGoods
goods
:
productGroupList
)
{
originalString
.
append
(
goods
.
toString
());
originalString
.
append
(
goods
.
toString
());
if
(
CollectionUtils
.
isNotEmpty
(
goods
.
getProductMaterialList
()))
{
goods
.
getProductMaterialList
().
stream
().
sorted
(
Comparator
.
comparing
(
MaterialGoods:
:
getSpuId
)).
forEach
(
e
->
originalString
.
append
(
e
.
getSpuId
()));
}
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
productMaterialList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
productMaterialList
))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
82530220
...
@@ -1520,6 +1520,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1520,6 +1520,7 @@ public class ShoppingCartMCoffeeServiceImpl {
CartGoods
.
MaterialGoods
materialGoods
=
new
CartGoods
.
MaterialGoods
();
CartGoods
.
MaterialGoods
materialGoods
=
new
CartGoods
.
MaterialGoods
();
materialGoods
.
setSpuId
(
materialRequestVo
.
getSpuId
());
materialGoods
.
setSpuId
(
materialRequestVo
.
getSpuId
());
materialGoods
.
setGroupId
(
materialRequestVo
.
getGroupId
());
materialGoods
.
setGroupId
(
materialRequestVo
.
getGroupId
());
materialGoods
.
setCustomerCode
(
materialRequestVo
.
getCustomerCode
());
comboxMaterialGoodsList
.
add
(
materialGoods
);
comboxMaterialGoodsList
.
add
(
materialGoods
);
}
}
productCombox
.
setProductMaterialList
(
comboxMaterialGoodsList
);
productCombox
.
setProductMaterialList
(
comboxMaterialGoodsList
);
...
...
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