提交 1f0cb788 作者: 17607474349

fix:

1、用户导入、导出
2、部门导入、导出
3、新增根据用户名或手机号码检索
上级 1cb3b1b2
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.excel.dept; package com.yiring.app.excel.dept;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn; import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.github.liaochong.myexcel.core.annotation.ExcelModel; import com.github.liaochong.myexcel.core.annotation.ExcelModel;
import com.yiring.auth.domain.dept.Department; import com.yiring.auth.domain.dept.Department;
...@@ -31,14 +30,22 @@ public class DepartmentExportExcel implements Serializable { ...@@ -31,14 +30,22 @@ public class DepartmentExportExcel implements Serializable {
@ExcelColumn(title = "部门名称") @ExcelColumn(title = "部门名称")
String name; String name;
@ExcelColumn(title = "创建时间") @ExcelColumn(title = "负责人")
String createTime; String realName;
@ExcelColumn(title = "手机号")
String mobile;
@ExcelColumn(title = "是否启用")
String enable;
public static DepartmentExportExcel transform(Department department) { public static DepartmentExportExcel transform(Department department) {
return DepartmentExportExcel return DepartmentExportExcel
.builder() .builder()
.name(department.getName()) .name(department.getName())
.createTime(LocalDateTimeUtil.format(department.getCreateTime(), "yyyy-MM-dd HH:mm:ss")) .realName(department.getLeader().getRealName())
.mobile(department.getLeader().getMobile())
.enable(department.getEnable() ? "启用" : "禁用")
.build(); .build();
} }
} }
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.excel.dept; package com.yiring.app.excel.dept;
import cn.hutool.core.util.StrUtil;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn; import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.yiring.auth.domain.dept.Department; import com.yiring.auth.domain.dept.Department;
import java.io.Serial; import java.io.Serial;
...@@ -37,13 +38,13 @@ public class DepartmentImportExcel implements Serializable { ...@@ -37,13 +38,13 @@ public class DepartmentImportExcel implements Serializable {
String mobile; String mobile;
@ExcelColumn(index = 3) @ExcelColumn(index = 3)
Boolean enable; String enable;
public static Department transform(DepartmentImportExcel departmentImportExcel) { public static Department transform(DepartmentImportExcel departmentImportExcel) {
return Department return Department
.builder() .builder()
.name(departmentImportExcel.getName()) .name(departmentImportExcel.getName())
.enable(departmentImportExcel.getEnable()) .enable(StrUtil.equals(departmentImportExcel.getEnable(), "启用"))
.build(); .build();
} }
} }
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.excel.user; package com.yiring.app.excel.user;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn; import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.yiring.app.vo.user.UserVo; import com.yiring.app.vo.user.UserVo;
import java.io.Serial; import java.io.Serial;
...@@ -29,14 +28,49 @@ public class UserExportExcel implements Serializable { ...@@ -29,14 +28,49 @@ public class UserExportExcel implements Serializable {
@ExcelColumn(title = "真实姓名") @ExcelColumn(title = "真实姓名")
String realName; String realName;
@ExcelColumn(title = "创建时间") @ExcelColumn(title = "工号")
String createTime; String uuid;
// 图标类型
@ExcelColumn(title = "图标类型")
String type;
// 手机号
@ExcelColumn(title = "手机号")
String mobile;
// 部门id
@ExcelColumn(title = "部门名称")
String deptName;
// 职位id
@ExcelColumn(title = "职位名称")
String postName;
// 标签号
@ExcelColumn(title = "标签号")
String code;
// 性别
@ExcelColumn(title = "性别")
Boolean gender;
// 是否为特殊人员
@ExcelColumn(title = "是否为特殊人员")
Boolean isSpecial;
public static UserExportExcel transform(UserVo userVo) { public static UserExportExcel transform(UserVo userVo) {
return UserExportExcel return UserExportExcel
.builder() .builder()
.realName(userVo.getRealName()) .realName(userVo.getRealName())
.createTime(LocalDateTimeUtil.format(userVo.getCreateTime(), "yyyy-MM-dd HH:mm:ss")) .uuid(userVo.getUuid())
.type(userVo.getType().text())
.mobile(userVo.getMobile())
.deptName(userVo.getDepartment())
.postName(userVo.getPost())
.code(userVo.getCode())
.gender(userVo.getGender())
.isSpecial(userVo.getIsSpecial())
.build(); .build();
} }
} }
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.excel.user; package com.yiring.app.excel.user;
import cn.hutool.core.convert.Convert;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn; import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.yiring.auth.domain.dept.Department;
import com.yiring.auth.domain.post.Post;
import com.yiring.auth.domain.user.User; import com.yiring.auth.domain.user.User;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
...@@ -46,11 +43,11 @@ public class UserImportExcel implements Serializable { ...@@ -46,11 +43,11 @@ public class UserImportExcel implements Serializable {
// 部门id // 部门id
@ExcelColumn(index = 4) @ExcelColumn(index = 4)
String deptId; String deptName;
// 职位id // 职位id
@ExcelColumn(index = 5) @ExcelColumn(index = 5)
String postId; String postName;
// 标签号 // 标签号
@ExcelColumn(index = 6) @ExcelColumn(index = 6)
...@@ -71,8 +68,6 @@ public class UserImportExcel implements Serializable { ...@@ -71,8 +68,6 @@ public class UserImportExcel implements Serializable {
.uuid(userImportExcel.getUuid()) .uuid(userImportExcel.getUuid())
.type(User.Type.valueOf(userImportExcel.getType())) .type(User.Type.valueOf(userImportExcel.getType()))
.mobile(userImportExcel.getMobile()) .mobile(userImportExcel.getMobile())
.department(Department.builder().id(Convert.toLong(userImportExcel.getDeptId())).build())
.post(Post.builder().id(Convert.toLong(userImportExcel.getPostId())).build())
.gender(userImportExcel.getGender()) .gender(userImportExcel.getGender())
.isSpecial(userImportExcel.getIsSpecial()) .isSpecial(userImportExcel.getIsSpecial())
.build(); .build();
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.app.param.user;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serial;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.FieldDefaults;
/**
* 用户检索
*
* @author LJ-2204
* @date 2022/4/26
*/
@ApiModel("UserIndexParam")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class UserIndexParam implements Serializable {
@Serial
private static final long serialVersionUID = -5843843146263025946L;
@ApiModelProperty(value = "真实姓名or手机号码")
String str;
}
...@@ -6,10 +6,12 @@ import com.yiring.app.param.dept.DepartmentFindParam; ...@@ -6,10 +6,12 @@ import com.yiring.app.param.dept.DepartmentFindParam;
import com.yiring.app.param.dept.DepartmentModifyParam; import com.yiring.app.param.dept.DepartmentModifyParam;
import com.yiring.app.vo.dept.DepartmentInfoVo; import com.yiring.app.vo.dept.DepartmentInfoVo;
import com.yiring.app.vo.dept.DepartmentVo; import com.yiring.app.vo.dept.DepartmentVo;
import com.yiring.auth.domain.dept.Department;
import com.yiring.auth.param.IdsParam; import com.yiring.auth.param.IdsParam;
import com.yiring.common.core.Result; import com.yiring.common.core.Result;
import com.yiring.common.param.IdParam; import com.yiring.common.param.IdParam;
import com.yiring.common.vo.PageVo; import com.yiring.common.vo.PageVo;
import java.util.HashMap;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -82,4 +84,10 @@ public interface DepartmentService { ...@@ -82,4 +84,10 @@ public interface DepartmentService {
* @return Result<String> * @return Result<String>
*/ */
Result<String> importDepartment(MultipartFile file); Result<String> importDepartment(MultipartFile file);
/**
* 部门名称字符串形式
* @return HashMap<String, Department>
*/
HashMap<String, Department> getStringDepartmentHashMap();
} }
...@@ -237,22 +237,7 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -237,22 +237,7 @@ public class DepartmentServiceImpl implements DepartmentService {
} }
// 拿到所有部门 // 拿到所有部门
List<Department> departments = departmentRepository.findAll(); HashMap<String, Department> hashMap = getStringDepartmentHashMap();
HashMap<String, Department> hashMap = new HashMap<>();
departments
.stream()
.peek(department -> {
if (department.getPid() == 0) {
hashMap.put(department.getName(), department);
} else {
List<String> deptNames = getDeptNames(department.getPid(), departments);
deptNames = ListUtil.reverse(deptNames);
deptNames.add(department.getName());
hashMap.put(StrUtil.join("/", deptNames), department);
}
})
.close();
// 对导入信息进行排序 // 对导入信息进行排序
departmentImportExcels departmentImportExcels
...@@ -262,10 +247,44 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -262,10 +247,44 @@ public class DepartmentServiceImpl implements DepartmentService {
int yCount = StrUtil.count(y.getName(), "/"); int yCount = StrUtil.count(y.getName(), "/");
return Integer.compare(xCount, yCount); return Integer.compare(xCount, yCount);
}) })
.peek(departmentImportExcel -> {}) .forEach(departmentImportExcel -> {
.close(); String name = departmentImportExcel.getName();
if (ObjectUtil.isNotEmpty(hashMap.get(name))) return;
int lastIndexOf = name.lastIndexOf("/");
Department department = DepartmentImportExcel.transform(departmentImportExcel);
department.setPid(0L);
if (lastIndexOf == -1) {
Department save = departmentRepository.save(department);
hashMap.putIfAbsent(name, save);
} else {
String subName = name.substring(0, lastIndexOf);
Department hashDept = hashMap.get(subName);
department.setName(name.substring(lastIndexOf + 1));
department.setPid(hashDept.getId());
Department save = departmentRepository.save(department);
hashMap.putIfAbsent(name, save);
}
});
return Result.ok();
}
public HashMap<String, Department> getStringDepartmentHashMap() {
List<Department> departments = departmentRepository.findAll();
HashMap<String, Department> hashMap = new HashMap<>();
departments.forEach(department -> {
if (department.getPid() == 0) {
hashMap.put(department.getName(), department);
} else {
ArrayList<String> list = ListUtil.toList();
List<String> deptNames = getDeptNames(list, department.getPid(), departments);
ListUtil.reverse(deptNames);
deptNames.add(department.getName());
return null; hashMap.put(StrUtil.join("/", deptNames), department);
}
});
return hashMap;
} }
public List<DepartmentVo> getChildrenList(Long pid, String pName, List<DepartmentVo> departmentVos) { public List<DepartmentVo> getChildrenList(Long pid, String pName, List<DepartmentVo> departmentVos) {
...@@ -279,16 +298,14 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -279,16 +298,14 @@ public class DepartmentServiceImpl implements DepartmentService {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
public List<String> getDeptNames(Long pid, List<Department> departmentList) { public List<String> getDeptNames(ArrayList<String> list, Long pid, List<Department> departmentList) {
ArrayList<String> list = ListUtil.toList();
departmentList departmentList
.stream() .stream()
.filter(department -> pid.equals(department.getId())) .filter(department -> pid.equals(department.getId()))
.peek(department -> { .forEach(department -> {
list.add(department.getName()); list.add(department.getName());
getDeptNames(department.getPid(), departmentList); getDeptNames(list, department.getPid(), departmentList);
}) });
.close();
return list; return list;
} }
} }
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.service.user; package com.yiring.app.service.user;
import com.yiring.app.param.user.UserAddParam; import com.yiring.app.param.user.*;
import com.yiring.app.param.user.UserBingTagParam;
import com.yiring.app.param.user.UserFindParam;
import com.yiring.app.param.user.UserModifyParam;
import com.yiring.app.vo.user.UserVo; import com.yiring.app.vo.user.UserVo;
import com.yiring.common.core.Result; import com.yiring.common.core.Result;
import com.yiring.common.param.IdParam; import com.yiring.common.param.IdParam;
...@@ -95,4 +92,11 @@ public interface UserService { ...@@ -95,4 +92,11 @@ public interface UserService {
* @return Result<String> * @return Result<String>
*/ */
Result<String> importUser(MultipartFile file); Result<String> importUser(MultipartFile file);
/**
* 用户索引
* @param param UserIndexParam
* @return Result<PageVo<UserVo>>
*/
Result<PageVo<UserVo>> indexUser(UserIndexParam param);
} }
...@@ -10,15 +10,14 @@ import com.yiring.app.domain.location.LocationTag; ...@@ -10,15 +10,14 @@ import com.yiring.app.domain.location.LocationTag;
import com.yiring.app.domain.location.LocationTagRepository; import com.yiring.app.domain.location.LocationTagRepository;
import com.yiring.app.excel.user.UserExportExcel; import com.yiring.app.excel.user.UserExportExcel;
import com.yiring.app.excel.user.UserImportExcel; import com.yiring.app.excel.user.UserImportExcel;
import com.yiring.app.param.user.UserAddParam; import com.yiring.app.param.user.*;
import com.yiring.app.param.user.UserBingTagParam; import com.yiring.app.service.dept.DepartmentService;
import com.yiring.app.param.user.UserFindParam;
import com.yiring.app.param.user.UserModifyParam;
import com.yiring.app.service.user.UserService; import com.yiring.app.service.user.UserService;
import com.yiring.app.vo.user.UserVo; import com.yiring.app.vo.user.UserVo;
import com.yiring.auth.domain.dept.Department; import com.yiring.auth.domain.dept.Department;
import com.yiring.auth.domain.dept.DepartmentRepository; import com.yiring.auth.domain.dept.DepartmentRepository;
import com.yiring.auth.domain.post.Post; import com.yiring.auth.domain.post.Post;
import com.yiring.auth.domain.post.PostRepository;
import com.yiring.auth.domain.user.User; import com.yiring.auth.domain.user.User;
import com.yiring.auth.domain.user.UserRepository; import com.yiring.auth.domain.user.UserRepository;
import com.yiring.common.core.Result; import com.yiring.common.core.Result;
...@@ -32,8 +31,7 @@ import java.io.InputStream; ...@@ -32,8 +31,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.*;
import java.util.Optional;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -71,6 +69,12 @@ public class UserServiceImpl implements UserService { ...@@ -71,6 +69,12 @@ public class UserServiceImpl implements UserService {
@Resource @Resource
DepartmentRepository departmentRepository; DepartmentRepository departmentRepository;
@Resource
DepartmentService departmentService;
@Resource
PostRepository postRepository;
@Override @Override
public Result<PageVo<UserVo>> findUserPage(UserFindParam param, PageParam pageParam) { public Result<PageVo<UserVo>> findUserPage(UserFindParam param, PageParam pageParam) {
CriteriaQuery<UserVo> cq = getUserVoCriteriaQuery(param); CriteriaQuery<UserVo> cq = getUserVoCriteriaQuery(param);
...@@ -258,6 +262,14 @@ public class UserServiceImpl implements UserService { ...@@ -258,6 +262,14 @@ public class UserServiceImpl implements UserService {
log.info(e.getMessage()); log.info(e.getMessage());
throw new RuntimeException("文件导入异常"); throw new RuntimeException("文件导入异常");
} }
// 部门信息
HashMap<String, Department> hashMap = departmentService.getStringDepartmentHashMap();
// 职位信息
Map<String, List<Post>> postMap = postRepository
.findAll()
.stream()
.collect(Collectors.groupingBy(Post::getName));
userImportExcels = userImportExcels =
userImportExcels userImportExcels
...@@ -275,6 +287,10 @@ public class UserServiceImpl implements UserService { ...@@ -275,6 +287,10 @@ public class UserServiceImpl implements UserService {
userImportExcels.forEach(userImportExcel -> { userImportExcels.forEach(userImportExcel -> {
User user = UserImportExcel.transform(userImportExcel); User user = UserImportExcel.transform(userImportExcel);
Department department = hashMap.get(userImportExcel.getDeptName());
Post post = postMap.get(userImportExcel.getPostName()).get(0);
user.setDepartment(department);
user.setPost(post);
User saveUser = userRepository.save(user); User saveUser = userRepository.save(user);
if (StrUtil.isNotEmpty(userImportExcel.getCode())) { if (StrUtil.isNotEmpty(userImportExcel.getCode())) {
LocationTag locationTag = LocationTag.builder().code(userImportExcel.getCode()).user(saveUser).build(); LocationTag locationTag = LocationTag.builder().code(userImportExcel.getCode()).user(saveUser).build();
...@@ -285,6 +301,46 @@ public class UserServiceImpl implements UserService { ...@@ -285,6 +301,46 @@ public class UserServiceImpl implements UserService {
return Result.ok(); return Result.ok();
} }
@Override
public Result<PageVo<UserVo>> indexUser(UserIndexParam param) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<UserVo> cq = cb.createQuery(UserVo.class);
Root<User> root = cq.from(User.class);
Expression<String> realName = root.get(User.Fields.realName);
Expression<String> uuid = root.get(User.Fields.uuid);
Expression<User.Type> type = root.get(User.Fields.type);
Expression<Boolean> gender = root.get(User.Fields.gender);
Expression<Boolean> isSpecial = root.get(User.Fields.isSpecial);
Expression<Department> department = root.get(User.Fields.department).get("name");
Expression<String> mobile = root.get(User.Fields.mobile);
Expression<Post> post = root.get(User.Fields.post).get("name");
Subquery<String> query = cq.subquery(String.class);
Root<LocationTag> tagRoot = query.from(LocationTag.class);
query.select(tagRoot.get(LocationTag.Fields.code));
query.where(cb.equal(tagRoot.get(LocationTag.Fields.user), root));
cq.multiselect(realName, uuid, type, department, mobile, post, query, gender, isSpecial);
List<Predicate> predicates = ListUtil.toList();
if (StrUtil.isNotEmpty(param.getStr())) {
if (StrUtil.isNumeric(param.getStr())) {
predicates.add(cb.like(root.get(User.Fields.mobile), param.getStr() + "%"));
} else {
predicates.add(cb.like(root.get(User.Fields.realName), param.getStr() + "%"));
}
}
Order order = cb.desc(root.get(BasicEntity.Fields.createTime));
cq.orderBy(order).where(predicates.toArray(new Predicate[0])).getRestriction();
List<UserVo> userVos = em.createQuery(cq).getResultList();
PageVo<UserVo> page = PageVo.build(userVos, userVos.size());
return Result.ok(page);
}
@NotNull @NotNull
private CriteriaQuery<UserVo> getUserVoCriteriaQuery(UserFindParam param) { private CriteriaQuery<UserVo> getUserVoCriteriaQuery(UserFindParam param) {
CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaBuilder cb = em.getCriteriaBuilder();
...@@ -293,6 +349,8 @@ public class UserServiceImpl implements UserService { ...@@ -293,6 +349,8 @@ public class UserServiceImpl implements UserService {
Expression<String> realName = root.get(User.Fields.realName); Expression<String> realName = root.get(User.Fields.realName);
Expression<String> uuid = root.get(User.Fields.uuid); Expression<String> uuid = root.get(User.Fields.uuid);
Expression<User.Type> type = root.get(User.Fields.type); Expression<User.Type> type = root.get(User.Fields.type);
Expression<Boolean> gender = root.get(User.Fields.gender);
Expression<Boolean> isSpecial = root.get(User.Fields.isSpecial);
Expression<Department> department = root.get(User.Fields.department).get("name"); Expression<Department> department = root.get(User.Fields.department).get("name");
Expression<String> mobile = root.get(User.Fields.mobile); Expression<String> mobile = root.get(User.Fields.mobile);
Expression<Post> post = root.get(User.Fields.post).get("name"); Expression<Post> post = root.get(User.Fields.post).get("name");
...@@ -302,7 +360,7 @@ public class UserServiceImpl implements UserService { ...@@ -302,7 +360,7 @@ public class UserServiceImpl implements UserService {
query.select(tagRoot.get(LocationTag.Fields.code)); query.select(tagRoot.get(LocationTag.Fields.code));
query.where(cb.equal(tagRoot.get(LocationTag.Fields.user), root)); query.where(cb.equal(tagRoot.get(LocationTag.Fields.user), root));
cq.multiselect(realName, uuid, type, department, mobile, post, query); cq.multiselect(realName, uuid, type, department, mobile, post, query, gender, isSpecial);
List<Predicate> predicates = ListUtil.toList(); List<Predicate> predicates = ListUtil.toList();
......
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.vo.dept; package com.yiring.app.vo.dept;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yiring.app.vo.user.UserVo; import com.yiring.app.vo.user.UserVo;
...@@ -62,15 +63,18 @@ public class DepartmentVo implements Serializable { ...@@ -62,15 +63,18 @@ public class DepartmentVo implements Serializable {
List<DepartmentVo> childList; List<DepartmentVo> childList;
public static DepartmentVo transform(Department department) { public static DepartmentVo transform(Department department) {
return DepartmentVo DepartmentVo departmentVo = DepartmentVo
.builder() .builder()
.id(department.getId()) .id(department.getId())
.name(department.getName()) .name(department.getName())
.leader(UserVo.transform(department.getLeader()))
.enable(department.getEnable()) .enable(department.getEnable())
.pid(department.getPid()) .pid(department.getPid())
.updateTime(department.getUpdateTime()) .updateTime(department.getUpdateTime())
.createTime(department.getCreateTime()) .createTime(department.getCreateTime())
.build(); .build();
if (ObjectUtil.isNotEmpty(department.getLeader())) {
departmentVo.setLeader(UserVo.transform(department.getLeader()));
}
return departmentVo;
} }
} }
...@@ -71,6 +71,12 @@ public class UserVo implements Serializable { ...@@ -71,6 +71,12 @@ public class UserVo implements Serializable {
@ApiModelProperty(value = "是否删除", example = "false") @ApiModelProperty(value = "是否删除", example = "false")
Boolean deleted; Boolean deleted;
@ApiModelProperty(value = "是否特殊", example = "false")
Boolean isSpecial;
@ApiModelProperty(value = "性别", example = "false")
Boolean gender;
@ApiModelProperty(value = "最后登录IP地址", example = "127.0.0.1") @ApiModelProperty(value = "最后登录IP地址", example = "127.0.0.1")
String lastLoginIp; String lastLoginIp;
...@@ -125,7 +131,9 @@ public class UserVo implements Serializable { ...@@ -125,7 +131,9 @@ public class UserVo implements Serializable {
String department, String department,
String mobile, String mobile,
String post, String post,
String code String code,
Boolean gender,
Boolean isSpecial
) { ) {
this.realName = realName; this.realName = realName;
this.uuid = uuid; this.uuid = uuid;
...@@ -134,6 +142,8 @@ public class UserVo implements Serializable { ...@@ -134,6 +142,8 @@ public class UserVo implements Serializable {
this.mobile = mobile; this.mobile = mobile;
this.post = post; this.post = post;
this.code = code; this.code = code;
this.gender = gender;
this.isSpecial = isSpecial;
} }
public static UserVo transformUserInfo(User user) { public static UserVo transformUserInfo(User user) {
......
/* (C) 2022 YiRing, Inc. */ /* (C) 2022 YiRing, Inc. */
package com.yiring.app.web.user; package com.yiring.app.web.user;
import com.yiring.app.param.user.UserAddParam; import com.yiring.app.param.user.*;
import com.yiring.app.param.user.UserBingTagParam;
import com.yiring.app.param.user.UserFindParam;
import com.yiring.app.param.user.UserModifyParam;
import com.yiring.app.service.user.UserService; import com.yiring.app.service.user.UserService;
import com.yiring.app.vo.user.UserVo; import com.yiring.app.vo.user.UserVo;
import com.yiring.common.core.Result; import com.yiring.common.core.Result;
...@@ -104,4 +101,10 @@ public class UserAppController { ...@@ -104,4 +101,10 @@ public class UserAppController {
public Result<String> importUser(@RequestParam("file") MultipartFile file) { public Result<String> importUser(@RequestParam("file") MultipartFile file) {
return userService.importUser(file); return userService.importUser(file);
} }
@ApiOperation("用户信息检索")
@GetMapping("indexUser")
public Result<PageVo<UserVo>> indexUser(@Valid UserIndexParam param) {
return userService.indexUser(param);
}
} }
...@@ -61,7 +61,6 @@ logging: ...@@ -61,7 +61,6 @@ logging:
level: level:
# sql bind parameter # sql bind parameter
org.hibernate.type.descriptor.sql.BasicBinder: trace org.hibernate.type.descriptor.sql.BasicBinder: trace
# 真源定位系统相关配置 # 真源定位系统相关配置
zy-config: zy-config:
host: project.yz-online.com host: project.yz-online.com
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论