| | |
| | | |
| | | String userId = SecurityUtils.getUserId(); |
| | | int count = orderItemSalesMapper.selectCount(new QueryWrapper<OrderItemSales>() |
| | | .eq("order_item_id", oi.getId())); |
| | | .eq("order_item_id", oi.getId()) |
| | | .eq("status", Constants.ORDER_SALES_STATUS.AGREED.name()) |
| | | ); |
| | | if(count >= 2){ |
| | | throw new ValidationException("售后申请超过限额"); |
| | | } |
| | |
| | | BigDecimal totalFee = feeSupplier.add(feePartner).add(feePlatform).add(feePlatformPack) |
| | | .add(feePlatformCheck).add(feePlatformTransport); |
| | | |
| | | BigDecimal st = oi.getPrice().multiply(new BigDecimal(sl.getNum()));//申请售后的花的金额 |
| | | if(totalFee.doubleValue() > st.doubleValue()){ |
| | | throw new ValidationException("退款金额不能大于商品申请数量的售价"); |
| | | } |
| | | |
| | | List<OrderItemSales> ls = orderItemSalesMapper.selectList(new QueryWrapper<OrderItemSales>() |
| | | .eq("order_item_id", oi.getId()) |
| | | .eq("status", Constants.ORDER_SALES_STATUS.AGREED.name()) |
| | |
| | | } |
| | | preFee = preFee.add(totalFee); |
| | | if(preFee.doubleValue() > oi.getTotal().doubleValue()){ |
| | | throw new ValidationException("退款金额不能大于商品总价"); |
| | | throw new ValidationException("退款总金额不能大于商品总价"); |
| | | } |
| | | |
| | | sl.setRemarks(dto.getRemarks()); |