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
cafe8572
Commit
cafe8572
authored
Oct 19, 2022
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车 套餐商品是否扣库存维护
parent
c00ae2ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
1 deletions
+10
-1
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/info/ProductComboType.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+6
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+1
-1
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartNewDiscountSpock.groovy
+0
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
cafe8572
...
@@ -1408,11 +1408,13 @@ public class ShoppingCartConvertAdapter {
...
@@ -1408,11 +1408,13 @@ public class ShoppingCartConvertAdapter {
if
(
isComboxGoods
)
{
if
(
isComboxGoods
)
{
productComboType
=
parentProductBean
.
getProductComboList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
comboxGoods
.
getGoodsId
(),
p
.
getProductId
())).
findFirst
().
orElse
(
new
ProductComboType
());
productComboType
=
parentProductBean
.
getProductComboList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
comboxGoods
.
getGoodsId
(),
p
.
getProductId
())).
findFirst
().
orElse
(
new
ProductComboType
());
comboxGoods
.
setLinkedId
(
productComboType
.
getLinkedId
());
comboxGoods
.
setLinkedId
(
productComboType
.
getLinkedId
());
comboxGoods
.
setStockLimit
(
Objects
.
equals
(
1
,
productComboType
.
getStockLimit
()));
}
else
{
}
else
{
Map
<
String
,
GroupDetailType
>
map
=
new
HashMap
<>();
Map
<
String
,
GroupDetailType
>
map
=
new
HashMap
<>();
parentProductBean
.
getProductGroupList
().
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
());
groupDetailType
=
map
.
get
(
comboxGoods
.
getGoodsId
());
comboxGoods
.
setLinkedId
(
groupDetailType
.
getLinkedId
());
comboxGoods
.
setLinkedId
(
groupDetailType
.
getLinkedId
());
comboxGoods
.
setStockLimit
(
Objects
.
equals
(
1
,
groupDetailType
.
getStockLimit
()));
}
}
// 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice
// 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/info/ProductComboType.java
View file @
cafe8572
...
@@ -25,4 +25,5 @@ public class ProductComboType {
...
@@ -25,4 +25,5 @@ public class ProductComboType {
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/
*/
private
String
linkedId
;
private
String
linkedId
;
private
Integer
stockLimit
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
cafe8572
...
@@ -391,6 +391,12 @@ public class CartGoods {
...
@@ -391,6 +391,12 @@ public class CartGoods {
@Data
@Data
public
final
static
class
ComboxGoods
{
public
final
static
class
ComboxGoods
{
/**
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
* 2022年10月19日11:20:11 tapd 新增套餐商品 可选搭配是否扣除库存 不走套餐主商品配置
*/
private
boolean
isStockLimit
;
/**
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/
*/
private
String
linkedId
;
private
String
linkedId
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
cafe8572
...
@@ -624,7 +624,7 @@ public class CalculationCommonService {
...
@@ -624,7 +624,7 @@ public class CalculationCommonService {
com
.
setProductType
(
comb
.
isWeightType
()
?
ProductType
.
WEIGHT_PRODUCT
.
getCode
()
:
ProductType
.
SETMEAL
.
getCode
());
com
.
setProductType
(
comb
.
isWeightType
()
?
ProductType
.
WEIGHT_PRODUCT
.
getCode
()
:
ProductType
.
SETMEAL
.
getCode
());
com
.
setParentProductId
(
cartGoods
.
getGoodsId
());
com
.
setParentProductId
(
cartGoods
.
getGoodsId
());
com
.
setIsFixedProduct
(
isFixed
);
com
.
setIsFixedProduct
(
isFixed
);
com
.
setStockLimit
(
c
artGoods
.
isStockLimit
());
com
.
setStockLimit
(
c
omb
.
isStockLimit
());
com
.
setCustomerCode
(
comb
.
getCustomerCode
());
com
.
setCustomerCode
(
comb
.
getCustomerCode
());
com
.
setWeight
(
comb
.
getWeight
());
com
.
setWeight
(
comb
.
getWeight
());
com
.
setUnit
(
comb
.
getUnit
());
com
.
setUnit
(
comb
.
getUnit
());
...
...
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartNewDiscountSpock.groovy
View file @
cafe8572
This diff is collapsed.
Click to expand it.
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