|
|
@@ -1060,6 +1060,40 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return baseMapper.vipUserList(bo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean closeBatchVip(UserEditBo bo) {
|
|
|
+ for(Long userId : bo.getUserIdList()){
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>().eq(User::getUserId, userId));
|
|
|
+ if(Validator.isNotEmpty(user)&&(user.getVipTag()!=1||user.getVipTag()!=3)){
|
|
|
+ throw new CustomException("该会员未开通会员");
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<User> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(User::getUserId, userId);
|
|
|
+ objectLambdaUpdateWrapper.set(User::getVipTag, 2);
|
|
|
+ objectLambdaUpdateWrapper.set(User::getVipCloseTime, DateUtils.getNowTime());
|
|
|
+ objectLambdaUpdateWrapper.set(User::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean restoreBatchVip(UserEditBo bo) {
|
|
|
+ for(Long userId : bo.getUserIdList()){
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>().eq(User::getUserId, userId));
|
|
|
+ if(Validator.isNotEmpty(user)&&(user.getVipTag()!=2)){
|
|
|
+ throw new CustomException("该会员未被注销");
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<User> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(User::getUserId, userId);
|
|
|
+ objectLambdaUpdateWrapper.set(User::getVipTag, 1);
|
|
|
+ objectLambdaUpdateWrapper.set(User::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private Long findSubjectId(String subject){
|
|
|
if(subject!=null){
|
|
|
String key = "SUB_"+subject;
|