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