|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.supervision.police.domain.SystemUser;
|
|
|
|
@ -107,16 +108,20 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|
|
|
|
.ne(SystemUser::getId, userInfoReqVo.getId()).count();
|
|
|
|
|
Assert.isTrue(count == 0, "用户名已存在,请更改用户名");
|
|
|
|
|
|
|
|
|
|
super.lambdaUpdate()
|
|
|
|
|
LambdaUpdateChainWrapper<SystemUser> updateChainWrapper = super.lambdaUpdate()
|
|
|
|
|
.set(SystemUser::getHeadPicId, userInfoReqVo.getHeadPicId())
|
|
|
|
|
.set(SystemUser::getUserName, userInfoReqVo.getUserName())
|
|
|
|
|
.set(SystemUser::getAccount, userInfoReqVo.getAccount())
|
|
|
|
|
.set(SystemUser::getPhoneNum, userInfoReqVo.getPhoneNum())
|
|
|
|
|
.set(StrUtil.isNotEmpty(userInfoReqVo.getPassword()),SystemUser::getUserPd, UserUtil.signPassword(userInfoReqVo.getPassword()))
|
|
|
|
|
.set(Objects.nonNull(userInfoReqVo.getStatus()),SystemUser::getStatus, userInfoReqVo.getStatus())
|
|
|
|
|
.set(Objects.nonNull(userInfoReqVo.getStatus()), SystemUser::getStatus, userInfoReqVo.getStatus())
|
|
|
|
|
.set(SystemUser::getRemark, userInfoReqVo.getRemark())
|
|
|
|
|
.eq(SystemUser::getId, userInfoReqVo.getId())
|
|
|
|
|
.update();
|
|
|
|
|
.eq(SystemUser::getId, userInfoReqVo.getId());
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(userInfoReqVo.getPassword())) {
|
|
|
|
|
updateChainWrapper.set(SystemUser::getUserPd, UserUtil.signPassword(userInfoReqVo.getPassword()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateChainWrapper.update();
|
|
|
|
|
|
|
|
|
|
userRoleRelationManageService.updateUserRoleRelation(userInfoReqVo.getId(), userInfoReqVo.getRoleIdList());
|
|
|
|
|
}
|
|
|
|
@ -151,7 +156,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|
|
|
|
//查询用户数据
|
|
|
|
|
Page<SystemUser> userInfoPage = super.page(Page.of(pageNum, pageSize),
|
|
|
|
|
new LambdaQueryWrapper<SystemUser>()
|
|
|
|
|
.eq(StrUtil.isNotEmpty(userName), SystemUser::getUserName, userName)
|
|
|
|
|
.like(StrUtil.isNotEmpty(userName), SystemUser::getUserName, userName)
|
|
|
|
|
.in(CollUtil.isNotEmpty(userRoleFilterList), SystemUser::getId, userRoleFilterList.stream().map(UserRoleDTO::getUserId).toList()));
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(userInfoPage.getRecords())){
|
|
|
|
|