| | |
| | | import com.ycl.bo.AdminUserDetails; |
| | | import com.ycl.dto.UmsAdminParam; |
| | | import com.ycl.dto.UpdateAdminPasswordParam; |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.entity.user.*; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.exception.Asserts; |
| | |
| | | import com.ycl.utils.SpringUtil; |
| | | import com.ycl.utils.common.LiveTimeMillisecond; |
| | | import com.ycl.utils.common.MacUtils; |
| | | import com.ycl.utils.common.PojoUtils; |
| | | import com.ycl.utils.redis.RedisKey; |
| | | import com.ycl.vo.user.UserVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | } |
| | | //对用户名系统默认添加 |
| | | //umsAdmin.setNickName(RandomUtils.getUserId(umsAdmin.getId())); |
| | | baseMapper.updateById(umsAdmin); |
| | | //添加部门 |
| | | UmsDepartManage departManage = new UmsDepartManage(); |
| | | departManage.setUserId(umsAdmin.getId()); |
| | | departManage.setDepartId(umsAdminParam.getDepartmentId()); |
| | | departManage.setCreateTime(new Date()); |
| | | departManage.setUpdateTime(new Date()); |
| | | umsDepartManageMapper.insert(departManage); |
| | | |
| | | baseMapper.updateById(umsAdmin); |
| | | return umsAdmin; |
| | | } |
| | | |
| | |
| | | int pageSize = pageUserVO.getPageSize(); |
| | | int current = pageUserVO.getCurrent(); |
| | | Page<UmsAdmin> page = new Page<>(current, pageSize); |
| | | LambdaQueryWrapper<UmsAdmin> queryWrapper = new LambdaQueryWrapper<>(); |
| | | /* LambdaQueryWrapper<UmsAdmin> queryWrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotBlank(pageUserVO.getKeyword())) { |
| | | queryWrapper.like(UmsAdmin::getUsername, pageUserVO.getKeyword()) |
| | |
| | | } |
| | | if (PojoUtils.Vo.isUsefulSearchParam(pageUserVO.getUserType())) { |
| | | queryWrapper.eq(UmsAdmin::getUserType, pageUserVO.getUserType()); |
| | | } |
| | | if (PojoUtils.Vo.isUsefulSearchParam(pageUserVO.getDepartmentId())) { |
| | | queryWrapper.eq(UmsAdmin::getDepartmentId, pageUserVO.getDepartmentId()); |
| | | } |
| | | Page<UmsAdmin> page1 = baseMapper.selectPage(page, queryWrapper); |
| | | List<UmsAdmin> records = page1.getRecords(); |
| | | if (CollUtil.isNotEmpty(records)) { |
| | | records.forEach(e -> { |
| | | UmsDepart umsDepart = departService.getById(e.getDepartmentId()); |
| | | if (null != umsDepart) { |
| | | e.setDepartName(umsDepart.getDepartName()); |
| | | } |
| | | //获取角色列表 |
| | | List<UmsRole> roles = umsRoleMapper.getRoleList(e.getId()); |
| | | e.setRoles(roles); |
| | | }); |
| | | } |
| | | }*/ |
| | | Page<UmsAdmin> page1 = baseMapper.selectCondPage(page,pageUserVO); |
| | | |
| | | return page1; |
| | | } |
| | | |