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
87a1db7f
Commit
87a1db7f
authored
Mar 04, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
围餐
parent
08b2af8f
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
309 additions
and
24 deletions
+309
-24
assortment-ordercenter-sdk/pom.xml
+2
-2
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/BaseCreateOrderRequest.java
+7
-0
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductExpandRequest.java
+31
-0
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductRequest.java
+10
-0
assortment-shoppingcart-sdk/pom.xml
+2
-2
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/adapter/ShoppingCartAdapter.java
+22
-0
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
+43
-6
order-application-service/pom.xml
+2
-2
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+4
-2
order-application-service/src/main/java/cn/freemud/entities/dto/OrderProductAddInfo.java
+2
-0
order-application-service/src/main/java/cn/freemud/entities/dto/ProductListDto.java
+10
-0
order-application-service/src/main/java/cn/freemud/entities/dto/StoreDeliveryInfoDto.java
+1
-0
order-application-service/src/main/java/cn/freemud/entities/dto/product/AttributeValue.java
+2
-0
order-application-service/src/main/java/cn/freemud/entities/dto/product/GroupDetail.java
+1
-0
order-application-service/src/main/java/cn/freemud/entities/dto/product/ProductAttributeGroup.java
+2
-0
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ActivityDiscountsDto.java
+1
-0
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+8
-1
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
+10
-0
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+4
-0
order-application-service/src/main/java/cn/freemud/service/thirdparty/ShoppingCartClient.java
+1
-1
order-application-service/src/main/resources/application.properties
+4
-0
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/CreateOrderRequest.java
+3
-0
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/OrderItemCreateReq.java
+5
-0
shopping-cart-application-service/pom.xml
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/CheckSpqInfoResponseDto.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMenuResponseDto.java
+14
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OrderProductAddInfo.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+10
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+28
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
+44
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+14
-5
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
+2
-0
shopping-cart-application-service/src/main/resources/application.properties
+3
-0
No files found.
assortment-ordercenter-sdk/pom.xml
View file @
87a1db7f
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
assortment-ordercenter-sdk
</artifactId>
<version>
2.1.33-RELEASE
</version>
<version>
2.1.33
_whh
-RELEASE
</version>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -55,7 +55,7 @@
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<artifactId>
storecenter-sdk
</artifactId>
<version>
3.
2.6.RELEASE
</version>
<version>
3.
3.12-SNAPSHOT
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
...
...
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/BaseCreateOrderRequest.java
View file @
87a1db7f
...
...
@@ -31,6 +31,10 @@ public class BaseCreateOrderRequest extends BaseConfig {
*/
private
String
shopName
;
/**
* 门店英文名称
*/
private
String
shopNameEn
;
/**
* 用户ID
*/
private
String
userId
;
...
...
@@ -213,6 +217,9 @@ public class BaseCreateOrderRequest extends BaseConfig {
private
SendPoint
point
;
//门店英文名称
private
String
storeNameEn
;
}
@Data
...
...
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductExpandRequest.java
0 → 100644
View file @
87a1db7f
package
com
.
freemud
.
sdk
.
api
.
assortment
.
order
.
request
.
order
;
import
lombok.Data
;
/**
* @author wanghanghang
* @title: CreateOrderProductExpandRequest
* @projectName order-group
* @description: 订单商品信息字段拓展表
* @date 2021/3/3上午10:43
*/
@Data
public
class
CreateOrderProductExpandRequest
{
/**订单主键id**/
private
Long
orderId
;
/**订单item主键id**/
private
Long
orderItemId
;
/**商品英文名**/
private
String
productForeignName
;
/**
* 商品规格英文名称
*/
private
String
specificationForeignName
;
}
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductRequest.java
View file @
87a1db7f
...
...
@@ -28,6 +28,11 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品名称
*/
private
String
productName
;
/**商品英文名**/
private
String
productForeignName
;
/**
* 商品数量
*/
...
...
@@ -40,6 +45,11 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品规格名称
*/
private
String
specificationName
;
/**
* 商品规格英文名称
*/
private
String
specificationForeignName
;
/**
* 第三方商品编号,商品服务唯一
*/
...
...
assortment-shoppingcart-sdk/pom.xml
View file @
87a1db7f
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
assortment-shoppingcart-sdk
</artifactId>
<version>
1.2.3.RELEASE
</version>
<version>
1.2.3
_whh
.RELEASE
</version>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -41,7 +41,7 @@
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<artifactId>
productcenter-sdk
</artifactId>
<version>
3.7.6-
SNAPSHOT
</version>
<version>
4.0.2.
SNAPSHOT
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
...
...
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/adapter/ShoppingCartAdapter.java
View file @
87a1db7f
...
...
@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
public
class
ShoppingCartAdapter
{
private
static
final
String
ATTRIBUTEID
=
"attributeId"
;
private
static
final
String
ATTRIBUTENAME
=
"attributeName"
;
private
static
final
String
ATTRIBUTEFOREIGNNAME
=
"attributeForeignName"
;
public
GetProductInfoRequest
convertGetProductInfoRequest
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
String
trackingNo
)
{
GetProductInfoRequest
request
=
new
GetProductInfoRequest
();
...
...
@@ -280,8 +281,12 @@ public class ShoppingCartAdapter {
if
(!
"早餐啡常搭"
.
equals
(
cartGoods
.
getName
())
&&
!
"早餐啡常搭"
.
equals
(
cartGoods
.
getSkuName
())
&&
!
"早餐啡常搭"
.
equals
(
cartGoods
.
getSpuName
())
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getName
())
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getSkuName
())
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getSpuName
()))
{
cartGoods
.
setName
(
spuProduct
.
getName
());
cartGoods
.
setForeignName
(
spuProduct
.
getForeignName
());
cartGoods
.
setSpuName
(
spuProduct
.
getName
());
cartGoods
.
setSpuForeignName
(
spuProduct
.
getForeignName
());
cartGoods
.
setSkuName
(
isSkuProduct
?
skuProduct
.
getProductName
()
:
spuProduct
.
getName
());
cartGoods
.
setSkuForeignName
(
isSkuProduct
?
skuProduct
.
getForeignProductName
()
:
spuProduct
.
getForeignName
());
}
cartGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
cartGoods
.
setPic
(
spuProduct
.
getPicture
());
...
...
@@ -292,17 +297,29 @@ public class ShoppingCartAdapter {
cartGoods
.
setMemberDiscount
(
spuProduct
.
getMemberDiscountResult
());
cartGoods
.
setClassificationId
(
spuProduct
.
getCategory
());
cartGoods
.
setClassificationName
(
spuProduct
.
getCategoryName
());
cartGoods
.
setClassificationForeignName
(
spuProduct
.
getCategoryName
());
cartGoods
.
setTax
(
spuProduct
.
getTax
());
cartGoods
.
setTaxId
(
spuProduct
.
getTaxId
());
String
skuSpecName
=
""
;
String
skuForeignSpecName
=
""
;
if
(
isSkuProduct
&&
CollectionUtils
.
isNotEmpty
(
skuProduct
.
getSkuSpecValues
()))
{
List
<
String
>
skuSpecValus
=
skuProduct
.
getSkuSpecValues
().
stream
().
map
(
p
->
p
.
getSpecValue
()).
collect
(
Collectors
.
toList
());
skuSpecName
=
StringUtils
.
join
(
skuSpecValus
,
"/"
);
}
if
(
isSkuProduct
&&
CollectionUtils
.
isNotEmpty
(
skuProduct
.
getSkuSpecValues
()))
{
List
<
String
>
skuSpecValus
=
skuProduct
.
getSkuSpecValues
().
stream
().
map
(
p
->
p
.
getForeignSpecValue
()).
collect
(
Collectors
.
toList
());
skuForeignSpecName
=
StringUtils
.
join
(
skuSpecValus
,
"/"
);
}
String
attributeName
=
attributes
.
get
(
ATTRIBUTENAME
)
==
null
?
""
:
attributes
.
get
(
ATTRIBUTENAME
);
String
attributeForeignName
=
attributes
.
get
(
ATTRIBUTEFOREIGNNAME
)
==
null
?
""
:
attributes
.
get
(
ATTRIBUTEFOREIGNNAME
);
//购物车小标题
cartGoods
.
setSubName
(
StringUtils
.
isNotEmpty
(
skuSpecName
)
&&
StringUtils
.
isNotEmpty
(
attributeName
)
?
skuSpecName
+
"/"
+
attributeName
:
skuSpecName
+
attributeName
);
//购物车英文小标题
cartGoods
.
setSubForeignName
(
StringUtils
.
isNotEmpty
(
skuForeignSpecName
)
&&
StringUtils
.
isNotEmpty
(
attributeForeignName
)
?
skuForeignSpecName
+
"/"
+
attributeForeignName
:
skuForeignSpecName
+
attributeForeignName
);
if
(
isSetMealProduct
)
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductComboList
()))
{
...
...
@@ -382,6 +399,7 @@ public class ShoppingCartAdapter {
if
(
detail
==
null
)
continue
;
CartGoods
.
MaterialGoods
material
=
new
CartGoods
.
MaterialGoods
();
material
.
setSpuName
(
detail
.
getProductName
());
material
.
setSpuForeignName
(
detail
.
getForeignProductName
());
material
.
setSpuId
(
detail
.
getProductId
());
//行单价 \ 行总价
material
.
setFinalPrice
(
detail
.
getProductFinalPrice
().
longValue
());
...
...
@@ -478,9 +496,13 @@ public class ShoppingCartAdapter {
// 设置商品详情
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
comboxGoods
.
getExtra
());
comboxGoods
.
setName
(
isComboxGoods
?
productComboType
.
getProductName
()
:
groupDetailType
.
getProductName
());
comboxGoods
.
setForeignName
(
isComboxGoods
?
productComboType
.
getForeignProductName
()
:
groupDetailType
.
getForeignProductName
());
comboxGoods
.
setSpuName
(
comboxGoods
.
getName
());
comboxGoods
.
setSpuForeignName
(
comboxGoods
.
getForeignName
());
comboxGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
comboxGoods
.
setSubName
(
attributes
.
get
(
ATTRIBUTENAME
));
comboxGoods
.
setSubForeignName
(
attributes
.
get
(
ATTRIBUTEFOREIGNNAME
));
comboxGoods
.
setPic
(
isComboxGoods
?
productComboType
.
getPicture
()
:
groupDetailType
.
getPicture
());
comboxGoods
.
setOriginalPrice
(
isComboxGoods
?
productComboType
.
getFinalPrice
().
longValue
()
:
groupDetailType
.
getProductFinalPrice
().
longValue
());
comboxGoods
.
setOriginalAmount
(
comboxGoods
.
getOriginalPrice
()
*
comboxGoods
.
getQty
());
...
...
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
View file @
87a1db7f
...
...
@@ -73,11 +73,6 @@ public class CartGoods {
* 单位
*/
private
String
unit
;
/**
* 商品券code
*/
private
String
couponCode
;
/**
* 是否是月享卡商品
*/
...
...
@@ -91,6 +86,10 @@ public class CartGoods {
*/
private
int
isSunnyCoupon
;
/**
* 商品券code
*/
private
String
couponCode
;
/**
* 商品券门槛金额
*/
private
Long
couponThresholdAmount
;
...
...
@@ -102,6 +101,12 @@ public class CartGoods {
* 商品券名称
*/
private
String
couponName
;
/**
* 购物车商品券商品价格
*/
private
Long
couponProductPrice
;
private
String
spuId
;
private
String
skuId
;
/**
...
...
@@ -146,9 +151,18 @@ public class CartGoods {
private
String
name
;
/**
* 购物车一行商品英文名称
*/
private
String
foreignName
;
/**
* 商品的spuName
*/
private
String
spuName
;
/**
* 商品的spuForeignName
*/
private
String
spuForeignName
;
/**
* 商品的skuName
...
...
@@ -156,10 +170,19 @@ public class CartGoods {
private
String
skuName
;
/**
* skuForeignName
*/
private
String
skuForeignName
;
/**
* 购物车一行商品的副名称
*/
private
String
subName
;
/**
* 购物车一行商品的英文副名称
*/
private
String
subForeignName
;
/**
* 商品图片URL
*/
private
String
pic
;
...
...
@@ -198,6 +221,7 @@ public class CartGoods {
* 统计分类名称
*/
private
String
classificationName
;
private
String
classificationForeignName
;
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
...
...
@@ -252,6 +276,8 @@ public class CartGoods {
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
}
@Data
...
...
@@ -265,6 +291,8 @@ public class CartGoods {
*/
private
String
attributeName
;
private
String
attributeForeignName
;
/**
* 麦咖啡特定属性入机code
*/
...
...
@@ -297,6 +325,7 @@ public class CartGoods {
private
String
spuId
;
private
String
skuId
;
private
String
skuName
;
private
String
skuForeignName
;
/**
* 所有属性attributeId的拼接
*/
...
...
@@ -337,15 +366,17 @@ public class CartGoods {
* 购物车一行商品的名称
*/
private
String
name
;
private
String
foreignName
;
/**
* 商品的spuName
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 购物车一行商品的副名称
*/
private
String
subName
;
private
String
subForeignName
;
/**
* 商品图片URL
*/
...
...
@@ -432,6 +463,7 @@ public class CartGoods {
* 加料名称
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 购物车一行商品的现单价
*/
...
...
@@ -451,5 +483,10 @@ public class CartGoods {
* 麦咖啡入机键位
*/
private
String
customerCode
;
/**
* 数量
*/
private
Integer
qty
;
}
}
order-application-service/pom.xml
View file @
87a1db7f
...
...
@@ -46,7 +46,7 @@
<dependency>
<groupId>
cn.freemud
</groupId>
<artifactId>
assortment-ordercenter-sdk
</artifactId>
<version>
2.1.3
2
-RELEASE
</version>
<version>
2.1.3
3_whh
-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
...
...
@@ -93,7 +93,7 @@
<!-- 商户门店sdk -->
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<version>
3.
2.6.RELEASE
</version>
<version>
3.
3.12-SNAPSHOT
</version>
<artifactId>
storecenter-sdk
</artifactId>
</dependency>
<dependency>
...
...
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
87a1db7f
...
...
@@ -648,6 +648,7 @@ public class OrderAdapter {
createOrderDto
.
setShopId
(
createOrderVo
.
getShopId
());
createOrderDto
.
setThirdShopId
(
createOrderVo
.
getThirdShopId
());
createOrderDto
.
setShopName
(
createOrderVo
.
getStoreName
());
createOrderDto
.
setShopNameEn
(
createOrderVo
.
getStoreNameEn
());
createOrderDto
.
setUserId
(
createOrderVo
.
getUserId
());
createOrderDto
.
setUserName
(
createOrderVo
.
getUserName
());
createOrderDto
.
setPhone
(
createOrderVo
.
getMobile
());
...
...
@@ -2396,8 +2397,6 @@ public class OrderAdapter {
});
createOrderProductDemoDto
.
setMaterialProduct
(
materialProducts
);
}
createOrderProductDemoDto
.
setProductType
(
cartGoodsDetailDto
.
getProductType
());
return
createOrderProductDemoDto
;
}
...
...
@@ -2478,8 +2477,11 @@ public class OrderAdapter {
CreateOrderProductRequest
createOrderProductDemoDto
=
new
CreateOrderProductRequest
();
createOrderProductDemoDto
.
setProductId
(
StringUtils
.
isNotBlank
(
cartGoodsDetailDto
.
getSpuId
())
?
cartGoodsDetailDto
.
getSpuId
()
:
cartGoodsDetailDto
.
getSkuId
());
createOrderProductDemoDto
.
setProductName
(
cartGoodsDetailDto
.
getSpuName
());
createOrderProductDemoDto
.
setProductForeignName
(
cartGoodsDetailDto
.
getSpuForeignName
());
createOrderProductDemoDto
.
setSpecification
(
cartGoodsDetailDto
.
getSkuId
());
createOrderProductDemoDto
.
setSpecificationName
(
cartGoodsDetailDto
.
getSkuName
());
createOrderProductDemoDto
.
setSpecificationForeignName
(
cartGoodsDetailDto
.
getSkuForeignName
());
createOrderProductDemoDto
.
setPrice
(
cartGoodsDetailDto
.
getOriginalPrice
());
createOrderProductDemoDto
.
setSalePrice
(
cartGoodsDetailDto
.
getOriginalPrice
());
createOrderProductDemoDto
.
setTotalDiscountAmount
(
cartGoodsDetailDto
.
getTotalDiscountAmount
()
==
null
?
0
:
cartGoodsDetailDto
.
getTotalDiscountAmount
().
longValue
());
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/OrderProductAddInfo.java
View file @
87a1db7f
...
...
@@ -14,6 +14,8 @@ public class OrderProductAddInfo {
* 属性名称 多糖/冷/常温
*/
private
String
attributeNames
;
private
String
attributeForeignName
;
/**
* 活动商品集合
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/ProductListDto.java
View file @
87a1db7f
...
...
@@ -40,6 +40,8 @@ public class ProductListDto {
*/
private
Long
finalPrice
;
private
String
name
;
private
String
foreignName
;
/**
* 原始价格 单位分
*/
...
...
@@ -94,6 +96,7 @@ public class ProductListDto {
private
Long
finalPrice
;
private
Long
originalPrice
;
private
String
productName
;
private
String
productForeignName
;
private
Integer
productType
;
private
Integer
sequence
;
private
String
skuCode
;
...
...
@@ -109,6 +112,7 @@ public class ProductListDto {
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
String
specForeignName
;
private
String
specValue
;
private
String
specValueId
;
}
...
...
@@ -121,6 +125,8 @@ public class ProductListDto {
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
String
specForeignName
;
private
List
<
SpecificationGroupBean
.
SpecValueVo
>
specValueVos
;
@NoArgsConstructor
...
...
@@ -138,6 +144,8 @@ public class ProductListDto {
public
static
class
ProductLabelNameListBean
{
private
String
id
;
private
String
name
;
private
String
foreignName
;
private
String
partnerId
;
List
<?>
productList
;
private
String
storeId
;
...
...
@@ -157,6 +165,8 @@ public class ProductListDto {
* 属性名称
*/
private
String
attributeName
;
private
String
attributeForeignName
;
/**
* 属性类型
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/StoreDeliveryInfoDto.java
View file @
87a1db7f
...
...
@@ -14,6 +14,7 @@ public class StoreDeliveryInfoDto {
private
String
storeId
;
private
String
storeName
;
private
String
storeNameEn
;
/**
* 门店是否可配送
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/product/AttributeValue.java
View file @
87a1db7f
...
...
@@ -30,6 +30,8 @@ public class AttributeValue {
private
String
attributeId
;
private
String
attributeValue
;
private
String
attributeForeignValue
;
/**
* 属性ID
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/product/GroupDetail.java
View file @
87a1db7f
...
...
@@ -23,6 +23,7 @@ public class GroupDetail {
private
Long
productFinalPrice
;
private
String
productId
;
private
String
productName
;
private
String
productForeignName
;
private
Long
productPrice
;
private
Integer
sequence
;
private
Integer
status
;
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/product/ProductAttributeGroup.java
View file @
87a1db7f
...
...
@@ -29,6 +29,8 @@ public class ProductAttributeGroup {
* 属性名称
*/
private
String
attributeName
;
private
String
attributeForeignName
;
/**
* 属性类型
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ActivityDiscountsDto.java
View file @
87a1db7f
...
...
@@ -19,6 +19,7 @@ public class ActivityDiscountsDto {
private
String
activityCode
;
private
String
activityName
;
private
String
activityForeignName
;
private
Integer
discountAmount
;
private
Integer
activityType
;
private
Integer
actualActivityGoodsNumber
;
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
87a1db7f
...
...
@@ -121,10 +121,12 @@ public class ShoppingCartGoodsDto {
* 商品的名称
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 如果是单品 skuName=spuName
*/
private
String
skuName
;
private
String
skuForeignName
;
/**
* 商品行原始价格
*/
...
...
@@ -163,6 +165,7 @@ public class ShoppingCartGoodsDto {
* 1.6.0 版本增加 分类名
*/
private
String
categoryName
;
private
String
categoryForeignName
;
/**
* 套餐--父级商品Id
...
...
@@ -191,6 +194,7 @@ public class ShoppingCartGoodsDto {
private
String
classificationId
;
private
String
classificationName
;
private
String
classificationForeignName
;
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
...
...
@@ -292,6 +296,7 @@ public class ShoppingCartGoodsDto {
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
/**
* 入机code
*/
...
...
@@ -304,10 +309,12 @@ public class ShoppingCartGoodsDto {
*/
public
String
getAttributeNames
()
{
String
extras
=
""
;
String
foreignExtras
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
this
.
extraList
))
{
extras
=
extraList
.
stream
().
map
(
CartGoodsDetailDto
.
CartGoodsExtra
::
getAttributeName
).
collect
(
Collectors
.
joining
(
"/"
));
foreignExtras
=
extraList
.
stream
().
map
(
CartGoodsDetailDto
.
CartGoodsExtra
::
getAttributeForeignName
).
collect
(
Collectors
.
joining
(
"/"
));
}
return
JSON
.
toJSONString
(
OrderProductAddInfo
.
builder
().
attributeNames
(
extras
).
build
());
return
JSON
.
toJSONString
(
OrderProductAddInfo
.
builder
().
attributeNames
(
extras
).
attributeForeignName
(
foreignExtras
).
build
());
}
}
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
View file @
87a1db7f
...
...
@@ -66,6 +66,8 @@ public class CreateOrderVo {
private
String
storeName
;
private
String
storeNameEn
;
//入参不需要传
private
String
storeAddress
;
...
...
@@ -319,6 +321,8 @@ public class CreateOrderVo {
@NotNull
(
message
=
"商品名称不能为空"
)
private
String
skuName
;
private
String
skuForeignName
;
@NotNull
(
message
=
"商品数量不能为空"
)
private
Integer
qty
;
...
...
@@ -350,6 +354,9 @@ public class CreateOrderVo {
* 属性名称
*/
private
String
attributeValue
;
private
String
attributeForeignValue
;
}
}
...
...
@@ -390,6 +397,9 @@ public class CreateOrderVo {
*/
private
String
goodsName
;
private
String
goodsForeignName
;
/**
* 赠送商品数量
*/
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
87a1db7f
...
...
@@ -43,6 +43,7 @@ import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIapp
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.application.sdk.api.base.BaseResponse
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest
;
import
com.freemud.application.sdk.api.membercenter.request.StatisticalPropertyRequest
;
...
...
@@ -624,6 +625,8 @@ public class CheckOrder {
if
(
this
.
isCollageOrder
(
createOrderVo
))
{
apportionResponse
=
shoppingCartClient
.
getCollageShoppingCartGoodsApportion
(
requestDto
);
}
else
{
log
.
info
(
JSONObject
.
toJSON
(
requestDto
));
apportionResponse
=
shoppingCartClient
.
getShoppingCartGoodsApportionNew
(
requestDto
);
}
...
...
@@ -724,6 +727,7 @@ public class CheckOrder {
storeDeliveryInfoDto
.
setPartnerId
(
storeResponseDto
.
getPartnerId
());
storeDeliveryInfoDto
.
setStoreId
(
storeResponseDto
.
getStoreCode
());
storeDeliveryInfoDto
.
setStoreName
(
storeResponseDto
.
getStoreName
());
storeDeliveryInfoDto
.
setStoreNameEn
(
storeResponseDto
.
getStoreNameEn
());
// 查询外卖配送信息
AssortmentOpenPlatformPartnerStoreDeliveryConfig
deliveryConfig
=
deliveryConfigManager
.
findByPartnerIdAndStoreCode
(
storeResponseDto
.
getPartnerId
(),
storeResponseDto
.
getStoreCode
());
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/ShoppingCartClient.java
View file @
87a1db7f
...
...
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"SHOPPING-CART-APPLICATION-SERVICE"
,
url
=
"
${saas.newshoppingcartclient.feign.url}
"
)
@FeignClient
(
name
=
"SHOPPING-CART-APPLICATION-SERVICE"
,
url
=
"
localhost:9211
"
)
//@FeignClient(name = "123",url = "http://localhost:9211")
@RequestMapping
(
value
=
"/shoppingCart"
,
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
ShoppingCartClient
{
...
...
order-application-service/src/main/resources/application.properties
View file @
87a1db7f
...
...
@@ -25,3 +25,6 @@ management.security.enabled=false
management.health.rabbit.enabled
=
false
mcCafe.partnerId
=
1206
eureka.client.enabled
=
false
\ No newline at end of file
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/CreateOrderRequest.java
View file @
87a1db7f
...
...
@@ -39,6 +39,8 @@ public class CreateOrderRequest extends BaseRequest {
//门店名
private
String
storeName
;
//门店名
private
String
storeNameEn
;
//门店全局唯一编号
private
String
storeUnifyId
;
...
...
@@ -193,6 +195,7 @@ public class CreateOrderRequest extends BaseRequest {
//订单商品信息
List
<
OrderItemCreateReq
>
orderItemList
;
//订单费用信息
List
<
OrderCostCreateReq
>
orderCostDetailList
;
...
...
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/OrderItemCreateReq.java
View file @
87a1db7f
...
...
@@ -45,6 +45,9 @@ public class OrderItemCreateReq {
//商品名称
private
String
productName
;
/**商品英文名**/
private
String
productForeignName
;
//商品序号
private
Integer
productSeq
;
...
...
@@ -54,6 +57,8 @@ public class OrderItemCreateReq {
//商品规格名称
private
String
productSpecName
;
private
String
productForeignSpecName
;
//商品UPC码
private
String
productUpc
;
...
...
shopping-cart-application-service/pom.xml
View file @
87a1db7f
...
...
@@ -35,7 +35,7 @@
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<artifactId>
productcenter-sdk
</artifactId>
<version>
3.7.6-
SNAPSHOT
</version>
<version>
4.0.2.
SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
...
...
@@ -45,7 +45,7 @@
<dependency>
<groupId>
cn.freemud
</groupId>
<artifactId>
assortment-shoppingcart-sdk
</artifactId>
<version>
1.2.3.RELEASE
</version>
<version>
1.2.3
_whh
.RELEASE
</version>
</dependency>
<!-- 再来一单查询订单信息 -->
<dependency>
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
87a1db7f
...
...
@@ -99,8 +99,10 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto
.
setTax
(
cartGoods
.
getTax
());
cartGoodsDetailDto
.
setSpuId
(
cartGoods
.
getSpuId
());
cartGoodsDetailDto
.
setSpuName
(
cartGoods
.
getSpuName
());
cartGoodsDetailDto
.
setSpuForeignName
(
cartGoods
.
getSpuForeignName
());
cartGoodsDetailDto
.
setSkuId
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuId
())
?
cartGoods
.
getSpuId
()
:
cartGoods
.
getSkuId
());
cartGoodsDetailDto
.
setSkuName
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuName
())
?
cartGoods
.
getSpuName
()
:
cartGoods
.
getSkuName
());
cartGoodsDetailDto
.
setSkuForeignName
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuForeignName
())
?
cartGoods
.
getSpuForeignName
()
:
cartGoods
.
getSkuForeignName
());
cartGoodsDetailDto
.
setOriginalPrice
(
cartGoods
.
getOriginalPrice
());
// cartGoodsDetailDto.setTotalDiscountAmount(0);
cartGoodsDetailDto
.
setUserId
(
cartGoods
.
getUserId
());
...
...
@@ -140,6 +142,7 @@ public class ShoppingCartConvertAdapter {
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
goods
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
();
goods
.
setSpuId
(
materialGoods
.
getSpuId
());
goods
.
setSpuName
(
materialGoods
.
getSpuName
());
goods
.
setSpuForeignName
(
materialGoods
.
getSpuForeignName
());
goods
.
setOriginalPrice
(
materialGoods
.
getOriginalPrice
());
goods
.
setSalePrice
(
materialGoods
.
getFinalPrice
());
goods
.
setCustomerCode
(
materialGoods
.
getCustomerCode
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/CheckSpqInfoResponseDto.java
View file @
87a1db7f
...
...
@@ -10,7 +10,9 @@ public class CheckSpqInfoResponseDto {
private
String
spuId
;
private
String
skuId
;
private
String
spuName
;
private
String
spuForeignName
;
private
String
skuName
;
private
String
skuForeignName
;
/**
* 活动名称
*/
...
...
@@ -32,6 +34,7 @@ public class CheckSpqInfoResponseDto {
private
String
picture
;
private
String
defaultSpecId
;
private
String
defaultSpecName
;
private
String
defaultForeignSpecName
;
/**
* 券商品类型 : 0 -> 商品券,4,换购券
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMenuResponseDto.java
View file @
87a1db7f
...
...
@@ -133,6 +133,7 @@ public class GetMenuResponseDto {
*/
private
Integer
isSkuProduct
;
private
String
name
;
private
String
foreignName
;
/**
* 原始价格 单位分
*/
...
...
@@ -143,6 +144,7 @@ public class GetMenuResponseDto {
private
Long
packPrice
;
private
String
picture
;
private
Double
weight
;
private
String
pid
;
private
Integer
pknumber
;
private
String
productionLocation
;
...
...
@@ -187,6 +189,7 @@ public class GetMenuResponseDto {
private
Long
finalPrice
;
private
Long
originalPrice
;
private
String
productName
;
private
String
foreignProductName
;
private
Integer
productType
;
private
Integer
sequence
;
private
String
skuCode
;
...
...
@@ -207,7 +210,9 @@ public class GetMenuResponseDto {
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
String
foreignSpecName
;
private
String
specValue
;
private
String
foreignSpecValue
;
private
String
specValueId
;
}
}
...
...
@@ -219,6 +224,7 @@ public class GetMenuResponseDto {
private
Integer
sequence
;
private
String
specId
;
private
String
specName
;
private
String
foreignSpecName
;
private
List
<
SpecValueVo
>
specValueVos
;
@NoArgsConstructor
...
...
@@ -227,6 +233,7 @@ public class GetMenuResponseDto {
private
Integer
sequence
;
private
String
specId
;
private
String
specValue
;
private
String
foreignSpecValue
;
private
String
specValueId
;
}
}
...
...
@@ -236,6 +243,7 @@ public class GetMenuResponseDto {
public
static
class
ProductLabelNameListBean
{
private
String
id
;
private
String
name
;
private
String
foreignName
;
private
String
partnerId
;
List
<?>
productList
;
private
String
storeId
;
...
...
@@ -255,6 +263,10 @@ public class GetMenuResponseDto {
* 属性名称
*/
private
String
attributeName
;
private
String
foreignAttributeName
;
/**
* 属性类型
*/
...
...
@@ -280,6 +292,8 @@ public class GetMenuResponseDto {
private
String
attributeId
;
private
String
attributeValue
;
private
String
foreignAttributeValue
;
/**
* 属性ID
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OrderProductAddInfo.java
View file @
87a1db7f
...
...
@@ -11,6 +11,8 @@ public class OrderProductAddInfo {
* 属性名称 多糖/冷/常温
*/
private
String
attributeNames
;
private
String
attributeForeignNames
;
/**
* 活动商品集合
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
87a1db7f
...
...
@@ -158,10 +158,13 @@ public class ShoppingCartGoodsDto {
* 商品的名称
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 如果是单品 skuName=spuName
*/
private
String
skuName
;
private
String
skuForeignName
;
/**
* 商品行原始价格(单价)
*/
...
...
@@ -291,6 +294,7 @@ public class ShoppingCartGoodsDto {
*/
private
String
classificationName
;
/**
* 税率代码
*/
...
...
@@ -331,6 +335,7 @@ public class ShoppingCartGoodsDto {
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
}
@Data
...
...
@@ -340,6 +345,7 @@ public class ShoppingCartGoodsDto {
*/
private
String
spuId
;
private
String
spuName
;
private
String
spuForeignName
;
/**
* 商品行记录:当前元售价
*/
...
...
@@ -371,10 +377,13 @@ public class ShoppingCartGoodsDto {
*/
public
String
getAttributeNames
()
{
String
extras
=
""
;
String
foreignExtras
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
this
.
extraList
))
{
extras
=
extraList
.
stream
().
map
(
CartGoodsDetailDto
.
CartGoodsExtra
::
getAttributeName
).
collect
(
Collectors
.
joining
(
"/"
));
foreignExtras
=
extraList
.
stream
().
map
(
CartGoodsDetailDto
.
CartGoodsExtra
::
getAttributeForeignName
).
collect
(
Collectors
.
joining
(
"/"
));
}
return
JSON
.
toJSONString
(
OrderProductAddInfo
.
builder
().
attributeNames
(
extras
).
build
());
return
JSON
.
toJSONString
(
OrderProductAddInfo
.
builder
().
attributeNames
(
extras
).
attributeForeignNames
(
foreignExtras
).
build
());
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
87a1db7f
...
...
@@ -140,19 +140,37 @@ public class CartGoods {
private
String
name
;
/**
* 购物车一行商品英文名称
*/
private
String
foreignName
;
/**
* 商品的spuName
*/
private
String
spuName
;
/**
* 商品的spuForeignName
*/
private
String
spuForeignName
;
/**
* 商品的skuName
*/
private
String
skuName
;
/**
* skuForeignName
*/
private
String
skuForeignName
;
/**
* 购物车一行商品的副名称
*/
private
String
subName
;
/**
* 购物车一行商品的英文副名称
*/
private
String
subForeignName
;
/**
* 商品图片URL
*/
...
...
@@ -274,6 +292,7 @@ public class CartGoods {
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
}
@Data
...
...
@@ -286,6 +305,8 @@ public class CartGoods {
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
/**
* 麦咖啡特定属性入机code
...
...
@@ -302,6 +323,7 @@ public class CartGoods {
private
String
spuId
;
private
String
skuId
;
private
String
skuName
;
private
String
skuForeignName
;
/**
* 所有属性attributeId的拼接
*/
...
...
@@ -338,14 +360,18 @@ public class CartGoods {
*/
private
String
name
;
private
String
foreignName
;
/**
* 商品的spuName
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 购物车一行商品的副名称
*/
private
String
subName
;
private
String
subForeignName
;
/**
* 商品图片URL
*/
...
...
@@ -555,6 +581,8 @@ public class CartGoods {
* 加料名称
*/
private
String
spuName
;
private
String
spuForeignName
;
/**
* 购物车一行商品的原单价
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
View file @
87a1db7f
...
...
@@ -2,30 +2,39 @@ package cn.freemud.service.impl;
import
ch.qos.logback.classic.Level
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.entities.dto.GetProductInfoDto
;
import
cn.freemud.entities.dto.ProductInfosDto
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ShoppingCartGoodsBaseResponseVo
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.thirdparty.StoreItemClient
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
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.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest
;
import
com.freemud.sdk.api.assortment.shoppingcart.request.GetProductInfoRequest
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
cn.freemud.entities.dto.GetMenuResponseDto.DataBean.RootNodeBean.ChildrenBeanFirst.ChildrenBeanSecond.ProductBean
;
import
javax.naming.Name
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* All rights Reserved, Designed By www.freemud.cn
...
...
@@ -42,6 +51,9 @@ import java.util.List;
@Service
public
class
AssortmentSdkService
{
@Autowired
StoreItemClient
storeItemClient
;
/**
* 调用聚合sdk获取单个商品行信息
*
...
...
@@ -244,6 +256,38 @@ public class AssortmentSdkService {
return
baseResponse
.
getResult
();
}
/**
* 调用获取商品详情
*
* @param partnerId
* @param storeId
* @param goodsIds
* @return
*/
public
List
<
ProductBean
>
getProductsInfo
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
String
menuType
,
ShoppingCartBaseService
shoppingCartService
)
{
//移除空的goodsId及spq的商品券
goodsIds
=
goodsIds
.
parallelStream
().
filter
(
StringUtils:
:
isNotEmpty
).
filter
(
goodsId
->
!
goodsId
.
startsWith
(
CommonsConstant
.
COUPON_PREFIX
)).
collect
(
Collectors
.
toList
());
GetProductInfoDto
getProductInfoDto
=
new
GetProductInfoDto
();
getProductInfoDto
.
setPartnerId
(
partnerId
);
getProductInfoDto
.
setShopId
(
storeId
);
getProductInfoDto
.
setProductInfoType
(
2
);
getProductInfoDto
.
setProductIds
(
goodsIds
);
getProductInfoDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
());
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
productInfosDto
.
getErrcode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
ApiLog
.
info
(
"查询商品信息失败,getProductInfoDto,baseResponse"
,
getProductInfoDto
,
productInfosDto
);
return
null
;
}
return
productInfosDto
.
getData
().
getProducts
();
}
/**
* 组装CartParamDto信息
*
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
87a1db7f
...
...
@@ -95,6 +95,7 @@ import java.util.*;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
cn.freemud.entities.dto.GetMenuResponseDto.DataBean.RootNodeBean.ChildrenBeanFirst.ChildrenBeanSecond.ProductBean
;
import
static
cn
.
freemud
.
constant
.
ApplicationConstant
.*;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_INVALIAD_GOODS
;
...
...
@@ -304,11 +305,19 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
,
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
(),
couponProductDto
);
}
}
// // 获取商品详细信息
// List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId
// , Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getMenuType(), this.shoppingCartBaseService);
// LogUtil.info("productBeanListSpuClass", spuId2,JSON.toJSONString(productBeanListSpuClass));
// 获取商品详细信息
List
<
ProductBean
DTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
List
<
ProductBean
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfo
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
getMenuType
(),
this
.
shoppingCartBaseService
);
LogUtil
.
info
(
"productBeanListSpuClass"
,
spuId2
,
JSON
.
toJSONString
(
productBeanListSpuClass
));
//缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样
List
<
CartGoods
>
allCartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
addShoppingCartGoodsRequestVo
.
getSessionId
(),
null
,
shoppingCartBaseService
);
...
...
@@ -1691,7 +1700,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
private
void
addProductGoods
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
CartGoods
cartGoods
,
String
spuId2
,
String
userId
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
String
spuId
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
DTO
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
)
{
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
)
{
// 商品券商品list
List
<
CartGoods
>
tmpCartGoods
=
allCartGoodsList
.
parallelStream
().
filter
(
k
->
k
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
)).
collect
(
Collectors
.
toList
());
// 当已有商品券时,不得添加(暂时的限制)
...
...
@@ -1722,7 +1731,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
&&
productBeanListSpuClass
.
get
(
0
).
getStockLimit
()
==
1
)
{
stockLimit
=
true
;
}
else
{
for
(
ProductBean
DTO
.
SkuProductBean
skuProductBean
:
productBeanListSpuClass
.
get
(
0
).
getSkuList
())
{
for
(
ProductBean
.
SkuProductBean
skuProductBean
:
productBeanListSpuClass
.
get
(
0
).
getSkuList
())
{
if
(
spuId2
.
equals
(
skuProductBean
.
getSkuId
())
&&
skuProductBean
.
getStockLimit
()
==
1
)
{
stockLimit
=
true
;
break
;
...
...
@@ -1753,7 +1762,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* @param skuId
*/
private
void
queryManyGoodsStocks
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
List
<
Long
>
productIds
,
List
<
ProductBean
DTO
>
productBeanListSpuClass
,
String
skuId
,
Integer
qty
)
{
,
List
<
ProductBean
>
productBeanListSpuClass
,
String
skuId
,
Integer
qty
)
{
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
());
requestDto
.
setPartnerId
(
addShoppingCartGoodsRequestVo
.
getPartnerId
());
...
...
@@ -1764,7 +1773,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
&&
productBeanListSpuClass
.
get
(
0
).
getStockLimit
()
==
1
)
{
availableStocks
=
stockClient
.
getAvailableStocks
(
requestDto
);
}
else
{
for
(
ProductBean
DTO
.
SkuProductBean
skuProductBean
:
productBeanListSpuClass
.
get
(
0
).
getSkuList
())
{
for
(
ProductBean
.
SkuProductBean
skuProductBean
:
productBeanListSpuClass
.
get
(
0
).
getSkuList
())
{
if
(
skuId
.
equals
(
skuProductBean
.
getSkuId
())
&&
skuProductBean
.
getStockLimit
()
==
1
)
{
availableStocks
=
stockClient
.
getAvailableStocks
(
requestDto
);
break
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
87a1db7f
...
...
@@ -330,8 +330,11 @@ public class CalculationCommonService {
cartGoodsDetailDto
.
setTax
(
cartGoods
.
getTax
());
cartGoodsDetailDto
.
setSpuId
(
cartGoods
.
getSpuId
());
cartGoodsDetailDto
.
setSpuName
(
cartGoods
.
getSpuName
());
cartGoodsDetailDto
.
setSpuForeignName
(
cartGoods
.
getSpuForeignName
());
cartGoodsDetailDto
.
setSkuId
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuId
())
?
cartGoods
.
getSpuId
()
:
cartGoods
.
getSkuId
());
cartGoodsDetailDto
.
setSkuName
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuName
())
?
cartGoods
.
getSpuName
()
:
cartGoods
.
getSkuName
());
cartGoodsDetailDto
.
setSkuForeignName
(
StringUtils
.
isEmpty
(
cartGoods
.
getSkuForeignName
())
?
cartGoods
.
getSpuForeignName
()
:
cartGoods
.
getSkuForeignName
());
cartGoodsDetailDto
.
setOriginalPrice
(
cartGoods
.
getOriginalPrice
());
cartGoodsDetailDto
.
setSalePrice
(
cartGoods
.
getOriginalPrice
());
cartGoodsDetailDto
.
setPicture
(
cartGoods
.
getPic
());
...
...
@@ -391,6 +394,7 @@ public class CalculationCommonService {
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
goods
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
();
goods
.
setSpuId
(
mg
.
getSpuId
());
goods
.
setSpuName
(
mg
.
getSpuName
());
goods
.
setSpuForeignName
(
mg
.
getSpuForeignName
());
goods
.
setSalePrice
(
mg
.
getFinalPrice
());
goods
.
setQty
(
cartGoods
.
getQty
());
goods
.
setCustomerCode
(
cartGoods
.
getCustomerCode
());
...
...
@@ -469,8 +473,11 @@ public class CalculationCommonService {
ShoppingCartGoodsDto
.
CartGoodsDetailDto
com
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
com
.
setSpuId
(
comb
.
getGoodsId
());
com
.
setSpuName
(
comb
.
getSpuName
());
com
.
setSpuForeignName
(
comb
.
getSpuForeignName
());
com
.
setSkuId
(
comb
.
getGoodsId
());
com
.
setSkuName
(
StringUtils
.
isEmpty
(
comb
.
getSkuName
())
?
com
.
getSpuName
()
:
com
.
getSkuName
());
com
.
setSkuForeignName
(
StringUtils
.
isEmpty
(
comb
.
getSkuForeignName
())
?
com
.
getSpuForeignName
()
:
com
.
getSkuForeignName
());
com
.
setPicture
(
comb
.
getPic
());
com
.
setProductType
(
comb
.
isWeightType
()
?
ProductType
.
WEIGHT_PRODUCT
.
getCode
()
:
ProductType
.
SETMEAL
.
getCode
());
com
.
setParentProductId
(
cartGoods
.
getGoodsId
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
View file @
87a1db7f
...
...
@@ -141,8 +141,10 @@ public class CouponSharingService {
cartGoods
.
setQty
(
1
);
cartGoods
.
setCouponCode
(
checkSpqInfoResponseDto
.
getCouponCode
());
cartGoods
.
setSpuName
(
checkSpqInfoResponseDto
.
getSpuName
());
cartGoods
.
setSpuForeignName
(
checkSpqInfoResponseDto
.
getSpuForeignName
());
cartGoods
.
setSpecProductId
(
checkSpqInfoResponseDto
.
getDefaultSpecId
());
cartGoods
.
setSubName
(
checkSpqInfoResponseDto
.
getDefaultSpecName
());
cartGoods
.
setSubForeignName
(
checkSpqInfoResponseDto
.
getDefaultForeignSpecName
());
cartGoods
.
setExtra
(
checkSpqInfoResponseDto
.
getExtras
());
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
discountGoods
=
discountResult
.
getGoods
()
...
...
shopping-cart-application-service/src/main/resources/application.properties
View file @
87a1db7f
...
...
@@ -22,3 +22,5 @@ management.metrics.tags.application=${spring.application.name}
management.endpoint.shutdown.enabled
=
true
management.security.enabled
=
false
management.health.rabbit.enabled
=
false
eureka.client.enabled
=
false
\ No newline at end of file
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