创建订单修复
This commit is contained in:
@@ -694,9 +694,10 @@ public class CartService {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
TbProductSkuWithBLOBs tbProduct = productSkuMapper.selectByPrimaryKey(Integer.valueOf(cart.getSkuId()));
|
||||
TbProductSkuWithBLOBs tbProduct;
|
||||
if (!"-999".equals(cart.getProductId())) {
|
||||
tbProduct = productSkuMapper.selectByPrimaryKey(Integer.valueOf(cart.getSkuId()));
|
||||
TbProduct tbProduct1 = tbProductMapper.selectById(Integer.valueOf(tbProduct.getProductId()));
|
||||
|
||||
// 判断商品是否已下架
|
||||
if (tbProduct.getIsGrounding().equals(0)) {
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
@@ -731,11 +732,17 @@ public class CartService {
|
||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
continue;
|
||||
}
|
||||
saleAmount = saleAmount.add(tbProduct.getSalePrice());
|
||||
}else {
|
||||
tbProduct = null;
|
||||
saleAmount = saleAmount.add(shopEatTypeInfoDTO.getShopInfo().getTableFee());
|
||||
|
||||
}
|
||||
|
||||
|
||||
totalAmount = totalAmount.add(cart.getTotalAmount());
|
||||
packAMount = packAMount.add(cart.getPackFee());
|
||||
originAmount = originAmount.add(cart.getTotalAmount());
|
||||
saleAmount = saleAmount.add(tbProduct.getSalePrice());
|
||||
|
||||
TbOrderDetail orderDetail = oldOrderDetailMap.get(cart.getOrderId() + cart.getId());
|
||||
if (orderDetail == null) {
|
||||
@@ -751,7 +758,7 @@ public class CartService {
|
||||
}
|
||||
orderDetail.setProductId(Integer.valueOf(cart.getProductId()));
|
||||
orderDetail.setProductSkuId(Integer.valueOf(cart.getSkuId()));
|
||||
orderDetail.setProductSkuName(tbProduct.getSpecSnap());
|
||||
orderDetail.setProductSkuName(tbProduct == null ? null : tbProduct.getSpecSnap());
|
||||
orderDetail.setProductName(cart.getName());
|
||||
orderDetail.setShopId(jsonObject.getInteger("shopId"));
|
||||
orderDetail.setPackAmount(cart.getPackFee());
|
||||
@@ -915,7 +922,11 @@ public class CartService {
|
||||
|
||||
for (TbOrderDetail orderDetail : orderDetails) {
|
||||
orderDetail.setOrderId(orderId);
|
||||
orderDetailMapper.insert(orderDetail);
|
||||
if (orderDetail.getId() != null) {
|
||||
mpOrderDetailMapper.updateById(orderDetail);
|
||||
}else {
|
||||
mpOrderDetailMapper.insert(orderDetail);
|
||||
}
|
||||
}
|
||||
List<TbActivateOutRecord> outRecords = new ArrayList<>();
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
|
||||
@@ -889,6 +889,8 @@ public class ProductService {
|
||||
.eq(TbCashierCart::getShopId, choseCountDTO.getShopId())
|
||||
.eq(TbCashierCart::getProductId, "-999")
|
||||
.eq(TbCashierCart::getSkuId, "-999")
|
||||
.eq(TbCashierCart::getStatus, "create")
|
||||
.and(r -> r.eq(TbCashierCart::getUserId, choseCountDTO.getUserId()).or().isNull(TbCashierCart::getUserId))
|
||||
.eq(TbCashierCart::getUseType, shopEatTypeInfoDTO.getUseType())
|
||||
.eq(TbCashierCart::getTableId, choseCountDTO.getTableId());
|
||||
TbCashierCart tbCashierCart = mpCashierCartMapper.selectOne(query);
|
||||
|
||||
Reference in New Issue
Block a user