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
fabd82a1
Commit
fabd82a1
authored
Dec 14, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20201125_多规格商品下添加单规格商品_yu.sun' into feature/20201210_可选商品加料需求_yu.sun
parents
1b122167
372d54c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
298 additions
and
15 deletions
+298
-15
.gitignore
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/ProductTypeBeanDTO.java
+278
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/ValiadShopProductResult.java
+3
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+7
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+8
-5
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
+1
-1
No files found.
.gitignore
View file @
fabd82a1
# Created by .ignore support plugin (hsz.mobi)
.gitignore
.idea/
.DS_Store
assortment-ordercenter-sdk/assortment-ordercenter-sdk.iml
assortment-ordercenter-sdk/target/
assortment-shoppingcart-sdk/assortment-shoppingcart-sdk.iml
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
fabd82a1
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/ProductTypeBeanDTO.java
0 → 100644
View file @
fabd82a1
package
cn
.
freemud
.
entities
.
dto
.
product
;
import
lombok.Data
;
import
java.util.List
;
/**
* All rights Reserved, Designed By sunary.site
*
* @version v1.0
* @Title: IntelliJ IDEA
* @Package cn.freemud.entities.dto.product
* @Description: 请简单描述下这个类是做什么用的
* @author: yu.sun
* @date: 2020-11-25 11:51:44
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
*/
@Data
public
class
ProductTypeBeanDTO
{
private
String
businessNo
;
private
String
barcode
;
private
String
brandId
;
private
String
brandName
;
private
String
category
;
private
String
categoryName
;
private
String
companyId
;
private
String
customerCode
;
private
String
productCode
;
private
Long
finalPrice
;
private
Integer
isSkuProduct
;
private
String
name
;
private
Long
originalPrice
;
private
Long
packPrice
;
private
String
picture
;
private
String
pid
;
private
String
specification
;
private
Integer
status
;
private
Integer
stock
;
private
Integer
stockLimit
;
private
int
type
;
private
String
unit
;
private
Integer
riseSell
;
private
String
rawMaterial
;
private
Double
tax
;
private
String
taxId
;
private
Integer
openMemberDiscount
;
private
Integer
memberDiscount
;
private
List
<
ProductAttributeGroupListBean
>
productAttributeGroupList
;
private
List
<
ProductPictureListBean
>
productPictureList
;
private
List
<
SkuProductBean
>
skuList
;
private
List
<
ProductComboType
>
productComboList
;
private
List
<
ProductGroupType
>
productGroupList
;
private
List
<
SkuProductBean
.
SkuSpecValue
>
skuSpecValues
;
private
List
<
PackageProductTypeDto
>
packageProductTypes
;
private
List
<
ProductGroupType
>
additionalGroupList
;
private
List
<
ProductComboDetailTypeDto
>
productComboInfos
;
private
Integer
isDishware
;
private
Integer
weightType
;
private
Double
weight
;
public
Integer
getMemberDiscountResult
()
{
return
this
.
openMemberDiscount
!=
null
&&
this
.
openMemberDiscount
==
1
?
this
.
memberDiscount
:
100
;
}
public
ProductTypeBeanDTO
()
{
}
@Data
public
static
class
ProductComboDetailTypeDto
{
private
String
productId
;
private
Integer
quantity
;
private
Integer
sequence
;
public
ProductComboDetailTypeDto
()
{
}
}
@Data
public
static
class
ProductAttributeGroupListBean
{
private
String
attributeName
;
private
Integer
attributeType
;
private
List
<
AttributeValueBean
>
attributeValues
;
public
ProductAttributeGroupListBean
()
{
}
}
@Data
public
static
class
AttributeValueBean
{
private
String
attributeId
;
private
String
attributeValue
;
private
Long
id
;
private
Long
price
;
private
Integer
sequence
;
private
Integer
status
;
public
AttributeValueBean
()
{
}
}
@Data
public
static
class
PackageProductTypeDto
{
private
Long
groupId
;
private
Integer
sequence
;
public
PackageProductTypeDto
()
{
}
}
@Data
public
static
class
ProductGroupType
{
private
String
pgid
;
private
String
linkId
;
private
String
groupCode
;
private
String
options
;
private
String
name
;
private
Integer
must
;
private
Integer
allowRepeat
;
private
Integer
minNumber
;
private
Integer
maxNumber
;
private
String
remark
;
private
Integer
total
;
private
List
<
ProductGroupType
.
GroupDetailType
>
groupDetail
;
public
ProductGroupType
()
{
}
@Data
public
static
class
GroupDetailType
{
private
String
productId
;
private
String
productName
;
private
String
customerCode
;
private
Integer
productPrice
;
protected
Integer
productFinalPrice
;
protected
Integer
markUpPrice
;
private
String
picture
;
private
Integer
stockLimit
;
protected
String
unit
;
protected
String
productCode
;
private
Integer
weightType
;
private
Double
weight
;
private
Double
tax
;
private
String
taxId
;
}
}
@Data
public
static
class
ProductComboType
{
private
String
productId
;
private
String
productName
;
private
String
customerCode
;
private
Integer
originalPrice
;
protected
Integer
finalPrice
;
protected
Integer
packPrice
;
private
String
picture
;
protected
String
unit
;
protected
String
productCode
;
private
Integer
quantity
;
private
Integer
weightType
;
private
Double
weight
;
private
Double
tax
;
private
String
taxId
;
}
@Data
public
static
class
ProductPictureListBean
{
private
String
pictureId
;
private
String
productId
;
private
String
sequence
;
private
String
type
;
private
String
url
;
@Data
public
static
class
AttributeValueBean
{
private
String
attributeId
;
private
String
attributeValue
;
private
Long
id
;
private
Long
price
;
private
Integer
sequence
;
private
Integer
status
;
public
AttributeValueBean
()
{
}
}
}
@Data
public
static
class
ProductLabelNameListBean
{
private
String
id
;
private
String
name
;
private
String
partnerId
;
List
<?>
productList
;
private
String
storeId
;
private
String
type
;
public
ProductLabelNameListBean
()
{
}
}
@Data
public
static
class
SpecificationGroupBean
{
private
String
partnerId
;
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
List
<
SpecificationGroupBean
.
SpecValueVo
>
specValueVos
;
public
SpecificationGroupBean
()
{
}
@Data
public
static
class
SpecValueVo
{
private
Integer
sequence
;
private
String
specId
;
private
String
specValue
;
private
String
specValueId
;
public
SpecValueVo
()
{
}
}
}
@Data
public
static
class
SkuProductBean
{
private
String
customerCode
;
private
String
productCode
;
private
Long
finalPrice
;
private
Long
originalPrice
;
private
String
productName
;
private
Integer
productType
;
private
Integer
sequence
;
private
String
skuCode
;
private
String
skuId
;
private
Integer
status
;
private
Integer
stockLimit
;
private
Integer
stockQty
;
private
Long
packPrice
;
private
Integer
riseSell
;
private
String
rawMaterial
;
private
Double
tax
;
private
String
taxId
;
private
List
<
SkuProductBean
.
SkuSpecValue
>
skuSpecValues
;
private
List
<
ProductGroupType
>
additionalGroupList
;
private
Double
weight
;
protected
String
unit
;
private
Integer
openMemberDiscount
;
private
Integer
memberDiscount
;
public
Integer
getMemberDiscountResult
()
{
return
this
.
openMemberDiscount
!=
null
&&
this
.
openMemberDiscount
==
1
?
this
.
memberDiscount
:
100
;
}
public
SkuProductBean
()
{
}
@Data
public
static
class
SkuSpecValue
{
private
String
productId
;
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
String
specValue
;
private
String
specValueId
;
public
SkuSpecValue
()
{
}
}
@Data
public
static
class
PackageProductTypeDto
{
private
Long
groupId
;
private
Integer
sequence
;
public
PackageProductTypeDto
()
{
}
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/product/ValiadShopProductResult.java
View file @
fabd82a1
package
cn
.
freemud
.
entities
.
dto
.
product
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
lombok.Data
;
import
java.util.Map
;
...
...
@@ -24,9 +24,9 @@ public class ValiadShopProductResult {
private
String
message
;
private
String
skuId
;
private
String
spuId
;
private
ProductBeanDTO
productType
;
private
Product
Type
BeanDTO
productType
;
private
String
uuid
;
private
Map
<
String
,
ProductBeanDTO
>
subProductTypeMap
;
private
Map
<
String
,
Product
Type
BeanDTO
>
subProductTypeMap
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
fabd82a1
...
...
@@ -9,6 +9,7 @@ import cn.freemud.constant.ShoppingCartConstant;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryResponseDto
;
import
cn.freemud.entities.dto.product.ProductTypeBeanDTO
;
import
cn.freemud.entities.dto.product.ValiadShopProductResponse
;
import
cn.freemud.entities.dto.product.ValiadShopProductResult
;
import
cn.freemud.entities.dto.product.ValidateShopProductRequest
;
...
...
@@ -33,6 +34,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.service.thirdparty.ProductClient
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
...
...
@@ -169,7 +171,6 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
oldCartGoodsList
=
new
ArrayList
<>();
}
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
...
...
@@ -1039,7 +1040,7 @@ public class ShoppingCartMCoffeeServiceImpl {
newCartGoods
.
add
(
addCartGoods
);
//加购商品校验
List
<
CartGoods
>
allCartGoodsList
=
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
newCartGoods
);
List
<
CartGoods
>
allCartGoodsList
=
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
newCartGoods
);
List
<
CartGoods
>
nowCartGoodsList
=
new
ArrayList
<>();
//判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1
...
...
@@ -1482,7 +1483,6 @@ public class ShoppingCartMCoffeeServiceImpl {
try
{
ValidateShopProductRequest
validateShopProductRequest
=
shoppingCartConvertAdapter
.
getValidateShopProductRequest
(
checkCartRequest
);
ProductBaseResponse
<
ValiadShopProductResponse
>
valiadResponse
=
productClient
.
validateShopProductAboutReason
(
validateShopProductRequest
);
if
(
valiadResponse
==
null
||
!
CartResponseConstant
.
SUCCESS
.
getCode
().
equals
(
valiadResponse
.
getErrcode
().
toString
())
||
valiadResponse
.
getData
()==
null
)
{
checkCartRequest
.
getCartGoodsList
().
clear
();
checkCartRequest
.
getShoppingCartGoodsResponseVo
().
setChanged
(
true
);
...
...
@@ -1526,7 +1526,8 @@ public class ShoppingCartMCoffeeServiceImpl {
}
if
(
PRODUCT_PRICE_CHANGE
==
validaProduct
.
getCode
())
{
changePriceSpu
.
add
(
spuName
);
List
<
ProductBeanDTO
>
productList
=
validateResult
.
getFailureList
().
stream
().
map
(
ValiadShopProductResult:
:
getProductType
).
collect
(
Collectors
.
toList
());
List
<
ProductTypeBeanDTO
>
productList
=
validateResult
.
getFailureList
().
stream
().
map
(
ValiadShopProductResult:
:
getProductType
).
collect
(
Collectors
.
toList
());
shoppingCartConvertAdapter
.
updateCartGoodsInfoForMCoffee
(
cartGoods
,
productList
);
}
if
(
PRODUCT_GROUP_EMPTY
==
validaProduct
.
getCode
())
{
...
...
@@ -1565,9 +1566,9 @@ public class ShoppingCartMCoffeeServiceImpl {
continue
;
}
for
(
ValiadShopProductResult
valiadShopProductResult
:
validateResult
.
getSuccessList
()){
ProductBeanDTO
productType
=
valiadShopProductResult
.
getProductType
();
Product
Type
BeanDTO
productType
=
valiadShopProductResult
.
getProductType
();
if
(
ObjectUtils
.
equals
(
productType
.
getPid
(),
cartGoods
.
getSpuId
())){
Map
<
String
,
ProductBeanDTO
>
subProductTypeMap
=
valiadShopProductResult
.
getSubProductTypeMap
();
Map
<
String
,
Product
Type
BeanDTO
>
subProductTypeMap
=
valiadShopProductResult
.
getSubProductTypeMap
();
shoppingCartConvertAdapter
.
updateCartGoodsInfo
(
cartGoods
,
productType
,
subProductTypeMap
);
break
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
fabd82a1
...
...
@@ -412,7 +412,8 @@ public class CalculationServiceImpl {
material
.
setType
(
2
);
material
.
setGoodsId
(
materialGoods
.
getGoodsId
());
material
.
setGoodsQuantity
(
materialGoods
.
getQty
());
material
.
setOriginalPrice
(
materialGoods
.
getFinalPrice
());
material
.
setOriginalPrice
(
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
()
:
0
);
materials
.
add
(
material
);
}
}
...
...
@@ -430,7 +431,8 @@ public class CalculationServiceImpl {
material
.
setType
(
1
);
material
.
setGoodsId
(
materialGoods2
.
getSpuId
());
material
.
setGoodsQuantity
(
1
);
material
.
setOriginalPrice
(
materialGoods2
.
getFinalPrice
());
material
.
setOriginalPrice
(
null
!=
materialGoods2
.
getFinalPrice
()
?
materialGoods2
.
getFinalPrice
()
:
0
);
materials
.
add
(
material
);
}
}
...
...
@@ -438,14 +440,15 @@ public class CalculationServiceImpl {
}
//加料
if
(
cartGoods
!=
null
&&
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductMaterialList
()))
{
if
(
null
!=
cartGoods
&&
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductMaterialList
()))
{
for
(
CartGoods
.
MaterialGoods
materialGoods
:
cartGoods
.
getProductMaterialList
())
{
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
material
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
material
.
setType
(
1
);
material
.
setGoodsId
(
materialGoods
.
getSpuId
());
material
.
setGoodsQuantity
(
1
);
material
.
setOriginalPrice
(
materialGoods
.
getOriginalPrice
());
material
.
setNowPrice
(
materialGoods
.
getFinalPrice
().
intValue
());
material
.
setOriginalPrice
(
null
!=
materialGoods
.
getOriginalPrice
()
?
materialGoods
.
getOriginalPrice
()
:
0
);
material
.
setNowPrice
(
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
().
intValue
():
0
);
materials
.
add
(
material
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
View file @
fabd82a1
...
...
@@ -76,7 +76,7 @@ public class SetMealCalculation {
Long
comboxmaterialPrice
=
0L
;
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
for
(
CartGoods
.
MaterialGoods
materialGoods
:
comboxGoods
.
getProductMaterialList
()){
comboxmaterialPrice
+=
materialGoods
.
getFinalPrice
()
*
cartGoods
.
getQty
()
;
comboxmaterialPrice
+=
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
()
*
cartGoods
.
getQty
()
:
0
;
}
}
comboxGoods
.
setAmount
(
comboxGoods
.
getAmount
()+
comboxmaterialPrice
);
...
...
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