用户管理功能

main
zhangyue 2025-11-06 10:12:59 +08:00
parent f67b69ed04
commit ade0f82cb5
22 changed files with 417 additions and 136 deletions

View File

@ -8,9 +8,7 @@ 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.zcloud.basic.info.api.UserServiceI; import com.zcloud.basic.info.api.UserServiceI;
import com.zcloud.basic.info.dto.UserAddCmd; import com.zcloud.basic.info.dto.*;
import com.zcloud.basic.info.dto.UserPageQry;
import com.zcloud.basic.info.dto.UserUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.UserCO; import com.zcloud.basic.info.dto.clientobject.UserCO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -32,12 +30,18 @@ import java.util.ArrayList;
public class UserController { public class UserController {
private final UserServiceI userService; private final UserServiceI userService;
@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("新增相关方用户")
@PostMapping("/saveXgf")
public SingleResponse<UserCO> addXgf(@Validated @RequestBody UserXgfAddCmd cmd) {
SSOUser ssoUser = AuthContext.getCurrentUser();
return userService.addXgf(cmd);
}
@ApiOperation("分页") @ApiOperation("分页")
@PostMapping("/list") @PostMapping("/list")
@ -47,8 +51,8 @@ public class UserController {
@ApiOperation("所有数据") @ApiOperation("所有数据")
@GetMapping("/listAll") @GetMapping("/listAll")
public MultiResponse<UserCO> listAll() { public MultiResponse<UserCO> listAll(UserQryCmd userQryCmd) {
return MultiResponse.of(new ArrayList<UserCO>()); return userService.listAll(userQryCmd);
} }
@ApiOperation("详情") @ApiOperation("详情")

View File

@ -1,11 +1,21 @@
package com.zcloud.basic.info.command; 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.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.gateway.UserGateway;
import com.zcloud.basic.info.domain.model.UserE; import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.dto.UserAddCmd; import com.zcloud.basic.info.dto.UserAddCmd;
import com.zcloud.basic.info.dto.UserXgfAddCmd;
import com.zcloud.gbscommon.utils.Tools;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils; 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.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -21,14 +31,50 @@ import org.springframework.transaction.annotation.Transactional;
@AllArgsConstructor @AllArgsConstructor
public class UserAddExe { public class UserAddExe {
private final UserGateway userGateway; private final UserGateway userGateway;
private UserCoConvertor userCoConvertor;
// @Autowired
// private RedisTemplate<String, Object> redisTemplate;
@DubboReference(check = false)
private UserFacade userFacade;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean execute(UserAddCmd cmd) { public boolean execute(UserAddCmd cmd) {
SSOUser ssoUser = AuthContext.getCurrentUser();
Long tenantId = ssoUser.getTenantId();
UserE userE = new UserE(); UserE userE = new UserE();
BeanUtils.copyProperties(cmd, userE); BeanUtils.copyProperties(cmd, userE);
userE.initAdd(tenantId, userE);
boolean res = false; boolean res = false;
try { try {
res = userGateway.add(userE); 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) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -1,5 +1,7 @@
package com.zcloud.basic.info.command.convertor; 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.dto.clientobject.UserCO;
import com.zcloud.basic.info.persistence.dataobject.UserDO; import com.zcloud.basic.info.persistence.dataobject.UserDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
@ -20,5 +22,8 @@ public interface UserCoConvertor {
* @return * @return
*/ */
List<UserCO> converDOsToCOs(List<UserDO> userDOs); List<UserCO> converDOsToCOs(List<UserDO> userDOs);
FacadeUserAddCmd converEToFacadeUserAddCmd(UserE userE);
} }

View File

@ -36,8 +36,8 @@ public class ImgFilesQueryExe {
* @return * @return
*/ */
public PageResponse<ImgFilesCO> execute(ImgFilesPageQry imgFilesPageQry) { public PageResponse<ImgFilesCO> execute(ImgFilesPageQry imgFilesPageQry) {
Map<String,Object> parmas = PageQueryHelper.toHashMap(imgFilesPageQry); Map<String,Object> params = PageQueryHelper.toHashMap(imgFilesPageQry);
PageResponse<ImgFilesDO> pageResponse = imgFilesRepository.listPage(parmas); PageResponse<ImgFilesDO> pageResponse = imgFilesRepository.listPage(params);
List<ImgFilesCO> examCenterCOS = imgFilesCoConvertor.converDOsToCOs(pageResponse.getData()); List<ImgFilesCO> examCenterCOS = imgFilesCoConvertor.converDOsToCOs(pageResponse.getData());
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
} }
@ -48,8 +48,8 @@ public class ImgFilesQueryExe {
* @return * @return
*/ */
public MultiResponse<ImgFilesCO> executeList(ImgFilesQryCmd imgFilesQryCmd) { public MultiResponse<ImgFilesCO> executeList(ImgFilesQryCmd imgFilesQryCmd) {
Map<String,Object> parmas = PageQueryHelper.toHashMap(imgFilesQryCmd); Map<String,Object> params = PageQueryHelper.toHashMap(imgFilesQryCmd);
List<ImgFilesDO> imgFilesDOList = imgFilesRepository.listAll(parmas); List<ImgFilesDO> imgFilesDOList = imgFilesRepository.listAll(params);
List<ImgFilesCO> imgFilesCOList = imgFilesCoConvertor.converDOsToCOs(imgFilesDOList); List<ImgFilesCO> imgFilesCOList = imgFilesCoConvertor.converDOsToCOs(imgFilesDOList);
return MultiResponse.of(imgFilesCOList); return MultiResponse.of(imgFilesCOList);
} }

View File

@ -1,14 +1,19 @@
package com.zcloud.basic.info.command.query; package com.zcloud.basic.info.command.query;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.zcloud.basic.info.command.convertor.UserCoConvertor; import com.zcloud.basic.info.command.convertor.UserCoConvertor;
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.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.UserDO; import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.basic.info.persistence.repository.UserRepository; import com.zcloud.basic.info.persistence.repository.UserRepository;
import com.zcloud.gbscommon.utils.PageQueryHelper; import com.zcloud.gbscommon.utils.PageQueryHelper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -38,5 +43,22 @@ public class UserQueryExe {
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());
} }
/**
*
*
* @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);
}
} }

View File

@ -1,5 +1,6 @@
package com.zcloud.basic.info.service; package com.zcloud.basic.info.service;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse; import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.UserServiceI; 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.UserRemoveExe;
import com.zcloud.basic.info.command.UserUpdateExe; 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.UserAddCmd; import com.zcloud.basic.info.dto.*;
import com.zcloud.basic.info.dto.UserPageQry;
import com.zcloud.basic.info.dto.UserUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.UserCO; import com.zcloud.basic.info.dto.clientobject.UserCO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -40,6 +39,13 @@ public class UserServiceImpl implements UserServiceI {
return SingleResponse.buildSuccess(); return SingleResponse.buildSuccess();
} }
@Override
public SingleResponse addXgf(UserXgfAddCmd cmd) {
userAddExe.executeXgf(cmd);
return SingleResponse.buildSuccess();
}
@Override @Override
public void edit(UserUpdateCmd userUpdateCmd) { public void edit(UserUpdateCmd userUpdateCmd) {
userUpdateExe.execute(userUpdateCmd); userUpdateExe.execute(userUpdateCmd);
@ -54,5 +60,10 @@ public class UserServiceImpl implements UserServiceI {
public void removeBatch(Long[] ids) { public void removeBatch(Long[] ids) {
userRemoveExe.execute(ids); userRemoveExe.execute(ids);
} }
@Override
public MultiResponse<UserCO> listAll(UserQryCmd userQryCmd) {
return userQueryExe.executeListAll(userQryCmd);
}
} }

View File

@ -1,11 +1,10 @@
package com.zcloud.basic.info.api; package com.zcloud.basic.info.api;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse; import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.dto.UserAddCmd; import com.zcloud.basic.info.dto.*;
import com.zcloud.basic.info.dto.UserPageQry;
import com.zcloud.basic.info.dto.UserUpdateCmd;
import com.zcloud.basic.info.dto.clientobject.UserCO; import com.zcloud.basic.info.dto.clientobject.UserCO;
/** /**
@ -18,10 +17,14 @@ public interface UserServiceI {
SingleResponse<UserCO> add(UserAddCmd cmd); SingleResponse<UserCO> add(UserAddCmd cmd);
SingleResponse<UserCO> addXgf(UserXgfAddCmd cmd);
void edit(UserUpdateCmd cmd); void edit(UserUpdateCmd cmd);
void remove(Long id); void remove(Long id);
void removeBatch(Long[] ids); void removeBatch(Long[] ids);
MultiResponse<UserCO> listAll(UserQryCmd userQryCmd);
} }

View File

@ -21,8 +21,7 @@ import javax.validation.constraints.NotNull;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class UserAddCmd extends Command { public class UserAddCmd extends Command {
@ApiModelProperty(value = "业务主键id老系统id", name = "userId", required = true) @ApiModelProperty(value = "业务主键id老系统id", name = "userId")
@NotEmpty(message = "业务主键id老系统id不能为空")
private String userId; private String userId;
@ApiModelProperty(value = "登录账号", name = "username", required = true) @ApiModelProperty(value = "登录账号", name = "username", required = true)
@ -49,84 +48,71 @@ public class UserAddCmd 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", required = true)
@NotNull(message = "角色id不能为空") @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")
private String phone;
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true) @ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空") @NotEmpty(message = "人员类型不能为空")
private String personnelType; private String personnelType;
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true) @ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
@NotEmpty(message = "人员类型翻译不能为空") @NotEmpty(message = "人员类型不能为空")
private String personnelTypeName; private String personnelTypeName;
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true) @ApiModelProperty(value = "民族编码", name = "nation")
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
private String nation; private String nation;
@ApiModelProperty(value = "民族名称", name = "nationName", required = true) @ApiModelProperty(value = "民族名称", name = "nationName")
@NotEmpty(message = "民族名称不能为空")
private String nationName; private String nationName;
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true) @ApiModelProperty(value = "身份证号", name = "userIdCard")
@NotEmpty(message = "身份证号不能为空")
private String userIdCard; private String userIdCard;
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true) @ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl")
@NotEmpty(message = "人脸头像url不能为空")
private String userAvatarUrl; private String userAvatarUrl;
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true) @ApiModelProperty(value = "现住址", name = "currentAddress")
@NotEmpty(message = "现住址不能为空")
private String currentAddress; private String currentAddress;
@ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true) @ApiModelProperty(value = "户口所在地", name = "locationAddress")
@NotEmpty(message = "户口所在地不能为空")
private String locationAddress; private String locationAddress;
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true) // TODO 待确认企业端和监管端是否必填
@NotNull(message = "人员在部门中的排序不能为空") @ApiModelProperty(value = "人员在部门中的排序", name = "sort")
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")
@NotEmpty(message = "文化程度 数据字典不能为空")
private String culturalLevel; private String culturalLevel;
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true) @ApiModelProperty(value = "文化程度名称", name = "culturalLevelName")
@NotEmpty(message = "文化程度名称不能为空")
private String culturalLevelName; private String culturalLevelName;
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true) @ApiModelProperty(value = "婚姻状态", name = "maritalStatus")
@NotEmpty(message = "婚姻状态不能为空")
private String maritalStatus; private String maritalStatus;
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true) @ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName")
@NotEmpty(message = "婚姻状态名称不能为空")
private String maritalStatusName; private String maritalStatusName;
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true) @ApiModelProperty(value = "政治面貌", name = "politicalAffiliation")
@NotEmpty(message = "政治面貌不能为空")
private String politicalAffiliation; private String politicalAffiliation;
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true) @ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName")
@NotEmpty(message = "政治面貌名称不能为空")
private String politicalAffiliationName; private String politicalAffiliationName;
} }

View File

@ -23,6 +23,9 @@ public class UserPageQry extends PageQuery {
* - `le`: * - `le`:
* - `ne`: SQL!= * - `ne`: SQL!=
*/ */
private String likeUserId; private Long eqCorpinfoId;
private Long eqDepartmentId;
private Long eqPostId;
} }

View File

@ -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`: SQLLIKE
* - `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;
}

View File

@ -11,10 +11,11 @@ import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* web-client * web-client
* @Author zhangyue *
* @Date 2025-11-04 14:07:38 * @Author zhangyue
*/ * @Date 2025-11-04 14:07:38
*/
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@ -27,82 +28,56 @@ public class UserUpdateCmd extends Command {
@NotEmpty(message = "业务主键id老系统id不能为空") @NotEmpty(message = "业务主键id老系统id不能为空")
private String userId; private String userId;
@ApiModelProperty(value = "登录账号", name = "username", required = true) @ApiModelProperty(value = "登录账号", name = "username", required = true)
@NotEmpty(message = "登录账号不能为空")
private String username; private String username;
@ApiModelProperty(value = "姓名", name = "name", required = true) @ApiModelProperty(value = "姓名", name = "name", required = true)
@NotEmpty(message = "姓名不能为空")
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)
@NotNull(message = "是否主账号1是0否不能为空")
private Integer mainCorpFlag; private Integer mainCorpFlag;
@ApiModelProperty(value = "用户类型,1监管2企业3相关方", name = "userType", required = true) @ApiModelProperty(value = "用户类型,1监管2企业3相关方", name = "userType", required = true)
@NotNull(message = "用户类型,1监管2企业3相关方不能为空")
private Integer userType; private Integer userType;
@ApiModelProperty(value = "部门id", name = "departmentId", required = true) @ApiModelProperty(value = "部门id", name = "departmentId", required = true)
@NotNull(message = "部门id不能为空")
private Long departmentId; private Long departmentId;
@ApiModelProperty(value = "岗位id", name = "postId", required = true) @ApiModelProperty(value = "岗位id", name = "postId", required = true)
@NotNull(message = "岗位id不能为空")
private Long postId; private Long postId;
@ApiModelProperty(value = "角色id", name = "roleId", required = true) @ApiModelProperty(value = "角色id", name = "roleId", required = true)
@NotNull(message = "角色id不能为空")
private Long roleId; private Long roleId;
@ApiModelProperty(value = "邮箱", name = "email", required = true) @ApiModelProperty(value = "邮箱", name = "email", required = true)
@NotEmpty(message = "邮箱不能为空")
private String email; private String email;
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true) @ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
@NotEmpty(message = "人员类型编码(主要负责人等)不能为空")
private String personnelType; private String personnelType;
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true) @ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
@NotEmpty(message = "人员类型翻译不能为空")
private String personnelTypeName; private String personnelTypeName;
@ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true) @ApiModelProperty(value = "民族编码问一下有没有组件", name = "nation", required = true)
@NotEmpty(message = "民族编码问一下有没有组件不能为空")
private String nation; private String nation;
@ApiModelProperty(value = "民族名称", name = "nationName", required = true) @ApiModelProperty(value = "民族名称", name = "nationName", required = true)
@NotEmpty(message = "民族名称不能为空")
private String nationName; private String nationName;
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true) @ApiModelProperty(value = "身份证号", name = "userIdCard", required = true)
@NotEmpty(message = "身份证号不能为空")
private String userIdCard; private String userIdCard;
@ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true) @ApiModelProperty(value = "人脸头像url", name = "userAvatarUrl", required = true)
@NotEmpty(message = "人脸头像url不能为空")
private String userAvatarUrl; private String userAvatarUrl;
@ApiModelProperty(value = "现住址", name = "currentAddress", required = true) @ApiModelProperty(value = "现住址", name = "currentAddress", required = true)
@NotEmpty(message = "现住址不能为空")
private String currentAddress; private String currentAddress;
@ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true) @ApiModelProperty(value = "户口所在地", name = "locationAddress", required = true)
@NotEmpty(message = "户口所在地不能为空")
private String locationAddress; private String locationAddress;
@ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true) @ApiModelProperty(value = "人员在部门中的排序", name = "sort", required = true)
@NotNull(message = "人员在部门中的排序不能为空")
private Integer sort; private Integer sort;
@ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true) @ApiModelProperty(value = "是否部门领导0否1是", name = "departmentLeaderFlag", required = true)
@NotNull(message = "是否部门领导0否1是不能为空")
private Integer departmentLeaderFlag; private Integer departmentLeaderFlag;
@ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true) @ApiModelProperty(value = "是否分管领导0否1是", name = "deputyLeaderFlag", required = true)
@NotNull(message = "是否分管领导0否1是不能为空")
private Integer deputyLeaderFlag; private Integer deputyLeaderFlag;
@ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true) @ApiModelProperty(value = "文化程度 数据字典", name = "culturalLevel", required = true)
@NotEmpty(message = "文化程度 数据字典不能为空")
private String culturalLevel; private String culturalLevel;
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true) @ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
@NotEmpty(message = "文化程度名称不能为空")
private String culturalLevelName; private String culturalLevelName;
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true) @ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true)
@NotEmpty(message = "婚姻状态不能为空")
private String maritalStatus; private String maritalStatus;
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true) @ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true)
@NotEmpty(message = "婚姻状态名称不能为空")
private String maritalStatusName; private String maritalStatusName;
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true) @ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true)
@NotEmpty(message = "政治面貌不能为空")
private String politicalAffiliation; private String politicalAffiliation;
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true) @ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true)
@NotEmpty(message = "政治面貌名称不能为空")
private String politicalAffiliationName; private String politicalAffiliationName;
} }

