|
@@ -1,6 +1,7 @@
|
|
|
package com.game.business.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -144,8 +145,8 @@ public class AppUserCountDividendServiceImpl extends ServiceImpl<AppUserCountDiv
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<AppUserCountDividend> selectUserDividendList(Long pid,Long userId,String dateNum) {
|
|
|
- List<AppUserCountDividend> dividendList = appUserCountDividendMapper.selectUserDividendList(pid,userId,dateNum);
|
|
|
+ public List<AppUserCountDividend> selectUserDividendList(Long pid,Long userId,String dateNum,Integer status) {
|
|
|
+ List<AppUserCountDividend> dividendList = appUserCountDividendMapper.selectUserDividendList(pid,userId,dateNum,status);
|
|
|
if(null != dividendList && dividendList.size()>0){
|
|
|
List<Long> ids = dividendList.stream().map(AppUserCountDividend::getUserId).collect(Collectors.toList());
|
|
|
List<AppUser> userList = appUserService.selectListByIds(ids);
|
|
@@ -164,14 +165,14 @@ public class AppUserCountDividendServiceImpl extends ServiceImpl<AppUserCountDiv
|
|
|
|
|
|
@Override
|
|
|
public HttpRet<Boolean> send(String userId, String dateNo,Long sendUserId) {
|
|
|
- List<AppUserCountDividend> dividendList = this.selectUserDividendList(sendUserId, StringUtils.isBlank(userId)?null:Long.parseLong(userId),dateNo);
|
|
|
+ List<AppUserCountDividend> dividendList = this.selectUserDividendList(sendUserId, StringUtils.isBlank(userId)?null:Long.parseLong(userId),dateNo,0);
|
|
|
if(null == dividendList || dividendList.size() < 1){
|
|
|
return HttpRet.fail("发放失败,不存在或已发放");
|
|
|
}
|
|
|
- dividendList = dividendList.stream().filter(e->e.getStatus().intValue() == 0).collect(Collectors.toList());
|
|
|
+
|
|
|
if(dividendList.size() < 1){
|
|
|
return HttpRet.fail("发放失败,不存在或已发放");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
if(curUser.getDiamondCoin() < dividendList.stream().mapToDouble(e->e.getDiamondCoin()).sum()){
|
|
|
return HttpRet.fail("发放失败,余额不足");
|
|
@@ -194,7 +195,6 @@ public class AppUserCountDividendServiceImpl extends ServiceImpl<AppUserCountDiv
|
|
|
continue;
|
|
|
}
|
|
|
try {
|
|
|
- List<FinTranRecord> tranRecordList = new ArrayList<>();
|
|
|
AppUser appUser = userMap.get(String.valueOf(countDividend.getUserId()));
|
|
|
AppUser curUser = appUserService.selectAppUserByUserid(sendUserId);
|
|
|
if(!sendUserId.equals(appUser.getPid())){
|
|
@@ -308,7 +308,9 @@ public class AppUserCountDividendServiceImpl extends ServiceImpl<AppUserCountDiv
|
|
|
userIds = userIds.stream().distinct().collect(Collectors.toList());
|
|
|
for(Long uid : userIds) {
|
|
|
|
|
|
- appUserCountTask.updateWithdrawAble(uid);
|
|
|
+ ThreadUtil.execute(()->{
|
|
|
+ appUserCountTask.updateWithdrawAble(uid);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
return HttpRet.success("发放成功",true);
|