| | |
| | | throw new ValidationException("处理数量不能大于商品数量"); |
| | | } |
| | | |
| | | List<OrderItemCheck> cLs = orderItemCheckMapper.selectList(new QueryWrapper<OrderItemCheck>() |
| | | .ne("type", dto.getType()) |
| | | .eq("order_item_id", dto.getOrderItemId()) |
| | | ); |
| | | int otherNum = 0; |
| | | if(cLs != null && cLs.size() > 0){ |
| | | for(OrderItemCheck c : cLs){ |
| | | otherNum += c.getNum(); |
| | | } |
| | | } |
| | | if(otherNum + dto.getNum() > oi.getNum()){ |
| | | throw new ValidationException("处理总数量不能大于商品数量"); |
| | | } |
| | | |
| | | BigDecimal deduct = new BigDecimal(0); |
| | | if(Constants.CHECK_TYPE.replace.name().equals(dto.getType())){ |
| | | deduct = oi.getSupplierPrice().multiply(new BigDecimal(dto.getNum())); |