Commit 30d26a81 by 黄兆良

20210701-日志切面-黄兆良

parent 3f36710d
......@@ -30,7 +30,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>sdk-common-base</artifactId>
<version>1.5.7-SNAPSHOT</version>
<version>2.0.BETA</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......
......@@ -690,7 +690,8 @@ public class ShoppingCartConvertAdapter {
this.checkMaterialProductForMCoffee(cartGoods, spuProduct);
} catch (Exception ex) {
ErrorLog.infoConvertJson(this.getClass(), "updateCartGoodsInfoForMCoffee_Error", ex);
//ErrorLog.infoConvertJson(this.getClass(), "updateCartGoodsInfoForMCoffee_Error", ex);
ErrorLog.errorConvertJson(this.getClass(),"updateCartGoodsInfoForMCoffee_Error", ex);
cartGoods.setCartGoodsUid(null);
}
}
......
......@@ -3,9 +3,6 @@ package cn.freemud.annotations;
import java.lang.annotation.*;
/**
* @author freemud
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(value = {ElementType.METHOD})
@Documented
......@@ -23,10 +20,11 @@ public @interface IgnoreFeignLogAnnotation {
*
* @return
*/
String[] excludeStatusCodes() default "100";
int[] excludeStatusCodes() default 0;
String statusCodeFieldName() default "code";
String messageFieldName() default "message";
}
......@@ -34,8 +34,8 @@ import java.util.UUID;
/**
* @author freemud_whh
*/
@Aspect
@Component
//@Aspect
//@Component
public class ControllerLogAop implements Ordered {
@Autowired
......@@ -72,9 +72,9 @@ public class ControllerLogAop implements Ordered {
Object target = joinPoint.getTarget();
Method currentMethod = target.getClass().getMethod(msig.getName(), msig.getParameterTypes());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
if (ApiLog.isDebugEnabled()) {
/*if (ApiLog.isDebugEnabled()) {
ApiLog.debug("获取tracking的值====>{}", new Object[]{request.getHeader("x-transaction-id")});
}
}*/
LogThreadLocal.setTrackingNo(StringUtils.isEmpty(request.getHeader("x-transaction-id")) ? UUID.randomUUID().toString().replaceAll("-", "") : request.getHeader("x-transaction-id"));
List logArgs = this.getLogArgs(currentMethod, joinPoint);
String requestData = JSON.toJSONString(logArgs);
......@@ -95,7 +95,7 @@ public class ControllerLogAop implements Ordered {
}
}
}
ApiLog.infoConvertJson(logMethod.toString(), logIgnore.logMessage(), request, startTime, System.currentTimeMillis(), requestData, logObj);
//ApiLog.infoConvertJson(logMethod.toString(), logIgnore.logMessage(), request, startTime, System.currentTimeMillis(), requestData, logObj);
LogThreadLocal.removeTrackingNo();
return object;
}
......
......@@ -14,6 +14,7 @@ import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformConf
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.log.ThirdPartyLog;
import lombok.extern.slf4j.Slf4j;
......@@ -54,6 +55,7 @@ import java.util.Objects;
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Slf4j
@Aspect
@Component
public class WebAspect {
......@@ -87,6 +89,12 @@ public class WebAspect {
/**
* 是否打印响应报文日志,默认是false,若为true会覆盖注解里面的{@link IgnoreFeignLogAnnotation}配置,输出响应报文里面所有的信息
*/
@Value("${print-feign-response-body-log:false}")
private volatile boolean printFeignResponseBodyLog = false;
/**
* 是否打印响应报文日志,默认是false,若为true会覆盖注解里面的{@link IgnoreFeignLogAnnotation}配置,输出响应报文里面所有的信息
*/
@Value("${print-feign-response-body-log-shop-cart:false}")
private volatile boolean printFeignResponseBodyLogForShopCart = false;
......@@ -159,7 +167,7 @@ public class WebAspect {
@Around("clientLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
/*long start = System.currentTimeMillis();
Object result = null;
try {
result = joinPoint.proceed();
......@@ -197,6 +205,52 @@ public class WebAspect {
} catch (Exception e) {
LogUtil.error("WebAspect Feign Log Ignore error {}", "","",e);
}
return result;*/
long start = System.currentTimeMillis();
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception ex) {
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
ErrorLog.printErrorLog(ex.getMessage(),thirdPartLogVo.getUri(),thirdPartLogVo.getRequestBody(),ex);
throw ex;
}
try {
Signature sig = joinPoint.getSignature();
MethodSignature msig = null;
if (sig instanceof MethodSignature) {
msig = (MethodSignature) sig;
Method currentMethod = sig.getDeclaringType().getDeclaredMethod(msig.getName(), msig.getParameterTypes());
Object logReult = result;
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
String statusCodeValue = "ignore";
String messageValue = "ignore";
// 打印第三方出参日志
IgnoreFeignLogAnnotation logIgnore = currentMethod.getAnnotation(IgnoreFeignLogAnnotation.class);
if (logIgnore != null) {
statusCodeValue = org.apache.commons.beanutils.BeanUtils.getProperty(result, logIgnore.statusCodeFieldName());
messageValue = org.apache.commons.beanutils.BeanUtils.getProperty(result, logIgnore.messageFieldName());
if (!this.printFeignResponseBodyLog || logIgnore.printLog()) {
//todo 当排除了这个状态码不打印响应的具体内容只会打印状态码和状态描述信息
int[] excludeStatusCodes = logIgnore.excludeStatusCodes();
if (!StringUtils.isEmpty(statusCodeValue) && this.containStatusCode(excludeStatusCodes, statusCodeValue)) {
logReult = result.getClass().newInstance();
org.apache.commons.beanutils.BeanUtils.setProperty(logReult, logIgnore.statusCodeFieldName(), statusCodeValue);
org.apache.commons.beanutils.BeanUtils.setProperty(logReult, logIgnore.messageFieldName(), messageValue);
}
}
}
ThirdPartyLog.infoConvertJson(statusCodeValue, messageValue, start, System.currentTimeMillis(),
thirdPartLogVo.getUri(), thirdPartLogVo.getRequestBody(), logReult);
}
} catch (Exception e) {
log.error("WebAspect Feign Log Ignore error {}", ExceptionUtils.getMessage(e));
}
return result;
}
......@@ -270,7 +324,7 @@ public class WebAspect {
return notFilterUrl;
}
private boolean containStatusCode(String[] excludeStatusCodes,
/*private boolean containStatusCode(String[] excludeStatusCodes,
String statusCodeValue) {
if (excludeStatusCodes == null || excludeStatusCodes.length == 0) {
return false;
......@@ -281,6 +335,18 @@ public class WebAspect {
}
}
return false;
}*/
private boolean containStatusCode(int[] excludeStatusCodes, String statusCodeValue) {
if (excludeStatusCodes == null || excludeStatusCodes.length == 0) {
return false;
}
for (int i = 0; i < excludeStatusCodes.length; i++) {
if (excludeStatusCodes[i] == Integer.valueOf(statusCodeValue)) {
return true;
}
}
return false;
}
}
......@@ -13,6 +13,8 @@
package cn.freemud.constant;
import org.springframework.beans.factory.annotation.Value;
public class ApplicationConstant {
public final static String CURRENT_VERSION = "1.5.2";
......@@ -22,4 +24,8 @@ public class ApplicationConstant {
public final static String DELIVERY_DISCOUNT_DESC2="订单满%s元免配送费";
public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%s元";
public final static String DELIVERY_DISCOUNT_DESC4=" 选择了配送券";
@Value("${print-debug-log:false}")
public final static boolean printDebug = false;
}
......@@ -2,13 +2,14 @@ package cn.freemud.controller;
import cn.freemud.monitorcenter.tools.HealthUtil;
import com.freemud.application.sdk.api.log.ApiAnnotation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class AgentController {
@ApiAnnotation
@RequestMapping(value = "/agent/check")
public String reportDefault() {
return HealthUtil.healthCheck();
......@@ -19,6 +20,7 @@ public class AgentController {
* 不可删除,如删除后会造成健康检查失败而重启服务
* @return
*/
@ApiAnnotation
@RequestMapping(value = "/health/check")
public String checkHealth() {
return "ok";
......
......@@ -38,6 +38,7 @@ public class ShoppingCartCollageController {
/**
* 向拼单购物车中添加商品
*/
@ApiAnnotation
@PostMapping(value = "/addGoods")
@LogIgnore(logMessage = "addGoods")
public BaseResponse addGoods(@Validated @LogParams @RequestBody AddShoppingCartGoodsRequestVo request) {
......@@ -47,6 +48,7 @@ public class ShoppingCartCollageController {
/**
* 修改拼单购物车中商品数量
*/
@ApiAnnotation
@LogIgnore(logMessage = "updateGoodsQty")
@PostMapping(value = "/updateGoodsQty")
public BaseResponse updateGoodsQty(@Validated @LogParams @RequestBody UpdateShoppingCartGoodsQtyRequestVo request) {
......@@ -56,6 +58,7 @@ public class ShoppingCartCollageController {
/**
* 查询购物车信息
*/
@ApiAnnotation
@LogIgnore(logMessage = "listCartGoods")
@PostMapping(value = "/listCartGoods")
public BaseResponse listCartGoods(@Validated @LogParams @RequestBody ShoppingCartInfoRequestVo request) {
......@@ -65,6 +68,7 @@ public class ShoppingCartCollageController {
/**
* 清空自己的购物车
*/
@ApiAnnotation
@LogIgnore(logMessage = "clearPartCartGoods")
@PostMapping(value = "/clearPartCartGoods")
public BaseResponse clearPartCartGoods(@Validated @LogParams @RequestBody ShoppingCartCollageClearRequestVo request) {
......@@ -74,6 +78,7 @@ public class ShoppingCartCollageController {
/**
* 清空购物车
*/
@ApiAnnotation
@LogIgnore(logMessage = "clearCartGoods")
@PostMapping(value = "/clearCartGoods")
public BaseResponse clearCartGoods(@Validated @LogParams @RequestBody ShoppingCartClearRequestVo request) {
......@@ -86,6 +91,7 @@ public class ShoppingCartCollageController {
* @param getShoppingCartGoodsApportionRequestVo
* @return
*/
@ApiAnnotation
@LogIgnore(logMessage = "getShoppingCartGoodsApportion")
@PostMapping(value = "/getShoppingCartGoodsApportion")
public BaseResponse getShoppingCartGoodsApportion(@Validated @LogParams @RequestBody GetShoppingCartGoodsApportionRequestVo getShoppingCartGoodsApportionRequestVo) {
......@@ -110,6 +116,7 @@ public class ShoppingCartCollageController {
* 查询购车信息无配送费
* SVC卡支付check,check购物车金额加配送费小于储值卡金额
*/
@ApiAnnotation
@LogIgnore(logMessage = "listCartGoodsCheck")
@PostMapping(value = "/listCartGoodsCheck")
public BaseResponse listCartGoodsCheck(@Validated @LogParams @RequestBody ShoppingCartInfoRequestVo request) {
......
......@@ -76,6 +76,7 @@ public class ShoppingCartController {
/**
* 从微信卡券向购物车中添加商品
*/
@ApiAnnotation
@PostMapping(value = "/addGoodsByCard")
@LogIgnore(logMessage = "addGoodsByCard")
public BaseResponse addGoodsByCard(@Validated @LogParams @RequestBody AddGoodsByWeixinCardRequestVo request) {
......@@ -85,6 +86,7 @@ public class ShoppingCartController {
/**
* 向购物车中添加商品
*/
@ApiAnnotation
@IsConvertEN
@PostMapping(value = "/addGoods")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "addGoods")
......@@ -101,6 +103,7 @@ public class ShoppingCartController {
/**
* 修改购物车中商品数量
*/
@ApiAnnotation
@IsConvertEN
@PostMapping(value = "/updateGoodsQty")
@LogIgnore(logMessage = "updateGoodsQty")
......@@ -117,6 +120,7 @@ public class ShoppingCartController {
/**
* 查询购物车信息
*/
@ApiAnnotation
@IsConvertEN
@PostMapping(value = "/listCartGoods")
@LogIgnore(logMessage = "listCartGoods")
......@@ -139,6 +143,7 @@ public class ShoppingCartController {
* 查询购车信息无配送费
* SVC卡支付check,check购物车金额加配送费小于储值卡金额
*/
@ApiAnnotation
@PostMapping(value = "/listCartGoodsCheck")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "listCartGoodsCheck")
public BaseResponse listCartGoodsCheck(@Validated @LogParams @RequestBody ShoppingCartInfoRequestVo request) {
......@@ -161,6 +166,7 @@ public class ShoppingCartController {
/**
* 清空购物车
*/
@ApiAnnotation
@IsConvertEN
@PostMapping(value = "/clearCartGoods")
@LogIgnore(logMessage = "clearCartGoods")
......@@ -182,6 +188,7 @@ public class ShoppingCartController {
* @param getShoppingCartGoodsApportionRequestVo
* @return
*/
@ApiAnnotation
@IsConvertEN
@PostMapping(value = "/getShoppingCartGoodsApportion")
@LogIgnore(logMessage = "getShoppingCartGoodsApportion")
......@@ -239,6 +246,7 @@ public class ShoppingCartController {
/**
* 线下订单查询接口
*/
@ApiAnnotation
@PostMapping(value = "/getMemberInfo")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/getMemberInfo")
public BaseResponse getMemberInfo(@LogParams @RequestBody GetMemberInfoRequestDto request) {
......@@ -248,6 +256,7 @@ public class ShoppingCartController {
/**
* 结算页获取是否展示订单那备注配置
*/
@ApiAnnotation
@PostMapping(value = "/getOpenStoreIappWxappConfig")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/getOpenStoreIappWxappConfig")
public BaseResponse getOpenStoreIappWxappConfig(@LogParams @RequestBody OpenStoreIappWxappConfigRequestVo request) {
......@@ -257,6 +266,7 @@ public class ShoppingCartController {
/**
* 结算页获取加价购活动商品列表
*/
@ApiAnnotation
@PostMapping(value = "/premiumExchange")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/premiumExchange")
public BaseResponse premiumExchange(@LogParams @RequestBody @Validated PremiumExchangeRequestVo request) {
......@@ -265,6 +275,7 @@ public class ShoppingCartController {
/**
* 券码查询购物车商品信息(平台结算页可用券列表用)
*/
@ApiAnnotation
@PostMapping(value = "/getCartInfoByUser")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/getCartInfoByUser")
public BaseResponse getCartInfoByUser(@LogParams @RequestBody @Validated CouponAvailableRequestVo request) {
......@@ -275,6 +286,7 @@ public class ShoppingCartController {
* 【C端服务端】批量一键加购
* 替换老门店的商品到切换的门店下
*/
@ApiAnnotation
@PostMapping(value = "/replaceGoodsByShop")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/replaceGoodsByShop")
public BaseResponse replaceGoodsByShop(@LogParams @RequestBody @Validated ShopGoodsReplaceVo request) {
......@@ -289,6 +301,7 @@ public class ShoppingCartController {
/**
* 测试用,后续删除
*/
@ApiAnnotation
@PostMapping(value = "/test/putCache")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/putCache")
public BaseResponse putCache(@LogParams @RequestBody @Validated PutCacheVo request) {
......
......@@ -249,8 +249,7 @@ public class CalculationSharingAdapter {
private List<GetCalculationDiscountBO.CalculationDiscountCoupon> buildCoupons(List<GetCalculationDiscountBO.CalculationDiscountCoupon> oldCoupons, List<CouponCode> coupons){
ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
//ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
for(int i = 0 ; i < oldCoupons.size() ; i++){
GetCalculationDiscountBO.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
oldCoupon.setUseIndex(i);
......@@ -274,7 +273,7 @@ public class CalculationSharingAdapter {
}
}
ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
//ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
return oldCoupons;
}
......
......@@ -44,7 +44,8 @@ public class KgdPromotionServiceImpl implements PromotionService{
CalculationSharingDiscountRequestDto shareDiscountRequestDto = promotionBO2DTOAdapter.convert2CalculationSharingDiscountRequestDto(getCalculationDiscountBO);
CalculationSharingDiscountResponseDto calculationSharingDiscountResponseDto = null;
try {
ApiLog.debug("start sharing discount dto={}", JSON.toJSONString(shareDiscountRequestDto));
//ApiLog.debug("start sharing discount dto={}", JSON.toJSONString(shareDiscountRequestDto));
ApiLog.printLog("start sharing discount dto={}",JSON.toJSONString(shareDiscountRequestDto),null,null);
calculationSharingDiscountResponseDto = calculationClient.calculationSharingDiscount(shareDiscountRequestDto);
}
catch (Exception e) {
......
......@@ -2,6 +2,7 @@ package cn.freemud.demo.service.impl;
import cn.freemud.adapter.CouponAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.demo.entities.bo.SendGoods;
import cn.freemud.demo.entities.bo.goods.*;
import cn.freemud.demo.entities.bo.promotion.GetCalculationDiscountBO;
......@@ -17,6 +18,7 @@ import cn.freemud.enums.*;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.CouponService;
import cn.freemud.utils.PropertyConvertUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.productcenter.request.product.valid.ValidateShopProductType;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant;
......@@ -26,6 +28,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.*;
......@@ -35,7 +38,6 @@ import static java.util.stream.Collectors.toList;
@Service
public class PlatformApportionService extends AbstractApportionService {
@Autowired
private ProductManager productManager;
@Autowired
......@@ -246,8 +248,10 @@ public class PlatformApportionService extends AbstractApportionService {
private List<GetCalculationDiscountBO.CalculationDiscountCoupon> buildCoupons(List<GetCalculationDiscountBO.CalculationDiscountCoupon> oldCoupons, List<ShoppingCartGoodsApportionBO.couponCode> coupons){
ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
//ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){
GetCalculationDiscountBO.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
oldCoupon.setUseIndex(i);
......@@ -272,7 +276,7 @@ public class PlatformApportionService extends AbstractApportionService {
}
}
ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
//ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
return oldCoupons;
}
......
......@@ -214,7 +214,7 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
if (StringUtils.isBlank(receiveId)) {
return deliveryAmount;
}
ApiLog.debug("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(), storeDeliveryUseOld, receiveId, partnerId, storeId);
//ApiLog.debug("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(), storeDeliveryUseOld, receiveId, partnerId, storeId);
if (storeDeliveryUseOld) {
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString());
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
......
......@@ -13,6 +13,7 @@
package cn.freemud.service.delivery.impl;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.entities.dto.store.GetEstimateDeliveryRequest;
import cn.freemud.entities.dto.store.StoreCBaseResponse;
import cn.freemud.entities.dto.store.StoreCBaseResponseDto;
......@@ -21,6 +22,7 @@ import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.delivery.DeliveryService;
import cn.freemud.service.store.StoreBaseApiClient;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest;
......@@ -140,7 +142,10 @@ public class GradDeliveryServiceImpl extends AbstractDeliveryServiceImpl impleme
request.setPartnerId(partnerId);
request.setStoreCode(storeCode);
StoreCBaseResponse<StoreCBaseResponseDto> responseDto = storeBaseApiClient.queryDeliverDetail(request);
ApiLog.info("fisherman 获取门店预计送达时间",request,responseDto);
//ApiLog.info("fisherman 获取门店预计送达时间",request,responseDto);
if(ApplicationConstant.printDebug){
ApiLog.printLog("fisherman 获取门店预计送达时间", JSON.toJSONString(request),JSON.toJSONString(responseDto),null);
}
if (responseDto == null) {
throw new ServiceException(ResponseResult.SYSTEM_BUSINESS_ERROR);
}
......
......@@ -2,6 +2,7 @@ package cn.freemud.service.impl;
import ch.qos.logback.classic.Level;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.entities.dto.GetProductInfoDto;
import cn.freemud.entities.dto.ProductInfosDto;
......@@ -81,7 +82,10 @@ public class AssortmentSdkService {
cartParamDto.setUserId(userId);
BaseResponse<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods> baseResponse = shoppingCartService.getCartGoods(cartParamDto, LogThreadLocal.getTrackingNo());
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || baseResponse.getResult() == null) {
ErrorLog.printLog(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(), "getCartGoods:" + JSONObject.toJSONString(baseResponse), cartParamDto, Level.ERROR);
/*ErrorLog.printLog(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(),"getCartGoods:" + JSONObject.toJSONString(baseResponse), cartParamDto, Level.ERROR);*/
if(ApplicationConstant.printDebug){
ApiLog.printLog("getCartGoods:", SDKCommonBaseContextWare.getAppName(),LogThreadLocal.getTrackingNo(),JSONObject.toJSONString(baseResponse));
}
return null;
}
......@@ -321,7 +325,10 @@ public class AssortmentSdkService {
ProductInfosDto productInfosDto = storeItemClient.listProductInfos(getProductInfoDto);
if (!ResponseCodeConstant.RESPONSE_SUCCESS.equals(productInfosDto.getErrcode()) || CollectionUtils.isEmpty(productInfosDto.getData().getProducts())) {
ApiLog.info("查询商品信息失败,getProductInfoDto,baseResponse",getProductInfoDto,productInfosDto);
// ApiLog.info("查询商品信息失败,getProductInfoDto,baseResponse",getProductInfoDto,productInfosDto);
if(ApplicationConstant.printDebug){
ApiLog.printLog("查询商品信息失败,getProductInfoDto,baseResponse",JSON.toJSONString(getProductInfoDto),JSON.toJSONString(productInfosDto),null);
}
return null;
}
return productInfosDto.getData().getProducts();
......
......@@ -17,6 +17,7 @@ import cn.freemud.adapter.CouponAdapter;
import cn.freemud.adapter.StoreAdapter;
import cn.freemud.adapter.StoreItemAdapter;
import cn.freemud.base.util.DateUtil;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.demo.manager.coupon.Finals;
import cn.freemud.entities.dto.*;
......@@ -762,7 +763,10 @@ public class CouponServiceImpl implements CouponService {
@Override
public CheckSpqInfoResponseDto checkSpqInfo(CheckSpqInfoRequestDto requestDto) {
ApiLog.debug("checkSpqInfo****" + gson.toJson(requestDto));
// ApiLog.debug("checkSpqInfo****" + gson.toJson(requestDto));
if(ApplicationConstant.printDebug){
ApiLog.printLog("checkSpqInfo****",gson.toJson(requestDto),null,null);
}
String partnerId = requestDto.getPartnerId();
String couponCode = requestDto.getCouponCode();
String storeId = requestDto.getStoreId();
......@@ -836,7 +840,10 @@ public class CouponServiceImpl implements CouponService {
dto.setSkuName(StringUtils.isNotBlank(productsVo.getSkuName()) ? productsVo.getSkuName() : productsVo.getSpuName());
dto.setPicture(productsVo.getSpuPicture());
dto.setCouponType(0);
ApiLog.debug("dto***" + dto);
// ApiLog.debug("dto***" + dto);
if(ApplicationConstant.printDebug){
ApiLog.printLog("dto***", JSON.toJSONString(dto),null,null);
}
return dto;
}
......
package cn.freemud.service.impl;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.UserLoginInfoDto;
import cn.freemud.entities.dto.activity.ActivityDiscountsDto;
......@@ -9,6 +10,7 @@ import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*;
import cn.freemud.enums.GoodsTypeEnum;
import cn.freemud.service.IPromotionService;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog;
import lombok.Data;
import lombok.extern.log4j.Log4j;
......@@ -83,9 +85,15 @@ public class MaterialPromotionService implements IPromotionService {
@Override
public void updateShoppingCartGoodsApportion(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
HashMap<String, MaterialApportion> map = getApportionGoodsDetail(calculationDiscountResult);
ApiLog.debug("updateShoppingCartGoodsApportion->map:" + map);
// ApiLog.debug("updateShoppingCartGoodsApportion->map:" + map);
if(ApplicationConstant.printDebug){
ApiLog.printLog("updateShoppingCartGoodsApportion->map:", JSON.toJSONString(map),null,null);
}
List<ShoppingCartGoodsDto.CartGoodsDetailDto> products = shoppingCartGoodsDto.getProducts();
ApiLog.debug("updateShoppingCartGoodsApportion->product:" + products);
// ApiLog.debug("updateShoppingCartGoodsApportion->product:" + products);
if(ApplicationConstant.printDebug){
ApiLog.printLog("updateShoppingCartGoodsApportion->product:", JSON.toJSONString(products),null,null);
}
if (map.size() > 0) {
String pk = "";
for (ShoppingCartGoodsDto.CartGoodsDetailDto product : products) {
......
......@@ -4,6 +4,7 @@ import cn.freemud.adapter.ActivityAdapter;
import cn.freemud.adapter.CouponAdapter;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.*;
......@@ -239,7 +240,10 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
.build();
List<CollageMemberState> collageMemberState = collageOrderBaseService.getCollageMemberState(collageOrderDto).getResult();
if(collageMemberState == null || collageMemberState.isEmpty()){
ApiLog.info("splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}",partnerId,storeId,createUserId,currentUserId);
// ApiLog.info("splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}",partnerId,storeId,createUserId,currentUserId);
if(ApplicationConstant.printDebug){
ApiLog.printLog("splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}"+partnerId,storeId,createUserId,currentUserId);
}
return null;
}
......
......@@ -16,6 +16,7 @@ import cn.freemud.adapter.ActivityAdapter;
import cn.freemud.adapter.CouponAdapter;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.*;
......@@ -930,7 +931,10 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
private List<CalculationSharingDiscountRequestDto.CalculationDiscountCoupon> buildCoupons(List<CalculationSharingDiscountRequestDto.CalculationDiscountCoupon> oldCoupons, List<ShoppingCartInfoRequestVo.couponCode> coupons){
ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
// ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){
CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
......@@ -956,7 +960,10 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
}
}
ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
// ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券后,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
return oldCoupons;
}
......
......@@ -205,7 +205,8 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
assortmentSdkService.updateGoodsQtyBySdk(customerInfo.getPartnerId(), customerInfo.getMemberId(),
customerInfo.getStoreId(), requestVo.getCartGoodsUid(), requestVo.getQty(), customerInfo.getTableNumber(), this.mealCartBaseService);
} catch (Exception e) {
ErrorLog.errorConvertJson(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(), "updateGoodsQty:" + e.getMessage(), e);
// ErrorLog.errorConvertJson(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(), "updateGoodsQty:" + e.getMessage(), e);
ErrorLog.errorConvertJson(getClass(),"updateGoodsQty:", e);
return ResponseUtil.error(ResponseResult.SHOPPING_CART_VERSION_ERROR, "购物车商品有变动,请手动刷新再修改");
} finally {
doUnlock(requestVo.getCartGoodsUid());
......
......@@ -19,6 +19,7 @@ import cn.freemud.adapter.StoreItemAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.base.util.DateUtil;
import cn.freemud.base.util.JsonUtil;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.demo.controller.ShoppingCartDemoController;
......@@ -719,7 +720,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, sendGoods
, deliveryAmount
, null);
ApiLog.info("fisherman 新算价 配送费字段数据 01 ",calculationSharingDiscountResult,shoppingCartGoodsResponseVo);
// ApiLog.info("fisherman 新算价 配送费字段数据 01 ",calculationSharingDiscountResult,shoppingCartGoodsResponseVo);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(calculationSharingDiscountResult),JSON.toJSONString(shoppingCartGoodsResponseVo),null);
}
sharingCartService.distribute(calculationSharingDiscountResult
, cartGoodsList
, shoppingCartGoodsResponseVo
......@@ -734,7 +738,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,shoppingCartInfoRequestVo.getFlag()
, userId
, storeId);
ApiLog.info("fisherman 新算价 配送费字段数据 02 ",null,shoppingCartGoodsResponseVo);
// ApiLog.info("fisherman 新算价 配送费字段数据 02 ",null,shoppingCartGoodsResponseVo);shoppingCartGoodsResponseVo
if(ApplicationConstant.printDebug){
ApiLog.printLog("fisherman 新算价 配送费字段数据 02 ",JSON.toJSONString(shoppingCartGoodsResponseVo), null,null);
}
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,calculationSharingDiscountResult,shoppingCartInfoRequestVo.getFlag(),partnerId);
}
else {
......@@ -817,7 +824,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 添加购物车商品总价和加价购商品总价,现在是自己计算,后面需要优化为促销计算, 这段要删除
ApiLog.info("fisherman 新算价 校验入参券是否可用new ",shoppingCartGoodsResponseVo,shoppingCartInfoRequestVo.getCouponCodes());
// ApiLog.info("fisherman 新算价 校验入参券是否可用new ",shoppingCartGoodsResponseVo,shoppingCartInfoRequestVo.getCouponCodes());
if(ApplicationConstant.printDebug){
ApiLog.printLog("fisherman 新算价 校验入参券是否可用new ",JSON.toJSONString(shoppingCartGoodsResponseVo),JSON.toJSONString(shoppingCartInfoRequestVo.getCouponCodes()),null);
}
// 校验入参券是否可用
if (!checkAvailableCoupon(shoppingCartGoodsResponseVo, shoppingCartInfoRequestVo.getCouponCode())){
return ResponseUtil.error(ResponseResult.SHOPPING_CART_COUPON_NOT_USE);
......@@ -2472,7 +2482,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(receiveId) && !Objects.equals(orderType, CreateOrderType.TAKE_OUT.getCode())) {
return deliveryAmount;
}
ApiLog.debug("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(), storeDeliveryUseOld, receiveId, partnerId, storeId);
// ApiLog.debug("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(), storeDeliveryUseOld, receiveId, partnerId, storeId);
if(ApplicationConstant.printDebug){
ApiLog.printLog("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(),JSON.toJSONString(storeDeliveryUseOld), "receiveId:"+receiveId+",partnerId:"+partnerId+",storeId:"+storeId);
}
if (storeDeliveryUseOld) {
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString());
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
......@@ -2822,7 +2835,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
List<ShoppingCartInfoRequestVo.couponCode> coupons){
ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
// ApiLog.info("批量使用优惠券前,oldCoupons,coupons",oldCoupons,coupons);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){
CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
......@@ -2848,7 +2864,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
// ApiLog.info("批量使用优惠券后,oldCoupons,coupons",oldCoupons,coupons);
if(ApplicationConstant.printDebug){
ApiLog.printLog("批量使用优惠券后,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
return oldCoupons;
}
......
package cn.freemud.service.impl.calculate;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.demo.entities.bo.goods.CalculationDiscountBO;
import cn.freemud.demo.entities.bo.goods.ShoppingCartApportionBO;
......@@ -70,7 +71,10 @@ public class CalculationCommonService {
/**
* 使用促销算价赋值行记录
*/
ApiLog.debug("initShoppingCart={},discountResult={}", JSON.toJSON(cartGoodsList),JSON.toJSON(discountResult));
// ApiLog.debug("initShoppingCart={},discountResult={}", JSON.toJSON(cartGoodsList),JSON.toJSON(discountResult));
if(ApplicationConstant.printDebug){
ApiLog.printLog("initShoppingCart={},discountResult={}",JSON.toJSONString(cartGoodsList),JSON.toJSONString(discountResult),null);
}
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods = null;
if (discountResult != null && CollectionUtils.isNotEmpty(discountResult.getGoods())) {
goods = discountResult.getGoods();
......@@ -217,7 +221,10 @@ public class CalculationCommonService {
public ShoppingCartGoodsDto.CartGoodsDetailDto convertCartGoods2DetailGoodsList(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods calculationGoods
, CartGoods cartGoods
, String partnerId) {
ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
// ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
if(ApplicationConstant.printDebug){
ApiLog.printLog("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", JSON.toJSONString(calculationGoods), JSON.toJSONString(cartGoods),null);
}
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.convertCartGoods2DetailGoods(calculationGoods, cartGoods,partnerId);
return cartGoodsDetailDto;
}
......@@ -231,7 +238,10 @@ public class CalculationCommonService {
*/
public ShoppingCartApportionBO.CartGoodsDetailDto convertCartGoods2NewDetailGoodsList(CalculationDiscountBO.CalculationDiscountResult.Goods calculationGoods
, CartGoods cartGoods, String partnerId) {
ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
// ApiLog.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
if(ApplicationConstant.printDebug){
ApiLog.printLog("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", JSON.toJSONString(calculationGoods), JSON.toJSONString(cartGoods),null);
}
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods oldGoods = mapperFacade.map(calculationGoods, CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.class);
......
package cn.freemud.service.impl.calculate;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.entities.dto.CheckSpqInfoRequestDto;
import cn.freemud.entities.dto.CheckSpqInfoResponseDto;
......@@ -102,10 +103,16 @@ public class CalculationSharingDiscountService {
CheckSpqInfoResponseDto checkSpqInfo = null;
if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
checkSpqInfo = couponService.checkSpqInfo(checkSpqInfoRequestDto, cartGoods.getSkuId());
ApiLog.debug("coupon:{},{}", "hg", JSON.toJSONString(checkSpqInfo));
// ApiLog.debug("coupon:{},{}", "hg", JSON.toJSONString(checkSpqInfo));
if(ApplicationConstant.printDebug){
ApiLog.printLog("coupon:{},{}", "hg", JSON.toJSONString(checkSpqInfo),null);
}
} else {
checkSpqInfo = couponService.checkSpqInfo(checkSpqInfoRequestDto);
ApiLog.debug("coupon:{},{}", "sp", JSON.toJSONString(checkSpqInfo));
// ApiLog.debug("coupon:{},{}", "sp", JSON.toJSONString(checkSpqInfo));
if(ApplicationConstant.printDebug){
ApiLog.printLog("coupon:{},{}", "sp", JSON.toJSONString(checkSpqInfo),null);
}
}
if (null == checkSpqInfo) {
cartGoodsList.remove(i);
......@@ -180,7 +187,10 @@ public class CalculationSharingDiscountService {
//剔除商品数量为空的
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
ApiLog.debug("calculationDiscountGoodsList:{}", JSON.toJSON(calculationDiscountGoodsList));
// ApiLog.debug("calculationDiscountGoodsList:{}", JSON.toJSON(calculationDiscountGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("calculationDiscountGoodsList:{}", JSON.toJSONString(calculationDiscountGoodsList),null,null);
}
//throw new BizServiceException(ResponseResult.SHOPPING_CART_COUPON_NOT_EXIST,"参数促销计算商品有异常");
return null;
}
......
package cn.freemud.service.impl.calculate.promotion;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.activity.ActivityDiscountsDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto;
......@@ -13,6 +14,7 @@ import cn.freemud.service.ItemService;
import cn.freemud.service.impl.AssortmentSdkService;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ThirdPartyLog;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum;
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl;
......@@ -180,7 +182,7 @@ public class AdditionSharingService {
*/
private ResponseResult checkAdditionalGoods(List<CreateOrderVo.PremiumExchangeActivity.Product> additionalProducts
, List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.SendActivity> additionalActivityList) {
ApiLog.debug("checkAdditionalGoods additionalProducts:{}<---->additionalActivityList:{}", JSON.toJSONString(additionalProducts), JSON.toJSONString(additionalActivityList));
//ApiLog.debug("checkAdditionalGoods additionalProducts:{}<---->additionalActivityList:{}", JSON.toJSONString(additionalProducts), JSON.toJSONString(additionalActivityList));
//无加价购活动
if (CollectionUtils.isEmpty(additionalActivityList)) {
return ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST;
......@@ -253,7 +255,10 @@ public class AdditionSharingService {
if (getProductsVoMap.isEmpty()) {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST);
}
ApiLog.debug("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap));
//ApiLog.debug("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap));
if(ApplicationConstant.printDebug){
ApiLog.printLog("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap),null,null);
}
// 获取计算返回的价格
Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount();
//Long totalAmount = shoppingCartGoodsDto.getTotalAmount();
......
......@@ -4,6 +4,7 @@ import ch.qos.logback.classic.Level;
import cn.freemud.adapter.ActivityAdapter;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.*;
......@@ -236,7 +237,10 @@ public class ShoppingCartMCoffeeServiceImpl {
}
List<CartGoods> newCartGoods = null;
ApiLog.debug("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods));
// ApiLog.debug("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods));
if(ApplicationConstant.printDebug){
ApiLog.printLog("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods),null);
}
if(StringUtils.equals("9999",skuId)) {
// 将月享卡2.0的虚拟商品保存到购物车中
oldCartGoodsList.add(addCartGoods);
......@@ -798,7 +802,10 @@ public class ShoppingCartMCoffeeServiceImpl {
*/
if (null != cartGoods.getMonthCardInfo()){
cartGoods.getMonthCardInfo().setIsUseMonthCard(requestVo.getIsUseMonthCard());
ApiLog.info("【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}",requestVo.getIsUseMonthCard(),JSONObject.toJSONString(cartGoods));
//ApiLog.info("【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}",requestVo.getIsUseMonthCard(),JSONObject.toJSONString(cartGoods));
if(ApplicationConstant.printDebug){
ApiLog.printLog("【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}",String.valueOf(requestVo.getIsUseMonthCard()),JSONObject.toJSONString(cartGoods),null);
}
}
}
cartGoodsList = cartGoodsList.stream().filter(cartGoods -> !StringUtils.equals("9999",cartGoods.getSkuId())).collect(Collectors.toList());
......@@ -833,10 +840,16 @@ public class ShoppingCartMCoffeeServiceImpl {
// 先验证商品是否存在
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, null, shoppingCartBaseService);
ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
//ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService);
ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
//ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartSendGoodsList),null,null);
}
CartGoods cartGoods = null;
String skuId = "";
Integer finalQty = qty;
......@@ -1004,10 +1017,16 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService);
ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
// ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService);
ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
// ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartSendGoodsList: {}", JSONObject.toJSONString(cartSendGoodsList),null,null);
}
CartGoods monthCardProduct = null;
// 如果购物车商品不为空, 则check购物车中所有商品
if (CollectionUtils.isNotEmpty(cartGoodsList)) {
......@@ -1275,9 +1294,15 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService);
ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
//ApiLog.debug("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService);
ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
//ApiLog.debug("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList),null,null);
}
if (cartGoodsList == null || CollectionUtils.isEmpty(cartGoodsList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD);
}
......@@ -1412,7 +1437,10 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取原门店购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, fromStoreId, userId, sessionId, "", shoppingCartBaseService);
ApiLog.debug("【switchCardGoods】原门店数据: {} {}", requestVo.getSessionId(), JSONObject.toJSONString(cartGoodsList));
//ApiLog.debug("【switchCardGoods】原门店数据: {} {}", requestVo.getSessionId(), JSONObject.toJSONString(cartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("【switchCardGoods】原门店数据: {} {}", requestVo.getSessionId(), JSONObject.toJSONString(cartGoodsList),null);
}
// 如果购物车商品不为空, 则check购物车中所有商品
if (CollectionUtils.isEmpty(cartGoodsList)) {
return ResponseUtil.success(shoppingCartGoodsResponseVo);
......@@ -1812,7 +1840,10 @@ public class ShoppingCartMCoffeeServiceImpl {
nowCartGoodsList.addAll(oldCartGoodsList);
}
if(CollectionUtils.isNotEmpty(newCartGoodsList)){
ApiLog.debug("【merge-before】:{} ,【newCardGoods】:{}",JSONObject.toJSONString(nowCartGoodsList),JSONObject.toJSONString(newCartGoods));
//ApiLog.debug("【merge-before】:{} ,【newCardGoods】:{}",JSONObject.toJSONString(nowCartGoodsList),JSONObject.toJSONString(newCartGoods));
if(ApplicationConstant.printDebug){
ApiLog.printLog("【merge-before】:{} ,【newCardGoods】:{}",JSONObject.toJSONString(nowCartGoodsList),JSONObject.toJSONString(newCartGoods),null);
}
newCartGoodsList.forEach(newCartGood -> {
int index;
if ((index = nowCartGoodsList.indexOf(newCartGood)) >= 0) {
......@@ -2706,7 +2737,10 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.getMonthCardInfo().setCardCode(productBindingCouponType.getVirtualCouponCode());
cartGoods.getMonthCardInfo().setCardNo(productBindingCouponType.getCardId());
cartGoods.getMonthCardInfo().setType(cartGoods.getMonthCardInfo().getType());
ApiLog.debug("【月享卡】信息替换成功,cartGoods:{},productInfo:{}",cartGoods.toString(),result.toString());
//ApiLog.debug("【月享卡】信息替换成功,cartGoods:{},productInfo:{}",cartGoods.toString(),result.toString());
if(ApplicationConstant.printDebug){
ApiLog.printLog("【月享卡】信息替换成功,cartGoods:{},productInfo:{}",cartGoods.toString(),result.toString(),null);
}
}
}
}
......
......@@ -3,6 +3,7 @@ package cn.freemud.service.impl.mcoffee.calculation;
import cn.freemud.adapter.CouponAdapter;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.base.util.DateUtil;
import cn.freemud.constant.ApplicationConstant;
import cn.freemud.entities.dto.*;
import cn.freemud.entities.dto.activity.ActivityDiscountsDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
......@@ -195,7 +196,10 @@ public class CouponDiscountCalculation {
}
if (CollectionUtils.isNotEmpty(discountsNew)) {
useCoupon = true;
ApiLog.debug("couponDiscountCalculation:{}",discountsNew);
// ApiLog.debug("couponDiscountCalculation:{}",discountsNew);
if(ApplicationConstant.printDebug){
ApiLog.printLog("couponDiscountCalculation:{}",JSON.toJSONString(discountsNew),null,null);
}
//这里过滤掉了 月享卡2.0,因为月享卡2.0商品不用展示划线价,故显示原价
Optional<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount> targetDiscount = discountsNew.stream()
.filter(t -> ActivityTypeEnum.TYPE_32.getCode().equals(t.getType())
......@@ -281,7 +285,10 @@ public class CouponDiscountCalculation {
AtomicBoolean changed = new AtomicBoolean();
changed.set(false);
if(CollectionUtils.isNotEmpty(cartGoodsList)){
ApiLog.debug("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
// ApiLog.debug("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
for (int i = cartGoodsList.size() - 1; i >= 1; i--) {
CartGoods cartGoods = cartGoodsList.get(i);
int index2 = nowCartGoodsList.indexOf(cartGoods);
......@@ -294,9 +301,15 @@ public class CouponDiscountCalculation {
cartGoodsNow.setOriginalAmount(cartGoodsNow.getOriginalAmount() + cartGoods.getOriginalAmount());
nowCartGoodsList.remove(i);
}
ApiLog.debug("合并买3赠1商品券 【merge-ing】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
// ApiLog.debug("合并买3赠1商品券 【merge-ing】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("合并买3赠1商品券 【merge-ing】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
}
// ApiLog.debug("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if(ApplicationConstant.printDebug){
ApiLog.printLog("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
ApiLog.debug("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
}
if(changed.get()) {
cartGoodsList.clear();
......
......@@ -30,14 +30,14 @@ public interface ActivityClient {
* 统一活动查询接口
*/
@PostMapping("/activity/query")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
ActivityQueryResponseDto query(ActivityQueryRequestDto activityQueryRequestDto);
/**
* 优惠金额计算
*/
@PostMapping("/calculation/discount")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
ActivityCalculationDiscountResponseDto calculationDiscount(ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto);
/**
......@@ -60,6 +60,6 @@ public interface ActivityClient {
* @return
*/
@PostMapping("/calculation/discount/sharing")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
ActivityCalculationDiscountResponseDto calculationDiscountSharing(ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto);
}
......@@ -19,6 +19,6 @@ public interface CalculationClient {
* 促销新的算价对接
*/
@PostMapping("/promotioncenter/calculateservice/discount/sharing")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
CalculationSharingDiscountResponseDto calculationSharingDiscount(CalculationSharingDiscountRequestDto shareDiscountRequestDto);
}
......@@ -21,7 +21,7 @@ public interface CardBinClient {
* @return
*/
@PostMapping("/getAppKey")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
GetAppKeyResponseDto getAppKey(GetAppKeyRequestDto requestDto);
/**
......@@ -30,7 +30,7 @@ public interface CardBinClient {
* @return
*/
@PostMapping(value = "/batchQueryActivityInfo")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
BatchQueryActivityInfoResponseDto batchQueryActivityInfo(BatchQueryActivityInfoRequestDto requestDto);
......
......@@ -21,7 +21,7 @@ public interface CouponOnlineClient {
/**
* 查询券详情
*/
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE)
@PostMapping(value = "/code_v4", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}
)
......
......@@ -29,12 +29,12 @@ public interface CustomerApplicationClient {
@PostMapping(value = "/membercard/getPaidRule")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
BaseResponse<GetPaidRuleResponseDto> getPaidRule(GetPaidRuleRequestDto getPaidRuleRequestDto);
@PostMapping(value = "/user/getSessionUserInfo")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
BaseResponse<CustomerInfoVo>getSessionUserInfo(GetSessionUserInfoDto getSessionUserInfoDto);
......
......@@ -32,12 +32,12 @@ import java.util.List;
public interface ProductClient {
@PostMapping({"/Shop/ListMenuMustProduct"})
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName = ResponseCodeKeyConstant.ERR_MSG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName = ResponseCodeKeyConstant.ERR_MSG)
ProductBaseResponse<List<String>> getRequiredProductList(@RequestBody RequiredProductRequest request);
@PostMapping({"/Shop/ValidateShopProduct/Reason"})
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName = ResponseCodeKeyConstant.ERR_MSG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName = ResponseCodeKeyConstant.ERR_MSG)
ProductBaseResponse<ValiadShopProductResponse> validateShopProductAboutReason(@RequestBody ValidateShopProductRequest request);
}
......@@ -32,7 +32,7 @@ public interface StockClient {
* 前端查询多个商品库存信息
*/
@PostMapping("/getAvailableStocks")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR})
GetProductStockResponseDto getAvailableStocks(@RequestBody GetProductStockRequestDto requestDto);
/**
......
......@@ -42,14 +42,14 @@ public interface StoreItemClient {
* 根据商品id查询门店特定时间段菜单
*/
@PostMapping(value = "/Menu/GetMenuByIds")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
GetMenuByIdsResponseDto getMenuCategoryByIds(@RequestBody GetMenuCategoryByIdsDto getMenuCategoryByIdsDto);
/**
* 获取商品的详细信息
*/
@PostMapping("/Shop/ListProductInfoByIdList")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
ProductInfosDto listProductInfos(@RequestBody GetProductInfoDto getProductInfoDto);
/**
......@@ -57,20 +57,20 @@ public interface StoreItemClient {
* @return
*/
@PostMapping("/Product/GetSpectionProductBySkuId")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
ProductListDto getSpuIdsBySkuIds(@RequestBody GetSpuIdsBySkuIdsDto requestDto);
/**
* 校验商品可用性
*/
@PostMapping("Shop/ValidateShopProduct")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
// @IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
ProductResponseDTO<ValiadShopProductResponse> validateShopProduct(@RequestBody ValidateShopProductRequest request);
/**
* 校验商品在当前门店是否可售
*/
@PostMapping("/Shop/validateShopContainProduct")
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
//@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.ERR_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
ValidateProductInfosDto validateShopContainProduct(@RequestBody GetValidateProductInfoDto getProductInfoDto);
}
......@@ -11,13 +11,21 @@
</layout>
</encoder>
</appender>
<appender name="STDOUT_SKYWALKING" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
<pattern>{"timestamp":"%d", "level":"%p", "projectName":"${PROJECT_NAME:-}", "grayVersion":"${eureka.instance.metadataMap.version}", "tid":"%tid", "scenarios":"%X{scenarios}", "message":%m}%n
</pattern>
</layout>
</encoder>
</appender>
<springProfile name="default">
<logger name="cn.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
<logger name="com.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
<appender name="FREEMUD_DEV_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/${PROJECT_NAME}/freemud_api_${PROJECT_NAME}-dev.log</file>
......@@ -35,25 +43,25 @@
<appender-ref ref="FREEMUD_DEV_DEBUG"/>
</logger>
<logger name="com.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDOUT_SKYWALKING"/>
</logger>
</springProfile>
<springProfile name="mock">
<logger name="cn.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
<logger name="com.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
</springProfile>
<springProfile name="qa">
<logger name="cn.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
<logger name="com.freemud" level="debug" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="STDOUT_SKYWALKING" />
</logger>
</springProfile>
......@@ -81,18 +89,18 @@
<springProfile name="pro">
<logger name="cn.freemud" level="info" additivity="false">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDOUT_SKYWALKING"/>
</logger>
<logger name="com.freemud" level="info" additivity="false">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDOUT_SKYWALKING"/>
</logger>
</springProfile>
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDOUT_SKYWALKING"/>
</root>
</configuration>
\ No newline at end of file
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