Commit d262986d by weijiguang

下单时校验订单中sku数量

parent 1cac5c58
...@@ -175,8 +175,11 @@ public class OrderServiceImpl implements IOrderService { ...@@ -175,8 +175,11 @@ public class OrderServiceImpl implements IOrderService {
orderDetail.setCreatedAt(new Date()); orderDetail.setCreatedAt(new Date());
orderDetail.setUpdatedAt(new Date()); orderDetail.setUpdatedAt(new Date());
orderDetail.setMachineId(machineId); orderDetail.setMachineId(machineId);
orderDetail.setNum("1");
for (int i = 0; i < Integer.parseInt(orderDetail.getNum()); i++) {
orderDetailMapper.insertOrderDetail(orderDetail); orderDetailMapper.insertOrderDetail(orderDetail);
} }
}
// 更新用户的优惠券状态 // 更新用户的优惠券状态
if (couponUserId != null) { if (couponUserId != null) {
...@@ -658,7 +661,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -658,7 +661,7 @@ public class OrderServiceImpl implements IOrderService {
} }
for (GoodsVo good : goods) { for (GoodsVo good : goods) {
String cateAndGoodsIdStr = good.getCategory() + good.getGoodsId(); String cateAndGoodsIdStr = good.getCategory() + good.getGoodsId();
if(cateAndGoodsIdSet.contains(cateAndGoodsIdStr)) { if (cateAndGoodsIdSet.contains(cateAndGoodsIdStr)) {
continue; continue;
} else { } else {
cateAndGoodsIdSet.add(cateAndGoodsIdStr); cateAndGoodsIdSet.add(cateAndGoodsIdStr);
......
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