diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/cash/impl/CashServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/cash/impl/CashServiceImpl.java index 4d840e2..37732cd 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/cash/impl/CashServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/cash/impl/CashServiceImpl.java @@ -225,17 +225,6 @@ public class CashServiceImpl extends ServiceImpl implements Ca throw new MsgException("提现金额必须大于" + Cash.MINIMUM_CASH + "元"); } - LambdaQueryWrapper qWrapper = Wrappers.lambdaQuery(); - qWrapper.eq(Cash::getUserId, cash.getUserId()) - .orderByDesc(Cash::getCreateDt) - .last("limit 1"); - Cash existData = getOne(qWrapper); - - //TODO 注释提现限制,后面要取消 - /* if (existData != null && DateUtil.isSameDay(new Date(), existData.getCreateDt())) { - throw new MsgException("一天只能提现一次"); - } -*/ LambdaQueryWrapper qWrapper2 = Wrappers.lambdaQuery(); qWrapper2.eq(CashAccount::getUserId, cash.getUserId()) .last("limit 1"); @@ -251,36 +240,14 @@ public class CashServiceImpl extends ServiceImpl implements Ca throw new MsgException("请先补充提现账户信息"); } - // ======查询可提现金额 - // 查询商户所有分润 - BigDecimal totalProfit = mpService.getSumValidProfit(cash.getUserId() + ""); - if (totalProfit == null) { - totalProfit = BigDecimal.ZERO; - } if (!StringUtils.isEmpty(tokenUa.getMerchantCode())) { Map map = new HashMap<>(); map.put("lastMerchantCode", tokenUa.getMerchantCode()); - // 查询可提现粉丝分润 -// Double sum = fansService.queryFansSumShareMoney(map); -// if (sum != null) { -// BigDecimal fansProfit = BigDecimal.valueOf(sum); -// totalProfit = totalProfit.add(fansProfit); -// } - } - - // 查询商户已提现总数 - //BigDecimal totalCashAmt = getSumValidCashAmtTotal(cash.getUserId() + ""); - UserAccount userAccountByUserId = userAccountService.getUserAccountByUserId(cash.getUserId()); - if (userAccountByUserId == null) { - throw new MsgException("可提现金额不足!"); - } - // 校验提现金额是否充足 - int flag = cash.getCashAmt().compareTo(totalProfit.subtract(userAccountByUserId.getBalance())); - if (flag > 0) { - throw new MsgException("可提现金额不足!"); } + UserAccount userAccount = userAccountService.getUserAccountByUserId(cash.getUserId()); + MsgException.checkNull(userAccount,"可提现金额不足!"); cash.setRate(10); cash.setBaseServiceCharge(BigDecimal.ZERO); cash.setRatioCharge(new BigDecimal("0.1"));