Commit 29e36568 by 李学兴

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

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