jiaosong
2023-10-23 7d0a11a2dc932d620f9e2e2df06c61ea06383238
#调整记录修改单位
已修改1个文件
5 ■■■■■ 文件已修改
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -520,7 +520,8 @@
        wrapper.select("sum(money) as money").last(" limit 1");
        Refund total = refundMapper.selectOne(wrapper);
        BigDecimal refundMoney = total == null?new BigDecimal(0):Constants.formatDecimalNum(total.getMoney());
        BigDecimal canBalance =Constants.formatDecimalNum(goodsorder.getMoney()).subtract(money);
        //可退剩余 单位元
        BigDecimal canBalance =Constants.translateMoney(Constants.formatDecimalNum(goodsorder.getMoney()).subtract(refundMoney));
        if(canBalance.compareTo(money) > Constants.ZERO){
            RefundDTO refundDTO = new RefundDTO();
            refundDTO.setOrderId(orderId);
@@ -533,7 +534,7 @@
            refundDTO.setType(Constants.REFUND_TYPE.BACK.getKey());
            Refund refund = wxMiniUtilService.wxRefund(refundDTO);
        }else {
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,退款金额不允许超过"+canBalance);
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,退款金额不允许超过"+canBalance+"元");
        }
    }