Commit d7b89ef8 by chongfu.liang

fix

parent 3354fcb6
......@@ -15,5 +15,9 @@ public class GetProductBO {
private String menuType;
private Integer couponType;
/**
* 活动号
*/
private String activityCode;
}
......@@ -235,6 +235,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
cartGoods.setPic(productsInfo.getPicture());
cartGoods.setWeight(productsInfo.getWeight());
cartGoods.setUnit(productsInfo.getUnit());
cartGoods.setActivityCode(getProductBO.getActivityCode());
boolean stockLimit = false;
if (productsInfo.getType() == ProductType.NOSPEC.getCode()
&& productsInfo.getStockLimit() == 1) {
......@@ -325,6 +326,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
getProductBO.setSpuid(Collections.singletonList(productsVo.getSpuId()));
getProductBO.setSkuid(Collections.singletonList(productsVo.getSkuId()));
getProductBO.setCouponType(couponType);
getProductBO.setActivityCode(couponDetail.getDetails().get(0).getActive().getActiveCode());
} else {
getProductBO.setSkuid(Collections.singletonList(baseRequestBO.getSkuId()));
getProductBO.setSpuid(Collections.singletonList(baseRequestBO.getSpuId()));
......@@ -979,18 +981,18 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
}
private void checkStocks(BaseAddGoodsBO baseRequestDTO, CheckBussinessRulesBO checkBussinessRulesBO){
GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
requestDto.setChannel(BusinessTypeEnum.getByType(baseRequestDTO.getMenuType()).getCode());
requestDto.setPartnerId(baseRequestDTO.getPartnerId());
requestDto.setStoreId(baseRequestDTO.getShopId());
List<Long> productIds = new ArrayList<>();
productIds.add(Long.parseLong(checkBussinessRulesBO.getProduct().getSkuId()));
requestDto.setProductIds(productIds);
ProductBO product = checkBussinessRulesBO.getProduct();
ProductStockBO availableStocks = null;
GetProductStock getProductStock = new GetProductStock();
getProductStock.setChannel(BusinessTypeEnum.getByType(baseRequestDTO.getMenuType()).getCode());
getProductStock.setPartnerId(baseRequestDTO.getPartnerId());
getProductStock.setStoreId(baseRequestDTO.getShopId());
List<Long> productIds = new ArrayList<>();
productIds.add(Long.parseLong(checkBussinessRulesBO.getProduct().getSkuId()));
getProductStock.setProductIds(productIds);
if (product.getType() == ProductType.NOSPEC.getCode()
&& product.getStockLimit() == 1) {
List<ProductStockBO> productStock = productManager.getProductStock(getProductStock, baseRequestDTO.getManagerService().getProductService());
......
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