Commit 29e36568 by 李学兴

Merge branch 'master' into 20210702-日志规范-lxx

parents 61ce2d25 41971239
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>assortment-ordercenter-sdk</artifactId> <artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.1.76-RELEASE</version> <version>2.1.84-RELEASE</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>cn.freemud</groupId> <groupId>cn.freemud</groupId>
<artifactId>ordercenter-sdk</artifactId> <artifactId>ordercenter-sdk</artifactId>
<!-- <version>1.3.63.RELEASE</version>--> <version>1.3.63.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.freemud.application.service.sdk</groupId> <groupId>com.freemud.application.service.sdk</groupId>
......
...@@ -151,4 +151,6 @@ ...@@ -151,4 +151,6 @@
| 2.1.73-RELEASE | 预计送达时间逻辑添加 | 周晓航 | 2021-06-24| | 2.1.73-RELEASE | 预计送达时间逻辑添加 | 周晓航 | 2021-06-24|
| 2.1.74-RELEASE | 麦咖啡p7v2 | xukang | 2021-06-24| | 2.1.74-RELEASE | 麦咖啡p7v2 | xukang | 2021-06-24|
| 2.1.75-RELEASE | 集点活动改造 | 张志恒 | 2021-06-28| | 2.1.75-RELEASE | 集点活动改造 | 张志恒 | 2021-06-28|
| 2.1.76-RELEASE | 开放平台取消订单调用oms| 张志恒 | 2021-07-01| | 2.1.76-RELEASE | 开放平台取消订单调用oms| 张志恒 | 2021-07-01|
\ No newline at end of file | 2.1.82-RELEASE | pos 打印满赠 | 张志恒 | 2021-07-09|
| 2.1.84-RELEASE | KA-20210702-非码发版日售后单时间推迟 | 周晓航 | 2021-07-12|
\ No newline at end of file
...@@ -948,17 +948,17 @@ public class OrderSdkAdapter { ...@@ -948,17 +948,17 @@ public class OrderSdkAdapter {
productList.add(productBean); productList.add(productBean);
} }
if (null != productList && productList.size() > 0) { if (null != productList && productList.size() > 0) {
List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> originalProductLists = productList;
for (QueryOrdersResponse.DataBean.OrderBean.ProductBean sendProductBean : productList) { for (QueryOrdersResponse.DataBean.OrderBean.ProductBean sendProductBean : productList) {
sendProductBean.setIsPrint(true); sendProductBean.setIsPrint(true);
if (null != sendProductBean.getIsSendGoods() && sendProductBean.getIsSendGoods() && StringUtils.isNotEmpty(sendProductBean.getOriginalGoodsUid())) { if (null != sendProductBean.getIsSendGoods() && sendProductBean.getIsSendGoods() && StringUtils.isNotEmpty(sendProductBean.getOriginalGoodsUid())) {
sendProductBean.setIsPrint(false); sendProductBean.setIsPrint(false);
} }
if (StringUtils.isNotEmpty(sendProductBean.getCartGoodsUid()) && null != sendProductBean.getIsSendGoods() && !sendProductBean.getIsSendGoods()) { if (StringUtils.isNotEmpty(sendProductBean.getCartGoodsUid()) && null != sendProductBean.getIsSendGoods() && !sendProductBean.getIsSendGoods()) {
sendProductBean.setSendProduct(productList.stream() sendProductBean.setSendProduct(
.filter(productBean -> productBean.getOriginalGoodsUid().equalsIgnoreCase(sendProductBean.getCartGoodsUid()) originalProductLists.stream().filter(productBean -> productBean.getOriginalGoodsUid().equalsIgnoreCase(sendProductBean.getCartGoodsUid()) && productBean.getIsSendGoods() == true)
&& productBean.getIsSendGoods() == true)
.map(o -> JSON.parseObject(JSON.toJSONString(o), QueryOrdersResponse.DataBean.OrderBean.ProductBean.class)) .map(o -> JSON.parseObject(JSON.toJSONString(o), QueryOrdersResponse.DataBean.OrderBean.ProductBean.class))
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
......
package com.freemud.sdk.api.assortment.order.constant;
import java.util.Arrays;
import java.util.List;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2021/7/5 下午4:17
* @description :
*/
public class CommonConstant {
/**
* 2:星期二
* 4:星期四
*/
public static List<Integer> weekDay = Arrays.asList(2, 4);
}
...@@ -33,7 +33,6 @@ import com.freemud.application.sdk.api.ordercenter.enums.*; ...@@ -33,7 +33,6 @@ import com.freemud.application.sdk.api.ordercenter.enums.*;
import com.freemud.application.sdk.api.ordercenter.request.*; import com.freemud.application.sdk.api.ordercenter.request.*;
import com.freemud.application.sdk.api.ordercenter.request.create.*; import com.freemud.application.sdk.api.ordercenter.request.create.*;
import com.freemud.application.sdk.api.ordercenter.response.*; import com.freemud.application.sdk.api.ordercenter.response.*;
import com.freemud.application.sdk.api.ordercenter.response.AfterSalesListResp;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.QueryByCodeResponse; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.QueryByCodeResponse;
...@@ -60,6 +59,7 @@ import com.freemud.application.sdk.api.structure.MessageCenterType; ...@@ -60,6 +59,7 @@ import com.freemud.application.sdk.api.structure.MessageCenterType;
import com.freemud.application.sdk.api.structure.request.PushMessageNoticeDto; import com.freemud.application.sdk.api.structure.request.PushMessageNoticeDto;
import com.freemud.application.sdk.api.structure.service.MessageCenterClient; import com.freemud.application.sdk.api.structure.service.MessageCenterClient;
import com.freemud.sdk.api.assortment.order.adapter.*; import com.freemud.sdk.api.assortment.order.adapter.*;
import com.freemud.sdk.api.assortment.order.constant.CommonConstant;
import com.freemud.sdk.api.assortment.order.domain.ResponseCodeConstant; import com.freemud.sdk.api.assortment.order.domain.ResponseCodeConstant;
import com.freemud.sdk.api.assortment.order.entities.OrderEditInfo; import com.freemud.sdk.api.assortment.order.entities.OrderEditInfo;
import com.freemud.sdk.api.assortment.order.enums.*; import com.freemud.sdk.api.assortment.order.enums.*;
...@@ -77,8 +77,10 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -77,8 +77,10 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -124,6 +126,15 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -124,6 +126,15 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
@Autowired @Autowired
private OfflineCouponSdkService offlineCouponSdkService; private OfflineCouponSdkService offlineCouponSdkService;
/**
* 规避 发版时间配置的双虎
*/
@Value("${avoid.version.upgrade.config:}")
private String avoidVersionUpgradeConfig;
@Value("${version.upgrade.weekDay:}")
private List<Integer> weekDay;
@Override @Override
public CreateOrderResponse createOrderFlow(CreateOrderRequest config) { public CreateOrderResponse createOrderFlow(CreateOrderRequest config) {
com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest request = orderSdkAdapter.convent2NEWCreateOrderRequest(config.getBaseCreateOrderRequest()); com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest request = orderSdkAdapter.convent2NEWCreateOrderRequest(config.getBaseCreateOrderRequest());
...@@ -544,7 +555,7 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -544,7 +555,7 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
&& !ObjectUtils.equals("0", configuration.getAutoChargebackOrderTime())) { && !ObjectUtils.equals("0", configuration.getAutoChargebackOrderTime())) {
request.setTimeOut(AutoOrderConfigTime.getTime(configuration.getAutoChargebackOrderTime())); request.setTimeOut(AutoOrderConfigTime.getTime(configuration.getAutoChargebackOrderTime()));
} }
OrderTaskReq orderTask = setAfterSalesOrderTimeOutTask(configuration); OrderTaskReq orderTask = setAfterSalesOrderTimeOutTask(configuration,orderRefundRequest.getPartnerId());
request.setOrderTask(orderTask); request.setOrderTask(orderTask);
com.freemud.application.sdk.api.ordercenter.response.BaseResponse response = orderSdkService.createAfterSalesOrder(request, orderRefundRequest.getTrackingNo()); com.freemud.application.sdk.api.ordercenter.response.BaseResponse response = orderSdkService.createAfterSalesOrder(request, orderRefundRequest.getTrackingNo());
return orderSdkAdapter.convent2BaseOrderResponse(response); return orderSdkAdapter.convent2BaseOrderResponse(response);
...@@ -557,13 +568,24 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -557,13 +568,24 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
* 为了防止同一时刻的退款量太大,需要将退款的订单分散到指定的时间后半小时内 * 为了防止同一时刻的退款量太大,需要将退款的订单分散到指定的时间后半小时内
*/ */
private OrderTaskReq setAfterSalesOrderTimeOutTask(StoreResponse.Configuration configuration) { private OrderTaskReq setAfterSalesOrderTimeOutTask(StoreResponse.Configuration configuration) {
OrderTaskReq orderTaskReq = setAfterSalesOrderTimeOutTask(configuration, null);
return orderTaskReq;
}
/**
* 设置申请退款时间
* 如果时间的类型是2表示采用原来的48小时逻辑
* 如果时间的类型是1表示在指定的时间之后进行退款
* 为了防止同一时刻的退款量太大,需要将退款的订单分散到指定的时间后半小时内
*/
public OrderTaskReq setAfterSalesOrderTimeOutTask(StoreResponse.Configuration configuration, String partnerId) {
if(configuration == null ){ if(configuration == null ){
return null; return null;
} }
OrderTaskReq orderTask;
if((configuration.getTimeTypeOfRefund() != null && 2 == configuration.getTimeTypeOfRefund().intValue()) || configuration.getTimeTypeOfRefund() == null){// 48小时之后 if((configuration.getTimeTypeOfRefund() != null && configuration.getTimeTypeOfRefund().compareTo(2) == 0 ) || configuration.getTimeTypeOfRefund() == null){// 48小时之后
OrderTaskReq orderTask = new OrderTaskReq(); orderTask = new OrderTaskReq();
orderTask.setTaskType(4); orderTask.setTaskType(4);
orderTask.setTimeout(1); orderTask.setTimeout(1);
//1000*60*60*24*2 毫秒(48小时) //1000*60*60*24*2 毫秒(48小时)
...@@ -574,10 +596,8 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -574,10 +596,8 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
orderTask.setTaskTime(DateUtil.convert2String(taskTime, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS)); orderTask.setTaskTime(DateUtil.convert2String(taskTime, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS));
//处理时间,当前时间加48小时减1分钟 //处理时间,当前时间加48小时减1分钟
orderTask.setProcessingTime(DateUtil.convert2String(processingDate, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS)); orderTask.setProcessingTime(DateUtil.convert2String(processingDate, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS));
}else if(configuration.getTimeTypeOfRefund() != null && configuration.getTimeTypeOfRefund().compareTo(1) == 0 ){// 指定时间
return orderTask; orderTask = new OrderTaskReq();
}else if(configuration.getTimeTypeOfRefund() != null && 1 == configuration.getTimeTypeOfRefund().intValue()){// 指定时间
OrderTaskReq orderTask = new OrderTaskReq();
orderTask.setTaskType(4); orderTask.setTaskType(4);
orderTask.setTimeout(1); orderTask.setTimeout(1);
// 获取门店配置的当天指定的退款时间 // 获取门店配置的当天指定的退款时间
...@@ -597,10 +617,84 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -597,10 +617,84 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
String processingStr = DateUtil.convert2String(processingDate, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS); String processingStr = DateUtil.convert2String(processingDate, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
orderTask.setTaskTime(processingStr); orderTask.setTaskTime(processingStr);
orderTask.setProcessingTime(processingStr); orderTask.setProcessingTime(processingStr);
} else {
orderTask = null;
}
return orderTask; // fisherman [KA-20210702] 规避版本升级
if (orderTask != null) {
avoidVersionUpgrade(orderTask,partnerId);
} }
return null; return orderTask;
}
/**
* fisherman 规避版本升级
* 周二周四晚 23:00开始发版, 服务器会存在宕机, 延迟定时器处理时间
* 1.校验时间
* 2.校验 apollo配置商户
* @param orderTask
*/
private void avoidVersionUpgrade(OrderTaskReq orderTask, String partnerId) {
if (Objects.isNull(partnerId)) {
return;
}
// 时间校验
boolean checkResult = checkDate(orderTask);
if (checkResult && StringUtils.isNotBlank(avoidVersionUpgradeConfig)) {
// 读取 是否商户配置
Map<String,Integer> map = JSON.parseObject(avoidVersionUpgradeConfig, Map.class);
if (map.containsKey(partnerId)) {
Integer addHours = map.get(partnerId);
// 增加 时间
String processingTime = orderTask.getProcessingTime();
Date datet = DateUtil.convert2Date(processingTime, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
Date date = DateUtil.addHours(datet, addHours);
String resultTime = DateUtil.convert2String(date, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
orderTask.setProcessingTime(resultTime);
// 显示时间一起设置
processingTime = orderTask.getProcessingTime();
datet = DateUtil.convert2Date(processingTime, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
date = DateUtil.addHours(datet, addHours);
resultTime = DateUtil.convert2String(date, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
orderTask.setTaskTime(resultTime);
}
}
}
private boolean checkDate(OrderTaskReq orderTask) {
// 校验 是否 周二 周四
String processingTime = orderTask.getProcessingTime();
Calendar cal = Calendar.getInstance();
Date datet = DateUtil.convert2Date(processingTime, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
if (datet == null) {
return false;
}
cal.setTime(datet);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
// 增加一个发版开关
if (CollectionUtils.isNotEmpty(weekDay) && weekDay.size()>0) {
if (weekDay.contains(w)) {
// 校验时间 是否是 23:00 之后
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 23){
// 表示 设置时间为23点之后
return true;
}
}
}else {
if (CommonConstant.weekDay.contains(w)) {
// 校验时间 是否是 23:00 之后
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 23){
// 表示 设置时间为23点之后
return true;
}
}
}
return false;
} }
/** /**
...@@ -739,7 +833,7 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -739,7 +833,7 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
&& !ObjectUtils.equals("0", configuration.getAutoChargebackOrderTime())) { && !ObjectUtils.equals("0", configuration.getAutoChargebackOrderTime())) {
request.setTimeOut(AutoOrderConfigTime.getTime(configuration.getAutoChargebackOrderTime())); request.setTimeOut(AutoOrderConfigTime.getTime(configuration.getAutoChargebackOrderTime()));
} }
OrderTaskReq orderTask = setAfterSalesOrderTimeOutTask(configuration); OrderTaskReq orderTask = setAfterSalesOrderTimeOutTask(configuration,cancelOrderRequest.getPartnerId());
request.setOrderTask(orderTask); request.setOrderTask(orderTask);
} }
request.setRefundDeliveryAmount(cancelOrderRequest.isRefundDeliveryAmount()); request.setRefundDeliveryAmount(cancelOrderRequest.isRefundDeliveryAmount());
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>cn.freemud</groupId> <groupId>cn.freemud</groupId>
<artifactId>assortment-ordercenter-sdk</artifactId> <artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.1.76-RELEASE</version> <version>2.1.84-RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.freemud.application.service.sdk</groupId> <groupId>com.freemud.application.service.sdk</groupId>
......
...@@ -410,5 +410,6 @@ public class OrderController { ...@@ -410,5 +410,6 @@ public class OrderController {
orderReportJobHandler.sendYesterDayStoreMsg(); orderReportJobHandler.sendYesterDayStoreMsg();
return ResponseUtil.success(); return ResponseUtil.success();
} }
} }
...@@ -405,8 +405,8 @@ public class ActivityAdapter { ...@@ -405,8 +405,8 @@ public class ActivityAdapter {
couponAvailableCartInfo.setRealAmount(0L); couponAvailableCartInfo.setRealAmount(0L);
couponAvailableCartInfo.setDiscountAmount(0L); couponAvailableCartInfo.setDiscountAmount(0L);
} }
couponAvailableCartInfo.setDeliveryAmount(discountResult.getDeliveryAmount()); couponAvailableCartInfo.setDeliveryAmount(discountResult!=null?discountResult.getDeliveryAmount():0);
couponAvailableCartInfo.setDistributionFee(discountResult.getDistributionFee()); couponAvailableCartInfo.setDistributionFee(discountResult!=null?discountResult.getDistributionFee():0);
return couponAvailableCartInfo; return couponAvailableCartInfo;
} }
public CouponAvailableCartInfo convert2CouponAvailableCartInfo(String partnerId,String storeId,ActivityCalculationDiscountResponseDto.CalculationDiscountResult discountResult, List<String> orgCodes) { public CouponAvailableCartInfo convert2CouponAvailableCartInfo(String partnerId,String storeId,ActivityCalculationDiscountResponseDto.CalculationDiscountResult discountResult, List<String> orgCodes) {
......
...@@ -25,7 +25,4 @@ public class ApplicationConstant { ...@@ -25,7 +25,4 @@ public class ApplicationConstant {
public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%s元"; public final static String DELIVERY_DISCOUNT_DESC3="另需配送费%s元";
public final static String DELIVERY_DISCOUNT_DESC4=" 选择了配送券"; public final static String DELIVERY_DISCOUNT_DESC4=" 选择了配送券";
@Value("${print-debug-log:false}")
public final static boolean printDebug = false;
} }
...@@ -249,9 +249,7 @@ public class PlatformApportionService extends AbstractApportionService { ...@@ -249,9 +249,7 @@ public class PlatformApportionService extends AbstractApportionService {
//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);
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){ for(int i = 0 ; i < oldCoupons.size() ; i++){
GetCalculationDiscountBO.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i); GetCalculationDiscountBO.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
oldCoupon.setUseIndex(i); oldCoupon.setUseIndex(i);
......
...@@ -143,9 +143,7 @@ public class GradDeliveryServiceImpl extends AbstractDeliveryServiceImpl impleme ...@@ -143,9 +143,7 @@ public class GradDeliveryServiceImpl extends AbstractDeliveryServiceImpl impleme
request.setStoreCode(storeCode); request.setStoreCode(storeCode);
StoreCBaseResponse<StoreCBaseResponseDto> responseDto = storeBaseApiClient.queryDeliverDetail(request); 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);
ApiLog.printLog("fisherman 获取门店预计送达时间", JSON.toJSONString(request),JSON.toJSONString(responseDto),null);
}
if (responseDto == null) { if (responseDto == null) {
throw new ServiceException(ResponseResult.SYSTEM_BUSINESS_ERROR); throw new ServiceException(ResponseResult.SYSTEM_BUSINESS_ERROR);
} }
......
...@@ -83,9 +83,7 @@ public class AssortmentSdkService { ...@@ -83,9 +83,7 @@ public class AssortmentSdkService {
BaseResponse<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods> baseResponse = shoppingCartService.getCartGoods(cartParamDto, LogThreadLocal.getTrackingNo()); 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) { 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));
ApiLog.printLog("getCartGoods:", SDKCommonBaseContextWare.getAppName(),LogThreadLocal.getTrackingNo(),JSONObject.toJSONString(baseResponse));
}
return null; return null;
} }
...@@ -326,9 +324,7 @@ public class AssortmentSdkService { ...@@ -326,9 +324,7 @@ public class AssortmentSdkService {
ProductInfosDto productInfosDto = storeItemClient.listProductInfos(getProductInfoDto); ProductInfosDto productInfosDto = storeItemClient.listProductInfos(getProductInfoDto);
if (!ResponseCodeConstant.RESPONSE_SUCCESS.equals(productInfosDto.getErrcode()) || CollectionUtils.isEmpty(productInfosDto.getData().getProducts())) { 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);
ApiLog.printLog("查询商品信息失败,getProductInfoDto,baseResponse",JSON.toJSONString(getProductInfoDto),JSON.toJSONString(productInfosDto),null);
}
return null; return null;
} }
return productInfosDto.getData().getProducts(); return productInfosDto.getData().getProducts();
......
...@@ -764,9 +764,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -764,9 +764,7 @@ public class CouponServiceImpl implements CouponService {
@Override @Override
public CheckSpqInfoResponseDto checkSpqInfo(CheckSpqInfoRequestDto requestDto) { 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);
ApiLog.printLog("checkSpqInfo****",gson.toJson(requestDto),null,null);
}
String partnerId = requestDto.getPartnerId(); String partnerId = requestDto.getPartnerId();
String couponCode = requestDto.getCouponCode(); String couponCode = requestDto.getCouponCode();
String storeId = requestDto.getStoreId(); String storeId = requestDto.getStoreId();
...@@ -841,9 +839,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -841,9 +839,7 @@ public class CouponServiceImpl implements CouponService {
dto.setPicture(productsVo.getSpuPicture()); dto.setPicture(productsVo.getSpuPicture());
dto.setCouponType(0); dto.setCouponType(0);
// ApiLog.debug("dto***" + dto); // ApiLog.debug("dto***" + dto);
if(ApplicationConstant.printDebug){ ApiLog.printLog("dto***", JSON.toJSONString(dto),null,null);
ApiLog.printLog("dto***", JSON.toJSONString(dto),null,null);
}
return dto; return dto;
} }
......
...@@ -86,14 +86,10 @@ public class MaterialPromotionService implements IPromotionService { ...@@ -86,14 +86,10 @@ public class MaterialPromotionService implements IPromotionService {
public void updateShoppingCartGoodsApportion(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) { public void updateShoppingCartGoodsApportion(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
HashMap<String, MaterialApportion> map = getApportionGoodsDetail(calculationDiscountResult); 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); ApiLog.printLog("updateShoppingCartGoodsApportion->map:", JSON.toJSONString(map),null,null);
}
List<ShoppingCartGoodsDto.CartGoodsDetailDto> products = shoppingCartGoodsDto.getProducts(); 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); ApiLog.printLog("updateShoppingCartGoodsApportion->product:", JSON.toJSONString(products),null,null);
}
if (map.size() > 0) { if (map.size() > 0) {
String pk = ""; String pk = "";
for (ShoppingCartGoodsDto.CartGoodsDetailDto product : products) { for (ShoppingCartGoodsDto.CartGoodsDetailDto product : products) {
......
...@@ -241,9 +241,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp ...@@ -241,9 +241,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
List<CollageMemberState> collageMemberState = collageOrderBaseService.getCollageMemberState(collageOrderDto).getResult(); List<CollageMemberState> collageMemberState = collageOrderBaseService.getCollageMemberState(collageOrderDto).getResult();
if(collageMemberState == null || collageMemberState.isEmpty()){ 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);
ApiLog.printLog("splitByUser 参单人员为空,partnerId:{},storeId:{},createUserId:{},currentUserId:{}"+partnerId,storeId,createUserId,currentUserId);
}
return null; return null;
} }
......
...@@ -932,9 +932,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -932,9 +932,7 @@ 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); ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){ for(int i = 0 ; i < oldCoupons.size() ; i++){
CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i); CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
...@@ -961,9 +959,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -961,9 +959,7 @@ 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); ApiLog.printLog("批量使用优惠券后,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
return oldCoupons; return oldCoupons;
} }
......
...@@ -721,9 +721,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -721,9 +721,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, deliveryAmount , deliveryAmount
, null); , null);
// ApiLog.info("fisherman 新算价 配送费字段数据 01 ",calculationSharingDiscountResult,shoppingCartGoodsResponseVo); // ApiLog.info("fisherman 新算价 配送费字段数据 01 ",calculationSharingDiscountResult,shoppingCartGoodsResponseVo);
if(ApplicationConstant.printDebug){ ApiLog.printLog("fisherman 新算价 配送费字段数据 01 ", JSON.toJSONString(calculationSharingDiscountResult),JSON.toJSONString(shoppingCartGoodsResponseVo),null);
ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(calculationSharingDiscountResult),JSON.toJSONString(shoppingCartGoodsResponseVo),null);
}
sharingCartService.distribute(calculationSharingDiscountResult sharingCartService.distribute(calculationSharingDiscountResult
, cartGoodsList , cartGoodsList
, shoppingCartGoodsResponseVo , shoppingCartGoodsResponseVo
...@@ -739,9 +737,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -739,9 +737,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, userId , userId
, storeId); , storeId);
// ApiLog.info("fisherman 新算价 配送费字段数据 02 ",null,shoppingCartGoodsResponseVo);shoppingCartGoodsResponseVo // ApiLog.info("fisherman 新算价 配送费字段数据 02 ",null,shoppingCartGoodsResponseVo);shoppingCartGoodsResponseVo
if(ApplicationConstant.printDebug){ ApiLog.printLog("fisherman 新算价 配送费字段数据 02 ",JSON.toJSONString(shoppingCartGoodsResponseVo), null,null);
ApiLog.printLog("fisherman 新算价 配送费字段数据 02 ",JSON.toJSONString(shoppingCartGoodsResponseVo), null,null);
}
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,calculationSharingDiscountResult,shoppingCartInfoRequestVo.getFlag(),partnerId); buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,calculationSharingDiscountResult,shoppingCartInfoRequestVo.getFlag(),partnerId);
} }
else { else {
...@@ -825,9 +821,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -825,9 +821,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 添加购物车商品总价和加价购商品总价,现在是自己计算,后面需要优化为促销计算, 这段要删除 // 添加购物车商品总价和加价购商品总价,现在是自己计算,后面需要优化为促销计算, 这段要删除
// ApiLog.info("fisherman 新算价 校验入参券是否可用new ",shoppingCartGoodsResponseVo,shoppingCartInfoRequestVo.getCouponCodes()); // ApiLog.info("fisherman 新算价 校验入参券是否可用new ",shoppingCartGoodsResponseVo,shoppingCartInfoRequestVo.getCouponCodes());
if(ApplicationConstant.printDebug){ ApiLog.printLog("校验入参券是否可用",JSON.toJSONString(shoppingCartGoodsResponseVo),shoppingCartInfoRequestVo.getCouponCode(),null);
ApiLog.printLog("校验入参券是否可用",JSON.toJSONString(shoppingCartGoodsResponseVo),shoppingCartInfoRequestVo.getCouponCode(),null);
}
// 校验入参券是否可用 // 校验入参券是否可用
if (!checkAvailableCoupon(shoppingCartGoodsResponseVo, shoppingCartInfoRequestVo.getCouponCode())){ if (!checkAvailableCoupon(shoppingCartGoodsResponseVo, shoppingCartInfoRequestVo.getCouponCode())){
return ResponseUtil.error(ResponseResult.SHOPPING_CART_COUPON_NOT_USE); return ResponseUtil.error(ResponseResult.SHOPPING_CART_COUPON_NOT_USE);
...@@ -1495,9 +1489,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1495,9 +1489,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
try { try {
// ApiLog.debug("activityClient discount :{}", JSON.toJSONString(activityCalculationDiscountRequestDto)); // ApiLog.debug("activityClient discount :{}", JSON.toJSONString(activityCalculationDiscountRequestDto));
if(ApplicationConstant.printDebug){
ApiLog.printLog("activityClient discount :{}", JSON.toJSONString(activityCalculationDiscountRequestDto),null,null); ApiLog.printLog("activityClient discount :{}", JSON.toJSONString(activityCalculationDiscountRequestDto),null,null);
}
activityCalculationDiscountResponseDto = activityClient.calculationDiscount(activityCalculationDiscountRequestDto); activityCalculationDiscountResponseDto = activityClient.calculationDiscount(activityCalculationDiscountRequestDto);
} catch (Exception ex) { } catch (Exception ex) {
ErrorLog.printErrorLog("calculation_discount_error", "/calculation/discount", activityCalculationDiscountRequestDto, ex); ErrorLog.printErrorLog("calculation_discount_error", "/calculation/discount", activityCalculationDiscountRequestDto, ex);
...@@ -2482,9 +2474,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2482,9 +2474,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return deliveryAmount; 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); ApiLog.printLog("获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}", LogThreadLocal.getTrackingNo(),JSON.toJSONString(storeDeliveryUseOld),"receiveId:"+receiveId+",partnerId:"+partnerId+",storeId:"+storeId);
}
if (storeDeliveryUseOld) { if (storeDeliveryUseOld) {
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString()); deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString());
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0); shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
...@@ -2835,9 +2825,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2835,9 +2825,7 @@ 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); ApiLog.printLog("批量使用优惠券前,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
for(int i = 0 ; i < oldCoupons.size() ; i++){ for(int i = 0 ; i < oldCoupons.size() ; i++){
CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i); CalculationSharingDiscountRequestDto.CalculationDiscountCoupon oldCoupon = oldCoupons.get(i);
...@@ -2864,9 +2852,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2864,9 +2852,7 @@ 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); ApiLog.printLog("批量使用优惠券后,oldCoupons,coupons", JSON.toJSONString(oldCoupons),JSON.toJSONString(coupons),null);
}
return oldCoupons; return oldCoupons;
} }
......
...@@ -72,9 +72,7 @@ public class CalculationCommonService { ...@@ -72,9 +72,7 @@ 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);
ApiLog.printLog("initShoppingCart={},discountResult={}",JSON.toJSONString(cartGoodsList),JSON.toJSONString(discountResult),null);
}
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods = null; List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods = null;
if (discountResult != null && CollectionUtils.isNotEmpty(discountResult.getGoods())) { if (discountResult != null && CollectionUtils.isNotEmpty(discountResult.getGoods())) {
goods = discountResult.getGoods(); goods = discountResult.getGoods();
...@@ -223,9 +221,7 @@ public class CalculationCommonService { ...@@ -223,9 +221,7 @@ public class CalculationCommonService {
, CartGoods cartGoods , CartGoods cartGoods
, String partnerId) { , 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);
ApiLog.printLog("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", JSON.toJSONString(calculationGoods), JSON.toJSONString(cartGoods),null);
}
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.convertCartGoods2DetailGoods(calculationGoods, cartGoods,partnerId); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.convertCartGoods2DetailGoods(calculationGoods, cartGoods,partnerId);
return cartGoodsDetailDto; return cartGoodsDetailDto;
} }
...@@ -240,9 +236,7 @@ public class CalculationCommonService { ...@@ -240,9 +236,7 @@ public class CalculationCommonService {
public ShoppingCartApportionBO.CartGoodsDetailDto convertCartGoods2NewDetailGoodsList(CalculationDiscountBO.CalculationDiscountResult.Goods calculationGoods public ShoppingCartApportionBO.CartGoodsDetailDto convertCartGoods2NewDetailGoodsList(CalculationDiscountBO.CalculationDiscountResult.Goods calculationGoods
, CartGoods cartGoods, String partnerId) { , 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);
ApiLog.printLog("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", JSON.toJSONString(calculationGoods), JSON.toJSONString(cartGoods),null);
}
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods oldGoods = mapperFacade.map(calculationGoods, CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.class); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods oldGoods = mapperFacade.map(calculationGoods, CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.class);
......
...@@ -104,15 +104,11 @@ public class CalculationSharingDiscountService { ...@@ -104,15 +104,11 @@ public class CalculationSharingDiscountService {
if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
checkSpqInfo = couponService.checkSpqInfo(checkSpqInfoRequestDto, cartGoods.getSkuId()); 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);
ApiLog.printLog("coupon:{},{}", "hg", JSON.toJSONString(checkSpqInfo),null);
}
} else { } else {
checkSpqInfo = couponService.checkSpqInfo(checkSpqInfoRequestDto); 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);
ApiLog.printLog("coupon:{},{}", "sp", JSON.toJSONString(checkSpqInfo),null);
}
} }
if (null == checkSpqInfo) { if (null == checkSpqInfo) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
...@@ -188,9 +184,7 @@ public class CalculationSharingDiscountService { ...@@ -188,9 +184,7 @@ public class CalculationSharingDiscountService {
calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0)); calculationDiscountGoodsList.removeIf(v->v.getGoodsQuantity().equals(0));
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) { 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);
ApiLog.printLog("calculationDiscountGoodsList:{}", JSON.toJSONString(calculationDiscountGoodsList),null,null);
}
//throw new BizServiceException(ResponseResult.SHOPPING_CART_COUPON_NOT_EXIST,"参数促销计算商品有异常"); //throw new BizServiceException(ResponseResult.SHOPPING_CART_COUPON_NOT_EXIST,"参数促销计算商品有异常");
return null; return null;
} }
......
...@@ -256,9 +256,7 @@ public class AdditionSharingService { ...@@ -256,9 +256,7 @@ public class AdditionSharingService {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST); 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);
ApiLog.printLog("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap),null,null);
}
// 获取计算返回的价格 // 获取计算返回的价格
Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount(); Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount();
//Long totalAmount = shoppingCartGoodsDto.getTotalAmount(); //Long totalAmount = shoppingCartGoodsDto.getTotalAmount();
......
...@@ -238,9 +238,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -238,9 +238,7 @@ public class ShoppingCartMCoffeeServiceImpl {
List<CartGoods> newCartGoods = null; 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);
ApiLog.printLog("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods),null);
}
if(StringUtils.equals("9999",skuId)) { if(StringUtils.equals("9999",skuId)) {
// 将月享卡2.0的虚拟商品保存到购物车中 // 将月享卡2.0的虚拟商品保存到购物车中
oldCartGoodsList.add(addCartGoods); oldCartGoodsList.add(addCartGoods);
...@@ -803,9 +801,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -803,9 +801,7 @@ public class ShoppingCartMCoffeeServiceImpl {
if (null != cartGoods.getMonthCardInfo()){ if (null != cartGoods.getMonthCardInfo()){
cartGoods.getMonthCardInfo().setIsUseMonthCard(requestVo.getIsUseMonthCard()); 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);
ApiLog.printLog("【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}",String.valueOf(requestVo.getIsUseMonthCard()),JSONObject.toJSONString(cartGoods),null);
}
} }
} }
cartGoodsList = cartGoodsList.stream().filter(cartGoods -> !StringUtils.equals("9999",cartGoods.getSkuId())).collect(Collectors.toList()); cartGoodsList = cartGoodsList.stream().filter(cartGoods -> !StringUtils.equals("9999",cartGoods.getSkuId())).collect(Collectors.toList());
...@@ -841,15 +837,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -841,15 +837,11 @@ public class ShoppingCartMCoffeeServiceImpl {
// 先验证商品是否存在 // 先验证商品是否存在
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, null, shoppingCartBaseService); 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);
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService); 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);
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartSendGoodsList),null,null);
}
CartGoods cartGoods = null; CartGoods cartGoods = null;
String skuId = ""; String skuId = "";
Integer finalQty = qty; Integer finalQty = qty;
...@@ -1018,15 +1010,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1018,15 +1010,11 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService); 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);
ApiLog.printLog("cartGoodsList: {}", JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, sessionId, "", shoppingCartBaseService); 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);
ApiLog.printLog("cartSendGoodsList: {}", JSONObject.toJSONString(cartSendGoodsList),null,null);
}
CartGoods monthCardProduct = null; CartGoods monthCardProduct = null;
// 如果购物车商品不为空, 则check购物车中所有商品 // 如果购物车商品不为空, 则check购物车中所有商品
if (CollectionUtils.isNotEmpty(cartGoodsList)) { if (CollectionUtils.isNotEmpty(cartGoodsList)) {
...@@ -1295,14 +1283,10 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1295,14 +1283,10 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService); 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);
ApiLog.printLog("cartGoodsList: {}",JSONObject.toJSONString(cartGoodsList),null,null);
}
List<CartGoods> cartSendGoodsList = assortmentSdkService.getShoppingCartSendGoods(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService); 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);
ApiLog.printLog("cartSendGoodsList: {}",JSONObject.toJSONString(cartSendGoodsList),null,null);
}
if (cartGoodsList == null || CollectionUtils.isEmpty(cartGoodsList)) { if (cartGoodsList == null || CollectionUtils.isEmpty(cartGoodsList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD); throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD);
} }
...@@ -1438,9 +1422,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1438,9 +1422,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取原门店购物车商品 // 获取原门店购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, fromStoreId, userId, sessionId, "", shoppingCartBaseService); 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);
ApiLog.printLog("【switchCardGoods】原门店数据: {} {}", requestVo.getSessionId(), JSONObject.toJSONString(cartGoodsList),null);
}
// 如果购物车商品不为空, 则check购物车中所有商品 // 如果购物车商品不为空, 则check购物车中所有商品
if (CollectionUtils.isEmpty(cartGoodsList)) { if (CollectionUtils.isEmpty(cartGoodsList)) {
return ResponseUtil.success(shoppingCartGoodsResponseVo); return ResponseUtil.success(shoppingCartGoodsResponseVo);
...@@ -1841,9 +1823,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1841,9 +1823,7 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
if(CollectionUtils.isNotEmpty(newCartGoodsList)){ 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);
ApiLog.printLog("【merge-before】:{} ,【newCardGoods】:{}",JSONObject.toJSONString(nowCartGoodsList),JSONObject.toJSONString(newCartGoods),null);
}
newCartGoodsList.forEach(newCartGood -> { newCartGoodsList.forEach(newCartGood -> {
int index; int index;
if ((index = nowCartGoodsList.indexOf(newCartGood)) >= 0) { if ((index = nowCartGoodsList.indexOf(newCartGood)) >= 0) {
...@@ -2738,9 +2718,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -2738,9 +2718,7 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.getMonthCardInfo().setCardNo(productBindingCouponType.getCardId()); cartGoods.getMonthCardInfo().setCardNo(productBindingCouponType.getCardId());
cartGoods.getMonthCardInfo().setType(cartGoods.getMonthCardInfo().getType()); 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);
ApiLog.printLog("【月享卡】信息替换成功,cartGoods:{},productInfo:{}",cartGoods.toString(),result.toString(),null);
}
} }
} }
} }
......
...@@ -197,9 +197,7 @@ public class CouponDiscountCalculation { ...@@ -197,9 +197,7 @@ public class CouponDiscountCalculation {
if (CollectionUtils.isNotEmpty(discountsNew)) { if (CollectionUtils.isNotEmpty(discountsNew)) {
useCoupon = true; useCoupon = true;
// ApiLog.debug("couponDiscountCalculation:{}",discountsNew); // ApiLog.debug("couponDiscountCalculation:{}",discountsNew);
if(ApplicationConstant.printDebug){ ApiLog.printLog("couponDiscountCalculation:{}",JSON.toJSONString(discountsNew),null,null);
ApiLog.printLog("couponDiscountCalculation:{}",JSON.toJSONString(discountsNew),null,null);
}
//这里过滤掉了 月享卡2.0,因为月享卡2.0商品不用展示划线价,故显示原价 //这里过滤掉了 月享卡2.0,因为月享卡2.0商品不用展示划线价,故显示原价
Optional<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount> targetDiscount = discountsNew.stream() Optional<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount> targetDiscount = discountsNew.stream()
.filter(t -> ActivityTypeEnum.TYPE_32.getCode().equals(t.getType()) .filter(t -> ActivityTypeEnum.TYPE_32.getCode().equals(t.getType())
...@@ -286,9 +284,7 @@ public class CouponDiscountCalculation { ...@@ -286,9 +284,7 @@ public class CouponDiscountCalculation {
changed.set(false); changed.set(false);
if(CollectionUtils.isNotEmpty(cartGoodsList)){ 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);
ApiLog.printLog("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
for (int i = cartGoodsList.size() - 1; i >= 1; i--) { for (int i = cartGoodsList.size() - 1; i >= 1; i--) {
CartGoods cartGoods = cartGoodsList.get(i); CartGoods cartGoods = cartGoodsList.get(i);
int index2 = nowCartGoodsList.indexOf(cartGoods); int index2 = nowCartGoodsList.indexOf(cartGoods);
...@@ -302,14 +298,10 @@ public class CouponDiscountCalculation { ...@@ -302,14 +298,10 @@ public class CouponDiscountCalculation {
nowCartGoodsList.remove(i); 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.printLog("合并买3赠1商品券 【merge-ing】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
} }
// ApiLog.debug("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList)); // ApiLog.debug("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList));
if(ApplicationConstant.printDebug){ ApiLog.printLog("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
ApiLog.printLog("合并买3赠1商品券 【merge-after】 : {} ", JSONObject.toJSONString(nowCartGoodsList),null,null);
}
} }
if(changed.get()) { if(changed.get()) {
cartGoodsList.clear(); cartGoodsList.clear();
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
*/ */
package cn.freemud.service.thirdparty; package cn.freemud.service.thirdparty;
import cn.freemud.entities.dto.*;
import cn.freemud.entities.dto.coupon.CouponAvailableRespDto; import cn.freemud.entities.dto.coupon.CouponAvailableRespDto;
import cn.freemud.entities.vo.coupon.CouponAvailableReqVo; import cn.freemud.entities.vo.coupon.CouponAvailableReqVo;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
......
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