未添加新商品不增加下单次数
This commit is contained in:
@@ -670,6 +670,8 @@ public class CartService {
|
||||
HashMap<String, TbOrderDetail> oldOrderDetailMap = new HashMap<>();
|
||||
oldOrderDetailList.forEach(item -> oldOrderDetailMap.put(item.getOrderId().toString() + item.getCartId(), item));
|
||||
|
||||
|
||||
boolean hasNewInfo = false;
|
||||
//校验 库存 耗材
|
||||
for (TbCashierCart cart : cashierCartList) {
|
||||
// 设置用餐类型
|
||||
@@ -748,6 +750,7 @@ public class CartService {
|
||||
TbOrderDetail orderDetail = oldOrderDetailMap.get(cart.getOrderId() + cart.getId());
|
||||
if (orderDetail == null) {
|
||||
orderDetail = new TbOrderDetail();
|
||||
hasNewInfo = true;
|
||||
}
|
||||
orderDetail.setCreateTime(new Date());
|
||||
orderDetail.setNum(cart.getNumber());
|
||||
@@ -899,7 +902,9 @@ public class CartService {
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
orderInfo.setRemark(remark);
|
||||
orderInfo.setUserId(userId);
|
||||
orderInfo.setPlaceNum(currentPlaceNum);
|
||||
if (hasNewInfo) {
|
||||
orderInfo.setPlaceNum(currentPlaceNum);
|
||||
}
|
||||
orderInfo.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||
orderInfo.setSeatCount(seatNum);
|
||||
orderInfo.setSeatAmount(seatCost);
|
||||
|
||||
Reference in New Issue
Block a user