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
4fcc0db1
Commit
4fcc0db1
authored
Dec 15, 2020
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
餐具商品
parent
7cf8e9e4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
58 additions
and
1 deletions
+58
-1
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+8
-1
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+4
-0
order-application-service/src/main/java/cn/freemud/entities/vo/ProductVo.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+24
-0
shopping-cart-application-service/src/main/resources/application.properties
+2
-0
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
4fcc0db1
...
@@ -2122,6 +2122,9 @@ public class OrderAdapter {
...
@@ -2122,6 +2122,9 @@ public class OrderAdapter {
//套餐
//套餐
productVo
.
setParentProductId
(
productBean
.
getParentProductId
());
productVo
.
setParentProductId
(
productBean
.
getParentProductId
());
productVo
.
setProductType
(
productBean
.
getProductType
());
productVo
.
setProductType
(
productBean
.
getProductType
());
if
(
ProductTypeEnum
.
TABLEWARE_PRODUCT
.
getCode
().
equals
(
productBean
.
getProductType
()))
{
productVo
.
setIsTableware
(
true
);
}
productVo
.
setUnit
(
productBean
.
getUnit
());
productVo
.
setUnit
(
productBean
.
getUnit
());
productVo
.
setWeight
(
productBean
.
getWeight
()
!=
null
?
productBean
.
getWeight
().
doubleValue
()
:
0
);
productVo
.
setWeight
(
productBean
.
getWeight
()
!=
null
?
productBean
.
getWeight
().
doubleValue
()
:
0
);
return
productVo
;
return
productVo
;
...
@@ -2438,7 +2441,11 @@ public class OrderAdapter {
...
@@ -2438,7 +2441,11 @@ public class OrderAdapter {
createOrderProductDemoDto
.
setPicture
(
cartGoodsDetailDto
.
getPicture
());
createOrderProductDemoDto
.
setPicture
(
cartGoodsDetailDto
.
getPicture
());
createOrderProductDemoDto
.
setAddInfo
(
cartGoodsDetailDto
.
getAttributeNames
());
createOrderProductDemoDto
.
setAddInfo
(
cartGoodsDetailDto
.
getAttributeNames
());
createOrderProductDemoDto
.
setDiscountId
(
cartGoodsDetailDto
.
getCouponCode
());
createOrderProductDemoDto
.
setDiscountId
(
cartGoodsDetailDto
.
getCouponCode
());
createOrderProductDemoDto
.
setProductType
(
productType
);
if
(!
cartGoodsDetailDto
.
getIsTableware
())
{
createOrderProductDemoDto
.
setProductType
(
productType
);
}
else
{
createOrderProductDemoDto
.
setProductType
(
ProductTypeEnum
.
TABLEWARE_PRODUCT
.
getCode
());
}
createOrderProductDemoDto
.
setParentProductId
(
cartGoodsDetailDto
.
getParentProductId
());
createOrderProductDemoDto
.
setParentProductId
(
cartGoodsDetailDto
.
getParentProductId
());
createOrderProductDemoDto
.
setIsFixedProduct
(
cartGoodsDetailDto
.
getIsFixedProduct
());
createOrderProductDemoDto
.
setIsFixedProduct
(
cartGoodsDetailDto
.
getIsFixedProduct
());
createOrderProductDemoDto
.
setCustomerCode
(
cartGoodsDetailDto
.
getCustomerCode
());
createOrderProductDemoDto
.
setCustomerCode
(
cartGoodsDetailDto
.
getCustomerCode
());
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
4fcc0db1
...
@@ -197,6 +197,10 @@ public class ShoppingCartGoodsDto {
...
@@ -197,6 +197,10 @@ public class ShoppingCartGoodsDto {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableware
=
false
;
/**
* 商品重量
* 商品重量
*/
*/
private
Double
weight
;
private
Double
weight
;
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/ProductVo.java
View file @
4fcc0db1
...
@@ -128,6 +128,11 @@ public class ProductVo {
...
@@ -128,6 +128,11 @@ public class ProductVo {
private
Integer
productType
;
private
Integer
productType
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableware
=
false
;
/**
* 商品单位
* 商品单位
*/
*/
private
String
unit
;
private
String
unit
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
4fcc0db1
...
@@ -33,6 +33,7 @@ import com.google.common.collect.Lists;
...
@@ -33,6 +33,7 @@ import com.google.common.collect.Lists;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.*
;
...
@@ -45,6 +46,9 @@ public class ShoppingCartConvertAdapter {
...
@@ -45,6 +46,9 @@ public class ShoppingCartConvertAdapter {
private
static
final
String
ATTRIBUTEID
=
"attributeId"
;
private
static
final
String
ATTRIBUTEID
=
"attributeId"
;
private
static
final
String
ATTRIBUTENAME
=
"attributeName"
;
private
static
final
String
ATTRIBUTENAME
=
"attributeName"
;
@Value
(
"${mccafe.tableware.skuId}"
)
private
String
mcCafeTablewareSkuId
;
public
ShoppingCartGoodsDto
.
CartGoodsDetailDto
getCartGoodsDetailDto
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
,
GetProductsVo
getProductsVo
,
String
goodsId
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
sendGoods
)
{
public
ShoppingCartGoodsDto
.
CartGoodsDetailDto
getCartGoodsDetailDto
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
,
GetProductsVo
getProductsVo
,
String
goodsId
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
sendGoods
)
{
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
cartGoodsDetailDto
.
setOriginalPrice
(
getProductsVo
.
getFinalPrice
());
cartGoodsDetailDto
.
setOriginalPrice
(
getProductsVo
.
getFinalPrice
());
...
@@ -119,6 +123,9 @@ public class ShoppingCartConvertAdapter {
...
@@ -119,6 +123,9 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto
.
setSpecialExtra
(
cartGoods
.
getSpecialExtra
());
cartGoodsDetailDto
.
setSpecialExtra
(
cartGoods
.
getSpecialExtra
());
cartGoodsDetailDto
.
setClassificationId
(
cartGoods
.
getClassificationId
());
cartGoodsDetailDto
.
setClassificationId
(
cartGoods
.
getClassificationId
());
cartGoodsDetailDto
.
setClassificationName
(
cartGoods
.
getClassificationName
());
cartGoodsDetailDto
.
setClassificationName
(
cartGoods
.
getClassificationName
());
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoods
.
getSkuId
()))
{
cartGoodsDetailDto
.
setIsTableWare
(
true
);
}
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
())
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
4fcc0db1
...
@@ -218,6 +218,10 @@ public class ShoppingCartGoodsDto {
...
@@ -218,6 +218,10 @@ public class ShoppingCartGoodsDto {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableWare
=
false
;
/**
* 商品货号
* 商品货号
*/
*/
private
String
productCode
;
private
String
productCode
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
4fcc0db1
...
@@ -164,6 +164,10 @@ public class CartGoods {
...
@@ -164,6 +164,10 @@ public class CartGoods {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableWare
=
false
;
/**
* 第三方商品编码
* 第三方商品编码
*/
*/
private
String
customerCode
;
private
String
customerCode
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
4fcc0db1
...
@@ -119,6 +119,8 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -119,6 +119,8 @@ public class ShoppingCartMCoffeeServiceImpl {
private
String
mcCafeUniversalCouponCode
;
private
String
mcCafeUniversalCouponCode
;
@Value
(
"${mccafe.pay.card.fee}"
)
@Value
(
"${mccafe.pay.card.fee}"
)
private
String
payCardFee
;
private
String
payCardFee
;
@Value
(
"${mccafe.tableware.skuId}"
)
private
String
mcCafeTablewareSkuId
;
/**
/**
* 添加商品、超值加购、商品券
* 添加商品、超值加购、商品券
...
@@ -169,6 +171,13 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -169,6 +171,13 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
oldCartGoodsList
=
new
ArrayList
<>();
oldCartGoodsList
=
new
ArrayList
<>();
}
}
if
(
mcCafeTablewareSkuId
.
equals
(
skuId
))
{
for
(
CartGoods
cartGoods
:
oldCartGoodsList
)
{
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoods
.
getSkuId
()))
{
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_ADD_ERROR
.
getCode
(),
"不能重复添加餐具商品"
);
}
}
}
//商品券已添加情况校验
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
...
@@ -1391,6 +1400,21 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1391,6 +1400,21 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isNotEmpty
(
reduceGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
reduceGoods
))
{
allCartGoodsList
.
addAll
(
reduceGoods
);
allCartGoodsList
.
addAll
(
reduceGoods
);
}
}
//如果是餐具商品,则放到最后
if
(
CollectionUtils
.
isNotEmpty
(
allCartGoodsList
))
{
int
size
=
allCartGoodsList
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
if
(
allCartGoodsList
.
get
(
i
).
getSkuId
().
equals
(
mcCafeTablewareSkuId
)
&&
i
!=
size
-
1
)
{
CartGoods
cartGoods
=
allCartGoodsList
.
get
(
i
);
cartGoods
.
setIsTableWare
(
true
);
allCartGoodsList
.
remove
(
i
);
allCartGoodsList
.
add
(
cartGoods
);
i
--;
}
}
}
return
allCartGoodsList
;
return
allCartGoodsList
;
}
}
...
...
shopping-cart-application-service/src/main/resources/application.properties
View file @
4fcc0db1
...
@@ -24,3 +24,4 @@ management.security.enabled=false
...
@@ -24,3 +24,4 @@ management.security.enabled=false
management.health.rabbit.enabled
=
false
management.health.rabbit.enabled
=
false
mccafe.tableware.skuId
=
12345
\ 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