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
9fb2cea4
Commit
9fb2cea4
authored
Jun 05, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加/更加增加 classificationId ,setClassificationName
parent
ff8ec771
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
3 deletions
+56
-3
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+26
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+8
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+9
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/GetProductsVo.java
+9
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+2
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
9fb2cea4
...
@@ -21,6 +21,7 @@ import cn.freemud.enums.ActivityTypeEnum;
...
@@ -21,6 +21,7 @@ import cn.freemud.enums.ActivityTypeEnum;
import
cn.freemud.enums.GoodsTypeEnum
;
import
cn.freemud.enums.GoodsTypeEnum
;
import
cn.freemud.enums.ProductType
;
import
cn.freemud.enums.ProductType
;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.utils.BeanUtil
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -100,6 +101,8 @@ public class ShoppingCartConvertAdapter {
...
@@ -100,6 +101,8 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto
.
setUnit
(
cartGoods
.
getUnit
());
cartGoodsDetailDto
.
setUnit
(
cartGoods
.
getUnit
());
cartGoodsDetailDto
.
setActivityDiscountsDtos
(
new
ArrayList
<>());
cartGoodsDetailDto
.
setActivityDiscountsDtos
(
new
ArrayList
<>());
cartGoodsDetailDto
.
setTotalDiscountAmount
(
0
);
cartGoodsDetailDto
.
setTotalDiscountAmount
(
0
);
cartGoodsDetailDto
.
setClassificationId
(
cartGoods
.
getClassificationId
());
cartGoodsDetailDto
.
setClassificationName
(
cartGoods
.
getClassificationName
());
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
cartGoodsDetailDto
.
setProductType
(
ProductType
.
SETMEAL
.
getCode
());
cartGoodsDetailDto
.
setProductType
(
ProductType
.
SETMEAL
.
getCode
());
}
else
if
(
cartGoods
.
isWeightType
())
{
}
else
if
(
cartGoods
.
isWeightType
())
{
...
@@ -363,7 +366,7 @@ public class ShoppingCartConvertAdapter {
...
@@ -363,7 +366,7 @@ public class ShoppingCartConvertAdapter {
productCombox
.
setSkuId
(
vo
.
getSkuId
());
productCombox
.
setSkuId
(
vo
.
getSkuId
());
productCombox
.
setQty
(
vo
.
getQty
());
productCombox
.
setQty
(
vo
.
getQty
());
productCombox
.
setExtra
(
vo
.
getExtra
());
productCombox
.
setExtra
(
vo
.
getExtra
());
productCombox
.
setProductGroupId
(
StringUtils
.
isEmpty
(
vo
.
getProductGroupId
())
?
null
:
Long
.
parseLong
(
vo
.
getProductGroupId
()));
productCombox
.
setProductGroupId
(
StringUtils
.
isEmpty
(
vo
.
getProductGroupId
())
?
null
:
Long
.
parseLong
(
vo
.
getProductGroupId
()));
productGroupList
.
add
(
productCombox
);
productGroupList
.
add
(
productCombox
);
}
}
}
}
...
@@ -371,4 +374,26 @@ public class ShoppingCartConvertAdapter {
...
@@ -371,4 +374,26 @@ public class ShoppingCartConvertAdapter {
cartGoods
.
setProductGroupList
(
productGroupList
);
cartGoods
.
setProductGroupList
(
productGroupList
);
return
cartGoods
;
return
cartGoods
;
}
}
/**
* 设置统计分类编码和统计分类名称
*
* @param cartGoods
* @param productBeanListSpuClass
*/
public
static
void
setClassification
(
CartGoods
cartGoods
,
List
<
ProductBeanDTO
>
productBeanListSpuClass
)
{
cartGoods
.
setClassificationId
(
productBeanListSpuClass
.
get
(
0
).
getCategory
());
cartGoods
.
setClassificationName
(
productBeanListSpuClass
.
get
(
0
).
getCategoryName
());
}
/**
* 设置统计分类编码和统计分类名称
*
* @param cartGoods
* @param getProductsVo
*/
public
static
void
setClassification
(
CartGoods
cartGoods
,
GetProductsVo
getProductsVo
)
{
cartGoods
.
setClassificationId
(
getProductsVo
.
getCategory
());
cartGoods
.
setClassificationName
(
getProductsVo
.
getCategoryName
());
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
9fb2cea4
...
@@ -214,7 +214,14 @@ public class ShoppingCartGoodsDto {
...
@@ -214,7 +214,14 @@ public class ShoppingCartGoodsDto {
* 单位
* 单位
*/
*/
private
String
unit
;
private
String
unit
;
/**
* 统计分类编号
*/
private
String
classificationId
;
/**
* 统计分类名称
*/
private
String
classificationName
;
/**
/**
* 配料或属性
* 配料或属性
*/
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
9fb2cea4
...
@@ -130,6 +130,15 @@ public class CartGoods {
...
@@ -130,6 +130,15 @@ public class CartGoods {
* 1.6.0 版本增加 分类名
* 1.6.0 版本增加 分类名
*/
*/
private
String
categoryName
;
private
String
categoryName
;
/**
* 统计分类编号
*/
private
String
classificationId
;
/**
* 统计分类名称
*/
private
String
classificationName
;
/**
/**
* 是否限制库存
* 是否限制库存
* 用于创建订单时,是否扣减库存
* 用于创建订单时,是否扣减库存
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/GetProductsVo.java
View file @
9fb2cea4
...
@@ -37,5 +37,12 @@ public class GetProductsVo {
...
@@ -37,5 +37,12 @@ public class GetProductsVo {
* 属性
* 属性
*/
*/
private
List
<
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
.
ProductAttributeGroupListBean
>
productAttributeGroupList
;
private
List
<
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
.
ProductAttributeGroupListBean
>
productAttributeGroupList
;
/**
* 分类id
*/
private
String
category
;
/**
* 分类名称
*/
private
String
categoryName
;
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
View file @
9fb2cea4
...
@@ -170,6 +170,8 @@ public class ItemServiceImpl implements ItemService {
...
@@ -170,6 +170,8 @@ public class ItemServiceImpl implements ItemService {
getProductsVo
.
setStock
(
productBean
.
getStock
());
getProductsVo
.
setStock
(
productBean
.
getStock
());
getProductsVo
.
setStockLimit
(
productBean
.
getStockLimit
());
getProductsVo
.
setStockLimit
(
productBean
.
getStockLimit
());
getProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
getProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
getProductsVo
.
setCategory
(
productBean
.
getCategory
());
getProductsVo
.
setCategoryName
(
productBean
.
getCategoryName
());
resultMap
.
put
(
productBean
.
getPid
(),
getProductsVo
);
resultMap
.
put
(
productBean
.
getPid
(),
getProductsVo
);
getProductsVo
.
setType
(
1
);
getProductsVo
.
setType
(
1
);
// 规格ID 剔除单品
// 规格ID 剔除单品
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
9fb2cea4
...
@@ -253,6 +253,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -253,6 +253,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//查询多个商品库存信息
//查询多个商品库存信息
queryManyGoodsStocks
(
addShoppingCartGoodsRequestVo
,
productIds
,
productBeanListSpuClass
,
skuId
,
checkQty
);
queryManyGoodsStocks
(
addShoppingCartGoodsRequestVo
,
productIds
,
productBeanListSpuClass
,
skuId
,
checkQty
);
ShoppingCartConvertAdapter
.
setClassification
(
cartGoods
,
productBeanListSpuClass
);
String
productName
=
null
;
String
productName
=
null
;
// 当添加的商品不是商品券时
// 当添加的商品不是商品券时
if
(!
spuId
.
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
if
(!
spuId
.
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
...
@@ -401,6 +402,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -401,6 +402,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if
((
getProductsVo
==
null
)
||
(
getProductsVo
.
getStockLimit
()
!=
1
))
{
if
((
getProductsVo
==
null
)
||
(
getProductsVo
.
getStockLimit
()
!=
1
))
{
return
;
return
;
}
}
ShoppingCartConvertAdapter
.
setClassification
(
cartGoods
,
getProductsVo
);
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
updateShoppingCartGoodsQtyRequestVo
.
getMenuType
()).
getCode
());
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
updateShoppingCartGoodsQtyRequestVo
.
getMenuType
()).
getCode
());
requestDto
.
setPartnerId
(
partnerId
);
requestDto
.
setPartnerId
(
partnerId
);
...
...
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