admin
2020-02-18 ddf5db7d31af51fcf697eac0cee7dd46ff73bcc1
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -53,6 +53,7 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.ExtractException;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.exception.ObjectStateException;
@@ -172,10 +173,10 @@
      updateExtract.setId(id);
      updateExtract.setState(Extract.STATE_PROCESSING);
      extractMapper.updateByPrimaryKeySelective(updateExtract);
      //TODO 新版部署后删除
      // TODO 新版部署后删除
      // 改变资金记录状态
      UserMoneyDetail detail = userMoneyDetailService
            .selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
      UserMoneyDetail detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
            UserMoneyDetailTypeEnum.extract, find.getUserInfo().getId(), find.getId());
      if (detail != null) {
         UserMoneyDetail update = new UserMoneyDetail(detail.getId());
         update.setShow(true);
@@ -188,7 +189,7 @@
      return null;
   }
   @Transactional
   @Transactional(rollbackFor = Exception.class)
   public synchronized void rejectExtract(long id, String reason, AdminUser admin)
         throws ObjectStateException, NotExistObjectException {
      Extract find = extractMapper.selectByPrimaryKey(id);
@@ -268,9 +269,9 @@
            && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L)
         return 111;
      final String autoExtract = configService.get("extract_way"); // 是否自动转账
      final String maxCount = configService.get("extract_count_day");
      final String maxMoney = configService.get("extract_money_day");
      final String autoExtract = configService.get(ConfigKeyEnum.extractWay.getKey()); // 是否自动转账
      final String maxCount = configService.get(ConfigKeyEnum.extractDayCount.getKey());
      final String maxMoney = configService.get(ConfigKeyEnum.extractMoneyDay.getKey());
      UserInfo user = userInfoMapper.selectByPrimaryKeyForUpdate(extract.getUserInfo().getId());
      // 余额不足
@@ -426,7 +427,7 @@
         response = alipayClient.execute(request);
         LogHelper.userErrorInfo("提现:支付宝通过提现成功-" + extract.getId());
      } catch (AlipayApiException e) {
         e.printStackTrace();
         LogHelper.errorDetailInfo(e, "支付宝转账异常:" + extract.getId(), "");
         LogHelper.userErrorInfo("提现:支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
      }
@@ -541,7 +542,7 @@
      return extractMapper.selectByPrimaryKey(id);
   }
   @Transactional
   @Transactional(rollbackFor = Exception.class)
   @Override
   public void checkExtract(Long uid) throws ExtractException {
      BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid);
@@ -1086,8 +1087,7 @@
      }
      return listOpendIDs;
   }
   @Override
   public List<UserInfo> preAutoUserTo1212() throws Exception {
      int page = 0;
@@ -1139,7 +1139,7 @@
      }
      return list;
   }
   @Override
   public List<String> getAutoExtractOpenIdsTo1212() throws Exception {
      int page = 0;
@@ -1152,9 +1152,7 @@
      String refundDate = DateUtil.reduceDayTostring(15, nowDate);
      // 提现金额
      BigDecimal money = BigDecimal.valueOf(Constant.AUTO_EXTRACT_MONEY);
      // 余额最低限制
      BigDecimal minSurplus = BigDecimal.valueOf(Constant.AUTO_EXTRACT_MIN_SURPLUS);
      BigDecimal money = BigDecimal.valueOf(1);
      List<String> listOpendIDs = new ArrayList<String>();
      // 首行appID
@@ -1179,7 +1177,7 @@
         }
         for (Long uid : listValid) {
            UserInfo userInfo = subHongBaoByUid(uid, money, minSurplus);
            UserInfo userInfo = subHongBaoByUid(uid, money, money);
            if (userInfo != null) {
               listOpendIDs.add(userInfo.getWxOpenId());
               if (listOpendIDs.size() >= maxSize)