yujian
2019-05-23 418678a2f6eeeb9de97795a26277d7c5c64c282d
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -254,10 +254,17 @@
         return 3;
      }
      // 有借贷关系
      boolean isHaveToReplay = userMoneyDebtService.isHaveDebtToRepay(extract.getUserInfo().getId());
      if (isHaveToReplay) {
         return 110;
      }
      Integer type = setExtractRecord(extract, maxCount, maxMoney);
      if (type != 0) {
         return type;
      }
      extractMapper.insertSelective(extract);
      ExtractAuditRecord auditRecord = new ExtractAuditRecord();
@@ -287,7 +294,8 @@
      if ("是".equals(autoExtract)) {
         LogHelper.userInfo("uid=" + user.getId() + ",提交转账申请!");
      } else {// 暂时不自动提现
         transfer(extract, null);
         // transfer(extract, null);
         ;
      }
      return null;
   }
@@ -507,9 +515,14 @@
   @Transactional
   @Override
   public void checkExtract(Long uid) throws ExtractException {
      BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid);
      if (compensateMoney == null)
         compensateMoney = new BigDecimal(0);
      // 不判定到账红包问题
      Long count = hongBaoV2Mapper.countByUidAndState(uid, HongBao.STATE_YILINGQU);
      if (count == null || count == 0)
      if ((count == null || count == 0) && compensateMoney.compareTo(new BigDecimal(0)) == 0) {
         throw new ExtractException(1, "没有已到账的红包");
      }
      // 查询是否有欠账
      boolean isDebt = userMoneyDebtService.isHaveDebtToRepay(uid);
      if (isDebt)
@@ -538,10 +551,6 @@
      weiqaunMoney = weiqaunMoney.abs();
      BigDecimal balance = userInfoService.selectByPKey(uid).getMyHongBao();
      BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid);
      if (compensateMoney == null)
         compensateMoney = new BigDecimal(0);
      BigDecimal after = hongBaoMoney.subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney));