Commit 8bbb24ca by shuhu.hou@freemud.cn

Merge branch 'master' into feature/1.9.9_购物车校验

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
parents a434a955 25b26079
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>1.1.0.RELEASE</version>
<version>1.1.3.RELEASE</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -32,7 +32,7 @@
<dependency>
<groupId>cn.freemud</groupId>
<artifactId>ordercenter-sdk</artifactId>
<version>1.1.0.RELEASE</version>
<version>1.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......
......@@ -4,3 +4,6 @@
| 1.0.0-SNAPSHOT | 迁移后包明改为cn.freemud开头第一版 | wuping | 2019-12-16 |
| 6.4.10.RELEASE| 骑手小费 | 张明警 | 2019-12-26 |
| 1.1.0.RELEASE| 1.9.8需求打包release版本 | 侯书虎 | 2019-12-26 |
| 1.1.1.RELEASE| 1.9.9sessionKey | 胡超 | 20200108 |
| 1.1.2.RELEASE| 1.9.9需求打包release版本 | 丁凯 | 20200108 |
| 1.1.3.RELEASE| 1.9.10需求打包release版本(thirdCateId) | 胡超 | 20200113 |
\ No newline at end of file
......@@ -30,7 +30,6 @@ import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -139,6 +138,11 @@ public class OrderSdkAdapter {
request.setOrderTask(requestVO.getOrderTask());
request.setOperator(requestVO.getOperator());
// 扩展字段(第三方商品分类编号)
if (null != requestVO && null != requestVO.getOtherInfo()) {
request.setExtInfo(JSONObject.toJSONString(requestVO.getOtherInfo()));
}
return request;
}
......@@ -2481,6 +2485,13 @@ public class OrderSdkAdapter {
createOrderProductRequest.setUnit(productBean.getUnit());
createOrderProductRequest.setId(productBean.getId());
createOrderProductRequest.setProductType(productBean.getProductType());
OrderProductAddInfoDto extInfo = JSONObject.parseObject(productBean.getExtInfo(), OrderProductAddInfoDto.class);
if(extInfo != null) {
createOrderProductRequest.setIsFixedProduct(extInfo.getIsFixedProduct());
createOrderProductRequest.setThirdProductSpecId(extInfo.getThirdProductSpecId());
createOrderProductRequest.setThirdProductPropertyId(extInfo.getThirdProductPropertyId());
}
if (productBean.getWeight() != null) {
createOrderProductRequest.setWeight(productBean.getWeight().doubleValue());
}
......
......@@ -73,4 +73,9 @@ public class OrderExtInfoDTO {
private String memberLevel;
private boolean paidMember;
/**
* 异常补退使用
*/
private String sessionKey;
}
......@@ -170,6 +170,9 @@ public class BaseCreateOrderRequest extends BaseConfig {
* 会员规则ID
*/
private String ruleId;
/** 第三方商品分类编号,不必传 */
private String thirdCateId;
}
......
......@@ -992,11 +992,22 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
updateOrderProductInfoRequest.getOrderItemList().forEach( t -> {
CreateOrderProductRequest createOrderProductRequest = createOrderProductRequestMap.get(t.getId());
if(createOrderProductRequest != null) {
if(!isDeleted) {
createOrderProductRequest.setWeight(t.getWeight());
createOrderProductRequest.setIsDeleted(isDeleted);
if(isDeleted) {
if(CollectionUtils.isNotEmpty(createOrderProductRequest.getComboProduct())) {
createOrderProductRequest.getComboProduct().forEach(ct -> {
ct.setIsDeleted(true);
});
}
deletedOrderProductList.add(createOrderProductRequest);
} else {
if(t.getWeight() != null && t.getWeight() > 0D) {
createOrderProductRequest.setWeight(t.getWeight());
}
if(t.getNumber() != null && t.getNumber() > 0) {
createOrderProductRequest.setNumber(t.getNumber());
}
}
createOrderProductRequest.setIsDeleted(isDeleted);
}
});
}
......
......@@ -27,4 +27,5 @@ public class CheckCartRequest {
private Integer orderWay;
private String trackingNo;
private String tableNumber;
private String businessType;
}
......@@ -27,4 +27,6 @@ public class GetProductInfoRequest {
String trackingNo;
String businessType;
}
......@@ -112,7 +112,7 @@ public interface ShoppingCartBaseService {
getProductInfoDto.setShopId(getProductInfoRequest.getStoreId());
getProductInfoDto.setProductInfoType(2);
getProductInfoDto.setProductIds(goodsIds);
getProductInfoDto.setChannel(OrderChannelType.SAAS.getCode());
getProductInfoDto.setChannel(getProductInfoRequest.getBusinessType());
ProductService productService = SDKCommonBaseContextWare.getBean(ProductService.class);
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) {
......@@ -245,6 +245,7 @@ public interface ShoppingCartBaseService {
// 包含:1、普通商品 2、套餐内的固定商品和可选商品
ShoppingCartAdapter shoppingCartAdapter = SDKCommonBaseContextWare.getBean(ShoppingCartAdapter.class);
GetProductInfoRequest getSpuProductInfoRequest = shoppingCartAdapter.convertGetProductInfoRequest(checkCartRequest);
getSpuProductInfoRequest.setBusinessType(checkCartRequest.getBusinessType());
BaseResponse<List<ProductBeanDTO>> productInfo = getProductsInfo(getSpuProductInfoRequest);
if ((productInfo == null) || (!CartResponseConstant.SUCCESS.getCode().equals(productInfo.getCode()))) {
return;
......
......@@ -35,7 +35,7 @@
<dependency>
<groupId>cn.freemud</groupId>
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>1.1.0.RELEASE</version>
<version>1.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......@@ -65,7 +65,7 @@
<dependency>
<groupId>com.freemud.sdk.api.assortment</groupId>
<artifactId>assortment-messagepush-sdk</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.5.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>cn.freemud.commons</groupId>
......@@ -109,7 +109,7 @@
<dependency>
<artifactId>assortment-data-manager</artifactId>
<groupId>com.freemud.sdk.api.assortment</groupId>
<version>3.5.RELEASE</version>
<version>3.9.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.freemud.commons</groupId>
......
......@@ -71,6 +71,15 @@ public class OrderController {
}
/**
* 扫脸支付下单
*/
@ApiAnnotation(logMessage = "scanFaceCreateOrder")
@PostMapping("/scanFaceCreateOrder")
public BaseResponse scanFaceCreateOrder(@Validated @LogParams @RequestBody CreateOrderVo createOrderVo) {
return orderservice.scanFaceCreateOrder(createOrderVo);
}
/**
* 订单支付成功后通知
*/
@ApiAnnotation(logMessage = "paySuccessCallback")
......
......@@ -4,6 +4,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
public class PayGitCheckAndJoinRequestDto {
//门店编号
......@@ -22,4 +24,6 @@ public class PayGitCheckAndJoinRequestDto {
//点餐方式 1-到店取餐 2-外卖
private Integer orderWay;
private List<String> skuIds;
}
package cn.freemud.entities.dto.order;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import lombok.Data;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: CreateOrderOperateDto
* @Package cn.freemud.entities.dto.order
* @Description:
* @author: ping1.wu
* @date: 2019/12/25 18:00
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public class CreateOrderOperateDto {
//支付总金额(父子订单时包括购买会员卡订单金额)
private Long totalAmount;
//会员卡支付金额
private Integer cardAmount;
//父子订单父订单
private QueryOrdersResponse.DataBean.OrderBean fatherOrderBean;
//父子订单商品订单
private QueryOrdersResponse.DataBean.OrderBean productOrderBean;
}
package cn.freemud.entities.dto.order;
import lombok.Data;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: FacePayRequestDto
* @Package cn.freemud.entities.dto.order
* @Description:
* @author: ping1.wu
* @date: 2019/12/25 19:28
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public class FacePayRequestDto {
private String ver;
private String body;
private String cardCode;
private String divideDetail;
private String partnerId;
private String storeId;
private String frontTransId;
private String stationId;
private String operatorId;
private String transId;
private String businessDate;
private Long amount;
private Long clientCode;
private String code;
private Long undisAmount;
// private List<CodePayRequest.PayProduct> products;
}
package cn.freemud.entities.dto.order;
import lombok.Data;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: FacePayResponseDto
* @Package cn.freemud.entities.dto.order
* @Description:
* @author: ping1.wu
* @date: 2019/12/25 19:23
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public class FacePayResponseDto {
private Integer resultCode;
private String resultMsg;
private String fmId;
private String payTransId;
private String payCode;
private String userId;
private String originalChannel;
private Integer merchantCoupon;
private Integer platformCoupon;
}
......@@ -13,8 +13,8 @@
package cn.freemud.entities.vo;
import cn.freemud.entities.dto.UserDeliveryInfoDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
......@@ -170,6 +170,14 @@ public class CreateOrderVo {
*/
private String cardCode;
/**
* 扫脸支付使用
*/
private String faceCode;
@ApiModelProperty(hidden = true)
private String sessionKey; // 存储sessionKey,异常补退使用
@Data
public static class PremiumExchangeActivity {
@NotNull(message = "activityCode 不能为空")
......
......@@ -22,6 +22,8 @@ public interface Orderservice {
*/
BaseResponse createOrderNew(CreateOrderVo createOrderVo);
BaseResponse scanFaceCreateOrder(CreateOrderVo createOrderVo);
/**
* 支付成功后回调通知
*/
......
......@@ -52,6 +52,7 @@ import com.freemud.sdk.api.assortment.order.service.OrderCenterSdkService;
import com.freemud.sdk.api.assortment.promotion.response.ShoppingCartGoodsResponse;
import com.freemud.sdk.api.assortment.promotion.service.ActivityCalculationDiscountService;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
......@@ -107,6 +108,8 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
private final Integer RESPONSE_SUCCESS_CODE = 100;
private final String SESSION_KEY = "sessionKey";
@Override
public BaseResponse createReserveOrder(CreateOrderVo createOrderVo) {
//查询用户缓存信息(用户信息,用户绑定桌号信息)
......@@ -242,6 +245,10 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
}
groupCreateOrderRequest.setProducts(orderProductRequests);
groupCreateOrderRequest.setOperator(assortmentCustomerInfoVo.getNickName() == null ? "围餐": assortmentCustomerInfoVo.getNickName());
// 扩展字段添加sessionKey
if (StringUtils.isNotBlank(createOrderVo.getSessionKey())) {
groupCreateOrderRequest.setExtInfo(JSONObject.toJSONString(ImmutableMap.of(SESSION_KEY, createOrderVo.getSessionKey())));
}
return orderCenterSdkService.createGroupOrder(groupCreateOrderRequest);
}
......
......@@ -45,6 +45,8 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
if (assortmentCustomerInfoVo == null || StringUtils.isEmpty(assortmentCustomerInfoVo.getMemberId())) {
return ResponseUtil.error(ResponseResult.NOT_LOGIN);
}
// 扩展字段中存储 sessionKey
createOrderVo.setSessionKey(assortmentCustomerInfoVo.getSessionKey());
if(IappIdType.WC_XCX.getCode().equals(assortmentCustomerInfoVo.getIappId())){ //i围餐
BaseResponse baseResponse = null;
CreateReserveOrderVo createReserveOrderVo = new CreateReserveOrderVo();
......@@ -54,13 +56,13 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
createReserveOrderVo.setOrderUpdateVer(createOrderVo.getOrderUpdateVer());
if(createOrderVo.getOperation() == null) throw new ServiceException(ResponseResult.ORDER_CREATE_OPERATION_ERROR);
switch (createOrderVo.getOperation()){
case 2:
case 2:// 开台
baseResponse = encircleOrderService.createReserveOrder(createOrderVo);
break;
case 3:
case 3:// 下单
baseResponse = encircleOrderService.updateReserveOrder(createReserveOrderVo);
break;
case 4:
case 4:// 创建预支付订单
baseResponse = encircleOrderService.createPrepaymentOrder(createReserveOrderVo);
break;
default:
......
package cn.freemud.service.thirdparty;
import cn.freemud.entities.dto.order.FacePayRequestDto;
import cn.freemud.entities.dto.order.FacePayResponseDto;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: PaymentNewClient
* @Package cn.freemud.service.thirdparty
* @Description:
* @author: ping1.wu
* @date: 2019/12/25 19:09
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@FeignClient(name = "payment-service-new",url="${payment.new.baseUrl}")
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public interface PaymentNewClient {
/**
* 扫脸支付
*/
@PostMapping("paymentcenter/facePay")
com.freemud.application.sdk.api.base.BaseResponse<FacePayResponseDto> facePay(@RequestBody FacePayRequestDto orderPayDto);
}
......@@ -8,7 +8,7 @@
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.1.0.RELEASE</version>
<version>1.1.1.RELEASE</version>
<artifactId>ordercenter-sdk</artifactId>
<dependencies>
......
......@@ -4,3 +4,4 @@
| ------------ | ---------------- | ------ | ---------- |
| 1.0.0-SNAPSHOT | 迁移后包明改为cn.freemud开头第一版 | wuping | 2019-12-16 |
| 1.1.0.RELEASE| 1.9.8需求打包release版本 | 侯书虎 | 2019-12-26 |
| 1.1.1.RELEASE| 1.9.9需求打包release版本 | 丁凯 | 2020-01-08 |
\ No newline at end of file
......@@ -48,5 +48,12 @@ public class AddGoodsByWeixinCardRequestVo {
@NotNull(message = "couponType不能为空")
private Integer couponType;
private String skuId;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private Integer businessType ;
}
......@@ -75,7 +75,14 @@ public class AddShoppingCartGoodsRequestVo {
private String appType;
private String tableNumber;
private Integer qty;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private Integer businessType ;
}
......@@ -92,6 +92,11 @@ public class ShoppingCartInfoRequestVo {
*/
private BuyMemberCard buyMemberCard;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private Integer businessType ;
@Data
public final static class SendGoods {
/**
......
......@@ -58,4 +58,9 @@ public class UpdateShoppingCartGoodsQtyRequestVo {
*/
private Integer carVer;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private Integer businessType ;
}
package cn.freemud.enums;
import java.util.Arrays;
public enum BusinessTypeEnum {
SAAS_PICKUP(0,"自提","saas"),
SAAS_DELIVERY(1,"外卖","saas_delivery"),
SAAS_MALL(2,"商城","saas_mall"),
SAAS_WC(3,"围餐","wc");
private Integer type;
private String name;
private String code;
BusinessTypeEnum(Integer type, String name, String code) {
this.type = type;
this.name = name;
this.code = code;
}
public static BusinessTypeEnum getByType(Integer type) {
return Arrays.stream(BusinessTypeEnum.values())
.filter(e -> e.type.equals(type))
.findFirst().orElse(BusinessTypeEnum.SAAS_PICKUP);
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -97,7 +97,8 @@ public class AdditionalPromotionService implements IPromotionService {
List<ShoppingCartInfoRequestVo.SendGoods> sendGoods = shoppingCartInfoRequestVo.getSendGoods();
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));
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(shoppingCartInfoRequestVo.getPartnerId(), shoppingCartInfoRequestVo.getShopId(), goodsIds, shoppingCartBaseService);
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(shoppingCartInfoRequestVo.getPartnerId()
, shoppingCartInfoRequestVo.getShopId(), goodsIds,shoppingCartInfoRequestVo.getBusinessType(), shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST);
}
......
......@@ -4,6 +4,7 @@ import ch.qos.logback.classic.Level;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.vo.CartGoods;
import cn.freemud.entities.vo.ShoppingCartGoodsBaseResponseVo;
import cn.freemud.enums.BusinessTypeEnum;
import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.utils.LogUtil;
......@@ -150,6 +151,7 @@ public class AssortmentSdkService {
checkCartRequest.setStoreId(storeId);
checkCartRequest.setTableNumber(tableNumber);
checkCartRequest.setTrackingNo(LogThreadLocal.getTrackingNo());
checkCartRequest.setBusinessType(BusinessTypeEnum.getByType(BusinessTypeEnum.SAAS_PICKUP.getType()).getCode());
BaseResponse<CheckCartRequest> baseResponse ;
if ("checkAllCartGoodsNew".equals(shoppingCartCheckAction)){
baseResponse= shoppingCartService.checkAllCartGoodsNew(checkCartRequest);
......@@ -170,12 +172,13 @@ public class AssortmentSdkService {
* @param goodsIds
* @return
*/
public List<ProductBeanDTO> getProductsInfoSdk(String partnerId, String storeId, List<String> goodsIds, ShoppingCartBaseService shoppingCartService) {
public List<ProductBeanDTO> getProductsInfoSdk(String partnerId, String storeId, List<String> goodsIds,Integer businessType, ShoppingCartBaseService shoppingCartService) {
GetProductInfoRequest request = new GetProductInfoRequest();
request.setGoodsIds(goodsIds);
request.setPartnerId(partnerId);
request.setStoreId(storeId);
request.setTrackingNo(LogThreadLocal.getTrackingNo());
request.setBusinessType(BusinessTypeEnum.getByType(businessType).getCode());
BaseResponse<List<ProductBeanDTO>> baseResponse =
shoppingCartService.getProductsInfo(request);
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) {
......
......@@ -42,7 +42,10 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
private ShoppingCartBaseServiceImpl shoppingCartBaseService;
@Override
public void updateShoppingCartGoodsDiscount(CouponPromotionVO couponPromotionVO, ActivityQueryDto activityQueryDto, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, UserLoginInfoDto userLoginInfoDto, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
public void updateShoppingCartGoodsDiscount(CouponPromotionVO couponPromotionVO, ActivityQueryDto activityQueryDto,
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult,
List<CartGoods> cartGoodsList, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo,
UserLoginInfoDto userLoginInfoDto, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
if (calculationDiscountResult == null || CollectionUtils.isEmpty(calculationDiscountResult.getSendGoods())) {
return;
}
......@@ -52,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
}
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList = new ArrayList<>();
sendActivities.forEach(sendActivity -> sendGoodsList.addAll(sendActivity.getSendGoods()));
List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(activityQueryDto, sendGoodsList);
List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(activityQueryDto, sendGoodsList,shoppingCartInfoRequestVo==null?null:shoppingCartInfoRequestVo.getBusinessType());
if (CollectionUtils.isEmpty(productBeanDTOS)) {
return;
}
......@@ -145,10 +148,12 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
* @param sendGoodsList
* @return
*/
private List<ProductBeanDTO> buildActivityProduct(ActivityQueryDto activityQueryDto, List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList) {
private List<ProductBeanDTO> buildActivityProduct(ActivityQueryDto activityQueryDto, List<ActivityCalculationDiscountResponseDto
.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList,Integer businessType) {
//获取
List<String> goodsIds = sendGoodsList.stream().map(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods::getGoodsId).collect(Collectors.toList());
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId(), activityQueryDto.getStoreId(), goodsIds, shoppingCartBaseService);
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId()
, activityQueryDto.getStoreId(), goodsIds, businessType ,shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST);
}
......
......@@ -102,7 +102,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
}
// 获取商品信息
List<ProductBeanDTO> productBeanListSpuClass =
assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2), mealCartBaseService);
assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2),requestVo.getBusinessType(), mealCartBaseService);
if (productBeanListSpuClass == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_ADD_ERROR);
}
......
......@@ -176,7 +176,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 判断商品状态是否可以加入购物车
List<ProductBeanDTO> productInfos = assortmentSdkService.getProductsInfoSdk(request.getPartnerId(), request.getShopId(), Arrays.asList(getProductsVo.getSpuId()), this.shoppingCartBaseService);
List<ProductBeanDTO> productInfos = assortmentSdkService.getProductsInfoSdk(request.getPartnerId(), request.getShopId(), Arrays.asList(getProductsVo.getSpuId()),request.getBusinessType(),this.shoppingCartBaseService);
if (CollectionUtils.isNotEmpty(productInfos)) {
ProductBeanDTO productBean = productInfos.get(0);
Integer status = productBean.getStatus();
......@@ -226,7 +226,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
spuId2 = validCoupon(partnerId, storeId, spuId, productIds);
}
// 获取商品详细信息
List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2), this.shoppingCartBaseService);
List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId
, Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getBusinessType(), this.shoppingCartBaseService);
//缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样
......@@ -574,7 +575,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
coupons.add(coupon);
}
if (CollectionUtils.isNotEmpty(sendGoodsList)) {
processSendGoods(sendGoodsList, partnerId, storeId, shoppingCartBaseService);
processSendGoods(sendGoodsList, partnerId, storeId , shoppingCartInfoRequestVo.getBusinessType() , shoppingCartBaseService);
} else {
//组装加价购商品
if (null != premiumExchangeActivity && CollectionUtils.isNotEmpty(premiumExchangeActivity.getProducts())) {
......@@ -827,10 +828,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* @param partnerId
* @param storeId
*/
private void processSendGoods(List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList, String partnerId, String storeId, ShoppingCartBaseService shoppingCartService) {
private void processSendGoods(List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList
, String partnerId, String storeId,Integer businessType, ShoppingCartBaseService shoppingCartService) {
List<String> goodsIds = sendGoodsList.parallelStream().map(ShoppingCartInfoRequestVo.SendGoods::getGoodsId).collect(Collectors.toList());
List<ProductBeanDTO> productBeanList =
assortmentSdkService.getProductsInfoSdk(partnerId, storeId, goodsIds, shoppingCartService);
assortmentSdkService.getProductsInfoSdk(partnerId, storeId, goodsIds, businessType, shoppingCartService);
// 将productBeanList转换为Map,key为pid,即goodsId
Map<String, ProductBeanDTO> productBeanMap = productBeanList.parallelStream()
.collect(Collectors.toMap(ProductBeanDTO::getPid, Function.identity(), (k1, k2) -> k1));
......
......@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
//券活动测试 地址:http://115.159.65.101:8003 线上 http://10.51.0.7:8003
@FeignClient(name = "ACTIVITY", url = "${saas.activityclient.feign.url}")
@FeignClient(name = "promotion-service", url = "${saas.activityclient.feign.url}")
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public interface ActivityClient {
......
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