|
|
@@ -332,12 +332,10 @@ public class AdServiceImpl implements AdService {
|
|
|
}
|
|
|
if (updateUserTotal) {
|
|
|
//修改用户信息, 广告次数+1 总收益 + revenue
|
|
|
- YtDyzUser ytDyzUser = appUserMapper.selectPrimaryKey(user.getUserId());
|
|
|
- YtDyzUser updateEntity = new YtDyzUser();
|
|
|
- updateEntity.setUserId(ytDyzUser.getUserId());
|
|
|
- updateEntity.setTotalVideo(Objects.isNull(ytDyzUser.getTotalVideo()) ? 1 : (ytDyzUser.getTotalVideo() + 1));
|
|
|
- updateEntity.setTotalIncome(ytDyzUser.getTotalIncome().add(param.getRevenue()));
|
|
|
- appUserMapper.updateUser(updateEntity);
|
|
|
+ if (param.getRevenue() == null) {
|
|
|
+ param.setRevenue(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ appUserMapper.updateTotal(user.getUserId(), 1, param.getRevenue());
|
|
|
}
|
|
|
return adRecord.getRecordId();
|
|
|
}
|