用户管理相关功能
parent
91b4b995d9
commit
86c3b18e13
|
|
@ -7,6 +7,7 @@ import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
import com.jjb.saas.system.client.role.response.RoleCO;
|
||||||
import com.zcloud.basic.info.api.UserServiceI;
|
import com.zcloud.basic.info.api.UserServiceI;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
|
|
@ -24,10 +25,11 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-adapter
|
* web-adapter
|
||||||
* @Author zhangyue
|
*
|
||||||
* @Date 2025-11-04 14:07:33
|
* @Author zhangyue
|
||||||
*/
|
* @Date 2025-11-04 14:07:33
|
||||||
|
*/
|
||||||
@Api(tags = "用户信息表")
|
@Api(tags = "用户信息表")
|
||||||
@RequestMapping("/${application.gateway}/user")
|
@RequestMapping("/${application.gateway}/user")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -48,12 +50,19 @@ public class UserController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("验证用户是否存在")
|
||||||
|
@PostMapping("/verifyUser")
|
||||||
|
public Response verifyUser(@Validated @RequestBody UserVerifyQryCmd userVerifyQryCmd) {
|
||||||
|
return userService.verifyUser(userVerifyQryCmd);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("新增用户")
|
@ApiOperation("新增用户")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public SingleResponse<UserCO> add(@Validated @RequestBody UserAddCmd cmd) {
|
public SingleResponse<UserCO> add(@Validated @RequestBody UserAddCmd cmd) {
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
return userService.add(cmd);
|
return userService.add(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增相关方用户")
|
@ApiOperation("新增相关方用户")
|
||||||
@PostMapping("/saveXgf")
|
@PostMapping("/saveXgf")
|
||||||
public SingleResponse<UserCO> addXgf(@Validated @RequestBody UserXgfAddCmd cmd) {
|
public SingleResponse<UserCO> addXgf(@Validated @RequestBody UserXgfAddCmd cmd) {
|
||||||
|
|
@ -73,10 +82,11 @@ public class UserController {
|
||||||
return userService.listAll(userQryCmd);
|
return userService.listAll(userQryCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("详情")
|
@ApiOperation("详情")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public SingleResponse<UserCO> getInfoById(@PathVariable("id") Long id) {
|
public SingleResponse<UserCO> getInfoById(@PathVariable("id") Long id) {
|
||||||
return SingleResponse.of(new UserCO());
|
return userService.getInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除")
|
@ApiOperation("删除")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.command;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
import com.jjb.saas.system.client.role.facade.RoleFacade;
|
||||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||||
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
||||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||||
|
|
@ -36,6 +37,8 @@ public class UserAddExe {
|
||||||
// private RedisTemplate<String, Object> redisTemplate;
|
// private RedisTemplate<String, Object> redisTemplate;
|
||||||
@DubboReference(check = false)
|
@DubboReference(check = false)
|
||||||
private UserFacade userFacade;
|
private UserFacade userFacade;
|
||||||
|
@DubboReference
|
||||||
|
private RoleFacade roleFacade;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(UserAddCmd cmd) {
|
public boolean execute(UserAddCmd cmd) {
|
||||||
|
|
@ -44,7 +47,6 @@ public class UserAddExe {
|
||||||
UserE userE = new UserE();
|
UserE userE = new UserE();
|
||||||
BeanUtils.copyProperties(cmd, userE);
|
BeanUtils.copyProperties(cmd, userE);
|
||||||
userE.initAdd(tenantId, userE);
|
userE.initAdd(tenantId, userE);
|
||||||
|
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
res = userGateway.add(userE);
|
res = userGateway.add(userE);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,15 @@ package com.zcloud.basic.info.command.query;
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.system.client.role.facade.RoleFacade;
|
||||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||||
|
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.UserE;
|
||||||
import com.zcloud.basic.info.dto.UserPageQry;
|
import com.zcloud.basic.info.dto.UserPageQry;
|
||||||
import com.zcloud.basic.info.dto.UserQryCmd;
|
import com.zcloud.basic.info.dto.UserQryCmd;
|
||||||
|
import com.zcloud.basic.info.dto.UserVerifyQryCmd;
|
||||||
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
|
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
||||||
|
|
@ -22,17 +28,19 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
* @Author zhangyue
|
*
|
||||||
* @Date 2025-11-04 14:07:36
|
* @Author zhangyue
|
||||||
*/
|
* @Date 2025-11-04 14:07:36
|
||||||
|
*/
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserQueryExe {
|
public class UserQueryExe {
|
||||||
private final UserRepository userRepository;
|
private final UserRepository userRepository;
|
||||||
|
private final UserGateway userGateway;
|
||||||
private final UserCoConvertor userCoConvertor;
|
private final UserCoConvertor userCoConvertor;
|
||||||
|
private final RoleFacade roleFacade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
|
|
@ -41,7 +49,7 @@ public class UserQueryExe {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public PageResponse<UserCO> execute(UserPageQry userPageQry) {
|
public PageResponse<UserCO> execute(UserPageQry userPageQry) {
|
||||||
Map<String,Object> params = PageQueryHelper.toHashMap(userPageQry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(userPageQry);
|
||||||
PageResponse<UserDO> pageResponse = userRepository.listPage(params);
|
PageResponse<UserDO> pageResponse = userRepository.listPage(params);
|
||||||
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
|
@ -55,13 +63,41 @@ public class UserQueryExe {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public MultiResponse<UserCO> executeListAll(UserQryCmd userQryCmd) {
|
public MultiResponse<UserCO> executeListAll(UserQryCmd userQryCmd) {
|
||||||
Map<String,Object> params = PageQueryHelper.toHashMap(userQryCmd);
|
Map<String, Object> params = PageQueryHelper.toHashMap(userQryCmd);
|
||||||
List<UserDO> imgFilesDOList = userRepository.listAll(params);
|
List<UserDO> imgFilesDOList = userRepository.listAll(params);
|
||||||
List<UserCO> imgFilesCOList = userCoConvertor.converDOsToCOs(imgFilesDOList);
|
List<UserCO> imgFilesCOList = userCoConvertor.converDOsToCOs(imgFilesDOList);
|
||||||
return MultiResponse.of(imgFilesCOList);
|
return MultiResponse.of(imgFilesCOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SingleResponse<UserCO> executeGetInfo(Long id) {
|
||||||
|
UserDO userDO = userRepository.getInfoById(id);
|
||||||
|
UserCO userCO = new UserCO();
|
||||||
|
BeanUtils.copyProperties(userDO, userCO);
|
||||||
|
return SingleResponse.of(userCO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证用户是否存在
|
||||||
|
*
|
||||||
|
* @param userVerifyQryCmd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Response executeVerifyUser(UserVerifyQryCmd userVerifyQryCmd) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(userVerifyQryCmd);
|
||||||
|
Long count = userGateway.countUserByUsername(params);
|
||||||
|
UserE userE = new UserE();
|
||||||
|
return userE.verifyUser(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<UserCO> listByUserIds(Collection<Long> collection) {
|
public List<UserCO> listByUserIds(Collection<Long> collection) {
|
||||||
QueryWrapper<UserDO> userDOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<UserDO> userDOQueryWrapper = new QueryWrapper<>();
|
||||||
userDOQueryWrapper.in("id",collection);
|
userDOQueryWrapper.in("id",collection);
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,8 @@ package com.zcloud.basic.info.service;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.zcloud.basic.info.api.UserServiceI;
|
import com.zcloud.basic.info.api.UserServiceI;
|
||||||
import com.zcloud.basic.info.command.UserAddExe;
|
import com.zcloud.basic.info.command.UserAddExe;
|
||||||
import com.zcloud.basic.info.command.UserRemoveExe;
|
import com.zcloud.basic.info.command.UserRemoveExe;
|
||||||
|
|
@ -12,20 +11,18 @@ import com.zcloud.basic.info.command.UserUpdateExe;
|
||||||
import com.zcloud.basic.info.command.query.UserQueryExe;
|
import com.zcloud.basic.info.command.query.UserQueryExe;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
|
||||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
* @Author zhangyue
|
*
|
||||||
* @Date 2025-11-04 14:07:37
|
* @Author zhangyue
|
||||||
*/
|
* @Date 2025-11-04 14:07:37
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserServiceImpl implements UserServiceI {
|
public class UserServiceImpl implements UserServiceI {
|
||||||
|
|
@ -35,7 +32,7 @@ public class UserServiceImpl implements UserServiceI {
|
||||||
private final UserQueryExe userQueryExe;
|
private final UserQueryExe userQueryExe;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<UserCO> listPage(UserPageQry qry){
|
public PageResponse<UserCO> listPage(UserPageQry qry) {
|
||||||
|
|
||||||
return userQueryExe.execute(qry);
|
return userQueryExe.execute(qry);
|
||||||
}
|
}
|
||||||
|
|
@ -89,5 +86,16 @@ public class UserServiceImpl implements UserServiceI {
|
||||||
public UserCO getInfoByUserId(Long aLong) {
|
public UserCO getInfoByUserId(Long aLong) {
|
||||||
return userQueryExe.getInfoByUserId(aLong);
|
return userQueryExe.getInfoByUserId(aLong);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<UserCO> getInfoById(Long id) {
|
||||||
|
return userQueryExe.executeGetInfo(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response verifyUser(UserVerifyQryCmd userVerifyQryCmd) {
|
||||||
|
return userQueryExe.executeVerifyUser(userVerifyQryCmd);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.api;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
|
|
@ -34,6 +35,12 @@ public interface UserServiceI {
|
||||||
|
|
||||||
List<UserCO> getUserList();
|
List<UserCO> getUserList();
|
||||||
|
|
||||||
|
|
||||||
|
SingleResponse<UserCO> getInfoById(Long id);
|
||||||
|
Response verifyUser(UserVerifyQryCmd userVerifyQryCmd);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UserCO getInfoByUserId(Long aLong);
|
UserCO getInfoByUserId(Long aLong);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ public class UserAddCmd extends Command {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
@NotNull(message = "企业id不能为空")
|
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public class UserPageQry extends PageQuery {
|
||||||
private Long eqCorpinfoId;
|
private Long eqCorpinfoId;
|
||||||
private Long eqDepartmentId;
|
private Long eqDepartmentId;
|
||||||
private Long eqPostId;
|
private Long eqPostId;
|
||||||
|
private String likeName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,5 +30,6 @@ public class UserQryCmd {
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
private Long departmentId;
|
private Long departmentId;
|
||||||
private Long postId;
|
private Long postId;
|
||||||
|
private String username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author zhangyue
|
||||||
|
* @Date 2025-11-04 14:07:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserVerifyQryCmd {
|
||||||
|
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||||
|
@NotEmpty(message = "登录账号不能为空")
|
||||||
|
private String username;
|
||||||
|
@ApiModelProperty(value = "用户id", name = "id", required = true)
|
||||||
|
@NotNull(message = "用户id不能为空")
|
||||||
|
private Long id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,6 @@ public class UserXgfAddCmd extends Command {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
@NotNull(message = "企业id不能为空")
|
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
||||||
|
|
@ -48,31 +47,26 @@ public class UserXgfAddCmd extends Command {
|
||||||
@NotNull(message = "部门id不能为空")
|
@NotNull(message = "部门id不能为空")
|
||||||
private Long departmentId;
|
private Long departmentId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
@ApiModelProperty(value = "岗位id", name = "postId")
|
||||||
@NotNull(message = "岗位id不能为空")
|
|
||||||
private Long postId;
|
private Long postId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
@ApiModelProperty(value = "角色id", name = "roleId")
|
||||||
@NotNull(message = "角色id不能为空")
|
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "邮箱", name = "email", required = true)
|
@ApiModelProperty(value = "邮箱", name = "email")
|
||||||
@NotEmpty(message = "邮箱不能为空")
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@ApiModelProperty(value = "手机号", name = "phone")
|
@ApiModelProperty(value = "手机号", name = "phone")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
@ApiModelProperty(value = "人员类型编码", name = "personnelType")
|
||||||
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空")
|
|
||||||
private String personnelType;
|
private String personnelType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName")
|
||||||
@NotEmpty(message = "人员类型翻译不能为空")
|
|
||||||
private String personnelTypeName;
|
private String personnelTypeName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true)
|
@ApiModelProperty(value = "民族编码", name = "nation", required = true)
|
||||||
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
|
@NotEmpty(message = "民族编码不能为空")
|
||||||
private String nation;
|
private String nation;
|
||||||
|
|
||||||
@ApiModelProperty(value = "民族名称", name = "nationName", required = true)
|
@ApiModelProperty(value = "民族名称", name = "nationName", required = true)
|
||||||
|
|
@ -95,20 +89,17 @@ public class UserXgfAddCmd extends Command {
|
||||||
@NotEmpty(message = "户口所在地不能为空")
|
@NotEmpty(message = "户口所在地不能为空")
|
||||||
private String locationAddress;
|
private String locationAddress;
|
||||||
|
|
||||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
@ApiModelProperty(value = "人员在部门中的排序", name = "sort")
|
||||||
@NotNull(message = "人员在部门中的排序不能为空")
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag")
|
||||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
|
||||||
private Integer departmentLeaderFlag;
|
private Integer departmentLeaderFlag;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true)
|
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag")
|
||||||
@NotNull(message = "是否分管领导0否1是不能为空")
|
|
||||||
private Integer deputyLeaderFlag;
|
private Integer deputyLeaderFlag;
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true)
|
@ApiModelProperty(value = "文化程度", name = "culturalLevel", required = true)
|
||||||
@NotEmpty(message = "文化程度 数据字典不能为空")
|
@NotEmpty(message = "文化程度不能为空")
|
||||||
private String culturalLevel;
|
private String culturalLevel;
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
||||||
|
|
|
||||||
|
|
@ -161,5 +161,8 @@ public class UserCO extends ClientObject {
|
||||||
private String mappingUserName;
|
private String mappingUserName;
|
||||||
private String mappingPostName;
|
private String mappingPostName;
|
||||||
private String mappingDeptName;
|
private String mappingDeptName;
|
||||||
|
// 入职状态
|
||||||
|
@ApiModelProperty(value = "入职状态")
|
||||||
|
private Integer employmentFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.zcloud.basic.info.domain.gateway;
|
||||||
|
|
||||||
import com.zcloud.basic.info.domain.model.UserE;
|
import com.zcloud.basic.info.domain.model.UserE;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-domain
|
* web-domain
|
||||||
*
|
*
|
||||||
|
|
@ -27,5 +29,7 @@ public interface UserGateway {
|
||||||
Boolean deletedUserById(Long id);
|
Boolean deletedUserById(Long id);
|
||||||
|
|
||||||
Boolean deletedUserByIds(Long[] id);
|
Boolean deletedUserByIds(Long[] id);
|
||||||
|
|
||||||
|
Long countUserByUsername(Map<String,Object> params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.basic.info.domain.model;
|
package com.zcloud.basic.info.domain.model;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.jjb.saas.framework.domain.model.BaseE;
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
import com.zcloud.gbscommon.utils.DateUtil;
|
import com.zcloud.gbscommon.utils.DateUtil;
|
||||||
import com.zcloud.gbscommon.utils.FileUpload;
|
import com.zcloud.gbscommon.utils.FileUpload;
|
||||||
|
|
@ -99,10 +100,22 @@ public class UserE extends BaseE {
|
||||||
//政治面貌名称
|
//政治面貌名称
|
||||||
private String politicalAffiliationName;
|
private String politicalAffiliationName;
|
||||||
|
|
||||||
|
// 入职状态
|
||||||
|
private Integer employmentFlag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void initAdd(Long tenantId, UserE userE) {
|
public void initAdd(Long tenantId, UserE userE) {
|
||||||
userE.setUserId(Tools.get32UUID());
|
userE.setUserId(Tools.get32UUID());
|
||||||
userE.setTenantId(!ObjectUtils.isEmpty(userE.getTenantId())? userE.getTenantId() : tenantId);
|
userE.setTenantId(!ObjectUtils.isEmpty(userE.getTenantId())? userE.getTenantId() : tenantId);
|
||||||
|
userE.setCorpinfoId(!ObjectUtils.isEmpty(userE.getCorpinfoId())? userE.getCorpinfoId() : tenantId);
|
||||||
|
}
|
||||||
|
public Response verifyUser(Long userCount) {
|
||||||
|
if (userCount > 0) {
|
||||||
|
return Response.buildFailure("用户名已经存在,请联系管理员");
|
||||||
|
} else {
|
||||||
|
return Response.buildSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-infrastructure
|
* web-infrastructure
|
||||||
|
|
@ -50,5 +51,11 @@ public class UserGatewayImpl implements UserGateway {
|
||||||
public Boolean deletedUserByIds(Long[] ids) {
|
public Boolean deletedUserByIds(Long[] ids) {
|
||||||
return userRepository.removeByIds(Arrays.asList(ids));
|
return userRepository.removeByIds(Arrays.asList(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countUserByUsername(Map<String,Object> params) {
|
||||||
|
Long userCount = userRepository.countUserByUsername(params);
|
||||||
|
return userCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,10 @@ public class UserDO extends BaseDO {
|
||||||
@ApiModelProperty(value = "政治面貌名称")
|
@ApiModelProperty(value = "政治面貌名称")
|
||||||
private String politicalAffiliationName;
|
private String politicalAffiliationName;
|
||||||
|
|
||||||
|
// 入职状态
|
||||||
|
@ApiModelProperty(value = "入职状态")
|
||||||
|
private Integer employmentFlag;
|
||||||
|
|
||||||
public UserDO(String userId) {
|
public UserDO(String userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,7 @@ public interface UserMapper extends BaseMapper<UserDO> {
|
||||||
List<UserDO> selectListAll(@Param("params") Map<String, Object> params);
|
List<UserDO> selectListAll(@Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
IPage<UserDO> selectUserPage(IPage<UserDO> page, @Param("ew") QueryWrapper<UserDO> queryWrapper);
|
IPage<UserDO> selectUserPage(IPage<UserDO> page, @Param("ew") QueryWrapper<UserDO> queryWrapper);
|
||||||
|
|
||||||
|
UserDO getInfoById(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,10 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
||||||
|
|
||||||
Boolean checkUserDepartment(Long id);
|
Boolean checkUserDepartment(Long id);
|
||||||
Boolean checkUserDepartment(Long[] ids);
|
Boolean checkUserDepartment(Long[] ids);
|
||||||
|
|
||||||
|
UserDO getInfoById(Long id);
|
||||||
|
Long countUserByUsername(Map<String,Object> params);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,18 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDO getInfoById(Long id) {
|
||||||
|
return userMapper.getInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countUserByUsername(Map<String, Object> params) {
|
||||||
|
QueryWrapper<UserDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("username", params.get("username"));
|
||||||
|
queryWrapper.ne("id", params.get("id"));
|
||||||
|
return userMapper.selectCount(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,5 +81,61 @@
|
||||||
left join post p on p.id = u.post_id
|
left join post p on p.id = u.post_id
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getInfoById" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||||
|
select
|
||||||
|
d.name as department_name,
|
||||||
|
p.post_name,
|
||||||
|
u.id,
|
||||||
|
u.user_id,
|
||||||
|
u.username,
|
||||||
|
u.name,
|
||||||
|
u.corpinfo_id,
|
||||||
|
u.main_corp_flag,
|
||||||
|
u.user_type,
|
||||||
|
u.department_id,
|
||||||
|
u.post_id,
|
||||||
|
u.role_id,
|
||||||
|
u.email,
|
||||||
|
u.phone,
|
||||||
|
u.personnel_type,
|
||||||
|
u.personnel_type_name,
|
||||||
|
u.nation,
|
||||||
|
u.nation_name,
|
||||||
|
u.user_id_card,
|
||||||
|
u.user_avatar_url,
|
||||||
|
u.current_address,
|
||||||
|
u.location_address,
|
||||||
|
u.sort,
|
||||||
|
u.version,
|
||||||
|
u.create_id,
|
||||||
|
u.create_name,
|
||||||
|
u.create_time,
|
||||||
|
u.update_id,
|
||||||
|
u.update_name,
|
||||||
|
u.update_time,
|
||||||
|
u.remarks,
|
||||||
|
u.delete_enum,
|
||||||
|
u.tenant_id,
|
||||||
|
u.org_id,
|
||||||
|
u.env,
|
||||||
|
u.department_leader_flag,
|
||||||
|
u.deputy_leader_flag,
|
||||||
|
u.cultural_level,
|
||||||
|
u.cultural_level_name,
|
||||||
|
u.marital_status,
|
||||||
|
u.marital_status_name,
|
||||||
|
u.political_affiliation,
|
||||||
|
u.political_affiliation_name
|
||||||
|
from user u
|
||||||
|
left join corp_info c on c.id = u.corpinfo_id
|
||||||
|
left join department d on d.id = u.department_id
|
||||||
|
left join post p on p.id = u.post_id
|
||||||
|
<where>
|
||||||
|
u.id = #{id}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue