|
|
@ -9,6 +9,7 @@ import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
@ -125,10 +126,7 @@ import com.shop.cereshop.commons.domain.order.CereOrderReconciliation; |
|
|
|
import com.shop.cereshop.commons.domain.order.CereShopOrder; |
|
|
|
import com.shop.cereshop.commons.domain.pay.CerePayLog; |
|
|
|
import com.shop.cereshop.commons.domain.platformtool.*; |
|
|
|
import com.shop.cereshop.commons.domain.product.CereCommentWord; |
|
|
|
import com.shop.cereshop.commons.domain.product.CereProductMember; |
|
|
|
import com.shop.cereshop.commons.domain.product.CereProductSku; |
|
|
|
import com.shop.cereshop.commons.domain.product.CereProductStatsByDay; |
|
|
|
import com.shop.cereshop.commons.domain.product.*; |
|
|
|
import com.shop.cereshop.commons.domain.scene.CereShopScene; |
|
|
|
import com.shop.cereshop.commons.domain.scene.CereShopSceneMember; |
|
|
|
import com.shop.cereshop.commons.domain.sensitive.CerePlatformSensitive; |
|
|
@ -399,6 +397,18 @@ public class CereShopOrderServiceImpl implements CereShopOrderService { |
|
|
|
}else if (param.getPaymentMode() == null) { |
|
|
|
param.setPaymentMode(PayConfig.paymentMode); |
|
|
|
} |
|
|
|
//校验商品是否有效(非上架商品为无效) |
|
|
|
if (ObjectUtils.isNotEmpty(param.getShops())){ |
|
|
|
for (OrderProductParam shop : param.getShops()) { |
|
|
|
for (ProductSku productSku : shop.getSkus()) { |
|
|
|
CereShopProduct product = cereProductSkuService.findShopProdBySkuId(productSku.getSkuId()); |
|
|
|
if (product.getShelveState() != 1){ |
|
|
|
throw new CoBusinessException(CoReturnFormat.HAVE_INVALID_PRODUCT); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//额外的校验 |
|
|
|
PlaceOrderTemplate placeOrderTemplate = placeOrderFactory.getPlaceOrderTemplate(param.getType()); |
|
|
|
return placeOrderTemplate.placeOrder(param, user, ip, time); |
|
|
|