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
e5b3b651
Commit
e5b3b651
authored
Jul 22, 2021
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除logutil 打印
parent
f7ff0cb8
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
95 additions
and
71 deletions
+95
-71
shopping-cart-application-service/src/main/java/cn/freemud/aop/WebAspect.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/coupon/KgdCouponServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/customer/KgdCustomerServceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/promotion/KgdPromotionServiceImpl.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
+12
-12
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
+4
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AsyOperationServiceImpl.java
+4
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+12
-10
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
+4
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/OpenStoreIappWxappConfigServiceImpl.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+5
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
+4
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/UserServiceImpl.java
+13
-9
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/ScoreSharingService.java
+4
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+6
-4
shopping-cart-application-service/src/main/java/cn/freemud/utils/LogUtil.java
+3
-1
shopping-cart-application-service/src/test/java/cn.freemud/client/CouoponOnlineTest.java
+2
-2
shopping-cart-application-service/src/test/java/cn.freemud/client/MqTest.java
+3
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/aop/WebAspect.java
View file @
e5b3b651
...
@@ -212,7 +212,7 @@ public class WebAspect {
...
@@ -212,7 +212,7 @@ public class WebAspect {
result
=
joinPoint
.
proceed
();
result
=
joinPoint
.
proceed
();
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
ErrorLog
.
printErrorLog
(
ex
.
getMessage
(),
thirdPartLogVo
.
getUri
(),
thirdPartLogVo
.
getRequestBody
(),
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
thirdPartLogVo
.
getRequestBody
(),
ex
);
throw
ex
;
throw
ex
;
}
}
try
{
try
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/coupon/KgdCouponServiceImpl.java
View file @
e5b3b651
...
@@ -104,7 +104,7 @@ public class KgdCouponServiceImpl implements CouponService {
...
@@ -104,7 +104,7 @@ public class KgdCouponServiceImpl implements CouponService {
// 如果是商品券/换购券,获取券信息
// 如果是商品券/换购券,获取券信息
CouponDetailBO
couponDetail
=
getCouponDetail
(
getCouponDetail
);
CouponDetailBO
couponDetail
=
getCouponDetail
(
getCouponDetail
);
LogUtil
.
info
(
LogTreadLocal
.
getTrackingNo
(),
"KgdCouponServiceImpl.getCouponDetail"
,
JsonUtil
.
toJSONString
(
getCouponDetail
),
JsonUtil
.
toJSONString
(
couponDetail
));
//
LogUtil.info(LogTreadLocal.getTrackingNo(), "KgdCouponServiceImpl.getCouponDetail", JsonUtil.toJSONString(getCouponDetail), JsonUtil.toJSONString(couponDetail));
if
(
couponDetail
==
null
||
!
couponDetail
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetail
.
getDetails
()))
{
if
(
couponDetail
==
null
||
!
couponDetail
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetail
.
getDetails
()))
{
return
null
;
return
null
;
...
@@ -160,7 +160,7 @@ public class KgdCouponServiceImpl implements CouponService {
...
@@ -160,7 +160,7 @@ public class KgdCouponServiceImpl implements CouponService {
GetProductBySkuIdBO
getProductBySkuIdBO
=
convert2GetProductBySkuIdBO
(
getCheckSpqBo
,
skuId
);
GetProductBySkuIdBO
getProductBySkuIdBO
=
convert2GetProductBySkuIdBO
(
getCheckSpqBo
,
skuId
);
Map
<
String
,
GetProductBySkuIdResponseBO
>
productsInfoBySkuIds
=
productManager
.
getProductsInfoBySkuIds
(
getProductBySkuIdBO
,
getCheckSpqBo
.
getProductService
());
Map
<
String
,
GetProductBySkuIdResponseBO
>
productsInfoBySkuIds
=
productManager
.
getProductsInfoBySkuIds
(
getProductBySkuIdBO
,
getCheckSpqBo
.
getProductService
());
LogUtil
.
info
(
LogTreadLocal
.
getTrackingNo
(),
"getProductBySkuIdBO >>>>"
,
JsonUtil
.
toJSONString
(
getProductBySkuIdBO
),
JsonUtil
.
toJSONString
(
couponDetail
));
//
LogUtil.info(LogTreadLocal.getTrackingNo(), "getProductBySkuIdBO >>>>", JsonUtil.toJSONString(getProductBySkuIdBO), JsonUtil.toJSONString(couponDetail));
GetProductBySkuIdResponseBO
productsVo
=
productsInfoBySkuIds
.
get
(
skuId
);
GetProductBySkuIdResponseBO
productsVo
=
productsInfoBySkuIds
.
get
(
skuId
);
if
(
null
==
productsVo
||
!
Objects
.
equals
(
productsVo
.
getStatus
(),
StoreItemStatus
.
PUT_ON_SALE
.
getCode
()))
{
if
(
null
==
productsVo
||
!
Objects
.
equals
(
productsVo
.
getStatus
(),
StoreItemStatus
.
PUT_ON_SALE
.
getCode
()))
{
return
null
;
return
null
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/customer/KgdCustomerServceImpl.java
View file @
e5b3b651
...
@@ -96,7 +96,7 @@ public class KgdCustomerServceImpl implements CustomerService {
...
@@ -96,7 +96,7 @@ public class KgdCustomerServceImpl implements CustomerService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"getUserScoreUseDetailError"
,
"/user/scoreUseDetail"
,
request
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getUserScoreUseDetailError"
,
ex
);
}
}
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
userScoreUserDetailBO
=
customerDTO2BOAdapter
.
convert2UserScoreUserDetailBO
(
userScoreUseDetail
);
userScoreUserDetailBO
=
customerDTO2BOAdapter
.
convert2UserScoreUserDetailBO
(
userScoreUseDetail
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/promotion/KgdPromotionServiceImpl.java
View file @
e5b3b651
package
cn
.
freemud
.
demo
.
manager
.
promotion
;
package
cn
.
freemud
.
demo
.
manager
.
promotion
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.demo.entities.bo.promotion.GetActivityBO
;
import
cn.freemud.demo.entities.bo.promotion.GetActivityBO
;
import
cn.freemud.demo.adapter.manager.PromotionBO2DTOAdapter
;
import
cn.freemud.demo.adapter.manager.PromotionBO2DTOAdapter
;
import
cn.freemud.demo.adapter.manager.PromotionDTO2BOAdapter
;
import
cn.freemud.demo.adapter.manager.PromotionDTO2BOAdapter
;
...
@@ -49,7 +50,7 @@ public class KgdPromotionServiceImpl implements PromotionService{
...
@@ -49,7 +50,7 @@ public class KgdPromotionServiceImpl implements PromotionService{
calculationSharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
shareDiscountRequestDto
);
calculationSharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
shareDiscountRequestDto
);
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount/sharing"
,
calculationSharingDiscountResponseDto
,
e
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONNoFeatures
(
calculationSharingDiscountResponseDto
)
,
e
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
View file @
e5b3b651
...
@@ -104,19 +104,19 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -104,19 +104,19 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
public
final
ShoppingCartGoodsBO
addGoods
(
BaseAddGoodsBO
addGoodsBO
)
{
public
final
ShoppingCartGoodsBO
addGoods
(
BaseAddGoodsBO
addGoodsBO
)
{
// 基本参数校验
// 基本参数校验
this
.
checkParams
(
addGoodsBO
);
this
.
checkParams
(
addGoodsBO
);
LogUtil
.
info
(
"addGoodsBO >>> "
,
JsonUtil
.
toJSONString
(
addGoodsBO
),
null
);
//
LogUtil.info("addGoodsBO >>> ",JsonUtil.toJSONString(addGoodsBO),null);
// 获取购物车和加车商品信息
// 获取购物车和加车商品信息
CheckBussinessRulesBO
checkBussinessRulesBO
=
this
.
getShoppingCartInfo
(
addGoodsBO
);
CheckBussinessRulesBO
checkBussinessRulesBO
=
this
.
getShoppingCartInfo
(
addGoodsBO
);
LogUtil
.
info
(
"getShoppingCartInfo >>> "
,
JsonUtil
.
toJSONString
(
addGoodsBO
),
JsonUtil
.
toJSONString
(
checkBussinessRulesBO
));
//
LogUtil.info("getShoppingCartInfo >>> ",JsonUtil.toJSONString(addGoodsBO),JsonUtil.toJSONString(checkBussinessRulesBO));
// 业务校验,例如商品数量库存之类的信息
// 业务校验,例如商品数量库存之类的信息
AddGoodsToShoppingCartBO
addGoodsToShoppingCartBO
=
this
.
checkBusinessRules
(
addGoodsBO
,
checkBussinessRulesBO
);
AddGoodsToShoppingCartBO
addGoodsToShoppingCartBO
=
this
.
checkBusinessRules
(
addGoodsBO
,
checkBussinessRulesBO
);
LogUtil
.
info
(
"checkBusinessRules >>> "
,
JsonUtil
.
toJSONString
(
addGoodsBO
),
JsonUtil
.
toJSONString
(
addGoodsToShoppingCartBO
));
//
LogUtil.info("checkBusinessRules >>> ",JsonUtil.toJSONString(addGoodsBO),JsonUtil.toJSONString(addGoodsToShoppingCartBO));
// 添加商品到购物车
// 添加商品到购物车
DiscountResultBO
discountResultBO
=
this
.
addGoodsToShoppingCart
(
addGoodsBO
,
addGoodsToShoppingCartBO
);
DiscountResultBO
discountResultBO
=
this
.
addGoodsToShoppingCart
(
addGoodsBO
,
addGoodsToShoppingCartBO
);
LogUtil
.
info
(
"addGoodsToShoppingCart >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
addGoodsBO
,
addGoodsToShoppingCartBO
)),
JsonUtil
.
toJSONString
(
discountResultBO
));
//
LogUtil.info("addGoodsToShoppingCart >>> ",JsonUtil.toJSONString(Arrays.asList(addGoodsBO,addGoodsToShoppingCartBO)),JsonUtil.toJSONString(discountResultBO));
// 去促销计算优惠
// 去促销计算优惠
CalCostBO
calCostBO
=
this
.
getDiscountResult
(
addGoodsBO
,
discountResultBO
);
CalCostBO
calCostBO
=
this
.
getDiscountResult
(
addGoodsBO
,
discountResultBO
);
...
@@ -215,7 +215,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -215,7 +215,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
GetProductBO
getProductBO
=
convert2ProductBO
(
baseRequestBO
,
spqBO
);
GetProductBO
getProductBO
=
convert2ProductBO
(
baseRequestBO
,
spqBO
);
// 获取商品信息
// 获取商品信息
List
<
ProductBO
>
productsInfoList
=
productManager
.
getProductsInfo
(
getProductBO
,
baseRequestBO
.
getManagerService
().
getProductService
());
List
<
ProductBO
>
productsInfoList
=
productManager
.
getProductsInfo
(
getProductBO
,
baseRequestBO
.
getManagerService
().
getProductService
());
LogUtil
.
info
(
LogTreadLocal
.
getTrackingNo
(),
"getProductsInfo >>>"
,
JsonUtil
.
toJSONString
(
getProductBO
),
JsonUtil
.
toJSONString
(
productsInfoList
));
//
LogUtil.info(LogTreadLocal.getTrackingNo(), "getProductsInfo >>>", JsonUtil.toJSONString(getProductBO), JsonUtil.toJSONString(productsInfoList));
ProductBO
productsInfo
=
productsInfoList
.
get
(
0
);
ProductBO
productsInfo
=
productsInfoList
.
get
(
0
);
bo
.
setProduct
(
productsInfo
);
bo
.
setProduct
(
productsInfo
);
...
@@ -333,9 +333,9 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -333,9 +333,9 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
*/
*/
public
final
AddGoodsToShoppingCartBO
checkBusinessRules
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
)
{
public
final
AddGoodsToShoppingCartBO
checkBusinessRules
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
)
{
AddGoodsToShoppingCartBO
commAddGoodsToShoppingCartBO
=
this
.
checkCommBusinessRules
(
baseRequestDTO
,
checkBussinessRulesBO
);
AddGoodsToShoppingCartBO
commAddGoodsToShoppingCartBO
=
this
.
checkCommBusinessRules
(
baseRequestDTO
,
checkBussinessRulesBO
);
LogUtil
.
info
(
"checkCommBusinessRules >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
baseRequestDTO
,
checkBussinessRulesBO
)),
JsonUtil
.
toJSONString
(
commAddGoodsToShoppingCartBO
));
//
LogUtil.info("checkCommBusinessRules >>> ",JsonUtil.toJSONString(Arrays.asList(baseRequestDTO,checkBussinessRulesBO)),JsonUtil.toJSONString(commAddGoodsToShoppingCartBO));
AddGoodsToShoppingCartBO
customAddGoodsToShoppingCartBO
=
this
.
checkCustomBusinessRules
(
baseRequestDTO
,
checkBussinessRulesBO
,
commAddGoodsToShoppingCartBO
);
AddGoodsToShoppingCartBO
customAddGoodsToShoppingCartBO
=
this
.
checkCustomBusinessRules
(
baseRequestDTO
,
checkBussinessRulesBO
,
commAddGoodsToShoppingCartBO
);
LogUtil
.
info
(
"checkCustomBusinessRules >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
baseRequestDTO
,
checkBussinessRulesBO
)),
JsonUtil
.
toJSONString
(
customAddGoodsToShoppingCartBO
));
//
LogUtil.info("checkCustomBusinessRules >>> ",JsonUtil.toJSONString(Arrays.asList(baseRequestDTO,checkBussinessRulesBO)),JsonUtil.toJSONString(customAddGoodsToShoppingCartBO));
return
customAddGoodsToShoppingCartBO
;
return
customAddGoodsToShoppingCartBO
;
}
}
...
@@ -366,7 +366,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -366,7 +366,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
private
AddGoodsToShoppingCartBO
checkCommBusinessRules
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
)
{
private
AddGoodsToShoppingCartBO
checkCommBusinessRules
(
BaseAddGoodsBO
baseRequestDTO
,
CheckBussinessRulesBO
checkBussinessRulesBO
)
{
AddGoodsToShoppingCartBO
bo
=
new
AddGoodsToShoppingCartBO
();
AddGoodsToShoppingCartBO
bo
=
new
AddGoodsToShoppingCartBO
();
LogUtil
.
info
(
"checkCommBusinessRules111 >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
baseRequestDTO
,
checkBussinessRulesBO
)),
null
);
//
LogUtil.info("checkCommBusinessRules111 >>> ",JsonUtil.toJSONString(Arrays.asList(baseRequestDTO,checkBussinessRulesBO)),null);
//购物车添加数量限制
//购物车添加数量限制
CartGoods
addGoods
=
baseRequestDTO
.
getAddGoods
();
CartGoods
addGoods
=
baseRequestDTO
.
getAddGoods
();
...
@@ -386,11 +386,11 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -386,11 +386,11 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
// 检查校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
// 检查校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
ShoppingCartContext
cartContext
=
convert2ShopingCartContext
(
baseRequestDTO
);
ShoppingCartContext
cartContext
=
convert2ShopingCartContext
(
baseRequestDTO
);
LogUtil
.
info
(
"checkShoppingCart1111 >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
checkBussinessRulesBO
)),
null
);
//
LogUtil.info("checkShoppingCart1111 >>> ",JsonUtil.toJSONString(Arrays.asList(checkBussinessRulesBO)),null);
LogUtil
.
info
(
"checkShoppingCart2222 >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
addGoods
)),
null
);
//
LogUtil.info("checkShoppingCart2222 >>> ",JsonUtil.toJSONString(Arrays.asList(addGoods)),null);
LogUtil
.
info
(
"checkShoppingCart3333 >>> "
,
JsonUtil
.
toJSONString
(
Arrays
.
asList
(
cartContext
)),
null
);
//
LogUtil.info("checkShoppingCart3333 >>> ",JsonUtil.toJSONString(Arrays.asList(cartContext)),null);
CheckCartRequest
checkCartRequest
=
shoppingBaseService
.
checkShoppingCart
(
checkBussinessRulesBO
.
getCartGoods
(),
addGoods
,
cartContext
);
CheckCartRequest
checkCartRequest
=
shoppingBaseService
.
checkShoppingCart
(
checkBussinessRulesBO
.
getCartGoods
(),
addGoods
,
cartContext
);
LogUtil
.
info
(
"checkShoppingCart >>> "
,
null
,
JsonUtil
.
toJSONString
(
checkCartRequest
));
//
LogUtil.info("checkShoppingCart >>> ",null,JsonUtil.toJSONString(checkCartRequest));
checkBussinessRulesBO
.
setChanged
(
checkCartRequest
.
getChanged
());
checkBussinessRulesBO
.
setChanged
(
checkCartRequest
.
getChanged
());
checkBussinessRulesBO
.
setToastMsg
(
checkCartRequest
.
getToastMsg
());
checkBussinessRulesBO
.
setToastMsg
(
checkCartRequest
.
getToastMsg
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
View file @
e5b3b651
...
@@ -2,6 +2,7 @@ package cn.freemud.demo.service.impl;
...
@@ -2,6 +2,7 @@ package cn.freemud.demo.service.impl;
import
cn.freemud.adapter.ActivityAdapter
;
import
cn.freemud.adapter.ActivityAdapter
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.demo.entities.bo.SendGoods
;
import
cn.freemud.demo.entities.bo.SendGoods
;
...
@@ -833,7 +834,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
...
@@ -833,7 +834,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail
=
customerManager
.
getUserScoreUseDetail
(
request
,
baseRequestDTO
.
getManagerService
().
getCustomerService
());
userScoreUseDetail
=
customerManager
.
getUserScoreUseDetail
(
request
,
baseRequestDTO
.
getManagerService
().
getCustomerService
());
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"getUserScoreUseDetailError"
,
"/user/scoreUseDetail"
,
request
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONString
(
request
)
,
ex
);
}
}
if
(
userScoreUseDetail
!=
null
)
{
if
(
userScoreUseDetail
!=
null
)
{
...
@@ -911,7 +912,8 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
...
@@ -911,7 +912,8 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
}
}
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"getScoreValueFail"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getScoreValueFail"
,
ex
);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
}
return
result
;
return
result
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
View file @
e5b3b651
...
@@ -710,7 +710,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -710,7 +710,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail
=
customerManager
.
getUserScoreUseDetail
(
request
,
baseRequestDTO
.
getManagerService
().
getCustomerService
());
userScoreUseDetail
=
customerManager
.
getUserScoreUseDetail
(
request
,
baseRequestDTO
.
getManagerService
().
getCustomerService
());
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"getUserScoreUseDetailError"
,
"/user/scoreUseDetail"
,
request
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getUserScoreUseDetailError"
,
ex
);
}
}
if
(
userScoreUseDetail
!=
null
)
{
if
(
userScoreUseDetail
!=
null
)
{
...
@@ -793,7 +793,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -793,7 +793,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
}
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"getScoreValueFail"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getScoreValueFail"
,
ex
);
}
}
return
result
;
return
result
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
View file @
e5b3b651
...
@@ -158,7 +158,7 @@ public interface ShoppingCartNewService {
...
@@ -158,7 +158,7 @@ public interface ShoppingCartNewService {
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
couponCode
,
menuType
);
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
couponCode
,
menuType
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
,
goodsId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
,
goodsId
);
LogUtil
.
info
(
"validCoupon.CheckSpqInfoResponseDto"
,
JSON
.
toJSONString
(
checkSpqInfoRequestDto
),
JSON
.
toJSONString
(
checkSpqInfoResponseDto
));
//
LogUtil.info("validCoupon.CheckSpqInfoResponseDto", JSON.toJSONString(checkSpqInfoRequestDto),JSON.toJSONString(checkSpqInfoResponseDto));
if
(
checkSpqInfoResponseDto
==
null
)
{
if
(
checkSpqInfoResponseDto
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_COUPON_MIX_NOT_EXIST
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_COUPON_MIX_NOT_EXIST
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AsyOperationServiceImpl.java
View file @
e5b3b651
...
@@ -16,12 +16,14 @@ package cn.freemud.service.impl;
...
@@ -16,12 +16,14 @@ package cn.freemud.service.impl;
import
cn.freemud.amqp.Header
;
import
cn.freemud.amqp.Header
;
import
cn.freemud.amqp.MQMessage
;
import
cn.freemud.amqp.MQMessage
;
import
cn.freemud.amqp.MQService
;
import
cn.freemud.amqp.MQService
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.comm.druid.MyMapper
;
import
cn.freemud.comm.druid.MyMapper
;
import
cn.freemud.entities.db.SaasLinkMonitorLog
;
import
cn.freemud.entities.db.SaasLinkMonitorLog
;
import
cn.freemud.entities.vo.ThirdPartLogVo
;
import
cn.freemud.entities.vo.ThirdPartLogVo
;
import
cn.freemud.service.AsyOperationService
;
import
cn.freemud.service.AsyOperationService
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
lombok.Getter
;
import
lombok.Getter
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -104,7 +106,8 @@ public class AsyOperationServiceImpl implements AsyOperationService {
...
@@ -104,7 +106,8 @@ public class AsyOperationServiceImpl implements AsyOperationService {
MQMessage
<
SaasLinkMonitorLog
>
message
=
new
MQMessage
<>(
header
,
saasLinkMonitorLog
);
MQMessage
<
SaasLinkMonitorLog
>
message
=
new
MQMessage
<>(
header
,
saasLinkMonitorLog
);
mqService
.
convertAndSend
(
linkLogExchange
,
linkLogQueue
,
message
);
mqService
.
convertAndSend
(
linkLogExchange
,
linkLogQueue
,
message
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"MQLOGERROR"
,
thirdPartLogVo
,
ex
.
getMessage
());
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONString
(
thirdPartLogVo
),
ex
);
// ErrorLog.printErrorLog("MQLOGERROR","",thirdPartLogVo,ex);
}
}
});
});
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
e5b3b651
...
@@ -41,6 +41,7 @@ import cn.freemud.utils.RedisUtil;
...
@@ -41,6 +41,7 @@ import cn.freemud.utils.RedisUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.productcenter.constant.ResponseConstant
;
import
com.freemud.application.sdk.api.productcenter.constant.ResponseConstant
;
import
com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductRequest
;
import
com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductRequest
;
import
com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductType
;
import
com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductType
;
...
@@ -230,7 +231,8 @@ public class CouponServiceImpl implements CouponService {
...
@@ -230,7 +231,8 @@ public class CouponServiceImpl implements CouponService {
try
{
try
{
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"会员服务优惠券接口调用失败"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"会员服务优惠券接口调用失败"
,
ex
);
// LogUtil.error("会员服务优惠券接口调用失败", "","",ex);
}
}
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
return
getMemberCouponListResponseDto
.
getData
();
return
getMemberCouponListResponseDto
.
getData
();
...
@@ -350,7 +352,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -350,7 +352,7 @@ public class CouponServiceImpl implements CouponService {
String
sign
=
SignUtil
.
createMD5Sign
(
map
,
appSecret
);
String
sign
=
SignUtil
.
createMD5Sign
(
map
,
appSecret
);
map
.
put
(
Finals
.
SIGN
,
sign
);
map
.
put
(
Finals
.
SIGN
,
sign
);
GetCouponDetailResponseDto
responseDto
=
couponOnlineClient
.
getCouponDetails
(
map
);
GetCouponDetailResponseDto
responseDto
=
couponOnlineClient
.
getCouponDetails
(
map
);
LogUtil
.
info
(
"couponOnlineClient.getCouponDetails****"
,
map
,
gson
.
toJson
(
responseDto
));
//
LogUtil.info("couponOnlineClient.getCouponDetails****", map, gson.toJson(responseDto));
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
.
equals
(
responseDto
.
getResult
()))
{
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
.
equals
(
responseDto
.
getResult
()))
{
details
.
addAll
(
responseDto
.
getDetails
());
details
.
addAll
(
responseDto
.
getDetails
());
}
}
...
@@ -454,7 +456,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -454,7 +456,7 @@ public class CouponServiceImpl implements CouponService {
getMemberCouponListRequestDto
.
setPageNum
(
1
);
getMemberCouponListRequestDto
.
setPageNum
(
1
);
getMemberCouponListRequestDto
.
setPageSize
(
Integer
.
MAX_VALUE
);
getMemberCouponListRequestDto
.
setPageSize
(
Integer
.
MAX_VALUE
);
GetMemberCouponListResponseDto
.
Result
result
=
getMemberCouponList
(
getMemberCouponListRequestDto
);
GetMemberCouponListResponseDto
.
Result
result
=
getMemberCouponList
(
getMemberCouponListRequestDto
);
LogUtil
.
debug
(
"CouponServiceImpl_getMemberCouponList"
,
JSON
.
toJSONString
(
getMemberCouponListRequestDto
),
JSON
.
toJSONString
(
result
));
//
LogUtil.debug("CouponServiceImpl_getMemberCouponList", JSON.toJSONString(getMemberCouponListRequestDto), JSON.toJSONString(result));
List
<
GetMemberCouponListResponseDto
.
Result
.
MemberCoupon
>
memberCoupons
=
Lists
.
newArrayList
();
List
<
GetMemberCouponListResponseDto
.
Result
.
MemberCoupon
>
memberCoupons
=
Lists
.
newArrayList
();
// 过滤优惠券得点餐方式
// 过滤优惠券得点餐方式
if
(!
Objects
.
isNull
(
result
)
&&
CollectionUtils
.
isNotEmpty
(
result
.
getMemberCoupons
()))
{
if
(!
Objects
.
isNull
(
result
)
&&
CollectionUtils
.
isNotEmpty
(
result
.
getMemberCoupons
()))
{
...
@@ -538,7 +540,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -538,7 +540,7 @@ public class CouponServiceImpl implements CouponService {
couponAvailableReqVo
.
setCouponCodes
(
calCouponCodes
);
couponAvailableReqVo
.
setCouponCodes
(
calCouponCodes
);
//CouponAvailableRespVo couponsAvailable = couponAvailableService.getCouponsAvailable(couponAvailableReqVo, appSecret);
//CouponAvailableRespVo couponsAvailable = couponAvailableService.getCouponsAvailable(couponAvailableReqVo, appSecret);
CouponAvailableRespDto
couponsAvailable
=
couponAdaptClient
.
getCouponsAvailable
(
couponAvailableReqVo
);
CouponAvailableRespDto
couponsAvailable
=
couponAdaptClient
.
getCouponsAvailable
(
couponAvailableReqVo
);
LogUtil
.
info
(
"availableCoupon_couponAvailableService.getCouponsAvailable"
,
JSON
.
toJSONString
(
couponAvailableReqVo
),
JSON
.
toJSONString
(
couponsAvailable
));
//
LogUtil.info("availableCoupon_couponAvailableService.getCouponsAvailable", JSON.toJSONString(couponAvailableReqVo), JSON.toJSONString(couponsAvailable));
if
(
Objects
.
equals
(
String
.
valueOf
(
couponsAvailable
.
getResult
()),
ResponseResult
.
SUCCESS
.
getCode
())
if
(
Objects
.
equals
(
String
.
valueOf
(
couponsAvailable
.
getResult
()),
ResponseResult
.
SUCCESS
.
getCode
())
&&
CollectionUtils
.
isNotEmpty
(
couponsAvailable
.
getCouponStateList
()))
{
&&
CollectionUtils
.
isNotEmpty
(
couponsAvailable
.
getCouponStateList
()))
{
couponStateList
.
addAll
(
couponsAvailable
.
getCouponStateList
());
couponStateList
.
addAll
(
couponsAvailable
.
getCouponStateList
());
...
@@ -550,10 +552,10 @@ public class CouponServiceImpl implements CouponService {
...
@@ -550,10 +552,10 @@ public class CouponServiceImpl implements CouponService {
private
ActivityClassifyCouponBean
returnSuccessAvailiableCoupons
(
Set
<
String
>
couponCodes
,
boolean
hasGoodsCoupon
,
ActivityClassifyCouponBean
availableCouponResponseVo
,
List
<
ActivityCouponBean
>
usableCoupons
,
private
ActivityClassifyCouponBean
returnSuccessAvailiableCoupons
(
Set
<
String
>
couponCodes
,
boolean
hasGoodsCoupon
,
ActivityClassifyCouponBean
availableCouponResponseVo
,
List
<
ActivityCouponBean
>
usableCoupons
,
List
<
ActivityCouponBean
>
disableCoupons
,
Map
<
String
,
GetMemberCouponListResponseDto
.
Result
.
MemberCoupon
>
memberCouponMap
,
List
<
ActivityCouponBean
>
disableCoupons
,
Map
<
String
,
GetMemberCouponListResponseDto
.
Result
.
MemberCoupon
>
memberCouponMap
,
List
<
CouponStateVo
>
couponStateList
,
String
chooseCouponCode
)
{
List
<
CouponStateVo
>
couponStateList
,
String
chooseCouponCode
)
{
LogUtil
.
info
(
"returnSuccessAvailiableCoupons 01 couponCode : hasGoodsCoupon"
,
couponCodes
,
hasGoodsCoupon
);
//
LogUtil.info("returnSuccessAvailiableCoupons 01 couponCode : hasGoodsCoupon", couponCodes,hasGoodsCoupon);
LogUtil
.
info
(
"returnSuccessAvailiableCoupons 02 availableCouponResponseVo : usableCoupons"
,
availableCouponResponseVo
,
usableCoupons
);
//
LogUtil.info("returnSuccessAvailiableCoupons 02 availableCouponResponseVo : usableCoupons", availableCouponResponseVo,usableCoupons);
LogUtil
.
info
(
"returnSuccessAvailiableCoupons 03 disableCoupons : memberCouponMap"
,
disableCoupons
,
memberCouponMap
);
//
LogUtil.info("returnSuccessAvailiableCoupons 03 disableCoupons : memberCouponMap", disableCoupons,memberCouponMap);
LogUtil
.
info
(
"returnSuccessAvailiableCoupons 04 couponStateList : chooseCouponCode"
,
couponStateList
,
chooseCouponCode
);
//
LogUtil.info("returnSuccessAvailiableCoupons 04 couponStateList : chooseCouponCode", couponStateList,chooseCouponCode);
int
disableCouponNum
=
0
;
int
disableCouponNum
=
0
;
int
usableCouponNum
=
0
;
int
usableCouponNum
=
0
;
for
(
CouponStateVo
couponStateVo
:
couponStateList
)
{
for
(
CouponStateVo
couponStateVo
:
couponStateList
)
{
...
@@ -775,7 +777,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -775,7 +777,7 @@ public class CouponServiceImpl implements CouponService {
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
LogUtil
.
info
(
"couponService.getMemberCoupon"
,
gson
.
toJson
(
requestVo
),
gson
.
toJson
(
couponDetailResponseDto
));
//
LogUtil.info("couponService.getMemberCoupon", gson.toJson(requestVo), gson.toJson(couponDetailResponseDto));
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
return
null
;
}
}
...
@@ -1028,7 +1030,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1028,7 +1030,7 @@ public class CouponServiceImpl implements CouponService {
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
LogUtil
.
info
(
"couponService.getMemberCoupon"
,
gson
.
toJson
(
requestVo
),
gson
.
toJson
(
couponDetailResponseDto
));
//
LogUtil.info("couponService.getMemberCoupon", gson.toJson(requestVo), gson.toJson(couponDetailResponseDto));
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
return
null
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
View file @
e5b3b651
package
cn
.
freemud
.
service
.
impl
;
package
cn
.
freemud
.
service
.
impl
;
import
cn.freemud.adapter.ShoppingCartConvertAdapter
;
import
cn.freemud.adapter.ShoppingCartConvertAdapter
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto
;
import
cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto
;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
...
@@ -55,7 +56,7 @@ public class CustomerScoreService implements IPromotionService {
...
@@ -55,7 +56,7 @@ public class CustomerScoreService implements IPromotionService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"getUserScoreUseDetailError"
,
"/user/scoreUseDetail"
,
request
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONString
(
request
)
,
ex
);
}
}
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
Integer
discountAmount
=
0
;
Integer
discountAmount
=
0
;
...
@@ -161,7 +162,8 @@ public class CustomerScoreService implements IPromotionService {
...
@@ -161,7 +162,8 @@ public class CustomerScoreService implements IPromotionService {
}
}
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"getScoreValueFail"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getScoreValueFail"
,
ex
);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
}
return
result
;
return
result
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/FullSubtractionActivityServiceImpl.java
View file @
e5b3b651
...
@@ -39,10 +39,10 @@ public class FullSubtractionActivityServiceImpl {
...
@@ -39,10 +39,10 @@ public class FullSubtractionActivityServiceImpl {
*/
*/
public
PromotionMessageDto
getFullPromotionActivityInfo
(
ActivityQueryDto
activityQueryDto
,
Long
totalAmount
,
boolean
hasOtherDiscount
)
{
public
PromotionMessageDto
getFullPromotionActivityInfo
(
ActivityQueryDto
activityQueryDto
,
Long
totalAmount
,
boolean
hasOtherDiscount
)
{
totalAmount
=
totalAmount
==
null
?
0L
:
totalAmount
;
totalAmount
=
totalAmount
==
null
?
0L
:
totalAmount
;
LogUtil
.
info
(
"getFullPromotionActivityInfo"
,
gson
.
toJson
(
activityQueryDto
)
+
"_"
+
totalAmount
+
"_"
+
hasOtherDiscount
,
null
);
//
LogUtil.info("getFullPromotionActivityInfo", gson.toJson(activityQueryDto) + "_" + totalAmount + "_" + hasOtherDiscount, null);
ActivityQueryResponseDto
activityQueryResponseDto
=
activityService
.
queryActivitys
(
activityQueryDto
,
null
,
null
);
ActivityQueryResponseDto
activityQueryResponseDto
=
activityService
.
queryActivitys
(
activityQueryDto
,
null
,
null
);
if
(
activityQueryResponseDto
==
null
)
{
if
(
activityQueryResponseDto
==
null
)
{
LogUtil
.
info
(
"queryActivitys is error"
,
gson
.
toJson
(
activityQueryDto
),
gson
.
toJson
(
activityQueryResponseDto
));
//
LogUtil.info("queryActivitys is error", gson.toJson(activityQueryDto), gson.toJson(activityQueryResponseDto));
return
null
;
return
null
;
}
}
PromotionMessageDto
promotionMessageDto
=
new
PromotionMessageDto
();
PromotionMessageDto
promotionMessageDto
=
new
PromotionMessageDto
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/OpenStoreIappWxappConfigServiceImpl.java
View file @
e5b3b651
...
@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -55,7 +56,7 @@ public class OpenStoreIappWxappConfigServiceImpl implements OpenStoreIappWxappCo
...
@@ -55,7 +56,7 @@ public class OpenStoreIappWxappConfigServiceImpl implements OpenStoreIappWxappCo
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
//异常打印日常日志,返回默认config
//异常打印日常日志,返回默认config
LogUtil
.
error
(
"getOpenStoreIappWxappConfig error {}"
,
""
,
"
"
,
e
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getOpenStoreIappWxappConfig
"
,
e
);
return
ResponseUtil
.
success
(
defauleConfig
);
return
ResponseUtil
.
success
(
defauleConfig
);
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
View file @
e5b3b651
...
@@ -970,7 +970,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
...
@@ -970,7 +970,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
if
(
StringUtils
.
isBlank
(
province
))
{
if
(
StringUtils
.
isBlank
(
province
))
{
return
deliveryAmount
;
return
deliveryAmount
;
}
}
log
.
info
(
"获取配送配逻辑 tackingNo:{},partnerId:{},province
"
,
LogThreadLocal
.
getTrackingNo
(),
partnerId
,
province
);
ApiLog
.
printLog
(
"获取配送配逻辑
"
,
LogThreadLocal
.
getTrackingNo
(),
partnerId
,
province
);
Long
orderAmount
=
0L
;
Long
orderAmount
=
0L
;
Integer
orderCount
=
0
;
Integer
orderCount
=
0
;
if
(
null
!=
cartGoodsList
&&
cartGoodsList
.
size
()>
0
){
if
(
null
!=
cartGoodsList
&&
cartGoodsList
.
size
()>
0
){
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
e5b3b651
...
@@ -2456,7 +2456,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -2456,7 +2456,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if
(
StringUtils
.
isBlank
(
receiveId
)
&&
!
Objects
.
equals
(
orderType
,
CreateOrderType
.
TAKE_OUT
.
getCode
()))
{
if
(
StringUtils
.
isBlank
(
receiveId
)
&&
!
Objects
.
equals
(
orderType
,
CreateOrderType
.
TAKE_OUT
.
getCode
()))
{
return
deliveryAmount
;
return
deliveryAmount
;
}
}
ApiLog
.
printLog
(
"获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}"
,
LogThreadLocal
.
getTrackingNo
(),
JSON
.
toJSONString
(
storeDeliveryUseOld
),
"receiveId:"
+
receiveId
+
",partnerId:"
+
partnerId
+
",storeId:"
+
storeId
);
//
ApiLog.printLog("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(),JSON.toJSONString(storeDeliveryUseOld),"receiveId:"+receiveId+",partnerId:"+partnerId+",storeId:"+storeId);
if
(
storeDeliveryUseOld
)
{
if
(
storeDeliveryUseOld
)
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
shoppingCartGoodsResponseVo
.
setDeliveryFeeZeroReason
(
0
);
shoppingCartGoodsResponseVo
.
setDeliveryFeeZeroReason
(
0
);
...
@@ -2849,7 +2849,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -2849,7 +2849,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
try
{
try
{
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"会员服务优惠券接口调用失败"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"会员服务优惠券接口调用失败"
,
ex
);
// LogUtil.error("会员服务优惠券接口调用失败","","", ex);
}
}
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
return
getMemberCouponListResponseDto
.
getData
();
return
getMemberCouponListResponseDto
.
getData
();
...
@@ -3374,7 +3375,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -3374,7 +3375,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//校验库存
//校验库存
List
<
CartGoods
>
stockLimitGoods
=
allCartGoodsList
.
stream
().
filter
(
CartGoods:
:
isStockLimit
).
collect
(
toList
());
List
<
CartGoods
>
stockLimitGoods
=
allCartGoodsList
.
stream
().
filter
(
CartGoods:
:
isStockLimit
).
collect
(
toList
());
List
<
CartGoods
>
notCheckStock
=
allCartGoodsList
.
stream
().
filter
(
cartGoods
->
!
cartGoods
.
isStockLimit
()).
collect
(
toList
());
List
<
CartGoods
>
notCheckStock
=
allCartGoodsList
.
stream
().
filter
(
cartGoods
->
!
cartGoods
.
isStockLimit
()).
collect
(
toList
());
LogUtil
.
info
(
"request check stock limit 001 "
,
stockLimitGoods
,
notCheckStock
);
if
(!
CollectionUtils
.
isEmpty
(
stockLimitGoods
))
{
if
(!
CollectionUtils
.
isEmpty
(
stockLimitGoods
))
{
List
<
Long
>
goodsId
=
stockLimitGoods
.
stream
().
map
(
v
->
Long
.
parseLong
(
v
.
getGoodsId
())).
collect
(
toList
());
List
<
Long
>
goodsId
=
stockLimitGoods
.
stream
().
map
(
v
->
Long
.
parseLong
(
v
.
getGoodsId
())).
collect
(
toList
());
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
...
@@ -3383,14 +3383,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -3383,14 +3383,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
requestDto
.
setStoreId
(
replaceGoodsRequestVo
.
getShopId
());
requestDto
.
setStoreId
(
replaceGoodsRequestVo
.
getShopId
());
requestDto
.
setProductIds
(
goodsId
);
requestDto
.
setProductIds
(
goodsId
);
GetProductStockResponseDto
availableStocks
=
stockClient
.
getAvailableStocks
(
requestDto
);
GetProductStockResponseDto
availableStocks
=
stockClient
.
getAvailableStocks
(
requestDto
);
LogUtil
.
info
(
"request check stock begin"
,
requestDto
,
availableStocks
);
if
(
availableStocks
!=
null
)
{
if
(
availableStocks
!=
null
)
{
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
availableStocks
.
getCode
())){
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
availableStocks
.
getCode
())){
// 没有请求数据
// 没有请求数据
fullReplace
=
false
;
fullReplace
=
false
;
}
}
if
(
CollectionUtils
.
isEmpty
(
availableStocks
.
getResult
())){
if
(
CollectionUtils
.
isEmpty
(
availableStocks
.
getResult
())){
LogUtil
.
info
(
"request check stock limit fail result is null"
,
requestDto
,
availableStocks
);
fullReplace
=
false
;
fullReplace
=
false
;
}
}
...
@@ -3409,10 +3407,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -3409,10 +3407,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
});
});
// 获取到最新的 库存 stockLimitGoods 数据 放入 nowCartGoodsList 中
// 获取到最新的 库存 stockLimitGoods 数据 放入 nowCartGoodsList 中
LogUtil
.
info
(
"request check stock limit 002 "
,
stockLimitGoods
,
notCheckStock
);
//
LogUtil.info("request check stock limit 002 ",stockLimitGoods,notCheckStock);
notCheckStock
.
addAll
(
stockLimitGoods
);
notCheckStock
.
addAll
(
stockLimitGoods
);
}
else
{
}
else
{
LogUtil
.
info
(
"request check stock limit fail"
,
requestDto
,
null
);
//
LogUtil.info("request check stock limit fail",requestDto,null);
fullReplace
=
false
;
fullReplace
=
false
;
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
View file @
e5b3b651
...
@@ -208,7 +208,8 @@ public class StoreServiceImpl {
...
@@ -208,7 +208,8 @@ public class StoreServiceImpl {
storeDeliveryInfoDto
.
setDeliveryStartTime
(
hhmmss
.
parse
(
startDateTimeStr
));
storeDeliveryInfoDto
.
setDeliveryStartTime
(
hhmmss
.
parse
(
startDateTimeStr
));
storeDeliveryInfoDto
.
setDeliveryEndTime
(
hhmmss
.
parse
(
endDateTimeStr
));
storeDeliveryInfoDto
.
setDeliveryEndTime
(
hhmmss
.
parse
(
endDateTimeStr
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtil
.
info
(
"getStoreDeliveryInfo parse deliveryHoursDay error"
,
storeDeliveryInfoDto
.
getDeliveryHoursDay
(),
null
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getStoreDeliveryInfo parse deliveryHoursDay error:"
+
storeDeliveryInfoDto
.
getDeliveryHoursDay
(),
e
);
// LogUtil.info("getStoreDeliveryInfo parse deliveryHoursDay error", storeDeliveryInfoDto.getDeliveryHoursDay(), null);
}
}
}
}
}
}
...
@@ -322,7 +323,8 @@ public class StoreServiceImpl {
...
@@ -322,7 +323,8 @@ public class StoreServiceImpl {
try
{
try
{
endDate
=
hhmmss
.
parse
(
endDateTimeStr
);
endDate
=
hhmmss
.
parse
(
endDateTimeStr
);
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
LogUtil
.
info
(
"getStoreDeliveryInfo endDate format error"
,
endDateTimeStr
,
null
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
endDateTimeStr
,
e
);
// LogUtil.info("getStoreDeliveryInfo endDate format error", endDateTimeStr, null);
return
false
;
return
false
;
}
}
if
(
endDate
==
null
||
new
Date
().
after
(
endDate
))
{
if
(
endDate
==
null
||
new
Date
().
after
(
endDate
))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/UserServiceImpl.java
View file @
e5b3b651
...
@@ -28,6 +28,7 @@ import cn.freemud.service.thirdparty.*;
...
@@ -28,6 +28,7 @@ import cn.freemud.service.thirdparty.*;
import
cn.freemud.utils.*
;
import
cn.freemud.utils.*
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
...
@@ -524,7 +525,7 @@ public class UserServiceImpl implements UserService {
...
@@ -524,7 +525,7 @@ public class UserServiceImpl implements UserService {
*/
*/
public
void
checkUserLogin
(
String
sessionId
)
{
public
void
checkUserLogin
(
String
sessionId
)
{
Map
<
String
,
Object
>
userInfoMap
=
this
.
getUserInfoMapBySessionId
(
sessionId
);
Map
<
String
,
Object
>
userInfoMap
=
this
.
getUserInfoMapBySessionId
(
sessionId
);
log
.
info
(
"submit userInfoMap:{}"
,
gson
.
toJson
(
userInfoMap
)
);
ApiLog
.
printLog
(
"submit userInfoMap"
,
gson
.
toJson
(
userInfoMap
),
null
,
null
);
if
(
userInfoMap
==
null
||
userInfoMap
.
size
()
<=
0
||
userInfoMap
.
get
(
UserInfoKeyConstant
.
MEMBER_ID
)
==
null
)
{
if
(
userInfoMap
==
null
||
userInfoMap
.
size
()
<=
0
||
userInfoMap
.
get
(
UserInfoKeyConstant
.
MEMBER_ID
)
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
NOT_LOGIN
);
throw
new
ServiceException
(
ResponseResult
.
NOT_LOGIN
);
}
}
...
@@ -534,7 +535,7 @@ public class UserServiceImpl implements UserService {
...
@@ -534,7 +535,7 @@ public class UserServiceImpl implements UserService {
*/
*/
public
boolean
checkUserLoginFlag
(
String
sessionId
)
{
public
boolean
checkUserLoginFlag
(
String
sessionId
)
{
Map
<
String
,
Object
>
userInfoMap
=
this
.
getUserInfoMapBySessionId
(
sessionId
);
Map
<
String
,
Object
>
userInfoMap
=
this
.
getUserInfoMapBySessionId
(
sessionId
);
log
.
info
(
"submit userInfoMap:{}"
,
gson
.
toJson
(
userInfoMap
)
);
ApiLog
.
printLog
(
"submit userInfoMap:{}"
,
gson
.
toJson
(
userInfoMap
),
null
,
null
);
if
(
userInfoMap
==
null
||
userInfoMap
.
size
()
<=
0
||
userInfoMap
.
get
(
UserInfoKeyConstant
.
MEMBER_ID
)
==
null
)
{
if
(
userInfoMap
==
null
||
userInfoMap
.
size
()
<=
0
||
userInfoMap
.
get
(
UserInfoKeyConstant
.
MEMBER_ID
)
==
null
)
{
return
false
;
return
false
;
}
}
...
@@ -579,7 +580,7 @@ public class UserServiceImpl implements UserService {
...
@@ -579,7 +580,7 @@ public class UserServiceImpl implements UserService {
if
(
response
==
null
)
{
if
(
response
==
null
)
{
return
null
;
return
null
;
}
}
log
.
info
(
"[getPhoneNumber] response :{}"
,
response
);
ApiLog
.
printLog
(
"[getPhoneNumber] response :{}"
,
response
,
null
,
null
);
String
phoneNumber
=
null
;
String
phoneNumber
=
null
;
try
{
try
{
if
(
response
.
contains
(
"phoneNumber"
))
{
if
(
response
.
contains
(
"phoneNumber"
))
{
...
@@ -1053,14 +1054,17 @@ public class UserServiceImpl implements UserService {
...
@@ -1053,14 +1054,17 @@ public class UserServiceImpl implements UserService {
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
keySpec
,
ivSpec
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
keySpec
,
ivSpec
);
decrptedString
=
new
String
(
cipher
.
doFinal
(
encData
),
"UTF-8"
);
decrptedString
=
new
String
(
cipher
.
doFinal
(
encData
),
"UTF-8"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"解密微信数据失败"
,
"sessionKey:"
+
sessionkey
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"解密微信数据失败"
+
"sessionKey:"
+
sessionkey
+
",encryptedData:"
+
encryptedData
+
",iv:"
+
iv
,
e
);
+
",encryptedData:"
+
encryptedData
// LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
+
",iv:"
+
iv
,
null
,
e
);
// + ",encryptedData:" + encryptedData
// + ",iv:" + iv, null, e);
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"解密微信数据失败"
,
"sessionKey:"
+
sessionkey
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"解密微信数据失败"
+
"sessionKey:"
+
sessionkey
+
",encryptedData:"
+
encryptedData
+
",iv:"
+
iv
,
ex
);
+
",encryptedData:"
+
encryptedData
+
",iv:"
+
iv
,
null
,
ex
);
// LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
// + ",encryptedData:" + encryptedData
// + ",iv:" + iv, null, ex);
}
}
return
decrptedString
;
return
decrptedString
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
e5b3b651
package
cn
.
freemud
.
service
.
impl
.
calculate
;
package
cn
.
freemud
.
service
.
impl
.
calculate
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.constant.ApplicationConstant
;
import
cn.freemud.constant.ApplicationConstant
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.entities.dto.CheckSpqInfoRequestDto
;
import
cn.freemud.entities.dto.CheckSpqInfoRequestDto
;
...
@@ -203,7 +204,7 @@ public class CalculationSharingDiscountService {
...
@@ -203,7 +204,7 @@ public class CalculationSharingDiscountService {
sharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
calculationSharingDiscountRequestDto
);
sharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
calculationSharingDiscountRequestDto
);
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount/sharing"
,
calculationSharingDiscountRequestDto
,
e
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONString
(
calculationSharingDiscountRequestDto
)
,
e
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
}
}
// 返回成功
// 返回成功
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/ScoreSharingService.java
View file @
e5b3b651
package
cn
.
freemud
.
service
.
impl
.
calculate
.
promotion
;
package
cn
.
freemud
.
service
.
impl
.
calculate
.
promotion
;
import
cn.freemud.base.util.JsonUtil
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.constant.CustomerScoreConstant
;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
import
cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto
;
import
cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto
;
...
@@ -57,7 +58,7 @@ public class ScoreSharingService {
...
@@ -57,7 +58,7 @@ public class ScoreSharingService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
userScoreUseDetail
=
customScoreClient
.
getUserScoreUseDetail
(
request
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"getUserScoreUseDetailError"
,
"/user/scoreUseDetail"
,
request
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JsonUtil
.
toJSONString
(
request
)
,
ex
);
}
}
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
if
(
userScoreUseDetail
!=
null
&&
userScoreUseDetail
.
getCode
().
equals
(
FMStatusCode
.
SUCCESS
.
getCode
())
&&
userScoreUseDetail
.
getResult
()
!=
null
)
{
...
@@ -165,7 +166,8 @@ public class ScoreSharingService {
...
@@ -165,7 +166,8 @@ public class ScoreSharingService {
}
}
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"getScoreValueFail"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"getScoreValueFail"
,
ex
);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
}
return
result
;
return
result
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
e5b3b651
...
@@ -138,7 +138,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -138,7 +138,7 @@ public class ShoppingCartMCoffeeServiceImpl {
* 添加商品、超值加购、商品券
* 添加商品、超值加购、商品券
*/
*/
public
BaseResponse
addGoods
(
MCoffeeAddGoodsRequestVo
addShoppingCartGoodsRequestVo
)
{
public
BaseResponse
addGoods
(
MCoffeeAddGoodsRequestVo
addShoppingCartGoodsRequestVo
)
{
log
.
info
(
"addShoppingCartGoodsRequestVo : "
+
JSON
.
toJSONString
(
addShoppingCartGoodsRequestVo
)
);
ApiLog
.
printLog
(
"addShoppingCartGoodsRequestVo"
,
JSON
.
toJSONString
(
addShoppingCartGoodsRequestVo
),
null
,
null
);
// 参数校验
// 参数校验
if
(
StringUtils
.
isEmpty
(
addShoppingCartGoodsRequestVo
.
getShopId
()))
{
if
(
StringUtils
.
isEmpty
(
addShoppingCartGoodsRequestVo
.
getShopId
()))
{
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
...
@@ -176,7 +176,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -176,7 +176,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// 查询购物车缓存
// 查询购物车缓存
List
<
CartGoods
>
oldCartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
List
<
CartGoods
>
oldCartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
log
.
info
(
"oldCartGoodsList : "
+
JSON
.
toJSONString
(
oldCartGoodsList
)
);
ApiLog
.
printLog
(
"oldCartGoodsList"
,
JSON
.
toJSONString
(
oldCartGoodsList
),
null
,
null
);
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
oldCartGoodsList
=
new
ArrayList
<>();
oldCartGoodsList
=
new
ArrayList
<>();
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
e5b3b651
...
@@ -215,7 +215,7 @@ public class CalculationServiceImpl {
...
@@ -215,7 +215,7 @@ public class CalculationServiceImpl {
calculationDiscountResult
.
setSendGoods
(
Arrays
.
asList
(
sendActivity
));
calculationDiscountResult
.
setSendGoods
(
Arrays
.
asList
(
sendActivity
));
}
}
}
}
log
.
info
(
"calculationDiscountResultAfterProcess : "
+
JSON
.
toJSONString
(
calculationDiscountGoodsList
)
);
ApiLog
.
printLog
(
"calculationDiscountResultAfterProcess"
,
JSON
.
toJSONString
(
calculationDiscountGoodsList
),
null
,
null
);
return
calculationDiscountResult
;
return
calculationDiscountResult
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
e5b3b651
...
@@ -462,7 +462,7 @@ public class CouponDiscountCalculation {
...
@@ -462,7 +462,7 @@ public class CouponDiscountCalculation {
getMemberCouponListRequestDto
.
setPageNum
(
1
);
getMemberCouponListRequestDto
.
setPageNum
(
1
);
getMemberCouponListRequestDto
.
setPageSize
(
Integer
.
MAX_VALUE
);
getMemberCouponListRequestDto
.
setPageSize
(
Integer
.
MAX_VALUE
);
GetMemberCouponListResponseDto
.
Result
result
=
getMemberCouponList
(
getMemberCouponListRequestDto
);
GetMemberCouponListResponseDto
.
Result
result
=
getMemberCouponList
(
getMemberCouponListRequestDto
);
LogUtil
.
debug
(
"CouponServiceImpl_getMemberCouponList"
,
JSON
.
toJSONString
(
getMemberCouponListRequestDto
),
JSON
.
toJSONString
(
result
));
//
LogUtil.debug("CouponServiceImpl_getMemberCouponList", JSON.toJSONString(getMemberCouponListRequestDto), JSON.toJSONString(result));
if
(
result
==
null
||
CollectionUtils
.
isEmpty
(
result
.
getMemberCoupons
()))
{
if
(
result
==
null
||
CollectionUtils
.
isEmpty
(
result
.
getMemberCoupons
()))
{
return
null
;
return
null
;
}
}
...
@@ -508,7 +508,8 @@ public class CouponDiscountCalculation {
...
@@ -508,7 +508,8 @@ public class CouponDiscountCalculation {
try
{
try
{
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
getMemberCouponListResponseDto
=
customerExtendClient
.
getMemberCouponListRequestDto
(
getMemberCouponListRequestDto
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"会员服务优惠券接口调用失败"
,
""
,
""
,
ex
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"会员服务优惠券接口调用失败"
,
ex
);
// LogUtil.error("会员服务优惠券接口调用失败","","", ex);
}
}
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
if
(
getMemberCouponListResponseDto
!=
null
&&
Objects
.
equals
(
getMemberCouponListResponseDto
.
getCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
return
getMemberCouponListResponseDto
.
getData
();
return
getMemberCouponListResponseDto
.
getData
();
...
@@ -554,10 +555,11 @@ public class CouponDiscountCalculation {
...
@@ -554,10 +555,11 @@ public class CouponDiscountCalculation {
try
{
try
{
couponsAvailable
=
mCoffeeCouponClient
.
getCouponsAvailable
(
couponAvailableReqVo
);
couponsAvailable
=
mCoffeeCouponClient
.
getCouponsAvailable
(
couponAvailableReqVo
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
LogUtil
.
error
(
"getCouponsAvailable_error"
,
JSON
.
toJSONString
(
couponAvailableReqVo
),
null
,
e
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
JSON
.
toJSONString
(
couponAvailableReqVo
),
e
);
// LogUtil.error("getCouponsAvailable_error",JSON.toJSONString(couponAvailableReqVo),null,e);
throw
new
ServiceException
(
ResponseResult
.
SYSTEM_BUSINESS_ERROR
);
throw
new
ServiceException
(
ResponseResult
.
SYSTEM_BUSINESS_ERROR
);
}
}
LogUtil
.
info
(
"getCouponsAvailable"
,
JSON
.
toJSONString
(
couponAvailableReqVo
),
JSON
.
toJSONString
(
couponsAvailable
));
//
LogUtil.info("getCouponsAvailable", JSON.toJSONString(couponAvailableReqVo), JSON.toJSONString(couponsAvailable));
if
(
couponsAvailable
!=
null
&&
Objects
.
equals
(
String
.
valueOf
(
couponsAvailable
.
getResult
()),
ResponseResult
.
SUCCESS
.
getCode
())
if
(
couponsAvailable
!=
null
&&
Objects
.
equals
(
String
.
valueOf
(
couponsAvailable
.
getResult
()),
ResponseResult
.
SUCCESS
.
getCode
())
&&
CollectionUtils
.
isNotEmpty
(
couponsAvailable
.
getCouponStateList
()))
{
&&
CollectionUtils
.
isNotEmpty
(
couponsAvailable
.
getCouponStateList
()))
{
couponStateList
.
addAll
(
couponsAvailable
.
getCouponStateList
());
couponStateList
.
addAll
(
couponsAvailable
.
getCouponStateList
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/utils/LogUtil.java
View file @
e5b3b651
...
@@ -20,6 +20,7 @@ import cn.freemud.entities.vo.ThirdPartLogVo;
...
@@ -20,6 +20,7 @@ import cn.freemud.entities.vo.ThirdPartLogVo;
import
cn.freemud.service.thirdparty.CouponOnlineClient
;
import
cn.freemud.service.thirdparty.CouponOnlineClient
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
...
@@ -288,8 +289,9 @@ public class LogUtil {
...
@@ -288,8 +289,9 @@ public class LogUtil {
method
=
targetClass
.
getMethod
(
joinPoint
.
getSignature
().
getName
(),
argTypes
);
method
=
targetClass
.
getMethod
(
joinPoint
.
getSignature
().
getName
(),
argTypes
);
}
}
}
catch
(
NoSuchMethodException
e
)
{
}
catch
(
NoSuchMethodException
e
)
{
// ErrorLog.errorConvertJson(this.getClass(),JSON.toJSONString(joinPoint.getArgs()),e);
LogUtil
.
error
(
""
,
serviceName
,
JSON
.
toJSONString
(
joinPoint
.
getArgs
()),
e
);
LogUtil
.
error
(
""
,
serviceName
,
JSON
.
toJSONString
(
joinPoint
.
getArgs
()),
e
);
e
.
printStackTrace
();
//
e.printStackTrace();
}
}
if
(
method
!=
null
)
{
if
(
method
!=
null
)
{
methodName
=
method
.
getName
();
methodName
=
method
.
getName
();
...
...
shopping-cart-application-service/src/test/java/cn.freemud/client/CouoponOnlineTest.java
View file @
e5b3b651
...
@@ -50,7 +50,7 @@ public class CouoponOnlineTest {
...
@@ -50,7 +50,7 @@ public class CouoponOnlineTest {
requestDto
.
put
(
"sign"
,
sign
);
requestDto
.
put
(
"sign"
,
sign
);
Object
responseDto2
=
couponOnlineClient
.
getCouponDetails
(
requestDto
);
Object
responseDto2
=
couponOnlineClient
.
getCouponDetails
(
requestDto
);
log
.
debug
(
"requestDto"
+
requestDto
);
log
.
debug
(
"requestDto"
+
requestDto
);
LogUtil
.
info
(
"couponOnlineClient.getCouponDetails"
,
gson
.
toJson
(
requestDto
),
gson
.
toJson
(
responseDto2
));
//
LogUtil.info("couponOnlineClient.getCouponDetails", gson.toJson(requestDto), gson.toJson(responseDto2));
}
}
@Test
@Test
...
@@ -63,7 +63,7 @@ public class CouoponOnlineTest {
...
@@ -63,7 +63,7 @@ public class CouoponOnlineTest {
String
sign
=
SignUtil
.
createMD5Sign
(
requestDto
,
appSecret
);
String
sign
=
SignUtil
.
createMD5Sign
(
requestDto
,
appSecret
);
requestDto
.
setSign
(
sign
);
requestDto
.
setSign
(
sign
);
BatchQueryActivityInfoResponseDto
batchQueryActivityInfoResponseDto
=
cardBinClient
.
batchQueryActivityInfo
(
requestDto
);
BatchQueryActivityInfoResponseDto
batchQueryActivityInfoResponseDto
=
cardBinClient
.
batchQueryActivityInfo
(
requestDto
);
LogUtil
.
debug
(
"batchQueryActivityInfoTest"
,
JSON
.
toJSONString
(
requestDto
),
JSON
.
toJSONString
(
batchQueryActivityInfoResponseDto
));
//
LogUtil.debug("batchQueryActivityInfoTest", JSON.toJSONString(requestDto), JSON.toJSONString(batchQueryActivityInfoResponseDto));
}
}
...
...
shopping-cart-application-service/src/test/java/cn.freemud/client/MqTest.java
View file @
e5b3b651
...
@@ -10,6 +10,7 @@ import cn.freemud.entities.dto.QueryOrdersResponseDto;
...
@@ -10,6 +10,7 @@ import cn.freemud.entities.dto.QueryOrdersResponseDto;
import
cn.freemud.utils.FileUtil
;
import
cn.freemud.utils.FileUtil
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -49,7 +50,8 @@ public class MqTest {
...
@@ -49,7 +50,8 @@ public class MqTest {
MQMessage
<
ActivityCancelStockRequestDto
>
message
=
new
MQMessage
<>(
header
,
activityCancelStockRequestDto
);
MQMessage
<
ActivityCancelStockRequestDto
>
message
=
new
MQMessage
<>(
header
,
activityCancelStockRequestDto
);
mqService
.
convertAndSend
(
backOrdersNotifyActivityExchange
,
backOrdersNotifyActivityQueue
,
message
);
mqService
.
convertAndSend
(
backOrdersNotifyActivityExchange
,
backOrdersNotifyActivityQueue
,
message
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"ActivityReverse"
,
JSON
.
toJSONString
(
activityCancelStockRequestDto
),
""
,
e
);
ErrorLog
.
errorConvertJson
(
this
.
getClass
(),
"ActivityReverse"
+
JSON
.
toJSONString
(
activityCancelStockRequestDto
),
e
);
// LogUtil.error("ActivityReverse", JSON.toJSONString(activityCancelStockRequestDto), "", e);
}
}
}
}
...
...
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