Commit 0c99d23b by ping.wu

Merge remote-tracking branch 'origin/feature/20210720-购物车日志修改-张志恒' into…

Merge remote-tracking branch 'origin/feature/20210720-购物车日志修改-张志恒' into feature/20210720-购物车日志修改-张志恒
parents ba555eef e5b3b651
......@@ -3,6 +3,7 @@ package cn.freemud.service.delivery;
import cn.freemud.adapter.MessageNoticeAdapter;
import cn.freemud.amp.service.ProduceMQService;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.base.log.ErrorLog;
import cn.freemud.base.log.LogTreadLocal;
import cn.freemud.entities.dto.delivery.*;
import cn.freemud.entities.dto.ecology.*;
......@@ -30,6 +31,7 @@ import com.freemud.application.sdk.api.deliverycenter.dto.CancelDeliveryOrderReq
import com.freemud.application.sdk.api.deliverycenter.response.DeliveryInfoDto;
import com.freemud.application.sdk.api.deliverycenter.response.DeliveryResponseDto;
import com.freemud.application.sdk.api.deliverycenter.service.DeliveryService;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.application.sdk.api.ordercenter.enums.OrderType;
......@@ -138,7 +140,7 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
OrderBaseResponse orderBaseResponseDto = orderCenterSdkService.updateDeliveryInfoById(requestDto);
//订单服务修改配送单信息失败
if (!SUCCESS_RESPONSE_CODE.equals(orderBaseResponseDto.getErrcode())) {
AppLogUtil.errorLog("updateDeliveryInfoById_error", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(orderBaseResponseDto));
ApiLog.printLog("updateDeliveryInfoById_error", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(orderBaseResponseDto), "");
return ResponseUtil.success();
}
PosBaseRequestDto posBaseRequestDto = new PosBaseRequestDto();
......@@ -410,11 +412,7 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
message.setContent(content);
pushMessageNoticeDto.setData(new Gson().toJson(message));
try {
messageNoticeClient.createMessage(pushMessageNoticeDto, LogThreadLocal.getTrackingNo());
}catch (Exception e){
AppLogUtil.errorLog("推送消息中心失败,订单编号:{},失败原因:{}", orderId, "", e);
}
messageNoticeClient.createMessage(pushMessageNoticeDto, LogThreadLocal.getTrackingNo());
}
/**
......@@ -552,37 +550,33 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
* 通知生态发送调用消息
*/
public void sendException(String orderId, String unusualReason, String unusualTime, String desc) {
try {
BaseQueryOrderRequest baseQueryOrderRequest = new BaseQueryOrderRequest();
baseQueryOrderRequest.setOrderId(orderId);
baseQueryOrderRequest.setTrackingNo(LogTreadLocal.getTrackingNo());
QueryOrderByIdResponse response = orderCenterSdkService.queryOrderById(baseQueryOrderRequest);
QueryOrdersResponse.DataBean.OrderBean orderBean = response.getData();
SubscribeMessageRequest request = new SubscribeMessageRequest();
OrderExtInfoDto extInfoDto = JSONObject.parseObject(orderBean.getExtInfo(), new TypeReference<OrderExtInfoDto>() {
});
String messageType = "UNUSUAL_ORDER";
if(deliveryEarlyWarningMsg.equals(desc)){
messageType = "DELIVERY_REMIND";
if(orderBean.getStatus() != null && OrderStatus.getByCode(orderBean.getStatus()) != null){
desc = OrderStatus.getByCode(orderBean.getStatus()).getDesc();
}
BaseQueryOrderRequest baseQueryOrderRequest = new BaseQueryOrderRequest();
baseQueryOrderRequest.setOrderId(orderId);
baseQueryOrderRequest.setTrackingNo(LogTreadLocal.getTrackingNo());
QueryOrderByIdResponse response = orderCenterSdkService.queryOrderById(baseQueryOrderRequest);
QueryOrdersResponse.DataBean.OrderBean orderBean = response.getData();
SubscribeMessageRequest request = new SubscribeMessageRequest();
OrderExtInfoDto extInfoDto = JSONObject.parseObject(orderBean.getExtInfo(), new TypeReference<OrderExtInfoDto>() {
});
String messageType = "UNUSUAL_ORDER";
if (deliveryEarlyWarningMsg.equals(desc)) {
messageType = "DELIVERY_REMIND";
if (orderBean.getStatus() != null && OrderStatus.getByCode(orderBean.getStatus()) != null) {
desc = OrderStatus.getByCode(orderBean.getStatus()).getDesc();
}
request.setMiniAppId(extInfoDto.getAppid());
SendMessageRequest sendMessageRequest = new SendMessageRequest();
sendMessageRequest.setMessageType(messageType);
sendMessageRequest.setMiniAppId(extInfoDto.getAppid());
sendMessageRequest.setOrderId(orderId);
sendMessageRequest.setPartnerId(orderBean.getCompanyId());
sendMessageRequest.setRemark(unusualReason);
sendMessageRequest.setStoreId(orderBean.getShopId());
sendMessageRequest.setOrderStatus(desc);
sendMessageRequest.setUtcTime(unusualTime);
SendMessageResponse sendMessageResponse = ecologyAdminApplicationClient.sendTemplateMessage(sendMessageRequest);
AppLogUtil.debugLotsParams("调用生态返回参数,订单编号:{},返回信息:{}", orderId, JSONObject.toJSONString(sendMessageResponse));
} catch (Exception e) {
AppLogUtil.errorLog("调用生态返回参数失败,订单编号:{},失败原因:{}", orderId, "", e);
}
request.setMiniAppId(extInfoDto.getAppid());
SendMessageRequest sendMessageRequest = new SendMessageRequest();
sendMessageRequest.setMessageType(messageType);
sendMessageRequest.setMiniAppId(extInfoDto.getAppid());
sendMessageRequest.setOrderId(orderId);
sendMessageRequest.setPartnerId(orderBean.getCompanyId());
sendMessageRequest.setRemark(unusualReason);
sendMessageRequest.setStoreId(orderBean.getShopId());
sendMessageRequest.setOrderStatus(desc);
sendMessageRequest.setUtcTime(unusualTime);
SendMessageResponse sendMessageResponse = ecologyAdminApplicationClient.sendTemplateMessage(sendMessageRequest);
AppLogUtil.debugLotsParams("调用生态返回参数,订单编号:{},返回信息:{}", orderId, JSONObject.toJSONString(sendMessageResponse));
}
......
......@@ -16,6 +16,7 @@ import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.EvaluationService;
import cn.freemud.service.thirdparty.ActivityApplicationClient;
import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOrderEvaluation;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentProductEvaluation;
import com.freemud.api.assortment.datamanager.entity.dto.InsertOrderEvaluationReqDto;
......@@ -101,7 +102,7 @@ public class EvaluationServiceImpl implements EvaluationService {
}
}
} catch (Exception ex) {
ErrorLog.printErrorLog("userOrderEvaluationNewError", "/order/userOrderEvaluationNew", request, ex);
ErrorLog.errorConvertJson(this.getClass(), "userOrderEvaluationNewError /order/userOrderEvaluationNew" + JSON.toJSONString(request), ex);
return ResponseUtil.success(new OrderEvaluationStatus(EvaluationStatus.FAIL.getCode()));
}
return ResponseUtil.success(orderEvaluationStatus);
......
......@@ -1298,23 +1298,19 @@ public class OrderServiceImpl implements Orderservice {
//fisherman 【ID1032306】 【订单聚合层】总部和区域活动可同时生效
BaseResponse<PayGiftCheckAndJoinResponseObj> payGiftBaseResponse;
try {
payGiftBaseResponse = activityApplicationClient.payGiftCheckAndJoinNew(payGitRequestDto);
AppLogUtil.infoLog("fisherman 总部和区域活动可同时生效 ", payGitRequestDto, payGiftBaseResponse);
if (String.valueOf(RESPONSE_SUCCESS_CODE).equals(payGiftBaseResponse.getCode()) && payGiftBaseResponse.getResult() != null) {
PayGiftCheckAndJoinResponseObj result = payGiftBaseResponse.getResult();
PayGiftCheckAndJoinResponseDto oldPayGift = result.getOldPayGift();
// fisherman 版本前 原参数保留,暂不变更 向下兼容
if (oldPayGift != null) {
queryOrderResponseVo.setActivityName(oldPayGift.getActivityName());
queryOrderResponseVo.setCoupons(oldPayGift.getCoupons());
queryOrderResponseVo.setWechatCouponInfo(oldPayGift.getWechatCouponInfo());
queryOrderResponseVo.setPayGiftReps(oldPayGift);
}
queryOrderResponseVo.setNewPayGift(result.getNewPayGift());
payGiftBaseResponse = activityApplicationClient.payGiftCheckAndJoinNew(payGitRequestDto);
AppLogUtil.infoLog("fisherman 总部和区域活动可同时生效 ", payGitRequestDto, payGiftBaseResponse);
if (String.valueOf(RESPONSE_SUCCESS_CODE).equals(payGiftBaseResponse.getCode()) && payGiftBaseResponse.getResult() != null) {
PayGiftCheckAndJoinResponseObj result = payGiftBaseResponse.getResult();
PayGiftCheckAndJoinResponseDto oldPayGift = result.getOldPayGift();
// fisherman 版本前 原参数保留,暂不变更 向下兼容
if (oldPayGift != null) {
queryOrderResponseVo.setActivityName(oldPayGift.getActivityName());
queryOrderResponseVo.setCoupons(oldPayGift.getCoupons());
queryOrderResponseVo.setWechatCouponInfo(oldPayGift.getWechatCouponInfo());
queryOrderResponseVo.setPayGiftReps(oldPayGift);
}
}catch (Exception e){
AppLogUtil.errorLog("error to /promotionActivity/payGiftShareCheckAndJoin ", JSON.toJSONString(payGitRequestDto),null, e);
queryOrderResponseVo.setNewPayGift(result.getNewPayGift());
}
}
......
......@@ -212,7 +212,7 @@ public class WebAspect {
result = joinPoint.proceed();
} catch (Exception ex) {
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
ErrorLog.printErrorLog(ex.getMessage(),thirdPartLogVo.getUri(),thirdPartLogVo.getRequestBody(),ex);
ErrorLog.errorConvertJson(this.getClass(),thirdPartLogVo.getRequestBody(),ex);
throw ex;
}
try {
......
......@@ -104,7 +104,7 @@ public class KgdCouponServiceImpl implements CouponService {
// 如果是商品券/换购券,获取券信息
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())) {
return null;
......@@ -160,7 +160,7 @@ public class KgdCouponServiceImpl implements CouponService {
GetProductBySkuIdBO getProductBySkuIdBO = convert2GetProductBySkuIdBO(getCheckSpqBo,skuId);
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);
if (null == productsVo || !Objects.equals(productsVo.getStatus(), StoreItemStatus.PUT_ON_SALE.getCode())) {
return null;
......
......@@ -96,7 +96,7 @@ public class KgdCustomerServceImpl implements CustomerService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail = customScoreClient.getUserScoreUseDetail(request);
} 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) {
userScoreUserDetailBO = customerDTO2BOAdapter.convert2UserScoreUserDetailBO(userScoreUseDetail);
......
package cn.freemud.demo.manager.promotion;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.demo.entities.bo.promotion.GetActivityBO;
import cn.freemud.demo.adapter.manager.PromotionBO2DTOAdapter;
import cn.freemud.demo.adapter.manager.PromotionDTO2BOAdapter;
......@@ -49,7 +50,7 @@ public class KgdPromotionServiceImpl implements PromotionService{
calculationSharingDiscountResponseDto = calculationClient.calculationSharingDiscount(shareDiscountRequestDto);
}
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);
}
......
......@@ -104,19 +104,19 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
public final ShoppingCartGoodsBO addGoods(BaseAddGoodsBO addGoodsBO) {
// 基本参数校验
this.checkParams(addGoodsBO);
LogUtil.info("addGoodsBO >>> ",JsonUtil.toJSONString(addGoodsBO),null);
// LogUtil.info("addGoodsBO >>> ",JsonUtil.toJSONString(addGoodsBO),null);
// 获取购物车和加车商品信息
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);
LogUtil.info("checkBusinessRules >>> ",JsonUtil.toJSONString(addGoodsBO),JsonUtil.toJSONString(addGoodsToShoppingCartBO));
// LogUtil.info("checkBusinessRules >>> ",JsonUtil.toJSONString(addGoodsBO),JsonUtil.toJSONString(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);
......@@ -215,7 +215,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
GetProductBO getProductBO = convert2ProductBO(baseRequestBO, spqBO);
// 获取商品信息
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);
bo.setProduct(productsInfo);
......@@ -333,9 +333,9 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
*/
public final AddGoodsToShoppingCartBO checkBusinessRules(BaseAddGoodsBO baseRequestDTO, CheckBussinessRulesBO 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);
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;
}
......@@ -366,7 +366,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
private AddGoodsToShoppingCartBO checkCommBusinessRules(BaseAddGoodsBO baseRequestDTO, CheckBussinessRulesBO checkBussinessRulesBO) {
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();
......@@ -386,11 +386,11 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
// 检查校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
ShoppingCartContext cartContext = convert2ShopingCartContext(baseRequestDTO);
LogUtil.info("checkShoppingCart1111 >>> ",JsonUtil.toJSONString(Arrays.asList(checkBussinessRulesBO)),null);
LogUtil.info("checkShoppingCart2222 >>> ",JsonUtil.toJSONString(Arrays.asList(addGoods)),null);
LogUtil.info("checkShoppingCart3333 >>> ",JsonUtil.toJSONString(Arrays.asList(cartContext)),null);
// LogUtil.info("checkShoppingCart1111 >>> ",JsonUtil.toJSONString(Arrays.asList(checkBussinessRulesBO)),null);
// LogUtil.info("checkShoppingCart2222 >>> ",JsonUtil.toJSONString(Arrays.asList(addGoods)),null);
// LogUtil.info("checkShoppingCart3333 >>> ",JsonUtil.toJSONString(Arrays.asList(cartContext)),null);
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.setToastMsg(checkCartRequest.getToastMsg());
......
......@@ -2,6 +2,7 @@ package cn.freemud.demo.service.impl;
import cn.freemud.adapter.ActivityAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.constant.CustomerScoreConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.demo.entities.bo.SendGoods;
......@@ -833,7 +834,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail = customerManager.getUserScoreUseDetail(request, baseRequestDTO.getManagerService().getCustomerService());
} catch (Exception ex) {
ErrorLog.printErrorLog("getUserScoreUseDetailError", "/user/scoreUseDetail", request, ex);
ErrorLog.errorConvertJson(this.getClass(), JsonUtil.toJSONString(request), ex);
}
if (userScoreUseDetail != null) {
......@@ -911,7 +912,8 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
}
}
} catch (Exception ex) {
LogUtil.error("getScoreValueFail", "", "", ex);
ErrorLog.errorConvertJson(this.getClass(),"getScoreValueFail",ex);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
return result;
}
......
......@@ -710,7 +710,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail = customerManager.getUserScoreUseDetail(request, baseRequestDTO.getManagerService().getCustomerService());
} catch (Exception ex) {
ErrorLog.printErrorLog("getUserScoreUseDetailError", "/user/scoreUseDetail", request, ex);
ErrorLog.errorConvertJson(this.getClass(),"getUserScoreUseDetailError",ex);
}
if (userScoreUseDetail != null) {
......@@ -793,7 +793,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
}
} catch (Exception ex) {
LogUtil.error("getScoreValueFail", "", "", ex);
ErrorLog.errorConvertJson(this.getClass(),"getScoreValueFail",ex);
}
return result;
}
......
......@@ -158,7 +158,7 @@ public interface ShoppingCartNewService {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, couponCode, menuType);
CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class);
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) {
throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_MIX_NOT_EXIST);
}
......
......@@ -16,12 +16,14 @@ package cn.freemud.service.impl;
import cn.freemud.amqp.Header;
import cn.freemud.amqp.MQMessage;
import cn.freemud.amqp.MQService;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.comm.druid.MyMapper;
import cn.freemud.entities.db.SaasLinkMonitorLog;
import cn.freemud.entities.vo.ThirdPartLogVo;
import cn.freemud.service.AsyOperationService;
import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.log.ErrorLog;
import lombok.Getter;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -104,7 +106,8 @@ public class AsyOperationServiceImpl implements AsyOperationService {
MQMessage<SaasLinkMonitorLog> message = new MQMessage<>(header, saasLinkMonitorLog);
mqService.convertAndSend(linkLogExchange, linkLogQueue, message);
} catch (Exception ex) {
LogUtil.error("MQLOGERROR", thirdPartLogVo, ex.getMessage());
ErrorLog.errorConvertJson(this.getClass(), JsonUtil.toJSONString(thirdPartLogVo),ex);
// ErrorLog.printErrorLog("MQLOGERROR","",thirdPartLogVo,ex);
}
});
}
......
......@@ -41,6 +41,7 @@ import cn.freemud.utils.RedisUtil;
import com.alibaba.fastjson.JSON;
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.productcenter.constant.ResponseConstant;
import com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductRequest;
import com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductType;
......@@ -230,7 +231,8 @@ public class CouponServiceImpl implements CouponService {
try {
getMemberCouponListResponseDto = customerExtendClient.getMemberCouponListRequestDto(getMemberCouponListRequestDto);
} catch (Exception ex) {
LogUtil.error("会员服务优惠券接口调用失败", "","",ex);
ErrorLog.errorConvertJson(this.getClass(),"会员服务优惠券接口调用失败",ex);
// LogUtil.error("会员服务优惠券接口调用失败", "","",ex);
}
if (getMemberCouponListResponseDto != null && Objects.equals(getMemberCouponListResponseDto.getCode(), ResponseResult.SUCCESS.getCode())) {
return getMemberCouponListResponseDto.getData();
......@@ -350,7 +352,7 @@ public class CouponServiceImpl implements CouponService {
String sign = SignUtil.createMD5Sign(map, appSecret);
map.put(Finals.SIGN, sign);
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())) {
details.addAll(responseDto.getDetails());
}
......@@ -454,7 +456,7 @@ public class CouponServiceImpl implements CouponService {
getMemberCouponListRequestDto.setPageNum(1);
getMemberCouponListRequestDto.setPageSize(Integer.MAX_VALUE);
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();
// 过滤优惠券得点餐方式
if (!Objects.isNull(result) && CollectionUtils.isNotEmpty(result.getMemberCoupons())) {
......@@ -538,7 +540,7 @@ public class CouponServiceImpl implements CouponService {
couponAvailableReqVo.setCouponCodes(calCouponCodes);
//CouponAvailableRespVo couponsAvailable = couponAvailableService.getCouponsAvailable(couponAvailableReqVo, appSecret);
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())
&& CollectionUtils.isNotEmpty(couponsAvailable.getCouponStateList())) {
couponStateList.addAll(couponsAvailable.getCouponStateList());
......@@ -550,10 +552,10 @@ public class CouponServiceImpl implements CouponService {
private ActivityClassifyCouponBean returnSuccessAvailiableCoupons(Set<String> couponCodes, boolean hasGoodsCoupon, ActivityClassifyCouponBean availableCouponResponseVo, List<ActivityCouponBean> usableCoupons,
List<ActivityCouponBean> disableCoupons, Map<String, GetMemberCouponListResponseDto.Result.MemberCoupon> memberCouponMap,
List<CouponStateVo> couponStateList, String chooseCouponCode) {
LogUtil.info("returnSuccessAvailiableCoupons 01 couponCode : hasGoodsCoupon", couponCodes,hasGoodsCoupon);
LogUtil.info("returnSuccessAvailiableCoupons 02 availableCouponResponseVo : usableCoupons", availableCouponResponseVo,usableCoupons);
LogUtil.info("returnSuccessAvailiableCoupons 03 disableCoupons : memberCouponMap", disableCoupons,memberCouponMap);
LogUtil.info("returnSuccessAvailiableCoupons 04 couponStateList : chooseCouponCode", couponStateList,chooseCouponCode);
// LogUtil.info("returnSuccessAvailiableCoupons 01 couponCode : hasGoodsCoupon", couponCodes,hasGoodsCoupon);
// LogUtil.info("returnSuccessAvailiableCoupons 02 availableCouponResponseVo : usableCoupons", availableCouponResponseVo,usableCoupons);
// LogUtil.info("returnSuccessAvailiableCoupons 03 disableCoupons : memberCouponMap", disableCoupons,memberCouponMap);
// LogUtil.info("returnSuccessAvailiableCoupons 04 couponStateList : chooseCouponCode", couponStateList,chooseCouponCode);
int disableCouponNum = 0;
int usableCouponNum = 0;
for (CouponStateVo couponStateVo : couponStateList) {
......@@ -775,7 +777,7 @@ public class CouponServiceImpl implements CouponService {
requestVo.setCouponCode(couponCode);
requestVo.setStoreId(requestDto.getStoreId());
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())) {
return null;
}
......@@ -1028,7 +1030,7 @@ public class CouponServiceImpl implements CouponService {
requestVo.setCouponCode(couponCode);
requestVo.setStoreId(requestDto.getStoreId());
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())) {
return null;
}
......
package cn.freemud.service.impl;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.constant.CustomerScoreConstant;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.UserLoginInfoDto;
......@@ -55,7 +56,7 @@ public class CustomerScoreService implements IPromotionService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail = customScoreClient.getUserScoreUseDetail(request);
} 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) {
Integer discountAmount = 0;
......@@ -161,7 +162,8 @@ public class CustomerScoreService implements IPromotionService {
}
}
} catch (Exception ex) {
LogUtil.error("getScoreValueFail", "", "", ex);
ErrorLog.errorConvertJson(this.getClass(),"getScoreValueFail",ex);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
return result;
}
......
......@@ -39,10 +39,10 @@ public class FullSubtractionActivityServiceImpl {
*/
public PromotionMessageDto getFullPromotionActivityInfo(ActivityQueryDto activityQueryDto, Long totalAmount, boolean hasOtherDiscount) {
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);
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;
}
PromotionMessageDto promotionMessageDto = new PromotionMessageDto();
......
......@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -55,7 +56,7 @@ public class OpenStoreIappWxappConfigServiceImpl implements OpenStoreIappWxappCo
}
}catch (Exception e){
//异常打印日常日志,返回默认config
LogUtil.error("getOpenStoreIappWxappConfig error {}" ,"","",e);
ErrorLog.errorConvertJson(this.getClass(),"getOpenStoreIappWxappConfig",e);
return ResponseUtil.success(defauleConfig);
}
}
......
......@@ -970,7 +970,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(province)) {
return deliveryAmount;
}
log.info("获取配送配逻辑 tackingNo:{},partnerId:{},province", LogThreadLocal.getTrackingNo(), partnerId,province);
ApiLog.printLog("获取配送配逻辑 ", LogThreadLocal.getTrackingNo(), partnerId,province);
Long orderAmount = 0L ;
Integer orderCount = 0;
if(null != cartGoodsList && cartGoodsList.size()>0){
......
......@@ -2456,7 +2456,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(receiveId) && !Objects.equals(orderType, CreateOrderType.TAKE_OUT.getCode())) {
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) {
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString());
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
......@@ -2849,7 +2849,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
try {
getMemberCouponListResponseDto = customerExtendClient.getMemberCouponListRequestDto(getMemberCouponListRequestDto);
} catch (Exception ex) {
LogUtil.error("会员服务优惠券接口调用失败","","", ex);
ErrorLog.errorConvertJson(this.getClass(),"会员服务优惠券接口调用失败",ex);
// LogUtil.error("会员服务优惠券接口调用失败","","", ex);
}
if (getMemberCouponListResponseDto != null && Objects.equals(getMemberCouponListResponseDto.getCode(), ResponseResult.SUCCESS.getCode())) {
return getMemberCouponListResponseDto.getData();
......@@ -3374,7 +3375,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//校验库存
List<CartGoods> stockLimitGoods = allCartGoodsList.stream().filter(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)) {
List<Long> goodsId = stockLimitGoods.stream().map(v -> Long.parseLong(v.getGoodsId())).collect(toList());
GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
......@@ -3383,14 +3383,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
requestDto.setStoreId(replaceGoodsRequestVo.getShopId());
requestDto.setProductIds(goodsId);
GetProductStockResponseDto availableStocks = stockClient.getAvailableStocks(requestDto);
LogUtil.info("request check stock begin",requestDto,availableStocks);
if (availableStocks != null ) {
if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode())){
// 没有请求数据
fullReplace = false;
}
if (CollectionUtils.isEmpty(availableStocks.getResult())){
LogUtil.info("request check stock limit fail result is null",requestDto,availableStocks);
fullReplace = false;
}
......@@ -3409,10 +3407,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
});
// 获取到最新的 库存 stockLimitGoods 数据 放入 nowCartGoodsList 中
LogUtil.info("request check stock limit 002 ",stockLimitGoods,notCheckStock);
// LogUtil.info("request check stock limit 002 ",stockLimitGoods,notCheckStock);
notCheckStock.addAll(stockLimitGoods);
}else {
LogUtil.info("request check stock limit fail",requestDto,null);
// LogUtil.info("request check stock limit fail",requestDto,null);
fullReplace = false;
}
}
......
......@@ -208,7 +208,8 @@ public class StoreServiceImpl {
storeDeliveryInfoDto.setDeliveryStartTime(hhmmss.parse(startDateTimeStr));
storeDeliveryInfoDto.setDeliveryEndTime(hhmmss.parse(endDateTimeStr));
} 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 {
try {
endDate = hhmmss.parse(endDateTimeStr);
} 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;
}
if (endDate == null || new Date().after(endDate)) {
......
......@@ -28,6 +28,7 @@ import cn.freemud.service.thirdparty.*;
import cn.freemud.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
......@@ -524,7 +525,7 @@ public class UserServiceImpl implements UserService {
*/
public void checkUserLogin(String 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) {
throw new ServiceException(ResponseResult.NOT_LOGIN);
}
......@@ -534,7 +535,7 @@ public class UserServiceImpl implements UserService {
*/
public boolean checkUserLoginFlag(String 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) {
return false;
}
......@@ -579,7 +580,7 @@ public class UserServiceImpl implements UserService {
if (response == null) {
return null;
}
log.info("[getPhoneNumber] response :{}", response);
ApiLog.printLog("[getPhoneNumber] response :{}", response,null,null);
String phoneNumber = null;
try {
if (response.contains("phoneNumber")) {
......@@ -1053,14 +1054,17 @@ public class UserServiceImpl implements UserService {
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
decrptedString = new String(cipher.doFinal(encData), "UTF-8");
} catch (Exception e) {
LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
+ ",encryptedData:" + encryptedData
+ ",iv:" + iv, null, e);
ErrorLog.errorConvertJson(this.getClass(),"解密微信数据失败"+"sessionKey:" + sessionkey + ",encryptedData:" + encryptedData + ",iv:" + iv, e);
// LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
// + ",encryptedData:" + encryptedData
// + ",iv:" + iv, null, e);
}
} catch (Exception ex) {
LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
+ ",encryptedData:" + encryptedData
+ ",iv:" + iv, null, ex);
ErrorLog.errorConvertJson(this.getClass(),"解密微信数据失败"+"sessionKey:" + sessionkey + ",encryptedData:" + encryptedData + ",iv:" + iv , ex);
// LogUtil.error("解密微信数据失败", "sessionKey:" + sessionkey
// + ",encryptedData:" + encryptedData
// + ",iv:" + iv, null, ex);
}
return decrptedString;
}
......
package cn.freemud.service.impl.calculate;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.entities.dto.CheckSpqInfoRequestDto;
......@@ -203,7 +204,7 @@ public class CalculationSharingDiscountService {
sharingDiscountResponseDto = calculationClient.calculationSharingDiscount(calculationSharingDiscountRequestDto);
}
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);
}
// 返回成功
......
package cn.freemud.service.impl.calculate.promotion;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.constant.CustomerScoreConstant;
import cn.freemud.entities.dto.UserLoginInfoDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto;
......@@ -57,7 +58,7 @@ public class ScoreSharingService {
// 加入try catch是为了custom服务挂掉,购物车服务可以也可以正常
userScoreUseDetail = customScoreClient.getUserScoreUseDetail(request);
} 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) {
......@@ -165,7 +166,8 @@ public class ScoreSharingService {
}
}
} catch (Exception ex) {
LogUtil.error("getScoreValueFail", "", "", ex);
ErrorLog.errorConvertJson(this.getClass(),"getScoreValueFail",ex);
// LogUtil.error("getScoreValueFail", "", "", ex);
}
return result;
}
......
......@@ -138,7 +138,7 @@ public class ShoppingCartMCoffeeServiceImpl {
* 添加商品、超值加购、商品券
*/
public BaseResponse addGoods(MCoffeeAddGoodsRequestVo addShoppingCartGoodsRequestVo) {
log.info("addShoppingCartGoodsRequestVo : " + JSON.toJSONString(addShoppingCartGoodsRequestVo));
ApiLog.printLog("addShoppingCartGoodsRequestVo" , JSON.toJSONString(addShoppingCartGoodsRequestVo),null,null);
// 参数校验
if (StringUtils.isEmpty(addShoppingCartGoodsRequestVo.getShopId())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
......@@ -176,7 +176,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// 查询购物车缓存
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)) {
oldCartGoodsList = new ArrayList<>();
}
......
......@@ -215,7 +215,7 @@ public class CalculationServiceImpl {
calculationDiscountResult.setSendGoods(Arrays.asList(sendActivity));
}
}
log.info("calculationDiscountResultAfterProcess : " + JSON.toJSONString(calculationDiscountGoodsList));
ApiLog.printLog("calculationDiscountResultAfterProcess" ,JSON.toJSONString(calculationDiscountGoodsList),null,null);
return calculationDiscountResult;
}
......
......@@ -462,7 +462,7 @@ public class CouponDiscountCalculation {
getMemberCouponListRequestDto.setPageNum(1);
getMemberCouponListRequestDto.setPageSize(Integer.MAX_VALUE);
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())) {
return null;
}
......@@ -508,7 +508,8 @@ public class CouponDiscountCalculation {
try {
getMemberCouponListResponseDto = customerExtendClient.getMemberCouponListRequestDto(getMemberCouponListRequestDto);
} catch (Exception ex) {
LogUtil.error("会员服务优惠券接口调用失败","","", ex);
ErrorLog.errorConvertJson(this.getClass(),"会员服务优惠券接口调用失败",ex);
// LogUtil.error("会员服务优惠券接口调用失败","","", ex);
}
if (getMemberCouponListResponseDto != null && Objects.equals(getMemberCouponListResponseDto.getCode(), ResponseResult.SUCCESS.getCode())) {
return getMemberCouponListResponseDto.getData();
......@@ -554,10 +555,11 @@ public class CouponDiscountCalculation {
try {
couponsAvailable = mCoffeeCouponClient.getCouponsAvailable(couponAvailableReqVo);
}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);
}
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())
&& CollectionUtils.isNotEmpty(couponsAvailable.getCouponStateList())) {
couponStateList.addAll(couponsAvailable.getCouponStateList());
......
......@@ -20,6 +20,7 @@ import cn.freemud.entities.vo.ThirdPartLogVo;
import cn.freemud.service.thirdparty.CouponOnlineClient;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.log.ErrorLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -288,8 +289,9 @@ public class LogUtil {
method = targetClass.getMethod(joinPoint.getSignature().getName(), argTypes);
}
} catch (NoSuchMethodException e) {
// ErrorLog.errorConvertJson(this.getClass(),JSON.toJSONString(joinPoint.getArgs()),e);
LogUtil.error("", serviceName, JSON.toJSONString(joinPoint.getArgs()), e);
e.printStackTrace();
// e.printStackTrace();
}
if(method != null) {
methodName = method.getName();
......
......@@ -50,7 +50,7 @@ public class CouoponOnlineTest {
requestDto.put("sign",sign);
Object responseDto2 = couponOnlineClient.getCouponDetails(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
......@@ -63,7 +63,7 @@ public class CouoponOnlineTest {
String sign = SignUtil.createMD5Sign(requestDto, appSecret);
requestDto.setSign(sign);
BatchQueryActivityInfoResponseDto batchQueryActivityInfoResponseDto = cardBinClient.batchQueryActivityInfo(requestDto);
LogUtil.debug("batchQueryActivityInfoTest", JSON.toJSONString(requestDto), JSON.toJSONString(batchQueryActivityInfoResponseDto));
// LogUtil.debug("batchQueryActivityInfoTest", JSON.toJSONString(requestDto), JSON.toJSONString(batchQueryActivityInfoResponseDto));
}
......
......@@ -10,6 +10,7 @@ import cn.freemud.entities.dto.QueryOrdersResponseDto;
import cn.freemud.utils.FileUtil;
import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ErrorLog;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -49,7 +50,8 @@ public class MqTest {
MQMessage<ActivityCancelStockRequestDto> message = new MQMessage<>(header, activityCancelStockRequestDto);
mqService.convertAndSend(backOrdersNotifyActivityExchange, backOrdersNotifyActivityQueue, message);
} 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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment