admin
2019-10-19 a18310725c451260bd93090d47978968c5bd5f65
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -961,6 +961,9 @@
      int pageSize = 100;
      int maxSize = 300;
      Date nowDate = new Date();
      // 一、自动提现针对的用户群: 前提条件:用户在距今60天到90天内未活跃过的用户
      String beganDate = DateUtil.reduceDayTostring(90, nowDate);
      String endDate = DateUtil.reduceDayTostring(60, nowDate);
      // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
      String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
      // 条件4:距离上一次未成功领取微信红包已经超过了15天时间,可在第16天再次下发;
@@ -973,7 +976,7 @@
      
      while (true) {
         // 查询满足条件 1、2 的uid
         List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
         List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
         if (listUser == null || listUser.isEmpty())
            break;
         
@@ -1019,6 +1022,9 @@
      int pageSize = 100;
      int maxSize = 301; // appId + 实际openid300个
      Date nowDate = new Date();
      // 一、自动提现针对的用户群: 前提条件:用户在距今60天到90天内未活跃过的用户
      String beganDate = DateUtil.reduceDayTostring(90, nowDate);
      String endDate = DateUtil.reduceDayTostring(60, nowDate);
      // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
      String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
      // 条件4:距离上一次未成功领取微信红包已经超过了15天时间,可在第16天再次下发;
@@ -1035,7 +1041,7 @@
      
      while (true) {
         // 查询满足条件 1、2 的uid
         List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
         List<UserInfo> listUser = userInfoService.getAutoExtractUser(page * pageSize, pageSize, minSurplus, beganDate, endDate);
         if (listUser == null || listUser.isEmpty())
            break;
         
@@ -1137,7 +1143,7 @@
      // 状态过滤
      String statusOld = record.getStatus();
      if (StringUtil.isNullOrEmpty(statusOld) ||ExtractWeiXinRecord.REFUND.equals(statusOld) 
            || ExtractWeiXinRecord.RFUND_ING.equals(statusOld))
            || ExtractWeiXinRecord.RECEIVED.equals(statusOld))
         return;
      
      ExtractWeiXinRecord updeteRecord = new ExtractWeiXinRecord();
@@ -1191,13 +1197,12 @@
         }  
      }
      updeteRecord.setStatus(status);
      // 更新红包记录
      extractWeiXinRecordService.updateByPrimaryKeySelective(updeteRecord);
      
      if (!ExtractWeiXinRecord.REFUND.equals(status))
         return;
      if (ExtractWeiXinRecord.RECEIVED.equals(status)) {
         // 发送消息通知
         userMoneyMsgNotificationService.extractAuto(record, "已领取-已提现", null, null);
      } else if (ExtractWeiXinRecord.REFUND.equals(status)) {
      // 资金明细
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
@@ -1210,6 +1215,10 @@
      
      // 资金计算
      userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
         // 发送消息通知
         userMoneyMsgNotificationService.extractAuto(record, "已退回-余额中", null, null);
      }
   }
   
}