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
91f03854
Commit
91f03854
authored
Oct 29, 2020
by
chongfu.liang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
24124486
be564409
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
109 additions
and
23 deletions
+109
-23
assortment-ordercenter-sdk/pom.xml
+1
-1
assortment-ordercenter-sdk/readme.md
+3
-2
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/adapter/OrderSdkAdapter.java
+1
-1
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
+23
-0
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+12
-8
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+8
-10
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
+60
-0
No files found.
assortment-ordercenter-sdk/pom.xml
View file @
91f03854
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
assortment-ordercenter-sdk
</artifactId>
<version>
2.0.
19
-SNAPSHOT
</version>
<version>
2.0.
20
-SNAPSHOT
</version>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
assortment-ordercenter-sdk/readme.md
View file @
91f03854
...
...
@@ -85,4 +85,5 @@
| 2.0.14-SNAPSHOT| 商品统计分类名称保存 | wuping | 2020-08-20 |
| 2.0.15-SNAPSHOT| 升级ordercenter-sdk | 肖家炜 | 2020-08-25 |
| 2.0.16-SNAPSHOT| 升级ordercenter-sdk,麦咖啡汇集回调 | 徐康 | 2020-09-02 |
| 2.0.17-SNAPSHOT| 升级ordercenter-sdk,麦咖啡加料 | 徐康 | 2020-09-28 |
\ No newline at end of file
| 2.0.17-SNAPSHOT| 升级ordercenter-sdk,麦咖啡加料 | 徐康 | 2020-09-28 |
| 2.0.20-SNAPSHOT| 麦咖啡p3v1 | 徐康 | 2020-10-29 |
\ No newline at end of file
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/adapter/OrderSdkAdapter.java
View file @
91f03854
...
...
@@ -2620,6 +2620,7 @@ public class OrderSdkAdapter {
return
originalAmount
;
}
Integer
index
=
1
;
Integer
comboIndex
=
1
;
for
(
CreateOrderProductRequest
productRequest
:
products
)
{
// 普通商品 订单转换
productRequest
.
setOpid
(
index
);
...
...
@@ -2629,7 +2630,6 @@ public class OrderSdkAdapter {
// 父类商品productId=productId+seq
String
parentProductId
=
productRequest
.
getProductId
()
+
"_"
+
index
;
if
(
CollectionUtils
.
isNotEmpty
(
productRequest
.
getComboProduct
()))
{
Integer
comboIndex
=
1
;
for
(
CreateOrderProductRequest
combo
:
productRequest
.
getComboProduct
())
{
combo
.
setOpid
(
comboIndex
);
updateOrderItemAndSettlement
(
orderItemList
,
orderSettlementCreateReqList
,
combo
,
partnerId
,
parentProductId
,
false
);
...
...
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
View file @
91f03854
...
...
@@ -254,12 +254,35 @@ public class DeliveryAdapter {
deliveryComboProductInfo
.
setParentCode
(
Long
.
valueOf
(
comboProduct
.
getParentProductId
().
replace
(
"_"
,
""
)));
deliveryProductInfo
.
setProductCode
(
deliveryComboProductInfo
.
getParentCode
()+
""
);
if
(
CollectionUtils
.
isNotEmpty
(
comboProduct
.
getMaterialProduct
()))
{
comboProduct
.
getMaterialProduct
().
forEach
(
o
->
{
deliveryComboProductInfo
.
setProductPrice
(
deliveryComboProductInfo
.
getProductPrice
()
+
o
.
getSalePrice
().
intValue
());
//餐道使用
deliveryComboProductInfo
.
setCumulatedTotal
(
deliveryComboProductInfo
.
getCumulatedTotal
()
+
comboProduct
.
getNumber
()
*
o
.
getSalePrice
().
intValue
());
deliveryProductInfo
.
setProductPrice
(
deliveryProductInfo
.
getProductPrice
()
+
o
.
getSalePrice
().
intValue
());
//餐道使用
deliveryProductInfo
.
setCumulatedTotal
(
deliveryProductInfo
.
getCumulatedTotal
()
+
comboProduct
.
getNumber
()
*
o
.
getSalePrice
().
intValue
());
});
}
productInfos
.
add
(
deliveryComboProductInfo
);
});
}
if
(
CollectionUtils
.
isNotEmpty
(
productList
.
getMaterialProduct
()))
{
productList
.
getMaterialProduct
().
forEach
(
o
->
{
deliveryProductInfo
.
setProductPrice
(
deliveryProductInfo
.
getProductPrice
()
+
o
.
getSalePrice
().
intValue
());
//餐道使用
deliveryProductInfo
.
setCumulatedTotal
(
deliveryProductInfo
.
getCumulatedTotal
()
+
productList
.
getNumber
()
*
o
.
getSalePrice
().
intValue
());
});
}
});
deliveryOrderRequestDto
.
setProductTotal
(
productInfos
.
stream
().
mapToInt
(
t
->
t
.
getCumulatedTotal
()).
sum
());
}
deliveryOrderRequestDto
.
setProductInfos
(
productInfos
);
deliveryOrderRequestDto
.
setOrderSource
(
OrderSourceType
.
ALIPAY
.
getCode
().
equals
(
order
.
getSource
())?
"Alipay"
:
"freemud"
);
if
(
CollectionUtils
.
isNotEmpty
(
order
.
getAccountList
()))
{
...
...
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
91f03854
...
...
@@ -1950,11 +1950,13 @@ public class OrderAdapter {
List
<
ProductVo
>
setMaterialProducts
=
new
ArrayList
<>();
product
.
getMaterialProduct
().
forEach
(
materialProduct
->
{
ProductVo
material
=
convent2ProductVo
(
materialProduct
);
material
.
setOriginalTotalAmount
(
new
BigDecimal
(
material
.
getOriginalPrice
()).
multiply
(
new
BigDecimal
(
productVo
.
getQty
())).
longValue
());
material
.
setSaleTotalAmount
(
new
BigDecimal
(
material
.
getFinalPrice
()).
multiply
(
new
BigDecimal
(
productVo
.
getQty
())).
longValue
());
setMaterialProducts
.
add
(
material
);
productVo
.
setOriginalPrice
(
new
BigDecimal
(
productVo
.
getOriginalPrice
()).
subtract
(
new
BigDecimal
(
material
.
getOriginalPrice
())).
longValue
());
productVo
.
setFinalPrice
(
new
BigDecimal
(
productVo
.
getFinalPrice
()).
subtract
(
new
BigDecimal
(
material
.
getFinalPrice
())).
longValue
());
productVo
.
setOriginalTotalAmount
(
new
BigDecimal
(
productVo
.
getOriginalTotalAmount
()).
subtract
(
new
BigDecimal
(
material
.
getOriginalTotalAmount
())).
longValue
());
productVo
.
setSaleTotalAmount
(
new
BigDecimal
(
productVo
.
getSaleTotalAmount
()).
subtract
(
new
BigDecimal
(
product
.
getSettlementPrice
())).
longValue
());
productVo
.
setOriginalPrice
(
new
BigDecimal
(
productVo
.
getOriginalPrice
()).
add
(
new
BigDecimal
(
material
.
getOriginalPrice
())).
longValue
());
productVo
.
setFinalPrice
(
new
BigDecimal
(
productVo
.
getFinalPrice
()).
add
(
new
BigDecimal
(
material
.
getFinalPrice
())).
longValue
());
productVo
.
setOriginalTotalAmount
(
new
BigDecimal
(
productVo
.
getOriginalTotalAmount
()).
add
(
new
BigDecimal
(
material
.
getOriginalTotalAmount
())).
longValue
());
productVo
.
setSaleTotalAmount
(
new
BigDecimal
(
productVo
.
getSaleTotalAmount
()).
add
(
new
BigDecimal
(
material
.
getSaleTotalAmount
())).
longValue
());
});
comboProduct
.
setSetMaterialProducts
(
setMaterialProducts
);
}
...
...
@@ -1966,11 +1968,13 @@ public class OrderAdapter {
List
<
ProductVo
>
setMaterialProducts
=
new
ArrayList
<>();
productBean
.
getMaterialProduct
().
forEach
(
product
->
{
ProductVo
material
=
convent2ProductVo
(
product
);
material
.
setOriginalTotalAmount
(
new
BigDecimal
(
material
.
getOriginalPrice
()).
multiply
(
new
BigDecimal
(
productVo
.
getQty
())).
longValue
());
material
.
setSaleTotalAmount
(
new
BigDecimal
(
material
.
getFinalPrice
()).
multiply
(
new
BigDecimal
(
productVo
.
getQty
())).
longValue
());
setMaterialProducts
.
add
(
material
);
productVo
.
setOriginalPrice
(
new
BigDecimal
(
productVo
.
getOriginalPrice
()).
subtract
(
new
BigDecimal
(
material
.
getOriginalPrice
())).
longValue
());
productVo
.
setFinalPrice
(
new
BigDecimal
(
productVo
.
getFinalPrice
()).
subtract
(
new
BigDecimal
(
material
.
getFinalPrice
())).
longValue
());
productVo
.
setOriginalTotalAmount
(
new
BigDecimal
(
productVo
.
getOriginalTotalAmount
()).
subtract
(
new
BigDecimal
(
material
.
getOriginalTotalAmount
())).
longValue
());
productVo
.
setSaleTotalAmount
(
new
BigDecimal
(
productVo
.
getSaleTotalAmount
()).
subtract
(
new
BigDecimal
(
product
.
getSettlementPrice
())).
longValue
());
productVo
.
setOriginalPrice
(
new
BigDecimal
(
productVo
.
getOriginalPrice
()).
add
(
new
BigDecimal
(
material
.
getOriginalPrice
())).
longValue
());
productVo
.
setFinalPrice
(
new
BigDecimal
(
productVo
.
getFinalPrice
()).
add
(
new
BigDecimal
(
material
.
getFinalPrice
())).
longValue
());
productVo
.
setOriginalTotalAmount
(
new
BigDecimal
(
productVo
.
getOriginalTotalAmount
()).
add
(
new
BigDecimal
(
material
.
getOriginalTotalAmount
())).
longValue
());
productVo
.
setSaleTotalAmount
(
new
BigDecimal
(
productVo
.
getSaleTotalAmount
()).
add
(
new
BigDecimal
(
material
.
getSaleTotalAmount
())).
longValue
());
});
productVo
.
setSetMaterialProducts
(
setMaterialProducts
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
91f03854
...
...
@@ -463,7 +463,7 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
String
>
couponCodes
=
new
ArrayList
<>();
couponCodes
.
add
(
deliveryFeeCoupon
);
couponCodes
.
add
(
moneyCoupon
);
List
<
CouponAvailableReq
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
List
<
CouponAvailableReq
ByCart
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
return
ResponseUtil
.
success
(
resList
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
91f03854
...
...
@@ -11,10 +11,7 @@ import cn.freemud.enums.*;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.CommonService
;
import
cn.freemud.service.impl.ItemServiceImpl
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp
;
import
cn.freemud.service.impl.mcoffee.entity.CouponProductVo
;
import
cn.freemud.service.impl.mcoffee.entity.CouponState
;
import
cn.freemud.service.impl.mcoffee.entity.*
;
import
cn.freemud.service.thirdparty.CouponClient
;
import
cn.freemud.service.thirdparty.CustomerExtendClient
;
import
cn.freemud.utils.BarcodeUtil
;
...
...
@@ -341,10 +338,10 @@ public class CouponDiscountCalculation {
}
public
List
<
CouponAvailableReq
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
,
public
List
<
CouponAvailableReq
ByCart
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
,
List
<
String
>
couponCodes
){
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
List
<
CouponAvailableReq
ByCart
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
ByCart
res
=
new
CouponAvailableReqByCart
();
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
...
...
@@ -352,6 +349,7 @@ public class CouponDiscountCalculation {
res
.
setCouponCodes
(
couponCodes
);
List
<
CouponProductVo
>
productList
=
new
ArrayList
<>();
res
.
setCouponCodes
(
couponCodes
);
List
<
CouponProductVo
>
calculAmountProductList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
cartGoods
.
forEach
(
cartGood
->
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
...
...
@@ -362,7 +360,7 @@ public class CouponDiscountCalculation {
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
p
roductList
.
add
(
couponProductVo
);
calculAmountP
roductList
.
add
(
couponProductVo
);
}
// if (CollectionUtils.isNotEmpty(cartGood.getProductComboList())) {
...
...
@@ -388,8 +386,8 @@ public class CouponDiscountCalculation {
// });
// }
});
res
.
setProductList
(
productList
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
p
roductList
);
res
.
setProductList
(
cartGoods
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
calculAmountP
roductList
);
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
resList
.
add
(
res
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
0 → 100644
View file @
91f03854
package
cn
.
freemud
.
service
.
impl
.
mcoffee
.
entity
;
import
cn.freemud.entities.vo.CartGoods
;
import
lombok.Data
;
import
java.util.List
;
/**
* All rights Reserved, Designed By sunary.site
*
* @version v1.0
* @Title: IntelliJ IDEA
* @Package cn.freemud.service.impl.mcoffee.entity
* @Description: 请简单描述下这个类是做什么用的
* @author: yu.sun
* @date: 2020-10-26 13:59:32
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
*/
@Data
public
class
CouponAvailableReqByCart
{
/**
* 渠道id
*/
private
String
providerId
;
/**
* 商户号
*/
private
String
merchantId
;
private
String
city
;
private
String
storeId
;
/**
* 组织机构id列表(校验渠道限制)
*/
private
List
<
String
>
channelIdList
;
/**
* 组织机构code列表(校验渠道限制)
*/
private
List
<
String
>
channelCodeList
;
/**
* 券码列表
*/
private
List
<
String
>
couponCodes
;
private
Integer
totalAmount
;
/**
* 核销渠道 枚举: mocoffee_wx : 麦咖啡微信小程序 mocoffee_zfb : 麦咖啡支付宝小程序
*/
private
String
redeemChannel
;
/**
* 购物车商品列表
*/
private
List
<
CartGoods
>
productList
;
private
String
stationId
;
private
String
operatorId
;
}
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