用户管理功能
parent
f67b69ed04
commit
ade0f82cb5
|
|
@ -8,9 +8,7 @@ import com.alibaba.cola.dto.SingleResponse;
|
|||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.api.UserServiceI;
|
||||
import com.zcloud.basic.info.dto.UserAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserPageQry;
|
||||
import com.zcloud.basic.info.dto.UserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -32,12 +30,18 @@ import java.util.ArrayList;
|
|||
public class UserController {
|
||||
private final UserServiceI userService;
|
||||
|
||||
@ApiOperation("新增")
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<UserCO> add(@Validated @RequestBody UserAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return userService.add(cmd);
|
||||
}
|
||||
@ApiOperation("新增相关方用户")
|
||||
@PostMapping("/saveXgf")
|
||||
public SingleResponse<UserCO> addXgf(@Validated @RequestBody UserXgfAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
return userService.addXgf(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
|
|
@ -47,8 +51,8 @@ public class UserController {
|
|||
|
||||
@ApiOperation("所有数据")
|
||||
@GetMapping("/listAll")
|
||||
public MultiResponse<UserCO> listAll() {
|
||||
return MultiResponse.of(new ArrayList<UserCO>());
|
||||
public MultiResponse<UserCO> listAll(UserQryCmd userQryCmd) {
|
||||
return userService.listAll(userQryCmd);
|
||||
}
|
||||
|
||||
@ApiOperation("详情")
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
||||
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.UserAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserXgfAddCmd;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -21,14 +31,50 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class UserAddExe {
|
||||
private final UserGateway userGateway;
|
||||
private UserCoConvertor userCoConvertor;
|
||||
// @Autowired
|
||||
// private RedisTemplate<String, Object> redisTemplate;
|
||||
@DubboReference(check = false)
|
||||
private UserFacade userFacade;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(UserAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
Long tenantId = ssoUser.getTenantId();
|
||||
UserE userE = new UserE();
|
||||
BeanUtils.copyProperties(cmd, userE);
|
||||
userE.initAdd(tenantId, userE);
|
||||
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userGateway.add(userE);
|
||||
// FacadeUserAddCmd facadeUserAddCmd = new FacadeUserAddCmd();
|
||||
// facadeUserAddCmd.setAccount(userE.getUsername());
|
||||
// FacadeUserAddCmd facadeUserAddCmd = userCoConvertor.converEToFacadeUserAddCmd(userE);
|
||||
// userFacade.addUser(facadeUserAddCmd);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean executeXgf(UserXgfAddCmd cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
Long tenantId = ssoUser.getTenantId();
|
||||
UserE userE = new UserE();
|
||||
BeanUtils.copyProperties(cmd, userE);
|
||||
userE.initAdd(tenantId, userE);
|
||||
|
||||
boolean res = false;
|
||||
try {
|
||||
res = userGateway.add(userE);
|
||||
// FacadeUserAddCmd facadeUserAddCmd = new FacadeUserAddCmd();
|
||||
// facadeUserAddCmd.setAccount(userE.getUsername());
|
||||
// FacadeUserAddCmd facadeUserAddCmd = userCoConvertor.converEToFacadeUserAddCmd(userE);
|
||||
// userFacade.addUser(facadeUserAddCmd);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.zcloud.basic.info.command.convertor;
|
||||
|
||||
import com.jjb.saas.system.client.user.request.FacadeUserAddCmd;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
|
@ -20,5 +22,8 @@ public interface UserCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<UserCO> converDOsToCOs(List<UserDO> userDOs);
|
||||
|
||||
FacadeUserAddCmd converEToFacadeUserAddCmd(UserE userE);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ public class ImgFilesQueryExe {
|
|||
* @return
|
||||
*/
|
||||
public PageResponse<ImgFilesCO> execute(ImgFilesPageQry imgFilesPageQry) {
|
||||
Map<String,Object> parmas = PageQueryHelper.toHashMap(imgFilesPageQry);
|
||||
PageResponse<ImgFilesDO> pageResponse = imgFilesRepository.listPage(parmas);
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(imgFilesPageQry);
|
||||
PageResponse<ImgFilesDO> pageResponse = imgFilesRepository.listPage(params);
|
||||
List<ImgFilesCO> examCenterCOS = imgFilesCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
|
@ -48,8 +48,8 @@ public class ImgFilesQueryExe {
|
|||
* @return
|
||||
*/
|
||||
public MultiResponse<ImgFilesCO> executeList(ImgFilesQryCmd imgFilesQryCmd) {
|
||||
Map<String,Object> parmas = PageQueryHelper.toHashMap(imgFilesQryCmd);
|
||||
List<ImgFilesDO> imgFilesDOList = imgFilesRepository.listAll(parmas);
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(imgFilesQryCmd);
|
||||
List<ImgFilesDO> imgFilesDOList = imgFilesRepository.listAll(params);
|
||||
List<ImgFilesCO> imgFilesCOList = imgFilesCoConvertor.converDOsToCOs(imgFilesDOList);
|
||||
return MultiResponse.of(imgFilesCOList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
package com.zcloud.basic.info.command.query;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||
import com.zcloud.basic.info.dto.UserPageQry;
|
||||
import com.zcloud.basic.info.dto.UserQryCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.ImgFilesCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -38,5 +43,22 @@ public class UserQueryExe {
|
|||
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询集合
|
||||
*
|
||||
* @param userQryCmd
|
||||
* @return
|
||||
*/
|
||||
public MultiResponse<UserCO> executeListAll(UserQryCmd userQryCmd) {
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(userQryCmd);
|
||||
List<UserDO> imgFilesDOList = userRepository.listAll(params);
|
||||
List<UserCO> imgFilesCOList = userCoConvertor.converDOsToCOs(imgFilesDOList);
|
||||
return MultiResponse.of(imgFilesCOList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.service;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.UserServiceI;
|
||||
|
|
@ -7,9 +8,7 @@ import com.zcloud.basic.info.command.UserAddExe;
|
|||
import com.zcloud.basic.info.command.UserRemoveExe;
|
||||
import com.zcloud.basic.info.command.UserUpdateExe;
|
||||
import com.zcloud.basic.info.command.query.UserQueryExe;
|
||||
import com.zcloud.basic.info.dto.UserAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserPageQry;
|
||||
import com.zcloud.basic.info.dto.UserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -40,6 +39,13 @@ public class UserServiceImpl implements UserServiceI {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SingleResponse addXgf(UserXgfAddCmd cmd) {
|
||||
userAddExe.executeXgf(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(UserUpdateCmd userUpdateCmd) {
|
||||
userUpdateExe.execute(userUpdateCmd);
|
||||
|
|
@ -54,5 +60,10 @@ public class UserServiceImpl implements UserServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
userRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<UserCO> listAll(UserQryCmd userQryCmd) {
|
||||
return userQueryExe.executeListAll(userQryCmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package com.zcloud.basic.info.api;
|
||||
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.dto.UserAddCmd;
|
||||
import com.zcloud.basic.info.dto.UserPageQry;
|
||||
import com.zcloud.basic.info.dto.UserUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
|
||||
/**
|
||||
|
|
@ -18,10 +17,14 @@ public interface UserServiceI {
|
|||
|
||||
SingleResponse<UserCO> add(UserAddCmd cmd);
|
||||
|
||||
SingleResponse<UserCO> addXgf(UserXgfAddCmd cmd);
|
||||
|
||||
void edit(UserUpdateCmd cmd);
|
||||
|
||||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
MultiResponse<UserCO> listAll(UserQryCmd userQryCmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ import javax.validation.constraints.NotNull;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键id老系统id", name = "userId", required = true)
|
||||
@NotEmpty(message = "业务主键id老系统id不能为空")
|
||||
@ApiModelProperty(value = "业务主键id老系统id", name = "userId")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||
|
|
@ -49,84 +48,71 @@ public class UserAddCmd extends Command {
|
|||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||
@NotNull(message = "岗位id不能为空")
|
||||
@ApiModelProperty(value = "岗位id", name = "postId")
|
||||
private Long postId;
|
||||
|
||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
||||
@NotNull(message = "角色id不能为空")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", name = "email", required = true)
|
||||
@NotEmpty(message = "邮箱不能为空")
|
||||
@ApiModelProperty(value = "邮箱", name = "email")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "手机号", name = "phone")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
||||
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空")
|
||||
@NotEmpty(message = "人员类型不能为空")
|
||||
private String personnelType;
|
||||
|
||||
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
||||
@NotEmpty(message = "人员类型翻译不能为空")
|
||||
@NotEmpty(message = "人员类型不能为空")
|
||||
private String personnelTypeName;
|
||||
|
||||
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true)
|
||||
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
|
||||
@ApiModelProperty(value = "民族编码", name = "nation")
|
||||
private String nation;
|
||||
|
||||
@ApiModelProperty(value = "民族名称", name = "nationName", required = true)
|
||||
@NotEmpty(message = "民族名称不能为空")
|
||||
@ApiModelProperty(value = "民族名称", name = "nationName")
|
||||
private String nationName;
|
||||
|
||||
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true)
|
||||
@NotEmpty(message = "身份证号不能为空")
|
||||
@ApiModelProperty(value = "身份证号", name = "userIdCard")
|
||||
private String userIdCard;
|
||||
|
||||
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true)
|
||||
@NotEmpty(message = "人脸头像url不能为空")
|
||||
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl")
|
||||
private String userAvatarUrl;
|
||||
|
||||
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true)
|
||||
@NotEmpty(message = "现住址不能为空")
|
||||
@ApiModelProperty(value = "现住址", name = "currentAddress")
|
||||
private String currentAddress;
|
||||
|
||||
@ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true)
|
||||
@NotEmpty(message = "户口所在地不能为空")
|
||||
@ApiModelProperty(value = "户口所在地", name = "locationAddress")
|
||||
private String locationAddress;
|
||||
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
||||
@NotNull(message = "人员在部门中的排序不能为空")
|
||||
// TODO 待确认企业端和监管端是否必填
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag")
|
||||
private Integer departmentLeaderFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true)
|
||||
@NotNull(message = "是否分管领导0否1是不能为空")
|
||||
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag")
|
||||
private Integer deputyLeaderFlag;
|
||||
|
||||
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true)
|
||||
@NotEmpty(message = "文化程度 数据字典不能为空")
|
||||
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel")
|
||||
private String culturalLevel;
|
||||
|
||||
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
||||
@NotEmpty(message = "文化程度名称不能为空")
|
||||
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName")
|
||||
private String culturalLevelName;
|
||||
|
||||
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true)
|
||||
@NotEmpty(message = "婚姻状态不能为空")
|
||||
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus")
|
||||
private String maritalStatus;
|
||||
|
||||
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true)
|
||||
@NotEmpty(message = "婚姻状态名称不能为空")
|
||||
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName")
|
||||
private String maritalStatusName;
|
||||
|
||||
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true)
|
||||
@NotEmpty(message = "政治面貌不能为空")
|
||||
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation")
|
||||
private String politicalAffiliation;
|
||||
|
||||
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true)
|
||||
@NotEmpty(message = "政治面貌名称不能为空")
|
||||
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName")
|
||||
private String politicalAffiliationName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ public class UserPageQry extends PageQuery {
|
|||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeUserId;
|
||||
private Long eqCorpinfoId;
|
||||
private Long eqDepartmentId;
|
||||
private Long eqPostId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:36
|
||||
*/
|
||||
@Data
|
||||
public class UserQryCmd {
|
||||
|
||||
/**
|
||||
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||
* - `eq`: 等值查询,对应SQL的=操作符
|
||||
* - `gt`: 大于比较查询
|
||||
* - `lt`: 小于比较查询
|
||||
* - `ge`: 大于等于比较查询
|
||||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String eqCorpinfoId;
|
||||
private String eqDepartmentId;
|
||||
private String eqPostId;
|
||||
|
||||
private Long corpinfoId;
|
||||
private Long departmentId;
|
||||
private Long postId;
|
||||
}
|
||||
|
||||
|
|
@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull;
|
|||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:38
|
||||
*/
|
||||
|
|
@ -27,82 +28,56 @@ public class UserUpdateCmd extends Command {
|
|||
@NotEmpty(message = "业务主键id老系统id不能为空")
|
||||
private String userId;
|
||||
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
private String username;
|
||||
@ApiModelProperty(value = "姓名", name = "name", required = true)
|
||||
@NotEmpty(message = "姓名不能为空")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
||||
@NotNull(message = "是否主账号1是0否不能为空")
|
||||
private Integer mainCorpFlag;
|
||||
@ApiModelProperty(value = "用户类型,1监管2企业3相关方", name = "userType", required = true)
|
||||
@NotNull(message = "用户类型,1监管2企业3相关方不能为空")
|
||||
private Integer userType;
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||
@NotNull(message = "岗位id不能为空")
|
||||
private Long postId;
|
||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
||||
@NotNull(message = "角色id不能为空")
|
||||
private Long roleId;
|
||||
@ApiModelProperty(value = "邮箱", name = "email", required = true)
|
||||
@NotEmpty(message = "邮箱不能为空")
|
||||
private String email;
|
||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
||||
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空")
|
||||
private String personnelType;
|
||||
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
||||
@NotEmpty(message = "人员类型翻译不能为空")
|
||||
private String personnelTypeName;
|
||||
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true)
|
||||
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
|
||||
private String nation;
|
||||
@ApiModelProperty(value = "民族名称", name = "nationName", required = true)
|
||||
@NotEmpty(message = "民族名称不能为空")
|
||||
private String nationName;
|
||||
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true)
|
||||
@NotEmpty(message = "身份证号不能为空")
|
||||
private String userIdCard;
|
||||
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true)
|
||||
@NotEmpty(message = "人脸头像url不能为空")
|
||||
private String userAvatarUrl;
|
||||
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true)
|
||||
@NotEmpty(message = "现住址不能为空")
|
||||
private String currentAddress;
|
||||
@ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true)
|
||||
@NotEmpty(message = "户口所在地不能为空")
|
||||
private String locationAddress;
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
||||
@NotNull(message = "人员在部门中的排序不能为空")
|
||||
private Integer sort;
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
||||
private Integer departmentLeaderFlag;
|
||||
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true)
|
||||
@NotNull(message = "是否分管领导0否1是不能为空")
|
||||
private Integer deputyLeaderFlag;
|
||||
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true)
|
||||
@NotEmpty(message = "文化程度 数据字典不能为空")
|
||||
private String culturalLevel;
|
||||
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
||||
@NotEmpty(message = "文化程度名称不能为空")
|
||||
private String culturalLevelName;
|
||||
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true)
|
||||
@NotEmpty(message = "婚姻状态不能为空")
|
||||
private String maritalStatus;
|
||||
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true)
|
||||
@NotEmpty(message = "婚姻状态名称不能为空")
|
||||
private String maritalStatusName;
|
||||
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true)
|
||||
@NotEmpty(message = "政治面貌不能为空")
|
||||
private String politicalAffiliation;
|
||||
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true)
|
||||
@NotEmpty(message = "政治面貌名称不能为空")
|
||||
private String politicalAffiliationName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-11-04 14:07:12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserXgfAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键id老系统id", name = "userId")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "登录账号", name = "username", required = true)
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "姓名", name = "name", required = true)
|
||||
@NotEmpty(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "是否主账号1是0否", name = "mainCorpFlag", required = true)
|
||||
@NotNull(message = "是否主账号1是0否不能为空")
|
||||
private Integer mainCorpFlag;
|
||||
|
||||
@ApiModelProperty(value = "用户类型,1监管2企业3相关方", name = "userType", required = true)
|
||||
@NotNull(message = "用户类型,1监管2企业3相关方不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||
@NotNull(message = "岗位id不能为空")
|
||||
private Long postId;
|
||||
|
||||
@ApiModelProperty(value = "角色id", name = "roleId", required = true)
|
||||
@NotNull(message = "角色id不能为空")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", name = "email", required = true)
|
||||
@NotEmpty(message = "邮箱不能为空")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "手机号", name = "phone")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
||||
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空")
|
||||
private String personnelType;
|
||||
|
||||
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
||||
@NotEmpty(message = "人员类型翻译不能为空")
|
||||
private String personnelTypeName;
|
||||
|
||||
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true)
|
||||
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
|
||||
private String nation;
|
||||
|
||||
@ApiModelProperty(value = "民族名称", name = "nationName", required = true)
|
||||
@NotEmpty(message = "民族名称不能为空")
|
||||
private String nationName;
|
||||
|
||||
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true)
|
||||
@NotEmpty(message = "身份证号不能为空")
|
||||
private String userIdCard;
|
||||
|
||||
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true)
|
||||
@NotEmpty(message = "人脸头像url不能为空")
|
||||
private String userAvatarUrl;
|
||||
|
||||
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true)
|
||||
@NotEmpty(message = "现住址不能为空")
|
||||
private String currentAddress;
|
||||
|
||||
@ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true)
|
||||
@NotEmpty(message = "户口所在地不能为空")
|
||||
private String locationAddress;
|
||||
|
||||
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
|
||||
@NotNull(message = "人员在部门中的排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
|
||||
@NotNull(message = "是否部门领导0否1是不能为空")
|
||||
private Integer departmentLeaderFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true)
|
||||
@NotNull(message = "是否分管领导0否1是不能为空")
|
||||
private Integer deputyLeaderFlag;
|
||||
|
||||
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true)
|
||||
@NotEmpty(message = "文化程度 数据字典不能为空")
|
||||
private String culturalLevel;
|
||||
|
||||
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
||||
@NotEmpty(message = "文化程度名称不能为空")
|
||||
private String culturalLevelName;
|
||||
|
||||
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true)
|
||||
@NotEmpty(message = "婚姻状态不能为空")
|
||||
private String maritalStatus;
|
||||
|
||||
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true)
|
||||
@NotEmpty(message = "婚姻状态名称不能为空")
|
||||
private String maritalStatusName;
|
||||
|
||||
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true)
|
||||
@NotEmpty(message = "政治面貌不能为空")
|
||||
private String politicalAffiliation;
|
||||
|
||||
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true)
|
||||
@NotEmpty(message = "政治面貌名称不能为空")
|
||||
private String politicalAffiliationName;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -31,6 +32,8 @@ public class UserCO extends ClientObject {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpinfoName;
|
||||
//是否主账号1是0否
|
||||
@ApiModelProperty(value = "是否主账号1是0否")
|
||||
private Integer mainCorpFlag;
|
||||
|
|
@ -40,9 +43,15 @@ public class UserCO extends ClientObject {
|
|||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Long roleId;
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ public class ImgFilesE extends BaseE {
|
|||
public void deleteFile(String filePath) throws Exception {
|
||||
Smb.deleteFile(filePath);
|
||||
}
|
||||
|
||||
public void deleteFileList(List<ImgFilesE> imgFilesEList) throws Exception {
|
||||
for (ImgFilesE imgFilesE : imgFilesEList) {
|
||||
Smb.deleteFile(imgFilesE.getFilePath());
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.gbscommon.utils.DateUtil;
|
||||
import com.zcloud.gbscommon.utils.FileUpload;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
|
|
@ -94,5 +98,11 @@ public class UserE extends BaseE {
|
|||
private String politicalAffiliation;
|
||||
//政治面貌名称
|
||||
private String politicalAffiliationName;
|
||||
|
||||
|
||||
public void initAdd(Long tenantId, UserE userE) {
|
||||
userE.setUserId(Tools.get32UUID());
|
||||
userE.setTenantId(!ObjectUtils.isEmpty(userE.getTenantId())? userE.getTenantId() : tenantId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.gatewayimpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
import com.zcloud.basic.info.domain.model.UserE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
|
|
@ -38,7 +39,11 @@ public class UserGatewayImpl implements UserGateway {
|
|||
|
||||
@Override
|
||||
public Boolean deletedUserById(Long id) {
|
||||
return userRepository.removeById(id);
|
||||
UpdateWrapper<UserDO> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", id)
|
||||
.eq("delete_enum", "FALSE")
|
||||
.set("delete_enum", "TRUE");
|
||||
return userRepository.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -30,6 +31,9 @@ public class UserDO extends BaseDO {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpinfoName;
|
||||
//是否主账号1是0否
|
||||
@ApiModelProperty(value = "是否主账号1是0否")
|
||||
private Integer mainCorpFlag;
|
||||
|
|
@ -39,9 +43,15 @@ public class UserDO extends BaseDO {
|
|||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Long departmentId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private Long roleId;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
package com.zcloud.basic.info.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -12,6 +18,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface UserMapper extends BaseMapper<UserDO> {
|
||||
List<UserDO> selectListAll(@Param("params") Map<String, Object> params);
|
||||
|
||||
IPage<UserDO> selectUserPage(IPage<UserDO> page, @Param("ew") QueryWrapper<UserDO> queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ import java.util.Map;
|
|||
* @Date 2025-10-30 16:10:07
|
||||
*/
|
||||
public interface ImgFilesRepository extends BaseRepository<ImgFilesDO> {
|
||||
PageResponse<ImgFilesDO> listPage(Map<String,Object> parmas);
|
||||
PageResponse<ImgFilesDO> listPage(Map<String,Object> params);
|
||||
|
||||
|
||||
List<ImgFilesDO> listAll(Map<String,Object> parmas);
|
||||
List<ImgFilesDO> listAll(Map<String,Object> params);
|
||||
|
||||
|
||||
void deleteList(Long[] ids);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.zcloud.basic.info.persistence.repository;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -13,5 +15,8 @@ import java.util.Map;
|
|||
*/
|
||||
public interface UserRepository extends BaseRepository<UserDO> {
|
||||
PageResponse<UserDO> listPage(Map<String,Object> params);
|
||||
|
||||
|
||||
List<UserDO> listAll(Map<String,Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,19 +30,19 @@ public class ImgFilesRepositoryImpl extends BaseRepositoryImpl<ImgFilesMapper, I
|
|||
private final ImgFilesMapper imgFilesMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<ImgFilesDO> listPage(Map<String, Object> parmas) {
|
||||
IPage<ImgFilesDO> iPage = new Query<ImgFilesDO>().getPage(parmas);
|
||||
public PageResponse<ImgFilesDO> listPage(Map<String, Object> params) {
|
||||
IPage<ImgFilesDO> iPage = new Query<ImgFilesDO>().getPage(params);
|
||||
QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas);
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ImgFilesDO> result = imgFilesMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ImgFilesDO> listAll(Map<String, Object> parmas) {
|
||||
public List<ImgFilesDO> listAll(Map<String, Object> params) {
|
||||
QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas);
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
// queryWrapper.select("id", "img_files_id", "file_path", "type", "foreign_key", "file_name", "corpinfo_id");
|
||||
return imgFilesMapper.selectList(queryWrapper);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.zcloud.basic.info.persistence.repository.impl;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.UserMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
|
|
@ -13,6 +15,7 @@ import com.zcloud.gbscommon.utils.Query;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -29,10 +32,16 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
public PageResponse<UserDO> listPage(Map<String,Object> params) {
|
||||
IPage<UserDO> iPage = new Query<UserDO>().getPage(params);
|
||||
QueryWrapper<UserDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<UserDO> result = userMapper.selectPage(iPage, queryWrapper);
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "u.");
|
||||
queryWrapper.orderByDesc("u.create_time");
|
||||
queryWrapper.eq("u.delete_enum", "FALSE");
|
||||
IPage<UserDO> result = userMapper.selectUserPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserDO> listAll(Map<String, Object> params) {
|
||||
return userMapper.selectListAll(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue