|
@@ -1023,8 +1023,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
public R createOrderScrmForAppRewards(long userId, FsStoreOrderCreateParamAppReward param) {
|
|
public R createOrderScrmForAppRewards(long userId, FsStoreOrderCreateParamAppReward param) {
|
|
|
FsStoreOrderComputedParam computedParam = new FsStoreOrderComputedParam();
|
|
FsStoreOrderComputedParam computedParam = new FsStoreOrderComputedParam();
|
|
|
BeanUtils.copyProperties(param, computedParam);
|
|
BeanUtils.copyProperties(param, computedParam);
|
|
|
- //计算金额
|
|
|
|
|
- //FsStoreOrderComputeDTO dto = this.computedOrder(userId, computedParam);
|
|
|
|
|
|
|
+ FsStoreProductAttrValueScrm fsStoreProductAttrValueScrm = fsStoreProductAttrValueMapper.selectProductAttrValueByProductId(param.getGoodsId());
|
|
|
|
|
+ if (fsStoreProductAttrValueScrm == null){
|
|
|
|
|
+ log.error("订单创建失败,SKU属性不存在,商品id:{}",param.getGoodsId());
|
|
|
|
|
+ return R.error("订单创建失败");
|
|
|
|
|
+ }
|
|
|
//获取地址
|
|
//获取地址
|
|
|
FsUserAddressScrm address = userAddressMapper.selectFsUserAddressById(param.getAddressId());
|
|
FsUserAddressScrm address = userAddressMapper.selectFsUserAddressById(param.getAddressId());
|
|
|
//生成分布式唯一值
|
|
//生成分布式唯一值
|
|
@@ -1045,7 +1048,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
|
|
|
|
|
storeOrder.setPayPostage(BigDecimal.ZERO);
|
|
storeOrder.setPayPostage(BigDecimal.ZERO);
|
|
|
storeOrder.setDeductionPrice(BigDecimal.ZERO);
|
|
storeOrder.setDeductionPrice(BigDecimal.ZERO);
|
|
|
- storeOrder.setPaid(0);
|
|
|
|
|
|
|
+ storeOrder.setPaid(1);//已支付
|
|
|
storeOrder.setPayType(param.getPayType());
|
|
storeOrder.setPayType(param.getPayType());
|
|
|
storeOrder.setUseIntegral(BigDecimal.ZERO);
|
|
storeOrder.setUseIntegral(BigDecimal.ZERO);
|
|
|
storeOrder.setBackIntegral(BigDecimal.ZERO);
|
|
storeOrder.setBackIntegral(BigDecimal.ZERO);
|
|
@@ -1064,7 +1067,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//实际支付金额
|
|
//实际支付金额
|
|
|
- storeOrder.setPayPrice(param.getPayPrice());
|
|
|
|
|
|
|
+ storeOrder.setPayPrice(fsStoreProductAttrValueScrm.getPrice());
|
|
|
|
|
|
|
|
storeOrder.setStatus(1); //待发货
|
|
storeOrder.setStatus(1); //待发货
|
|
|
storeOrder.setOrderCreateType(param.getOrderCreateType());
|
|
storeOrder.setOrderCreateType(param.getOrderCreateType());
|
|
@@ -1072,7 +1075,6 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (storeOrder.getCustomerId() == null) {
|
|
if (storeOrder.getCustomerId() == null) {
|
|
|
storeOrder.setCustomerId(param.getCustomerId());
|
|
storeOrder.setCustomerId(param.getCustomerId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
storeOrder.setOrderType(param.getOrderType());
|
|
storeOrder.setOrderType(param.getOrderType());
|
|
|
storeOrder.setOrderMedium(param.getOrderMedium());
|
|
storeOrder.setOrderMedium(param.getOrderMedium());
|
|
|
if (param.getAppRewardFlag()!=null){
|
|
if (param.getAppRewardFlag()!=null){
|
|
@@ -1094,13 +1096,12 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
|
|
|
|
|
FsStoreCartQueryVO vo = new FsStoreCartQueryVO();
|
|
FsStoreCartQueryVO vo = new FsStoreCartQueryVO();
|
|
|
vo.setProductId(param.getGoodsId());
|
|
vo.setProductId(param.getGoodsId());
|
|
|
- vo.setCartNum(1);//数量
|
|
|
|
|
|
|
+ vo.setCartNum(1);//数量1
|
|
|
|
|
+ vo.setPrice(fsStoreProductAttrValueScrm.getPrice());
|
|
|
|
|
+ vo.setBarCode(fsStoreProductAttrValueScrm.getBarCode());
|
|
|
//扣减库存
|
|
//扣减库存
|
|
|
fsStoreProductMapper.decProductAttrStock(param.getGoodsId(),1);
|
|
fsStoreProductMapper.decProductAttrStock(param.getGoodsId(),1);
|
|
|
- Long productAttrValueId=fsStoreProductAttrValueMapper.selectProductAttrValueIdByProductId(param.getGoodsId());
|
|
|
|
|
- if (productAttrValueId!=null){
|
|
|
|
|
- fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ fsStoreProductAttrValueMapper.decProductAttrStock(fsStoreProductAttrValueScrm.getId(),1);
|
|
|
//保存OrderItem
|
|
//保存OrderItem
|
|
|
List<FsStoreOrderItemScrm> listOrderItem = new ArrayList<>();
|
|
List<FsStoreOrderItemScrm> listOrderItem = new ArrayList<>();
|
|
|
//保存购物车商品信息
|
|
//保存购物车商品信息
|