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
e7084d1d
Commit
e7084d1d
authored
Oct 26, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/qa' into qa
parents
cb344a96
19a2fb77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
11 deletions
+73
-11
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+1
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+3
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+9
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
+60
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
e7084d1d
...
@@ -937,4 +937,4 @@ public class ShoppingCartConvertAdapter {
...
@@ -937,4 +937,4 @@ public class ShoppingCartConvertAdapter {
}
}
}
}
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
e7084d1d
...
@@ -457,7 +457,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -457,7 +457,7 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
String
>
couponCodes
=
new
ArrayList
<>();
List
<
String
>
couponCodes
=
new
ArrayList
<>();
couponCodes
.
add
(
deliveryFeeCoupon
);
couponCodes
.
add
(
deliveryFeeCoupon
);
couponCodes
.
add
(
moneyCoupon
);
couponCodes
.
add
(
moneyCoupon
);
List
<
CouponAvailableReq
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
List
<
CouponAvailableReq
ByCart
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
return
ResponseUtil
.
success
(
resList
);
return
ResponseUtil
.
success
(
resList
);
}
}
...
@@ -866,12 +866,12 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -866,12 +866,12 @@ public class ShoppingCartMCoffeeServiceImpl {
comboxGoods
.
setQty
(
orderItemResp
.
getProductQuantity
());
comboxGoods
.
setQty
(
orderItemResp
.
getProductQuantity
());
comboxGoods
.
setOriginalPrice
(
orderItemResp
.
getProductPrice
().
longValue
());
comboxGoods
.
setOriginalPrice
(
orderItemResp
.
getProductPrice
().
longValue
());
comboxGoods
.
setFinalPrice
(
orderItemResp
.
getSalePrice
().
longValue
());
comboxGoods
.
setFinalPrice
(
orderItemResp
.
getSalePrice
().
longValue
());
comboxGoods
.
setPic
(
orderItemResp
.
getProductPicUrl
());
comboxGoods
.
setName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductName
())
?
orderItemResp
.
getProductName
()
:
""
);
comboxGoods
.
setName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductName
())
?
orderItemResp
.
getProductName
()
:
""
);
comboxGoods
.
setSpuName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductName
())
?
orderItemResp
.
getProductName
()
:
""
);
comboxGoods
.
setSpuName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductName
())
?
orderItemResp
.
getProductName
()
:
""
);
comboxGoods
.
setSkuName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductSpecName
())
?
orderItemResp
.
getProductSpecName
()
:
""
);
comboxGoods
.
setSkuName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductSpecName
())
?
orderItemResp
.
getProductSpecName
()
:
""
);
comboxGoods
.
setSubName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductSpecName
())
?
orderItemResp
.
getProductSpecName
()
:
""
);
comboxGoods
.
setSubName
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductSpecName
())
?
orderItemResp
.
getProductSpecName
()
:
""
);
comboxGoods
.
setPic
(
StringUtils
.
isNotEmpty
(
orderItemResp
.
getProductPicUrl
())
?
orderItemResp
.
getProductPicUrl
()
:
""
);
if
(!
""
.
equals
(
orderItemResp
.
getProductProperty
()))
{
if
(!
""
.
equals
(
orderItemResp
.
getProductProperty
()))
{
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
<>();
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
<>();
String
[]
split
=
orderItemResp
.
getProductProperty
().
split
(
"/"
);
String
[]
split
=
orderItemResp
.
getProductProperty
().
split
(
"/"
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
e7084d1d
...
@@ -15,6 +15,8 @@ import cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq;
...
@@ -15,6 +15,8 @@ import cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp
;
import
cn.freemud.service.impl.mcoffee.entity.CouponProductVo
;
import
cn.freemud.service.impl.mcoffee.entity.CouponProductVo
;
import
cn.freemud.service.impl.mcoffee.entity.CouponState
;
import
cn.freemud.service.impl.mcoffee.entity.CouponState
;
import
cn.freemud.service.impl.ItemServiceImpl
;
import
cn.freemud.service.impl.mcoffee.entity.*
;
import
cn.freemud.service.thirdparty.CouponClient
;
import
cn.freemud.service.thirdparty.CouponClient
;
import
cn.freemud.service.thirdparty.CustomerExtendClient
;
import
cn.freemud.service.thirdparty.CustomerExtendClient
;
import
cn.freemud.utils.BarcodeUtil
;
import
cn.freemud.utils.BarcodeUtil
;
...
@@ -356,16 +358,17 @@ public class CouponDiscountCalculation {
...
@@ -356,16 +358,17 @@ 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
<
String
>
couponCodes
){
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
List
<
CouponAvailableReq
ByCart
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
CouponAvailableReq
ByCart
res
=
new
CouponAvailableReqByCart
();
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
res
.
setCouponCodes
(
couponCodes
);
res
.
setCouponCodes
(
couponCodes
);
List
<
CouponProductVo
>
productList
=
new
ArrayList
<>();
List
<
CartGoods
>
productList
=
new
ArrayList
<>();
List
<
CouponProductVo
>
calculAmountProductList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
cartGoods
.
forEach
(
cartGood
->
{
cartGoods
.
forEach
(
cartGood
->
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
...
@@ -376,7 +379,7 @@ public class CouponDiscountCalculation {
...
@@ -376,7 +379,7 @@ public class CouponDiscountCalculation {
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
couponProductVo
.
setCategoryCode
(
null
);
p
roductList
.
add
(
couponProductVo
);
calculAmountP
roductList
.
add
(
couponProductVo
);
}
}
// if (CollectionUtils.isNotEmpty(cartGood.getProductComboList())) {
// if (CollectionUtils.isNotEmpty(cartGood.getProductComboList())) {
...
@@ -403,7 +406,7 @@ public class CouponDiscountCalculation {
...
@@ -403,7 +406,7 @@ public class CouponDiscountCalculation {
// }
// }
});
});
res
.
setProductList
(
productList
);
res
.
setProductList
(
productList
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
p
roductList
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
calculAmountP
roductList
);
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
resList
.
add
(
res
);
resList
.
add
(
res
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
0 → 100644
View file @
e7084d1d
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