Commit 3e39749a by 姜海波

Merge remote-tracking branch 'remotes/origin/feature/1.9.10-购物车接口修改渠道字段-海波' into develop

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
parents 33ef5605 ac14a3bb
...@@ -27,4 +27,5 @@ public class CheckCartRequest { ...@@ -27,4 +27,5 @@ public class CheckCartRequest {
private Integer orderWay; private Integer orderWay;
private String trackingNo; private String trackingNo;
private String tableNumber; private String tableNumber;
private String MenuType;
} }
...@@ -27,6 +27,6 @@ public class GetProductInfoRequest { ...@@ -27,6 +27,6 @@ public class GetProductInfoRequest {
String trackingNo; String trackingNo;
String businessType; String menuType;
} }
...@@ -112,7 +112,7 @@ public interface ShoppingCartBaseService { ...@@ -112,7 +112,7 @@ public interface ShoppingCartBaseService {
getProductInfoDto.setShopId(getProductInfoRequest.getStoreId()); getProductInfoDto.setShopId(getProductInfoRequest.getStoreId());
getProductInfoDto.setProductInfoType(2); getProductInfoDto.setProductInfoType(2);
getProductInfoDto.setProductIds(goodsIds); getProductInfoDto.setProductIds(goodsIds);
getProductInfoDto.setChannel(getProductInfoRequest.getBusinessType()); getProductInfoDto.setChannel(getProductInfoRequest.getMenuType());
ProductService productService = SDKCommonBaseContextWare.getBean(ProductService.class); ProductService productService = SDKCommonBaseContextWare.getBean(ProductService.class);
com.freemud.application.sdk.api.base.BaseResponse<ProductInfosDTO> productInfosDTOBaseResponse = productService.listProductInfoByIdList(getProductInfoDto, LogThreadLocal.getTrackingNo()); com.freemud.application.sdk.api.base.BaseResponse<ProductInfosDTO> productInfosDTOBaseResponse = productService.listProductInfoByIdList(getProductInfoDto, LogThreadLocal.getTrackingNo());
if (!Objects.equals(ResponseResultEnum.SUCCESS.getCode(), productInfosDTOBaseResponse.getCode()) || productInfosDTOBaseResponse.getData() == null) { if (!Objects.equals(ResponseResultEnum.SUCCESS.getCode(), productInfosDTOBaseResponse.getCode()) || productInfosDTOBaseResponse.getData() == null) {
......
...@@ -44,5 +44,5 @@ public class AddGoodsByWeixinCardRequestVo extends BaseRequestVo{ ...@@ -44,5 +44,5 @@ public class AddGoodsByWeixinCardRequestVo extends BaseRequestVo{
/** /**
* 业务类型: 0 : 自提 1:外卖 2:微商城 * 业务类型: 0 : 自提 1:外卖 2:微商城
*/ */
private Integer businessType ; private Integer menuType ;
} }
...@@ -70,6 +70,6 @@ public class AddShoppingCartGoodsRequestVo extends BaseRequestVo{ ...@@ -70,6 +70,6 @@ public class AddShoppingCartGoodsRequestVo extends BaseRequestVo{
/** /**
* 业务类型: 0 : 自提 1:外卖 2:微商城 * 业务类型: 0 : 自提 1:外卖 2:微商城
*/ */
private Integer businessType ; private Integer menuType ;
} }
...@@ -85,7 +85,7 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo { ...@@ -85,7 +85,7 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo {
/** /**
* 业务类型: 0 : 自提 1:外卖 2:微商城 * 业务类型: 0 : 自提 1:外卖 2:微商城
*/ */
private Integer businessType ; private Integer menuType ;
@Data @Data
public final static class SendGoods { public final static class SendGoods {
......
...@@ -46,6 +46,6 @@ public class UpdateShoppingCartGoodsQtyRequestVo extends BaseRequestVo { ...@@ -46,6 +46,6 @@ public class UpdateShoppingCartGoodsQtyRequestVo extends BaseRequestVo {
/** /**
* 业务类型: 0 : 自提 1:外卖 2:微商城 * 业务类型: 0 : 自提 1:外卖 2:微商城
*/ */
private Integer businessType ; private Integer menuType ;
} }
...@@ -98,7 +98,7 @@ public class AdditionalPromotionService implements IPromotionService { ...@@ -98,7 +98,7 @@ public class AdditionalPromotionService implements IPromotionService {
List<String> goodsIds = sendGoods.stream().map(ShoppingCartInfoRequestVo.SendGoods::getGoodsId).collect(Collectors.toList()); List<String> goodsIds = sendGoods.stream().map(ShoppingCartInfoRequestVo.SendGoods::getGoodsId).collect(Collectors.toList());
Map<String, ShoppingCartInfoRequestVo.SendGoods> goodQtyMap = sendGoods.stream().collect(Collectors.toMap(ShoppingCartInfoRequestVo.SendGoods::getGoodsId, Function.identity(), (k1, k2) -> k1)); Map<String, ShoppingCartInfoRequestVo.SendGoods> goodQtyMap = sendGoods.stream().collect(Collectors.toMap(ShoppingCartInfoRequestVo.SendGoods::getGoodsId, Function.identity(), (k1, k2) -> k1));
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(shoppingCartInfoRequestVo.getPartnerId() List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(shoppingCartInfoRequestVo.getPartnerId()
, shoppingCartInfoRequestVo.getShopId(), goodsIds,shoppingCartInfoRequestVo.getBusinessType(), shoppingCartBaseService); , shoppingCartInfoRequestVo.getShopId(), goodsIds,shoppingCartInfoRequestVo.getMenuType(), shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) { if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST); throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST);
} }
......
...@@ -142,7 +142,7 @@ public class AssortmentSdkService { ...@@ -142,7 +142,7 @@ public class AssortmentSdkService {
* @param orderType * @param orderType
*/ */
public CheckCartRequest checkShoppingCartSdk(List<CartGoods> oldAllCartGoodsList, String partnerId, String storeId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo public CheckCartRequest checkShoppingCartSdk(List<CartGoods> oldAllCartGoodsList, String partnerId, String storeId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo
, Integer orderType, String tableNumber, ShoppingCartBaseService shoppingCartService) { , Integer orderType, String tableNumber, Integer menuType ,ShoppingCartBaseService shoppingCartService) {
CheckCartRequest checkCartRequest = new CheckCartRequest(); CheckCartRequest checkCartRequest = new CheckCartRequest();
checkCartRequest.setCartGoodsList(JSONArray.parseArray(JSONObject.toJSONString(oldAllCartGoodsList), com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.class)); checkCartRequest.setCartGoodsList(JSONArray.parseArray(JSONObject.toJSONString(oldAllCartGoodsList), com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.class));
checkCartRequest.setOrderWay(orderType); checkCartRequest.setOrderWay(orderType);
...@@ -151,6 +151,7 @@ public class AssortmentSdkService { ...@@ -151,6 +151,7 @@ public class AssortmentSdkService {
checkCartRequest.setStoreId(storeId); checkCartRequest.setStoreId(storeId);
checkCartRequest.setTableNumber(tableNumber); checkCartRequest.setTableNumber(tableNumber);
checkCartRequest.setTrackingNo(LogThreadLocal.getTrackingNo()); checkCartRequest.setTrackingNo(LogThreadLocal.getTrackingNo());
checkCartRequest.setMenuType(BusinessTypeEnum.getByType(menuType).getCode());
BaseResponse<CheckCartRequest> baseResponse ; BaseResponse<CheckCartRequest> baseResponse ;
if ("checkAllCartGoodsNew".equals(shoppingCartCheckAction)){ if ("checkAllCartGoodsNew".equals(shoppingCartCheckAction)){
baseResponse= shoppingCartService.checkAllCartGoodsNew(checkCartRequest); baseResponse= shoppingCartService.checkAllCartGoodsNew(checkCartRequest);
...@@ -171,13 +172,13 @@ public class AssortmentSdkService { ...@@ -171,13 +172,13 @@ public class AssortmentSdkService {
* @param goodsIds * @param goodsIds
* @return * @return
*/ */
public List<ProductBeanDTO> getProductsInfoSdk(String partnerId, String storeId, List<String> goodsIds,Integer businessType, ShoppingCartBaseService shoppingCartService) { public List<ProductBeanDTO> getProductsInfoSdk(String partnerId, String storeId, List<String> goodsIds,Integer menuType, ShoppingCartBaseService shoppingCartService) {
GetProductInfoRequest request = new GetProductInfoRequest(); GetProductInfoRequest request = new GetProductInfoRequest();
request.setGoodsIds(goodsIds); request.setGoodsIds(goodsIds);
request.setPartnerId(partnerId); request.setPartnerId(partnerId);
request.setStoreId(storeId); request.setStoreId(storeId);
request.setTrackingNo(LogThreadLocal.getTrackingNo()); request.setTrackingNo(LogThreadLocal.getTrackingNo());
request.setBusinessType(BusinessTypeEnum.getByType(businessType).getCode()); request.setMenuType(BusinessTypeEnum.getByType(menuType).getCode());
BaseResponse<List<ProductBeanDTO>> baseResponse = BaseResponse<List<ProductBeanDTO>> baseResponse =
shoppingCartService.getProductsInfo(request); shoppingCartService.getProductsInfo(request);
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) { if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) {
......
...@@ -55,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService { ...@@ -55,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
} }
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList = new ArrayList<>(); List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList = new ArrayList<>();
sendActivities.forEach(sendActivity -> sendGoodsList.addAll(sendActivity.getSendGoods())); sendActivities.forEach(sendActivity -> sendGoodsList.addAll(sendActivity.getSendGoods()));
List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(activityQueryDto, sendGoodsList,shoppingCartInfoRequestVo.getBusinessType()); List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(activityQueryDto, sendGoodsList,shoppingCartInfoRequestVo.getMenuType());
if (CollectionUtils.isEmpty(productBeanDTOS)) { if (CollectionUtils.isEmpty(productBeanDTOS)) {
return; return;
} }
...@@ -149,11 +149,11 @@ public class BuyAndGiftsPromotionService implements IPromotionService { ...@@ -149,11 +149,11 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
* @return * @return
*/ */
private List<ProductBeanDTO> buildActivityProduct(ActivityQueryDto activityQueryDto, List<ActivityCalculationDiscountResponseDto private List<ProductBeanDTO> buildActivityProduct(ActivityQueryDto activityQueryDto, List<ActivityCalculationDiscountResponseDto
.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList,Integer businessType) { .CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList,Integer menuType) {
//获取 //获取
List<String> goodsIds = sendGoodsList.stream().map(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods::getGoodsId).collect(Collectors.toList()); List<String> goodsIds = sendGoodsList.stream().map(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods::getGoodsId).collect(Collectors.toList());
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId() List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId()
, activityQueryDto.getStoreId(), goodsIds, businessType ,shoppingCartBaseService); , activityQueryDto.getStoreId(), goodsIds, menuType ,shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) { if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST); throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST);
} }
......
...@@ -6,6 +6,7 @@ import cn.freemud.entities.dto.ActivityCalculationDiscountRequestDto; ...@@ -6,6 +6,7 @@ import cn.freemud.entities.dto.ActivityCalculationDiscountRequestDto;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto; import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*; import cn.freemud.entities.vo.*;
import cn.freemud.enums.BusinessTypeEnum;
import cn.freemud.enums.ProductType; import cn.freemud.enums.ProductType;
import cn.freemud.enums.ResponseResult; import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException; import cn.freemud.interceptor.ServiceException;
...@@ -102,7 +103,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -102,7 +103,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
} }
// 获取商品信息 // 获取商品信息
List<ProductBeanDTO> productBeanListSpuClass = List<ProductBeanDTO> productBeanListSpuClass =
assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2),requestVo.getBusinessType(), mealCartBaseService); assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2),requestVo.getMenuType(), mealCartBaseService);
if (productBeanListSpuClass == null) { if (productBeanListSpuClass == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_ADD_ERROR); throw new ServiceException(ResponseResult.SHOPPING_CART_ADD_ERROR);
} }
...@@ -239,7 +240,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -239,7 +240,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
return; return;
} }
//检查购物车中是否存在非法或者价格变更商品 //检查购物车中是否存在非法或者价格变更商品
CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, customerInfo.getPartnerId(), customerInfo.getStoreId(), responseVo, orderType, customerInfo.getTableNumber(), this.mealCartBaseService); CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, customerInfo.getPartnerId(), customerInfo.getStoreId(), responseVo, orderType, customerInfo.getTableNumber(), BusinessTypeEnum.SAAS_WC.getType(),this.mealCartBaseService);
if (checkCartRequest != null) { if (checkCartRequest != null) {
if (checkCartRequest.getShoppingCartGoodsResponseVo() != null && StringUtils.isNotBlank(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg())) { if (checkCartRequest.getShoppingCartGoodsResponseVo() != null && StringUtils.isNotBlank(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg())) {
responseVo.setToastMsg(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg()); responseVo.setToastMsg(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg());
...@@ -458,7 +459,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -458,7 +459,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
//锁定当前所有购物车行 //锁定当前所有购物车行
this.mealCartBaseService.lockCart(partnerId, storeId, tableNumber, cartGoodsList.stream().map(CartGoods::getCartGoodsUid).collect(Collectors.toList())); this.mealCartBaseService.lockCart(partnerId, storeId, tableNumber, cartGoodsList.stream().map(CartGoods::getCartGoodsUid).collect(Collectors.toList()));
//检查购物车中是否存在非法或者价格变更商品 //检查购物车中是否存在非法或者价格变更商品
CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, customerInfo.getPartnerId(), customerInfo.getStoreId(), new ShoppingCartGoodsBaseResponseVo(), shoppingCartInfoRequestVo.getOrderType(), customerInfo.getTableNumber(), this.mealCartBaseService); CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, customerInfo.getPartnerId(), customerInfo.getStoreId(), new ShoppingCartGoodsBaseResponseVo(), shoppingCartInfoRequestVo.getOrderType(), customerInfo.getTableNumber(),BusinessTypeEnum.SAAS_WC.getType() ,this.mealCartBaseService);
if (checkCartRequest != null) { if (checkCartRequest != null) {
if (checkCartRequest.getShoppingCartGoodsResponseVo() != null && StringUtils.isNotBlank(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg())) { if (checkCartRequest.getShoppingCartGoodsResponseVo() != null && StringUtils.isNotBlank(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_VERSION_ERROR.getCode(), checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg(), result); return ResponseUtil.error(ResponseResult.SHOPPING_CART_VERSION_ERROR.getCode(), checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg(), result);
...@@ -497,7 +498,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -497,7 +498,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
@Override @Override
public List<CartGoods> updateCartGoodsLegal(CartGoods cartGoods, String userId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo, AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo, List<CartGoods> oldAllCartGoodsList) { public List<CartGoods> updateCartGoodsLegal(CartGoods cartGoods, String userId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo, AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo, List<CartGoods> oldAllCartGoodsList) {
CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(Collections.singletonList(cartGoods), addShoppingCartGoodsRequestVo.getPartnerId(), addShoppingCartGoodsRequestVo.getShopId(), shoppingCartGoodsResponseVo, addShoppingCartGoodsRequestVo.getOrderType(), addShoppingCartGoodsRequestVo.getTableNumber(), this.mealCartBaseService); CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(Collections.singletonList(cartGoods), addShoppingCartGoodsRequestVo.getPartnerId(), addShoppingCartGoodsRequestVo.getShopId(), shoppingCartGoodsResponseVo, addShoppingCartGoodsRequestVo.getOrderType(), addShoppingCartGoodsRequestVo.getTableNumber(),BusinessTypeEnum.SAAS_WC.getType() ,this.mealCartBaseService);
if (checkCartRequest == null) { if (checkCartRequest == null) {
throw new ServiceException(ResponseResult.STORE_ITEM_CHECK_VAILD_ERROR); throw new ServiceException(ResponseResult.STORE_ITEM_CHECK_VAILD_ERROR);
......
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