|
@@ -1,11 +1,17 @@
|
|
package com.zhongzheng.modules.user.service.impl;
|
|
package com.zhongzheng.modules.user.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
|
+import com.zhongzheng.common.type.EncryptHandler;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
|
+import com.zhongzheng.modules.sdk.domain.TopNuoMplatformLog;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyEditBo;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyEditBo;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyQueryBo;
|
|
import com.zhongzheng.modules.user.bo.UserLoginKeyQueryBo;
|
|
|
|
+import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.domain.UserLoginKey;
|
|
import com.zhongzheng.modules.user.domain.UserLoginKey;
|
|
import com.zhongzheng.modules.user.mapper.UserLoginKeyMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserLoginKeyMapper;
|
|
import com.zhongzheng.modules.user.service.IUserLoginKeyService;
|
|
import com.zhongzheng.modules.user.service.IUserLoginKeyService;
|
|
@@ -36,6 +42,13 @@ public class UserLoginKeyServiceImpl extends ServiceImpl<UserLoginKeyMapper, Use
|
|
return BeanUtil.toBean(db, UserLoginKeyVo.class);
|
|
return BeanUtil.toBean(db, UserLoginKeyVo.class);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public UserLoginKey queryByUserKey(String userKey) {
|
|
|
|
+ UserLoginKey loginKey = getOne(new LambdaQueryWrapper<UserLoginKey>()
|
|
|
|
+ .eq(UserLoginKey::getUserKey, userKey).eq(UserLoginKey::getStatus, 1).last("limit 1"));
|
|
|
|
+ return loginKey;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<UserLoginKeyVo> queryList(UserLoginKeyQueryBo bo) {
|
|
public List<UserLoginKeyVo> queryList(UserLoginKeyQueryBo bo) {
|
|
LambdaQueryWrapper<UserLoginKey> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<UserLoginKey> lqw = Wrappers.lambdaQuery();
|
|
@@ -100,4 +113,16 @@ public class UserLoginKeyServiceImpl extends ServiceImpl<UserLoginKeyMapper, Use
|
|
}
|
|
}
|
|
return this.removeByIds(ids);
|
|
return this.removeByIds(ids);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean offline(UserLoginKeyEditBo bo) {
|
|
|
|
+ if(Validator.isEmpty(bo.getUserId())||Validator.isEmpty(bo.getUserKey())){
|
|
|
|
+ throw new CustomException("参数错误");
|
|
|
|
+ }
|
|
|
|
+ LambdaUpdateWrapper<UserLoginKey> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
|
+ objectLambdaUpdateWrapper.eq(UserLoginKey::getUserId, bo.getUserId());
|
|
|
|
+ objectLambdaUpdateWrapper.ne(UserLoginKey::getUserKey, bo.getUserKey());
|
|
|
|
+ objectLambdaUpdateWrapper.set(UserLoginKey::getStatus, 0);
|
|
|
|
+ return this.update(null, objectLambdaUpdateWrapper);
|
|
|
|
+ }
|
|
}
|
|
}
|