View File

@ -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;
}

View File

@ -1,6 +1,7 @@
package com.zcloud.basic.info.dto.clientobject; package com.zcloud.basic.info.dto.clientobject;
import com.alibaba.cola.dto.ClientObject; import com.alibaba.cola.dto.ClientObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -31,6 +32,8 @@ public class UserCO extends ClientObject {
//企业id //企业id
@ApiModelProperty(value = "企业id") @ApiModelProperty(value = "企业id")
private Long corpinfoId; private Long corpinfoId;
@ApiModelProperty(value = "企业名称")
private String corpinfoName;
//是否主账号1是0否 //是否主账号1是0否
@ApiModelProperty(value = "是否主账号1是0否") @ApiModelProperty(value = "是否主账号1是0否")
private Integer mainCorpFlag; private Integer mainCorpFlag;
@ -40,9 +43,15 @@ public class UserCO extends ClientObject {
//部门id //部门id
@ApiModelProperty(value = "部门id") @ApiModelProperty(value = "部门id")
private Long departmentId; private Long departmentId;
//部门id
@ApiModelProperty(value = "部门名称")
private String departmentName;
//岗位id //岗位id
@ApiModelProperty(value = "岗位id") @ApiModelProperty(value = "岗位id")
private Long postId; private Long postId;
//岗位id
@ApiModelProperty(value = "岗位名称")
private String postName;
//角色id //角色id
@ApiModelProperty(value = "角色id") @ApiModelProperty(value = "角色id")
private Long roleId; private Long roleId;

View File

@ -70,7 +70,7 @@ public class ImgFilesE extends BaseE {
MultipartFile[] files = baseImgFilesE.getFiles(); MultipartFile[] files = baseImgFilesE.getFiles();
Long corpinfoId = ObjectUtils.isEmpty(baseImgFilesE.getCorpinfoId()) ? tenantId : baseImgFilesE.getCorpinfoId(); Long corpinfoId = ObjectUtils.isEmpty(baseImgFilesE.getCorpinfoId()) ? tenantId : baseImgFilesE.getCorpinfoId();
String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath()+ "/"; String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath() + "/";
// 文件上传并获取上传路径 // 文件上传并获取上传路径
String resultFilePath = FileUpload.fileUp(files[0], filePath, Tools.get32UUID()); String resultFilePath = FileUpload.fileUp(files[0], filePath, Tools.get32UUID());
return filePath + resultFilePath; return filePath + resultFilePath;
@ -105,8 +105,9 @@ public class ImgFilesE extends BaseE {
public void deleteFile(String filePath) throws Exception { public void deleteFile(String filePath) throws Exception {
Smb.deleteFile(filePath); Smb.deleteFile(filePath);
} }
public void deleteFileList(List<ImgFilesE> imgFilesEList) throws Exception { public void deleteFileList(List<ImgFilesE> imgFilesEList) throws Exception {
for (ImgFilesE imgFilesE: imgFilesEList) { for (ImgFilesE imgFilesE : imgFilesEList) {
Smb.deleteFile(imgFilesE.getFilePath()); Smb.deleteFile(imgFilesE.getFilePath());
} }
} }

View File

@ -1,10 +1,14 @@
package com.zcloud.basic.info.domain.model; package com.zcloud.basic.info.domain.model;
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.FileUpload;
import com.zcloud.gbscommon.utils.Tools;
import lombok.Data; import lombok.Data;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* web-domain * web-domain
@ -94,5 +98,11 @@ public class UserE extends BaseE {
private String politicalAffiliation; private String politicalAffiliation;
//政治面貌名称 //政治面貌名称
private String politicalAffiliationName; private String politicalAffiliationName;
public void initAdd(Long tenantId, UserE userE) {
userE.setUserId(Tools.get32UUID());
userE.setTenantId(!ObjectUtils.isEmpty(userE.getTenantId())? userE.getTenantId() : tenantId);
}
} }

View File

@ -1,5 +1,6 @@
package com.zcloud.basic.info.gatewayimpl; 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.gateway.UserGateway;
import com.zcloud.basic.info.domain.model.UserE; import com.zcloud.basic.info.domain.model.UserE;
import com.zcloud.basic.info.persistence.dataobject.UserDO; import com.zcloud.basic.info.persistence.dataobject.UserDO;
@ -38,7 +39,11 @@ public class UserGatewayImpl implements UserGateway {
@Override @Override
public Boolean deletedUserById(Long id) { 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 @Override

View File

@ -1,5 +1,6 @@
package com.zcloud.basic.info.persistence.dataobject; package com.zcloud.basic.info.persistence.dataobject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.jjb.saas.framework.repository.basedo.BaseDO; import com.jjb.saas.framework.repository.basedo.BaseDO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -30,6 +31,9 @@ public class UserDO extends BaseDO {
//企业id //企业id
@ApiModelProperty(value = "企业id") @ApiModelProperty(value = "企业id")
private Long corpinfoId; private Long corpinfoId;
//企业id
@ApiModelProperty(value = "企业名称")
private String corpinfoName;
//是否主账号1是0否 //是否主账号1是0否
@ApiModelProperty(value = "是否主账号1是0否") @ApiModelProperty(value = "是否主账号1是0否")
private Integer mainCorpFlag; private Integer mainCorpFlag;
@ -39,9 +43,15 @@ public class UserDO extends BaseDO {
//部门id //部门id
@ApiModelProperty(value = "部门id") @ApiModelProperty(value = "部门id")
private Long departmentId; private Long departmentId;
//部门id
@ApiModelProperty(value = "部门名称")
private String departmentName;
//岗位id //岗位id
@ApiModelProperty(value = "岗位id") @ApiModelProperty(value = "岗位id")
private Long postId; private Long postId;
//岗位id
@ApiModelProperty(value = "岗位名称")
private String postName;
//角色id //角色id
@ApiModelProperty(value = "角色id") @ApiModelProperty(value = "角色id")
private Long roleId; private Long roleId;

View File

@ -1,8 +1,14 @@
package com.zcloud.basic.info.persistence.mapper; 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.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zcloud.basic.info.persistence.dataobject.UserDO; import com.zcloud.basic.info.persistence.dataobject.UserDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* web-infrastructure * web-infrastructure
@ -12,6 +18,8 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface UserMapper extends BaseMapper<UserDO> { 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);
} }

View File

@ -14,10 +14,10 @@ import java.util.Map;
* @Date 2025-10-30 16:10:07 * @Date 2025-10-30 16:10:07
*/ */
public interface ImgFilesRepository extends BaseRepository<ImgFilesDO> { 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); void deleteList(Long[] ids);

View File

@ -1,9 +1,11 @@
package com.zcloud.basic.info.persistence.repository; package com.zcloud.basic.info.persistence.repository;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.jjb.saas.framework.repository.repo.BaseRepository; import com.jjb.saas.framework.repository.repo.BaseRepository;
import com.zcloud.basic.info.persistence.dataobject.UserDO; import com.zcloud.basic.info.persistence.dataobject.UserDO;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -13,5 +15,8 @@ import java.util.Map;
*/ */
public interface UserRepository extends BaseRepository<UserDO> { public interface UserRepository extends BaseRepository<UserDO> {
PageResponse<UserDO> listPage(Map<String,Object> params); PageResponse<UserDO> listPage(Map<String,Object> params);
List<UserDO> listAll(Map<String,Object> params);
} }

View File

@ -30,19 +30,19 @@ public class ImgFilesRepositoryImpl extends BaseRepositoryImpl<ImgFilesMapper, I
private final ImgFilesMapper imgFilesMapper; private final ImgFilesMapper imgFilesMapper;
@Override @Override
public PageResponse<ImgFilesDO> listPage(Map<String, Object> parmas) { public PageResponse<ImgFilesDO> listPage(Map<String, Object> params) {
IPage<ImgFilesDO> iPage = new Query<ImgFilesDO>().getPage(parmas); IPage<ImgFilesDO> iPage = new Query<ImgFilesDO>().getPage(params);
QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>(); QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas); queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
IPage<ImgFilesDO> result = imgFilesMapper.selectPage(iPage, queryWrapper); IPage<ImgFilesDO> result = imgFilesMapper.selectPage(iPage, queryWrapper);
return PageHelper.pageToResponse(result, result.getRecords()); return PageHelper.pageToResponse(result, result.getRecords());
} }
@Override @Override
public List<ImgFilesDO> listAll(Map<String, Object> parmas) { public List<ImgFilesDO> listAll(Map<String, Object> params) {
QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>(); QueryWrapper<ImgFilesDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas); queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
// queryWrapper.select("id", "img_files_id", "file_path", "type", "foreign_key", "file_name", "corpinfo_id"); // queryWrapper.select("id", "img_files_id", "file_path", "type", "foreign_key", "file_name", "corpinfo_id");
return imgFilesMapper.selectList(queryWrapper); return imgFilesMapper.selectList(queryWrapper);

View File

@ -1,10 +1,12 @@
package com.zcloud.basic.info.persistence.repository.impl; package com.zcloud.basic.info.persistence.repository.impl;
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.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.common.PageHelper; import com.jjb.saas.framework.repository.common.PageHelper;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl; 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.dataobject.UserDO;
import com.zcloud.basic.info.persistence.mapper.UserMapper; import com.zcloud.basic.info.persistence.mapper.UserMapper;
import com.zcloud.basic.info.persistence.repository.UserRepository; import com.zcloud.basic.info.persistence.repository.UserRepository;
@ -13,6 +15,7 @@ import com.zcloud.gbscommon.utils.Query;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -29,10 +32,16 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
public PageResponse<UserDO> listPage(Map<String,Object> params) { public PageResponse<UserDO> listPage(Map<String,Object> params) {
IPage<UserDO> iPage = new Query<UserDO>().getPage(params); IPage<UserDO> iPage = new Query<UserDO>().getPage(params);
QueryWrapper<UserDO> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserDO> queryWrapper = new QueryWrapper<>();
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params); queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "u.");
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("u.create_time");
IPage<UserDO> result = userMapper.selectPage(iPage, queryWrapper); queryWrapper.eq("u.delete_enum", "FALSE");
IPage<UserDO> result = userMapper.selectUserPage(iPage, queryWrapper);
return PageHelper.pageToResponse(result, result.getRecords()); return PageHelper.pageToResponse(result, result.getRecords());
} }
@Override
public List<UserDO> listAll(Map<String, Object> params) {
return userMapper.selectListAll(params);
}
} }