提示更新
This commit is contained in:
parent
16aa4dedd8
commit
205bfcfe6d
|
|
@ -38,9 +38,9 @@ public class OrderServiceImpl implements OrderService {
|
||||||
// 查询库存是否为0,是的话让它下架
|
// 查询库存是否为0,是的话让它下架
|
||||||
orderDetailDto.setMaStatus("1");
|
orderDetailDto.setMaStatus("1");
|
||||||
orderMapper.updateDeviceStatus(orderDetailDto);
|
orderMapper.updateDeviceStatus(orderDetailDto);
|
||||||
throw new RuntimeException(devInfo.getDeviceName() + "库存不足");
|
throw new RuntimeException(devInfo.getDeviceName() + "已下架,无法下单");
|
||||||
}else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) {
|
}else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) {
|
||||||
throw new RuntimeException(devInfo.getDeviceName() + "库存不足");
|
throw new RuntimeException(devInfo.getDeviceName() + "库存不足,无法下单");
|
||||||
} else {
|
} else {
|
||||||
// 改库存
|
// 改库存
|
||||||
orderMapper.updateDevCount(orderDetailDto);
|
orderMapper.updateDevCount(orderDetailDto);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue