|
@@ -17,7 +17,7 @@ import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-@Component
|
|
|
+@Component("appUserCountTask")
|
|
|
@Log4j2
|
|
|
public class AppUserCountTask {
|
|
|
|
|
@@ -59,91 +59,97 @@ public class AppUserCountTask {
|
|
|
* 统计用户前一天
|
|
|
* */
|
|
|
public void statistics(String dateTime){
|
|
|
- Date curDate = DateUtil.offsetDay(DateUtils.getNowDate(),-1);
|
|
|
- if(StringUtils.isNotBlank(dateTime)){
|
|
|
- curDate = DateUtil.parse(dateTime,"yyyy-MM-dd");
|
|
|
- }else{
|
|
|
- dateTime = DateUtils.parseDateToStr("yyyy-MM-dd",curDate);
|
|
|
- }
|
|
|
- AppUser queryUser = new AppUser();
|
|
|
- queryUser.setAgentFlag(1);
|
|
|
- List<AppUser> list = appUserService.selectAppUserList(queryUser);
|
|
|
- List<AppUsersCharge> appUsersChargeList = appUsersChargeService.getChargeList(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- List<AppUsersCashrecord> appUsersCashrecords = appUsersCashrecordService.getUserCashList(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- List<FinTranRecord> finTranRecordList = finTranRecordService.getUserRecordList(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- List<AppUserLiveDividedRecord> liveDividedRecordList = appUserLiveDividedRecordService.selectByDate(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null,dateTime.concat(" 00:00:00"),dateTime.concat(" 23:59:59"));
|
|
|
- if(null != list && list.size()>0){
|
|
|
- List<AppUserCount> appUserCountList = new ArrayList<>();
|
|
|
- String finalDateTime = dateTime;
|
|
|
- list.forEach(appUser -> {
|
|
|
- AppUserCount appUserCount = new AppUserCount();
|
|
|
- appUserCount.setUserId(appUser.getUserid());
|
|
|
- appUserCount.setStrDate(finalDateTime);
|
|
|
- appUserCount.setAgentUserId(appUser.getPid());
|
|
|
-
|
|
|
- appUserCount.setRechargeAmount(appUsersChargeList.stream().filter(e->e.getUid().equals(appUser.getUserid())).mapToDouble(e->e.getMoney().doubleValue()).sum());
|
|
|
-
|
|
|
- appUserCount.setWithdrawalAmount(appUsersCashrecords.stream().filter(e->e.getUid().equals(appUser.getUserid())).mapToDouble(e->e.getMoney().doubleValue()).sum());
|
|
|
-
|
|
|
- appUserCount.setWithdrawalCommission(appUsersCashrecords.stream().filter(e->e.getUid().equals(appUser.getUserid())).mapToDouble(e->e.getService().doubleValue()).sum());
|
|
|
-
|
|
|
- Map<String,KeyValue> type1Keys = Arrays.stream(FinTranType1.getKeyValues(1)).collect(Collectors.toMap(e->e.a, Function.identity(),(k1,k2)->k2));
|
|
|
- Map<String,KeyValue> type3Keys = Arrays.stream(FinTranType3.getKeyValues(1)).collect(Collectors.toMap(e->e.a, Function.identity(),(k1,k2)->k2));
|
|
|
- appUserCount.setLiveUseAmount(finTranRecordList.stream().filter(e->{
|
|
|
- return e.getUid().equals(appUser.getUserid()) &&
|
|
|
- null != type1Keys.get(String.valueOf(e.getTranType1().intValue())) &&
|
|
|
- null != type3Keys.get(String.valueOf(e.getTranType3().intValue()));
|
|
|
- }).mapToDouble(e->e.getCoinChange()).sum());
|
|
|
-
|
|
|
- appUserCount.setLiveCommission(liveDividedRecordList.stream().filter(e->e.getUserId().equals(appUser.getUserid())).mapToDouble(e->e.getMoney().doubleValue()).sum());
|
|
|
-
|
|
|
- appUserCount.setGameCommission(gameRecordCountList.stream().filter(e->e.getUserId().equals(appUser.getUserid())).mapToDouble(e->e.getCommission()).sum());
|
|
|
-
|
|
|
- appUserCount.setGameLoseAmount(gameBettingList.stream().filter(
|
|
|
- e->e.getUserId().equals(appUser.getUserid()) && e.getIsWinning().intValue() == 2
|
|
|
- ).mapToDouble(e->
|
|
|
- e.getBettingAmount()
|
|
|
- ).sum());
|
|
|
-
|
|
|
- appUserCount.setGameLoseAmount(gameBettingList.stream().filter(
|
|
|
- e->e.getUserId().equals(appUser.getUserid()) && e.getIsWinning().intValue() == 1
|
|
|
- ).mapToDouble(e->
|
|
|
- e.getBettingAmount() * e.getBettingMultiple()
|
|
|
- ).sum());
|
|
|
- appUserCountService.createAppUserCount(appUserCount);
|
|
|
- });
|
|
|
- }
|
|
|
+ log.info("开始统计用户每日直播、游戏、佣金");
|
|
|
+ try {
|
|
|
+ Date curDate = DateUtil.offsetDay(DateUtils.getNowDate(), -1);
|
|
|
+ if (StringUtils.isNotBlank(dateTime)) {
|
|
|
+ curDate = DateUtil.parse(dateTime, "yyyy-MM-dd");
|
|
|
+ } else {
|
|
|
+ dateTime = DateUtils.parseDateToStr("yyyy-MM-dd", curDate);
|
|
|
+ }
|
|
|
+ AppUser queryUser = new AppUser();
|
|
|
+ queryUser.setAgentFlag(1);
|
|
|
+ List<AppUser> list = appUserService.selectAppUserList(queryUser);
|
|
|
+ List<AppUsersCharge> appUsersChargeList = appUsersChargeService.getChargeList(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ List<AppUsersCashrecord> appUsersCashrecords = appUsersCashrecordService.getUserCashList(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ List<FinTranRecord> finTranRecordList = finTranRecordService.getUserRecordList(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ List<AppUserLiveDividedRecord> liveDividedRecordList = appUserLiveDividedRecordService.selectByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ List<AppUserCount> appUserCountList = new ArrayList<>();
|
|
|
+ String finalDateTime = dateTime;
|
|
|
+ list.forEach(appUser -> {
|
|
|
+ AppUserCount appUserCount = new AppUserCount();
|
|
|
+ appUserCount.setUserId(appUser.getUserid());
|
|
|
+ appUserCount.setStrDate(finalDateTime);
|
|
|
+ appUserCount.setAgentUserId(appUser.getPid());
|
|
|
+
|
|
|
+ appUserCount.setRechargeAmount(appUsersChargeList.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getMoney().doubleValue()).sum());
|
|
|
+
|
|
|
+ appUserCount.setWithdrawalAmount(appUsersCashrecords.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getMoney().doubleValue()).sum());
|
|
|
+
|
|
|
+ appUserCount.setWithdrawalCommission(appUsersCashrecords.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getService().doubleValue()).sum());
|
|
|
+
|
|
|
+ Map<String, KeyValue> type1Keys = Arrays.stream(FinTranType1.getKeyValues(1)).collect(Collectors.toMap(e -> e.a, Function.identity(), (k1, k2) -> k2));
|
|
|
+ Map<String, KeyValue> type3Keys = Arrays.stream(FinTranType3.getKeyValues(1)).collect(Collectors.toMap(e -> e.a, Function.identity(), (k1, k2) -> k2));
|
|
|
+ appUserCount.setLiveUseAmount(finTranRecordList.stream().filter(e -> {
|
|
|
+ return e.getUid().equals(appUser.getUserid()) &&
|
|
|
+ null != type1Keys.get(String.valueOf(e.getTranType1().intValue())) &&
|
|
|
+ null != type3Keys.get(String.valueOf(e.getTranType3().intValue()));
|
|
|
+ }).mapToDouble(e -> e.getCoinChange()).sum());
|
|
|
+
|
|
|
+ appUserCount.setLiveCommission(liveDividedRecordList.stream().filter(e -> e.getUserId().equals(appUser.getUserid())).mapToDouble(e -> e.getMoney().doubleValue()).sum());
|
|
|
+
|
|
|
+ appUserCount.setGameCommission(gameRecordCountList.stream().filter(e -> e.getUserId().equals(appUser.getUserid())).mapToDouble(e -> e.getCommission()).sum());
|
|
|
+
|
|
|
+ appUserCount.setGameLoseAmount(gameBettingList.stream().filter(
|
|
|
+ e -> e.getUserId().equals(appUser.getUserid()) && e.getIsWinning().intValue() == 2
|
|
|
+ ).mapToDouble(e ->
|
|
|
+ e.getBettingAmount()
|
|
|
+ ).sum());
|
|
|
+
|
|
|
+ appUserCount.setGameLoseAmount(gameBettingList.stream().filter(
|
|
|
+ e -> e.getUserId().equals(appUser.getUserid()) && e.getIsWinning().intValue() == 1
|
|
|
+ ).mapToDouble(e ->
|
|
|
+ e.getBettingAmount() * e.getBettingMultiple()
|
|
|
+ ).sum());
|
|
|
+ appUserCountService.createAppUserCount(appUserCount);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- if(null != gameBettingList && gameBettingList.size() > 0){
|
|
|
- Map<String,List<AppGameBetting>> map = gameBettingList.stream().
|
|
|
- collect(Collectors.groupingBy(
|
|
|
- e->String.valueOf(e.getUserId()).concat("_").
|
|
|
- concat(String.valueOf(e.getGameId())).
|
|
|
- concat("_").concat(String.valueOf(e.getIsWinning()))
|
|
|
- ));
|
|
|
- for(String key : map.keySet()){
|
|
|
- List<AppGameBetting> appGameBettingList = map.get(key);
|
|
|
- Long userId = Long.valueOf(key.split("_")[0]);
|
|
|
- Long gameId = Long.valueOf(key.split("_")[1]);
|
|
|
- AppUserGameCount appUserGameCount = new AppUserGameCount();
|
|
|
- appUserGameCount.setUserId(userId);
|
|
|
- appUserGameCount.setGameId(gameId);
|
|
|
- appUserGameCount.setStrDate(dateTime);
|
|
|
- appUserGameCount.setGameLoseAmount(appGameBettingList.stream().filter(e->2==e.getIsWinning()).mapToDouble(
|
|
|
- e->e.getBettingAmount()
|
|
|
- ).sum());
|
|
|
- appUserGameCount.setGameWinAmount(appGameBettingList.stream().filter(e->2==e.getIsWinning()).mapToDouble(
|
|
|
- e->e.getBettingAmount() * e.getBettingMultiple()
|
|
|
- ).sum());
|
|
|
- appUserGameCount.setGameCommission(gameRecordCountList.stream().filter(
|
|
|
- e->e.getUserId().equals(userId) && e.getGameId().equals(gameId)
|
|
|
- ).mapToDouble(e->e.getCommission()).sum());
|
|
|
- appUserGameCountService.save(appUserGameCount);
|
|
|
+
|
|
|
+ if (null != gameBettingList && gameBettingList.size() > 0) {
|
|
|
+ Map<String, List<AppGameBetting>> map = gameBettingList.stream().
|
|
|
+ collect(Collectors.groupingBy(
|
|
|
+ e -> String.valueOf(e.getUserId()).concat("_").
|
|
|
+ concat(String.valueOf(e.getGameId())).
|
|
|
+ concat("_").concat(String.valueOf(e.getIsWinning()))
|
|
|
+ ));
|
|
|
+ for (String key : map.keySet()) {
|
|
|
+ List<AppGameBetting> appGameBettingList = map.get(key);
|
|
|
+ Long userId = Long.valueOf(key.split("_")[0]);
|
|
|
+ Long gameId = Long.valueOf(key.split("_")[1]);
|
|
|
+ AppUserGameCount appUserGameCount = new AppUserGameCount();
|
|
|
+ appUserGameCount.setUserId(userId);
|
|
|
+ appUserGameCount.setGameId(gameId);
|
|
|
+ appUserGameCount.setStrDate(dateTime);
|
|
|
+ appUserGameCount.setGameLoseAmount(appGameBettingList.stream().filter(e -> 2 == e.getIsWinning()).mapToDouble(
|
|
|
+ e -> e.getBettingAmount()
|
|
|
+ ).sum());
|
|
|
+ appUserGameCount.setGameWinAmount(appGameBettingList.stream().filter(e -> 2 == e.getIsWinning()).mapToDouble(
|
|
|
+ e -> e.getBettingAmount() * e.getBettingMultiple()
|
|
|
+ ).sum());
|
|
|
+ appUserGameCount.setGameCommission(gameRecordCountList.stream().filter(
|
|
|
+ e -> e.getUserId().equals(userId) && e.getGameId().equals(gameId)
|
|
|
+ ).mapToDouble(e -> e.getCommission()).sum());
|
|
|
+ appUserGameCountService.save(appUserGameCount);
|
|
|
+ }
|
|
|
}
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("用户每日直播、游戏、佣金统计异常:{}",e.getMessage());
|
|
|
}
|
|
|
+ log.info("用户每日直播、游戏、佣金统计完成");
|
|
|
|
|
|
}
|
|
|
|
|
@@ -152,80 +158,87 @@ public class AppUserCountTask {
|
|
|
* @param dateTime 格式yyyy-MM-dd
|
|
|
* */
|
|
|
public void calculateDividends(String dateTime){
|
|
|
- Date curDate = DateUtil.offsetDay(DateUtils.getNowDate(),-1);
|
|
|
- if(StringUtils.isNotBlank(dateTime)){
|
|
|
- curDate = DateUtil.parse(dateTime,"yyyy-MM-dd");
|
|
|
- }else{
|
|
|
- dateTime = DateUtils.parseDateToStr("yyyy-MM-dd",curDate);
|
|
|
- }
|
|
|
- Date beginTime = DateUtil.beginOfWeek(curDate);
|
|
|
- Date endTime = DateUtil.endOfWeek(curDate);
|
|
|
-
|
|
|
- AppUser queryUser = new AppUser();
|
|
|
- queryUser.setAgentFlag(1);
|
|
|
- List<AppUser> list = appUserService.selectAppUserList(queryUser);
|
|
|
- if(null != list && list.size() > 0){
|
|
|
- list.forEach(appUser -> {
|
|
|
-
|
|
|
- LambdaQueryWrapper<AppUserCount> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.ge(AppUserCount::getStrDate,beginTime);
|
|
|
- queryWrapper.le(AppUserCount::getStrDate,endTime);
|
|
|
- queryWrapper.eq(AppUserCount::getAgentUserId,appUser.getUserid());
|
|
|
- List<AppUserCount> appUserCountList = appUserCountService.list(queryWrapper);
|
|
|
- if(null != appUserCountList && appUserCountList.size() > 0){
|
|
|
-
|
|
|
- double loseAmount = appUserCountList.stream().mapToDouble(e->e.getGameLoseAmount()).sum();
|
|
|
-
|
|
|
- double winAmount = appUserCountList.stream().mapToDouble(e->e.getGameWinAmount()).sum();
|
|
|
-
|
|
|
- double withdrawalCommission = appUserCountList.stream().mapToDouble(e->e.getWithdrawalCommission()).sum();
|
|
|
-
|
|
|
- double gameCommission = appUserCountList.stream().mapToDouble(e->e.getGameCommission()).sum();
|
|
|
-
|
|
|
- double liveCommission = appUserCountList.stream().mapToDouble(e->e.getLiveCommission()).sum();
|
|
|
-
|
|
|
-
|
|
|
- double money = (loseAmount - winAmount) - withdrawalCommission - gameCommission - liveCommission;
|
|
|
- if(money > 0){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- LambdaQueryWrapper<AppUserAgent> userAgentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- userAgentLambdaQueryWrapper.eq(AppUserAgent::getPid,appUser.getUserid());
|
|
|
- userAgentLambdaQueryWrapper.eq(AppUserAgent::getAuditStatus,1);
|
|
|
- List<AppUserAgent> appUserAgentList = appUserAgentService.list(userAgentLambdaQueryWrapper);
|
|
|
- if(null != appUserAgentList && appUserAgentList.size() > 0){
|
|
|
- appUserAgentList.forEach(userAgent ->{
|
|
|
-
|
|
|
- LambdaQueryWrapper<AppUserAgent> queryAgentWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryAgentWrapper.eq(AppUserAgent::getUserId,userAgent.getUserId());
|
|
|
- queryAgentWrapper.eq(AppUserAgent::getAuditStatus,1);
|
|
|
- AppUserAgent appUserAgent = appUserAgentService.getOne(queryAgentWrapper);
|
|
|
- if(null == appUserAgent){
|
|
|
- log.info("用户{},所有下级亏损{},查询下级为空,停止分红",appUserAgent.getUserId(),money);
|
|
|
- }
|
|
|
- double rate = appUserAgent.getDividendGuaranteeRate();
|
|
|
- double dividends = money * rate;
|
|
|
- AppUserCountDividend appUserCountDividend = new AppUserCountDividend();
|
|
|
- appUserCountDividend.setUserId(userAgent.getUserId());
|
|
|
- appUserCountDividend.setDateNo(DateUtil.format(endTime,"yyyy-MM-dd"));
|
|
|
- appUserCountDividend.setBeginTime(beginTime);
|
|
|
- appUserCountDividend.setEndTime(endTime);
|
|
|
- appUserCountDividend.setProfitLoss(money);
|
|
|
- appUserCountDividend.setRate(rate);
|
|
|
- appUserCountDividend.setCoin(0.00);
|
|
|
- appUserCountDividend.setDiamondCoin(dividends);
|
|
|
- appUserCountDividend.setStatus(0);
|
|
|
- appUserCountDividendService.insertAppUserCountDividend(appUserCountDividend);
|
|
|
- });
|
|
|
- }else{
|
|
|
- log.info("用户{},所有下级亏损{},查询下级为空,停止分红",appUser.getUserid(),money);
|
|
|
+ try {
|
|
|
+ log.info("开始每周代理分红");
|
|
|
+ Date curDate = DateUtil.offsetDay(DateUtils.getNowDate(), -1);
|
|
|
+ if (StringUtils.isNotBlank(dateTime)) {
|
|
|
+ curDate = DateUtil.parse(dateTime, "yyyy-MM-dd");
|
|
|
+ } else {
|
|
|
+ dateTime = DateUtils.parseDateToStr("yyyy-MM-dd", curDate);
|
|
|
+ }
|
|
|
+ Date beginTime = DateUtil.beginOfWeek(curDate);
|
|
|
+ Date endTime = DateUtil.endOfWeek(curDate);
|
|
|
+
|
|
|
+ AppUser queryUser = new AppUser();
|
|
|
+ queryUser.setAgentFlag(1);
|
|
|
+ List<AppUser> list = appUserService.selectAppUserList(queryUser);
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ list.forEach(appUser -> {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<AppUserCount> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.ge(AppUserCount::getStrDate, beginTime);
|
|
|
+ queryWrapper.le(AppUserCount::getStrDate, endTime);
|
|
|
+ queryWrapper.eq(AppUserCount::getAgentUserId, appUser.getUserid());
|
|
|
+ List<AppUserCount> appUserCountList = appUserCountService.list(queryWrapper);
|
|
|
+ if (null != appUserCountList && appUserCountList.size() > 0) {
|
|
|
+
|
|
|
+ double loseAmount = appUserCountList.stream().mapToDouble(e -> e.getGameLoseAmount()).sum();
|
|
|
+
|
|
|
+ double winAmount = appUserCountList.stream().mapToDouble(e -> e.getGameWinAmount()).sum();
|
|
|
+
|
|
|
+ double withdrawalCommission = appUserCountList.stream().mapToDouble(e -> e.getWithdrawalCommission()).sum();
|
|
|
+
|
|
|
+ double gameCommission = appUserCountList.stream().mapToDouble(e -> e.getGameCommission()).sum();
|
|
|
+
|
|
|
+ double liveCommission = appUserCountList.stream().mapToDouble(e -> e.getLiveCommission()).sum();
|
|
|
+
|
|
|
+
|
|
|
+ double money = (loseAmount - winAmount) - withdrawalCommission - gameCommission - liveCommission;
|
|
|
+ if (money > 0) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ LambdaQueryWrapper<AppUserAgent> userAgentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ userAgentLambdaQueryWrapper.eq(AppUserAgent::getPid, appUser.getUserid());
|
|
|
+ userAgentLambdaQueryWrapper.eq(AppUserAgent::getAuditStatus, 1);
|
|
|
+ List<AppUserAgent> appUserAgentList = appUserAgentService.list(userAgentLambdaQueryWrapper);
|
|
|
+ if (null != appUserAgentList && appUserAgentList.size() > 0) {
|
|
|
+ appUserAgentList.forEach(userAgent -> {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<AppUserAgent> queryAgentWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryAgentWrapper.eq(AppUserAgent::getUserId, userAgent.getUserId());
|
|
|
+ queryAgentWrapper.eq(AppUserAgent::getAuditStatus, 1);
|
|
|
+ AppUserAgent appUserAgent = appUserAgentService.getOne(queryAgentWrapper);
|
|
|
+ if (null == appUserAgent || appUserAgent.getDividendGuaranteeRate() > 0.00) {
|
|
|
+ log.info("用户{},所有下级亏损{},查询下级为空或者未设置分红比例,停止分红", appUserAgent.getUserId(), money);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ double rate = appUserAgent.getDividendGuaranteeRate();
|
|
|
+ double dividends = money * rate;
|
|
|
+ AppUserCountDividend appUserCountDividend = new AppUserCountDividend();
|
|
|
+ appUserCountDividend.setUserId(userAgent.getUserId());
|
|
|
+ appUserCountDividend.setDateNo(DateUtil.format(endTime, "yyyy-MM-dd"));
|
|
|
+ appUserCountDividend.setBeginTime(beginTime);
|
|
|
+ appUserCountDividend.setEndTime(endTime);
|
|
|
+ appUserCountDividend.setProfitLoss(money);
|
|
|
+ appUserCountDividend.setRate(rate);
|
|
|
+ appUserCountDividend.setCoin(0.00);
|
|
|
+ appUserCountDividend.setDiamondCoin(dividends);
|
|
|
+ appUserCountDividend.setStatus(0);
|
|
|
+ appUserCountDividendService.insertAppUserCountDividend(appUserCountDividend);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ log.info("用户{},所有下级亏损{},查询下级为空,停止分红", appUser.getUserid(), money);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.info("用户{},所有下级亏损{},不满足分红条件", appUser.getUserid(), money);
|
|
|
}
|
|
|
- }else{
|
|
|
- log.info("用户{},所有下级亏损{},不满足分红条件",appUser.getUserid(),money);
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ log.info("每周代理分红完成");
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("每周分红失败:{}",e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|