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
9cfd5745
Commit
9cfd5745
authored
Jul 12, 2021
by
黄兆良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
public final static boolean printDebug = true;
parent
1bd17173
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
32 additions
and
115 deletions
+32
-115
shopping-cart-application-service/src/main/java/cn/freemud/constant/ApplicationConstant.java
+0
-3
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
+1
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/delivery/impl/GradDeliveryServiceImpl.java
+1
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
+2
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+2
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/MaterialPromotionService.java
+0
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
+1
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
+0
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+3
-17
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+3
-9
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+3
-9
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/AdditionSharingService.java
+1
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+11
-33
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+4
-12
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/constant/ApplicationConstant.java
View file @
9cfd5745
...
...
@@ -25,7 +25,4 @@ public class ApplicationConstant {
public
final
static
String
DELIVERY_DISCOUNT_DESC3
=
"另需配送费%s元"
;
public
final
static
String
DELIVERY_DISCOUNT_DESC4
=
" 选择了配送券"
;
@Value
(
"${print-debug-log:false}"
)
public
final
static
boolean
printDebug
=
true
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
View file @
9cfd5745
...
...
@@ -249,9 +249,7 @@ public class PlatformApportionService extends AbstractApportionService {
//ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券前,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
}
ApiLog
.
printLog
(
"批量使用优惠券前,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
for
(
int
i
=
0
;
i
<
oldCoupons
.
size
()
;
i
++){
GetCalculationDiscountBO
.
CalculationDiscountCoupon
oldCoupon
=
oldCoupons
.
get
(
i
);
oldCoupon
.
setUseIndex
(
i
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/delivery/impl/GradDeliveryServiceImpl.java
View file @
9cfd5745
...
...
@@ -143,9 +143,7 @@ public class GradDeliveryServiceImpl extends AbstractDeliveryServiceImpl impleme
request
.
setStoreCode
(
storeCode
);
StoreCBaseResponse
<
StoreCBaseResponseDto
>
responseDto
=
storeBaseApiClient
.
queryDeliverDetail
(
request
);
//ApiLog.info("fisherman 获取门店预计送达时间",request,responseDto);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"fisherman 获取门店预计送达时间"
,
JSON
.
toJSONString
(
request
),
JSON
.
toJSONString
(
responseDto
),
null
);
}
ApiLog
.
printLog
(
"fisherman 获取门店预计送达时间"
,
JSON
.
toJSONString
(
request
),
JSON
.
toJSONString
(
responseDto
),
null
);
if
(
responseDto
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
SYSTEM_BUSINESS_ERROR
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
View file @
9cfd5745
...
...
@@ -83,9 +83,7 @@ public class AssortmentSdkService {
BaseResponse
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
>
baseResponse
=
shoppingCartService
.
getCartGoods
(
cartParamDto
,
LogThreadLocal
.
getTrackingNo
());
if
(
baseResponse
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
baseResponse
.
getCode
())
||
baseResponse
.
getResult
()
==
null
)
{
/*ErrorLog.printLog(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(),"getCartGoods:" + JSONObject.toJSONString(baseResponse), cartParamDto, Level.ERROR);*/
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"getCartGoods:"
,
SDKCommonBaseContextWare
.
getAppName
(),
LogThreadLocal
.
getTrackingNo
(),
JSONObject
.
toJSONString
(
baseResponse
));
}
ApiLog
.
printLog
(
"getCartGoods:"
,
SDKCommonBaseContextWare
.
getAppName
(),
LogThreadLocal
.
getTrackingNo
(),
JSONObject
.
toJSONString
(
baseResponse
));
return
null
;
}
...
...
@@ -326,9 +324,7 @@ public class AssortmentSdkService {
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
productInfosDto
.
getErrcode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
// ApiLog.info("查询商品信息失败,getProductInfoDto,baseResponse",getProductInfoDto,productInfosDto);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"查询商品信息失败,getProductInfoDto,baseResponse"
,
JSON
.
toJSONString
(
getProductInfoDto
),
JSON
.
toJSONString
(
productInfosDto
),
null
);
}
ApiLog
.
printLog
(
"查询商品信息失败,getProductInfoDto,baseResponse"
,
JSON
.
toJSONString
(
getProductInfoDto
),
JSON
.
toJSONString
(
productInfosDto
),
null
);
return
null
;
}
return
productInfosDto
.
getData
().
getProducts
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
9cfd5745
...
...
@@ -764,9 +764,7 @@ public class CouponServiceImpl implements CouponService {
@Override
public
CheckSpqInfoResponseDto
checkSpqInfo
(
CheckSpqInfoRequestDto
requestDto
)
{
// ApiLog.debug("checkSpqInfo****" + gson.toJson(requestDto));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"checkSpqInfo****"
,
gson
.
toJson
(
requestDto
),
null
,
null
);
}
ApiLog
.
printLog
(
"checkSpqInfo****"
,
gson
.
toJson
(
requestDto
),
null
,
null
);
String
partnerId
=
requestDto
.
getPartnerId
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
storeId
=
requestDto
.
getStoreId
();
...
...
@@ -841,9 +839,7 @@ public class CouponServiceImpl implements CouponService {
dto
.
setPicture
(
productsVo
.
getSpuPicture
());
dto
.
setCouponType
(
0
);
// ApiLog.debug("dto***" + dto);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"dto***"
,
JSON
.
toJSONString
(
dto
),
null
,
null
);
}
ApiLog
.
printLog
(
"dto***"
,
JSON
.
toJSONString
(
dto
),
null
,
null
);
return
dto
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/MaterialPromotionService.java
View file @
9cfd5745
...
...
@@ -86,14 +86,10 @@ public class MaterialPromotionService implements IPromotionService {
public
void
updateShoppingCartGoodsApportion
(
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
,
CreateOrderVo
.
PremiumExchangeActivity
premiumExchangeActivity
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
)
{
HashMap
<
String
,
MaterialApportion
>
map
=
getApportionGoodsDetail
(
calculationDiscountResult
);
// ApiLog.debug("updateShoppingCartGoodsApportion->map:" + map);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"updateShoppingCartGoodsApportion->map:"
,
JSON
.
toJSONString
(
map
),
null
,
null
);
}
List
<
ShoppingCartGoodsDto
.
CartGoodsDetailDto
>
products
=
shoppingCartGoodsDto
.
getProducts
();
// ApiLog.debug("updateShoppingCartGoodsApportion->product:" + products);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"updateShoppingCartGoodsApportion->product:"
,
JSON
.
toJSONString
(
products
),
null
,
null
);
}
if
(
map
.
size
()
>
0
)
{
String
pk
=
""
;
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
product
:
products
)
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
View file @
9cfd5745
...
...
@@ -241,9 +241,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
List
<
CollageMemberState
>
collageMemberState
=
collageOrderBaseService
.
getCollageMemberState
(
collageOrderDto
).
getResult
();
if
(
collageMemberState
==
null
||
collageMemberState
.
isEmpty
()){
// ApiLog.info("splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}",partnerId,storeId,createUserId,currentUserId);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}"
+
partnerId
,
storeId
,
createUserId
,
currentUserId
);
}
ApiLog
.
printLog
(
"splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}"
+
partnerId
,
storeId
,
createUserId
,
currentUserId
);
return
null
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
View file @
9cfd5745
...
...
@@ -932,9 +932,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
// ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券前,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
}
for
(
int
i
=
0
;
i
<
oldCoupons
.
size
()
;
i
++){
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
oldCoupon
=
oldCoupons
.
get
(
i
);
...
...
@@ -961,9 +959,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
}
// ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券后,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
}
return
oldCoupons
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
9cfd5745
...
...
@@ -721,9 +721,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
deliveryAmount
,
null
);
// ApiLog.info("fisherman 新算价 配送费字段数据 01 ",calculationSharingDiscountResult,shoppingCartGoodsResponseVo);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券前,oldCoupons,coupons"
,
JSON
.
toJSONString
(
calculationSharingDiscountResult
),
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
null
);
}
ApiLog
.
printLog
(
"fisherman 新算价 配送费字段数据 01 "
,
JSON
.
toJSONString
(
calculationSharingDiscountResult
),
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
null
);
sharingCartService
.
distribute
(
calculationSharingDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
...
...
@@ -739,9 +737,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
userId
,
storeId
);
// ApiLog.info("fisherman 新算价 配送费字段数据 02 ",null,shoppingCartGoodsResponseVo);shoppingCartGoodsResponseVo
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"fisherman 新算价 配送费字段数据 02 "
,
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
null
,
null
);
}
ApiLog
.
printLog
(
"fisherman 新算价 配送费字段数据 02 "
,
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
null
,
null
);
buildShoppingCartGoodsResponse
(
shoppingCartGoodsResponseVo
,
calculationSharingDiscountResult
,
shoppingCartInfoRequestVo
.
getFlag
(),
partnerId
);
}
else
{
...
...
@@ -825,9 +821,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 添加购物车商品总价和加价购商品总价,现在是自己计算,后面需要优化为促销计算, 这段要删除
// ApiLog.info("fisherman 新算价 校验入参券是否可用new ",shoppingCartGoodsResponseVo,shoppingCartInfoRequestVo.getCouponCodes());
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"校验入参券是否可用"
,
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
shoppingCartInfoRequestVo
.
getCouponCode
(),
null
);
}
ApiLog
.
printLog
(
"校验入参券是否可用"
,
JSON
.
toJSONString
(
shoppingCartGoodsResponseVo
),
shoppingCartInfoRequestVo
.
getCouponCode
(),
null
);
// 校验入参券是否可用
if
(!
checkAvailableCoupon
(
shoppingCartGoodsResponseVo
,
shoppingCartInfoRequestVo
.
getCouponCode
())){
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_COUPON_NOT_USE
);
...
...
@@ -1495,9 +1489,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
try
{
// ApiLog.debug("activityClient discount :{}", JSON.toJSONString(activityCalculationDiscountRequestDto));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"activityClient discount :{}"
,
JSON
.
toJSONString
(
activityCalculationDiscountRequestDto
),
null
,
null
);
}
activityCalculationDiscountResponseDto
=
activityClient
.
calculationDiscount
(
activityCalculationDiscountRequestDto
);
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount"
,
activityCalculationDiscountRequestDto
,
ex
);
...
...
@@ -2482,9 +2474,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return
deliveryAmount
;
}
// ApiLog.debug("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(), storeDeliveryUseOld, receiveId, partnerId, storeId);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}"
,
LogThreadLocal
.
getTrackingNo
(),
JSON
.
toJSONString
(
storeDeliveryUseOld
),
"receiveId:"
+
receiveId
+
",partnerId:"
+
partnerId
+
",storeId:"
+
storeId
);
}
if
(
storeDeliveryUseOld
)
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
shoppingCartGoodsResponseVo
.
setDeliveryFeeZeroReason
(
0
);
...
...
@@ -2835,9 +2825,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券前,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
}
for
(
int
i
=
0
;
i
<
oldCoupons
.
size
()
;
i
++){
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
oldCoupon
=
oldCoupons
.
get
(
i
);
...
...
@@ -2864,9 +2852,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"批量使用优惠券后,oldCoupons,coupons"
,
JSON
.
toJSONString
(
oldCoupons
),
JSON
.
toJSONString
(
coupons
),
null
);
}
return
oldCoupons
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
9cfd5745
...
...
@@ -72,9 +72,7 @@ public class CalculationCommonService {
* 使用促销算价赋值行记录
*/
// ApiLog.debug("initShoppingCart={},discountResult={}", JSON.toJSON(cartGoodsList),JSON.toJSON(discountResult));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"initShoppingCart={},discountResult={}"
,
JSON
.
toJSONString
(
cartGoodsList
),
JSON
.
toJSONString
(
discountResult
),
null
);
}
ApiLog
.
printLog
(
"initShoppingCart={},discountResult={}"
,
JSON
.
toJSONString
(
cartGoodsList
),
JSON
.
toJSONString
(
discountResult
),
null
);
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goods
=
null
;
if
(
discountResult
!=
null
&&
CollectionUtils
.
isNotEmpty
(
discountResult
.
getGoods
()))
{
goods
=
discountResult
.
getGoods
();
...
...
@@ -223,9 +221,7 @@ public class CalculationCommonService {
,
CartGoods
cartGoods
,
String
partnerId
)
{
// ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}"
,
JSON
.
toJSONString
(
calculationGoods
),
JSON
.
toJSONString
(
cartGoods
),
null
);
}
ApiLog
.
printLog
(
"convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}"
,
JSON
.
toJSONString
(
calculationGoods
),
JSON
.
toJSONString
(
cartGoods
),
null
);
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
this
.
convertCartGoods2DetailGoods
(
calculationGoods
,
cartGoods
,
partnerId
);
return
cartGoodsDetailDto
;
}
...
...
@@ -240,9 +236,7 @@ public class CalculationCommonService {
public
ShoppingCartApportionBO
.
CartGoodsDetailDto
convertCartGoods2NewDetailGoodsList
(
CalculationDiscountBO
.
CalculationDiscountResult
.
Goods
calculationGoods
,
CartGoods
cartGoods
,
String
partnerId
)
{
// ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}"
,
JSON
.
toJSONString
(
calculationGoods
),
JSON
.
toJSONString
(
cartGoods
),
null
);
}
ApiLog
.
printLog
(
"convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}"
,
JSON
.
toJSONString
(
calculationGoods
),
JSON
.
toJSONString
(
cartGoods
),
null
);
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
oldGoods
=
mapperFacade
.
map
(
calculationGoods
,
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
class
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
9cfd5745
...
...
@@ -104,15 +104,11 @@ public class CalculationSharingDiscountService {
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
checkSpqInfo
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
,
cartGoods
.
getSkuId
());
// ApiLog.debug("coupon:{},{}", "hg", JSON.toJSONString(checkSpqInfo));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"coupon:{},{}"
,
"hg"
,
JSON
.
toJSONString
(
checkSpqInfo
),
null
);
}
ApiLog
.
printLog
(
"coupon:{},{}"
,
"hg"
,
JSON
.
toJSONString
(
checkSpqInfo
),
null
);
}
else
{
checkSpqInfo
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
);
// ApiLog.debug("coupon:{},{}", "sp", JSON.toJSONString(checkSpqInfo));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"coupon:{},{}"
,
"sp"
,
JSON
.
toJSONString
(
checkSpqInfo
),
null
);
}
ApiLog
.
printLog
(
"coupon:{},{}"
,
"sp"
,
JSON
.
toJSONString
(
checkSpqInfo
),
null
);
}
if
(
null
==
checkSpqInfo
)
{
cartGoodsList
.
remove
(
i
);
...
...
@@ -188,9 +184,7 @@ public class CalculationSharingDiscountService {
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
// ApiLog.debug("calculationDiscountGoodsList:{}", JSON.toJSON(calculationDiscountGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"calculationDiscountGoodsList:{}"
,
JSON
.
toJSONString
(
calculationDiscountGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"calculationDiscountGoodsList:{}"
,
JSON
.
toJSONString
(
calculationDiscountGoodsList
),
null
,
null
);
//throw new BizServiceException(ResponseResult.SHOPPING_CART_COUPON_NOT_EXIST,"参数促销计算商品有异常");
return
null
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/AdditionSharingService.java
View file @
9cfd5745
...
...
@@ -256,9 +256,7 @@ public class AdditionSharingService {
throw
new
ServiceException
(
ResponseResult
.
PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST
);
}
//ApiLog.debug("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"getProductsVoMap:{}"
,
JSON
.
toJSONString
(
getProductsVoMap
),
null
,
null
);
}
ApiLog
.
printLog
(
"getProductsVoMap:{}"
,
JSON
.
toJSONString
(
getProductsVoMap
),
null
,
null
);
// 获取计算返回的价格
Long
originalTotalAmount
=
shoppingCartGoodsResponseVo
.
getOriginalTotalAmount
();
//Long totalAmount = shoppingCartGoodsDto.getTotalAmount();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
9cfd5745
...
...
@@ -238,9 +238,7 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
CartGoods
>
newCartGoods
=
null
;
// ApiLog.debug("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"【oldGoodsList】:{} ,【addCartGoods】:{}"
,
JSONObject
.
toJSONString
(
oldCartGoodsList
),
JSONObject
.
toJSONString
(
addCartGoods
),
null
);
}
ApiLog
.
printLog
(
"【oldGoodsList】:{} ,【addCartGoods】:{}"
,
JSONObject
.
toJSONString
(
oldCartGoodsList
),
JSONObject
.
toJSONString
(
addCartGoods
),
null
);
if
(
StringUtils
.
equals
(
"9999"
,
skuId
))
{
// 将月享卡2.0的虚拟商品保存到购物车中
oldCartGoodsList
.
add
(
addCartGoods
);
...
...
@@ -803,9 +801,7 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
null
!=
cartGoods
.
getMonthCardInfo
()){
cartGoods
.
getMonthCardInfo
().
setIsUseMonthCard
(
requestVo
.
getIsUseMonthCard
());
//ApiLog.info("【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}",requestVo.getIsUseMonthCard(),JSONObject.toJSONString(cartGoods));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}"
,
String
.
valueOf
(
requestVo
.
getIsUseMonthCard
()),
JSONObject
.
toJSONString
(
cartGoods
),
null
);
}
ApiLog
.
printLog
(
"【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}"
,
String
.
valueOf
(
requestVo
.
getIsUseMonthCard
()),
JSONObject
.
toJSONString
(
cartGoods
),
null
);
}
}
cartGoodsList
=
cartGoodsList
.
stream
().
filter
(
cartGoods
->
!
StringUtils
.
equals
(
"9999"
,
cartGoods
.
getSkuId
())).
collect
(
Collectors
.
toList
());
...
...
@@ -841,15 +837,11 @@ public class ShoppingCartMCoffeeServiceImpl {
// 先验证商品是否存在
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
//ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
List
<
CartGoods
>
cartSendGoodsList
=
assortmentSdkService
.
getShoppingCartSendGoods
(
partnerId
,
storeId
,
userId
,
sessionId
,
""
,
shoppingCartBaseService
);
//ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
CartGoods
cartGoods
=
null
;
String
skuId
=
""
;
Integer
finalQty
=
qty
;
...
...
@@ -1018,15 +1010,11 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
sessionId
,
""
,
shoppingCartBaseService
);
// ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
List
<
CartGoods
>
cartSendGoodsList
=
assortmentSdkService
.
getShoppingCartSendGoods
(
partnerId
,
storeId
,
userId
,
sessionId
,
""
,
shoppingCartBaseService
);
// ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartSendGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartSendGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
CartGoods
monthCardProduct
=
null
;
// 如果购物车商品不为空, 则check购物车中所有商品
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
))
{
...
...
@@ -1295,14 +1283,10 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
tableNumber
,
shoppingCartBaseService
);
//ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartGoodsList
),
null
,
null
);
List
<
CartGoods
>
cartSendGoodsList
=
assortmentSdkService
.
getShoppingCartSendGoods
(
partnerId
,
storeId
,
userId
,
null
,
tableNumber
,
shoppingCartBaseService
);
//ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"cartSendGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"cartSendGoodsList: {}"
,
JSONObject
.
toJSONString
(
cartSendGoodsList
),
null
,
null
);
if
(
cartGoodsList
==
null
||
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_GETINFO_INVAILD
);
}
...
...
@@ -1438,9 +1422,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取原门店购物车商品
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
fromStoreId
,
userId
,
sessionId
,
""
,
shoppingCartBaseService
);
//ApiLog.debug("【switchCardGoods】原门店数据: {} {}", requestVo.getSessionId(), JSONObject.toJSONString(cartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"【switchCardGoods】原门店数据: {} {}"
,
requestVo
.
getSessionId
(),
JSONObject
.
toJSONString
(
cartGoodsList
),
null
);
}
ApiLog
.
printLog
(
"【switchCardGoods】原门店数据: {} {}"
,
requestVo
.
getSessionId
(),
JSONObject
.
toJSONString
(
cartGoodsList
),
null
);
// 如果购物车商品不为空, 则check购物车中所有商品
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
...
...
@@ -1841,9 +1823,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
if
(
CollectionUtils
.
isNotEmpty
(
newCartGoodsList
)){
//ApiLog.debug("【merge-before】:{} ,【newCardGoods】:{}",JSONObject.toJSONString(nowCartGoodsList),JSONObject.toJSONString(newCartGoods));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"【merge-before】:{} ,【newCardGoods】:{}"
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
JSONObject
.
toJSONString
(
newCartGoods
),
null
);
}
ApiLog
.
printLog
(
"【merge-before】:{} ,【newCardGoods】:{}"
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
JSONObject
.
toJSONString
(
newCartGoods
),
null
);
newCartGoodsList
.
forEach
(
newCartGood
->
{
int
index
;
if
((
index
=
nowCartGoodsList
.
indexOf
(
newCartGood
))
>=
0
)
{
...
...
@@ -2738,9 +2718,7 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods
.
getMonthCardInfo
().
setCardNo
(
productBindingCouponType
.
getCardId
());
cartGoods
.
getMonthCardInfo
().
setType
(
cartGoods
.
getMonthCardInfo
().
getType
());
//ApiLog.debug("【月享卡】信息替换成功,cartGoods:{},productInfo:{}",cartGoods.toString(),result.toString());
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"【月享卡】信息替换成功,cartGoods:{},productInfo:{}"
,
cartGoods
.
toString
(),
result
.
toString
(),
null
);
}
ApiLog
.
printLog
(
"【月享卡】信息替换成功,cartGoods:{},productInfo:{}"
,
cartGoods
.
toString
(),
result
.
toString
(),
null
);
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
9cfd5745
...
...
@@ -197,9 +197,7 @@ public class CouponDiscountCalculation {
if
(
CollectionUtils
.
isNotEmpty
(
discountsNew
))
{
useCoupon
=
true
;
// ApiLog.debug("couponDiscountCalculation:{}",discountsNew);
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"couponDiscountCalculation:{}"
,
JSON
.
toJSONString
(
discountsNew
),
null
,
null
);
}
ApiLog
.
printLog
(
"couponDiscountCalculation:{}"
,
JSON
.
toJSONString
(
discountsNew
),
null
,
null
);
//这里过滤掉了 月享卡2.0,因为月享卡2.0商品不用展示划线价,故显示原价
Optional
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
targetDiscount
=
discountsNew
.
stream
()
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
...
...
@@ -286,9 +284,7 @@ public class CouponDiscountCalculation {
changed
.
set
(
false
);
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
)){
// ApiLog.debug("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-before】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-before】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
for
(
int
i
=
cartGoodsList
.
size
()
-
1
;
i
>=
1
;
i
--)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
int
index2
=
nowCartGoodsList
.
indexOf
(
cartGoods
);
...
...
@@ -302,14 +298,10 @@ public class CouponDiscountCalculation {
nowCartGoodsList
.
remove
(
i
);
}
// ApiLog.debug("合并买3赠1商品券 【merge-ing】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-ing】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-ing】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
}
// ApiLog.debug("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if
(
ApplicationConstant
.
printDebug
){
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-after】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
}
ApiLog
.
printLog
(
"合并买3赠1商品券 【merge-after】 : {} "
,
JSONObject
.
toJSONString
(
nowCartGoodsList
),
null
,
null
);
}
if
(
changed
.
get
())
{
cartGoodsList
.
clear
();
...
...
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