|
@@ -151,9 +151,15 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
|
|
|
if(incrementOrderMg !=null){
|
|
|
BeanUtil.copyProperties(incrementOrderMg,param);
|
|
|
}
|
|
|
+ param.setId(null);
|
|
|
param.setUserId(userIncrement.getUserId());
|
|
|
param.setCount(incrementType.getDownloadNum());
|
|
|
- userService.addDownNum(param);
|
|
|
+ //userService.addDownNum(param);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(User::getId,userIncrement.getUserId());
|
|
|
+ wrapper.setSql("download_num_total = download_num_total + " + incrementType.getDownloadNum());
|
|
|
+ userService.update(wrapper);
|
|
|
|
|
|
iIncrementOrderMgService.addOrder(param, incrementType);
|
|
|
|
|
@@ -203,8 +209,10 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
|
|
|
if(user == null){
|
|
|
throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
|
}
|
|
|
- user.setDownloadNumTotal(user.getDownloadNumTotal() + param.getCount() * incrementType.getDownloadNum());
|
|
|
- userService.updateById(user);
|
|
|
+ LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(User::getId,user.getId());
|
|
|
+ wrapper.setSql("download_num_total = download_num_total + " + param.getCount() * incrementType.getDownloadNum());
|
|
|
+ userService.update(wrapper);
|
|
|
}
|
|
|
}
|
|
|
|