|
@@ -178,24 +178,4 @@ public class UserBenefitsServiceImpl implements UserBenefitsService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void updateGalaxycoin(Long userId, BigDecimal addGalaxycoin, UserGalaxycoinRecord.Source source) {
|
|
|
|
|
- if (addGalaxycoin.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- while (true) {
|
|
|
|
|
- User user = userMapper.selectById(userId);
|
|
|
|
|
- if (user == null) break;
|
|
|
|
|
- Integer success = userMapper.updateGalaxycoin(user.getId(), addGalaxycoin, user.getGalaxycoin());
|
|
|
|
|
- if (success == 1) break;
|
|
|
|
|
- UserGalaxycoinRecord record = new UserGalaxycoinRecord();
|
|
|
|
|
- record.setUserId(userId);
|
|
|
|
|
- record.setGalaxycoin(addGalaxycoin);
|
|
|
|
|
- record.setSource(source);
|
|
|
|
|
- record.setRemark(source.getDesc());
|
|
|
|
|
- userGalaxycoinRecordMapper.insert(record);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|