Commit e2f8d586 by zhiheng.zhang

券码核销添加

parent 04ba8023
...@@ -540,12 +540,6 @@ public class MallOrderServiceImpl implements MallOrderService { ...@@ -540,12 +540,6 @@ public class MallOrderServiceImpl implements MallOrderService {
orderIds.add(orderBean.getOid()); orderIds.add(orderBean.getOid());
orderIds = orderIds.stream().distinct().collect(Collectors.toList()); orderIds = orderIds.stream().distinct().collect(Collectors.toList());
//接单 //接单
POSOrderOperationBaseReq acceptOrderReq = new POSOrderOperationBaseReq();
acceptOrderReq.setOrderCode(orderBean.getOid());
com.freemud.application.sdk.api.ordercenter.response.BaseResponse baseResponse = orderSdkService.acceptOrder(acceptOrderReq, LogTreadLocal.getTrackingNo());
if(baseResponse == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(baseResponse.getCode())) {
orderRefund(orderBean, "接单失败");
return gson.toJson(message);
if(orderIds.size() > 1 || orderBean.getMarketingType() != OrderMarketType.GROUPB.getIndex()){ if(orderIds.size() > 1 || orderBean.getMarketingType() != OrderMarketType.GROUPB.getIndex()){
POSOrderOperationBaseReq acceptOrderReq = new POSOrderOperationBaseReq(); POSOrderOperationBaseReq acceptOrderReq = new POSOrderOperationBaseReq();
......
...@@ -30,9 +30,7 @@ import cn.freemud.entities.vo.*; ...@@ -30,9 +30,7 @@ import cn.freemud.entities.vo.*;
import cn.freemud.enums.*; import cn.freemud.enums.*;
import cn.freemud.interceptor.ServiceException; import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.*; import cn.freemud.service.*;
import cn.freemud.service.impl.calculate.CalculateCenter; import cn.freemud.service.impl.calculate.*;
import cn.freemud.service.impl.calculate.CalculationSharingCartService;
import cn.freemud.service.impl.calculate.CalculationSharingDiscountService;
import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory; import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory;
import cn.freemud.service.shoppingCart.ShoppingCartRelationService; import cn.freemud.service.shoppingCart.ShoppingCartRelationService;
import cn.freemud.service.thirdparty.*; import cn.freemud.service.thirdparty.*;
...@@ -107,7 +105,10 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -107,7 +105,10 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
private CouponAdapter couponAdapter; private CouponAdapter couponAdapter;
@Autowired @Autowired
private DeliveryFeiginClient deliveryFeiginClient; private DeliveryFeiginClient deliveryFeiginClient;
@Autowired
private CalculationSharingValidatorService calculationSharingValidatorService;
@Autowired
private CalculationSharingEquallyService sharingEquallyService;
@Value("${saas.cart.sharing}") @Value("${saas.cart.sharing}")
private String sharing; private String sharing;
/** /**
...@@ -562,18 +563,17 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -562,18 +563,17 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType()); ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, shoppingCartInfoRequestVo.getOrderType());
CouponPromotionVO couponPromotionVO = couponAdapter.getCouponPromotionVO(shoppingCartInfoRequestVo, userLoginInfoDto); CouponPromotionVO couponPromotionVO = couponAdapter.getCouponPromotionVO(shoppingCartInfoRequestVo, userLoginInfoDto);
List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = new ArrayList<>(); List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = new ArrayList<>();
if (CollectionUtils.isNotEmpty(sendGoodsList)) { // 当couponCode不为空时,需参与价格计算
for (ShoppingCartInfoRequestVo.SendGoods sds : sendGoodsList) { if (StringUtils.isNotEmpty(couponCode)) {
ShoppingCartInfoRequestVo.SendGoods sd = new ShoppingCartInfoRequestVo.SendGoods(); CalculationSharingDiscountRequestDto.CalculationDiscountCoupon coupon = new CalculationSharingDiscountRequestDto.CalculationDiscountCoupon();
sd.setGoodsId(sds.getGoodsId()); coupon.setCode(couponCode);
if (StringUtils.isBlank(sds.getActivityCode())) continue; coupon.setActivityCode(activityCode);
sd.setQty(sds.getQty()); coupons.add(coupon);
sd.setOriginalPrice(0L);
sd.setActivityCode(sds.getActivityCode());
sendGoods.add(sd);
}
} }
CalculationSharingDiscountResponseDto.CalculationDiscountResult calculationSharingDiscountResult = sharingDiscountService.getCalculationSharingDiscountResult(menuType // 当couponCodes不为空时,需参与价格计算,同时排除单券入参
buildCoupons(coupons,shoppingCartInfoRequestVo.getCouponCodes());
CalculationSharingDiscountResponseDto.CalculationDiscountResult discountResult = sharingDiscountService.getCalculationSharingDiscountResult(menuType
, partnerId , partnerId
, storeId , storeId
, userId , userId
...@@ -582,10 +582,12 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -582,10 +582,12 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
, assortmentCustomerInfoVo.isMemberPaid() , assortmentCustomerInfoVo.isMemberPaid()
, cartGoodsList , cartGoodsList
, coupons , coupons
, sendGoods , shoppingCartInfoRequestVo.getSendGoods()
, deliveryAmount , deliveryAmount
, null); , shoppingCartInfoRequestVo);
sharingCartService.distribute(calculationSharingDiscountResult
// 活动校验
calculationSharingValidatorService.validator(discountResult
, cartGoodsList , cartGoodsList
, shoppingCartGoodsResponseVo , shoppingCartGoodsResponseVo
, shoppingCartInfoRequestVo , shoppingCartInfoRequestVo
...@@ -594,15 +596,20 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService { ...@@ -594,15 +596,20 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
, activityQueryDto , activityQueryDto
, menuType , menuType
, deliveryAmount , deliveryAmount
, ShoppingCartConstant.QUERY_INFO , ShoppingCartConstant.QUERY_INFO);
, partnerId
,shoppingCartInfoRequestVo.getFlag()
, userId
, storeId);
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo,calculationSharingDiscountResult,shoppingCartInfoRequestVo.getFlag(),partnerId); //直接利用促销返回做均摊
//设置均摊信息 sharingEquallyService.equally(discountResult
updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, null, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo); , cartGoodsList
, shoppingCartGoodsResponseVo
, shoppingCartInfoRequestVo
, userLoginInfoDto
, couponPromotionVO
, activityQueryDto
, menuType
, deliveryAmount
, shoppingCartGoodsDto
, premiumExchangeActivity);
return ResponseUtil.success(shoppingCartGoodsDto); return ResponseUtil.success(shoppingCartGoodsDto);
} }
......
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