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
d7b89ef8
Commit
d7b89ef8
authored
Jan 27, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3354fcb6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/GetProductBO.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/AbstractAddGoodsService.java
+10
-8
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/GetProductBO.java
View file @
d7b89ef8
...
@@ -15,5 +15,9 @@ public class GetProductBO {
...
@@ -15,5 +15,9 @@ public class GetProductBO {
private
String
menuType
;
private
String
menuType
;
private
Integer
couponType
;
private
Integer
couponType
;
/**
* 活动号
*/
private
String
activityCode
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/AbstractAddGoodsService.java
View file @
d7b89ef8
...
@@ -235,6 +235,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -235,6 +235,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
cartGoods
.
setPic
(
productsInfo
.
getPicture
());
cartGoods
.
setPic
(
productsInfo
.
getPicture
());
cartGoods
.
setWeight
(
productsInfo
.
getWeight
());
cartGoods
.
setWeight
(
productsInfo
.
getWeight
());
cartGoods
.
setUnit
(
productsInfo
.
getUnit
());
cartGoods
.
setUnit
(
productsInfo
.
getUnit
());
cartGoods
.
setActivityCode
(
getProductBO
.
getActivityCode
());
boolean
stockLimit
=
false
;
boolean
stockLimit
=
false
;
if
(
productsInfo
.
getType
()
==
ProductType
.
NOSPEC
.
getCode
()
if
(
productsInfo
.
getType
()
==
ProductType
.
NOSPEC
.
getCode
()
&&
productsInfo
.
getStockLimit
()
==
1
)
{
&&
productsInfo
.
getStockLimit
()
==
1
)
{
...
@@ -325,6 +326,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -325,6 +326,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
getProductBO
.
setSpuid
(
Collections
.
singletonList
(
productsVo
.
getSpuId
()));
getProductBO
.
setSpuid
(
Collections
.
singletonList
(
productsVo
.
getSpuId
()));
getProductBO
.
setSkuid
(
Collections
.
singletonList
(
productsVo
.
getSkuId
()));
getProductBO
.
setSkuid
(
Collections
.
singletonList
(
productsVo
.
getSkuId
()));
getProductBO
.
setCouponType
(
couponType
);
getProductBO
.
setCouponType
(
couponType
);
getProductBO
.
setActivityCode
(
couponDetail
.
getDetails
().
get
(
0
).
getActive
().
getActiveCode
());
}
else
{
}
else
{
getProductBO
.
setSkuid
(
Collections
.
singletonList
(
baseRequestBO
.
getSkuId
()));
getProductBO
.
setSkuid
(
Collections
.
singletonList
(
baseRequestBO
.
getSkuId
()));
getProductBO
.
setSpuid
(
Collections
.
singletonList
(
baseRequestBO
.
getSpuId
()));
getProductBO
.
setSpuid
(
Collections
.
singletonList
(
baseRequestBO
.
getSpuId
()));
...
@@ -979,18 +981,18 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -979,18 +981,18 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
}
}
private
void
checkStocks
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
){
private
void
checkStocks
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
){
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
baseRequestDTO
.
getMenuType
()).
getCode
());
requestDto
.
setPartnerId
(
baseRequestDTO
.
getPartnerId
());
requestDto
.
setStoreId
(
baseRequestDTO
.
getShopId
());
List
<
Long
>
productIds
=
new
ArrayList
<>();
productIds
.
add
(
Long
.
parseLong
(
checkBussinessRulesBO
.
getProduct
().
getSkuId
()));
requestDto
.
setProductIds
(
productIds
);
ProductBO
product
=
checkBussinessRulesBO
.
getProduct
();
ProductBO
product
=
checkBussinessRulesBO
.
getProduct
();
ProductStockBO
availableStocks
=
null
;
ProductStockBO
availableStocks
=
null
;
GetProductStock
getProductStock
=
new
GetProductStock
();
GetProductStock
getProductStock
=
new
GetProductStock
();
getProductStock
.
setChannel
(
BusinessTypeEnum
.
getByType
(
baseRequestDTO
.
getMenuType
()).
getCode
());
getProductStock
.
setPartnerId
(
baseRequestDTO
.
getPartnerId
());
getProductStock
.
setStoreId
(
baseRequestDTO
.
getShopId
());
List
<
Long
>
productIds
=
new
ArrayList
<>();
productIds
.
add
(
Long
.
parseLong
(
checkBussinessRulesBO
.
getProduct
().
getSkuId
()));
getProductStock
.
setProductIds
(
productIds
);
if
(
product
.
getType
()
==
ProductType
.
NOSPEC
.
getCode
()
if
(
product
.
getType
()
==
ProductType
.
NOSPEC
.
getCode
()
&&
product
.
getStockLimit
()
==
1
)
{
&&
product
.
getStockLimit
()
==
1
)
{
List
<
ProductStockBO
>
productStock
=
productManager
.
getProductStock
(
getProductStock
,
baseRequestDTO
.
getManagerService
().
getProductService
());
List
<
ProductStockBO
>
productStock
=
productManager
.
getProductStock
(
getProductStock
,
baseRequestDTO
.
getManagerService
().
getProductService
());
...
...
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