bug fix
This commit is contained in:
parent
08bb9aa48a
commit
7887d14e61
|
|
@ -214,9 +214,10 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||
user.setUserId(userId);
|
||||
user.setInviterCode(userEntity.getInvitationCode());
|
||||
user.setInviterUserId(userEntity.getUserId());
|
||||
user.setInviteCount((userEntity.getInviteCount() == null ? 0 : userEntity.getInviteCount()) + 1);
|
||||
userService.updateById(user);
|
||||
|
||||
userEntity.setInviteCount((user.getInviteCount() == null ? 0 : user.getInviteCount()) + 1);
|
||||
|
||||
// 金币
|
||||
int money = Integer.parseInt(commonInfoService.findOne(911).getValue());
|
||||
if (money > 0 && userEntity.getUserId() != 1) {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,11 @@ public class Tets {
|
|||
@Test
|
||||
public void testUserInviteCount() {
|
||||
List<UserEntity> userList = userService.list(Wrappers.emptyWrapper());
|
||||
System.out.println(userList.size());
|
||||
|
||||
int totalSize = userList.size();
|
||||
System.out.println(totalSize);
|
||||
|
||||
AtomicInteger hasExecuteCount = new AtomicInteger();
|
||||
|
||||
userList.parallelStream().forEach(item -> {
|
||||
try {
|
||||
|
|
@ -94,6 +98,9 @@ public class Tets {
|
|||
item.setInviteCount(count);
|
||||
userService.updateById(item);
|
||||
log.info("更新邀请人数: {}, {}", item.getUserId(), count);
|
||||
|
||||
hasExecuteCount.getAndIncrement();
|
||||
log.info("已执行: {}/{}", hasExecuteCount, totalSize);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue