dev:app入职相关接口
parent
ce6f71a9ac
commit
0a2315b30b
|
|
@ -1,26 +1,17 @@
|
||||||
package com.zcloud.basic.info.app;
|
package com.zcloud.basic.info.app;
|
||||||
|
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
|
||||||
import com.alibaba.cola.dto.Response;
|
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.utils.AuthContext;
|
|
||||||
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;
|
||||||
import com.zcloud.basic.info.dto.clientobject.UserXmfCO;
|
|
||||||
import com.zcloud.basic.info.plan.DockingRZUserPlanJob;
|
|
||||||
import com.zcloud.gbscommon.translateaop.TranslateField;
|
import com.zcloud.gbscommon.translateaop.TranslateField;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-adapter
|
* web-adapter
|
||||||
|
|
@ -50,14 +41,14 @@ public class AppUserController {
|
||||||
|
|
||||||
@ApiOperation("注册用户")
|
@ApiOperation("注册用户")
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public SingleResponse<UserCO> register(@Validated @RequestBody AppUserAddCmd cmd) {
|
public SingleResponse<UserCO> register(@Validated @RequestBody AppUserRegisterCmd cmd) {
|
||||||
return userService.register(cmd);
|
return userService.register(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("完善个人信息(不包括企业,部门,岗位)")
|
@ApiOperation("完善个人信息(不包括企业,部门,岗位)")
|
||||||
@PostMapping("/perfectUserInfo")
|
@PostMapping("/perfectUserInfo")
|
||||||
public SingleResponse<UserCO> perfectUserInfo(@Validated @RequestBody AppUserAddCmd cmd) {
|
public SingleResponse<UserCO> perfectUserInfo(@Validated @RequestBody AppUserInfoCmd cmd) {
|
||||||
return userService.register(cmd);
|
return userService.perfectUserInfo(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -68,6 +59,13 @@ public class AppUserController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("扫码入职")
|
||||||
|
@PostMapping("/onboarding")
|
||||||
|
public Response onboarding(@Validated @RequestBody AppUserOnboardingCmd cmd){
|
||||||
|
userService.onboarding(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,12 @@
|
||||||
package com.zcloud.basic.info.command;
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.jjb.saas.config.client.dicttree.facade.ConfDictTreeFacade;
|
import com.jjb.saas.config.client.dicttree.facade.ConfDictTreeFacade;
|
||||||
import com.jjb.saas.config.client.dicttree.response.ConfDictTreeCO;
|
|
||||||
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.message.client.message.facede.MessageFacade;
|
import com.jjb.saas.message.client.message.facede.MessageFacade;
|
||||||
import com.jjb.saas.message.client.message.request.MessageSendCmd;
|
|
||||||
import com.jjb.saas.message.client.message.request.MessageTargetCmd;
|
|
||||||
import com.jjb.saas.system.client.role.response.RoleCO;
|
|
||||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||||
import com.zcloud.basic.info.command.query.CorpInfoQueryExe;
|
import com.zcloud.basic.info.command.query.CorpInfoQueryExe;
|
||||||
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
import com.zcloud.basic.info.domain.enums.UserFlowFlagEnum;
|
||||||
|
|
@ -22,25 +15,14 @@ import com.zcloud.basic.info.domain.model.*;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.*;
|
import com.zcloud.basic.info.persistence.dataobject.*;
|
||||||
import com.zcloud.basic.info.persistence.repository.*;
|
import com.zcloud.basic.info.persistence.repository.*;
|
||||||
import com.zcloud.gbscommon.excelEntity.UserExcelImportEntity;
|
|
||||||
import com.zcloud.gbscommon.utils.Tools;
|
|
||||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
|
||||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
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;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,6 +44,7 @@ public class UserAddExe {
|
||||||
private ConfDictTreeFacade confDictTreeFacade;
|
private ConfDictTreeFacade confDictTreeFacade;
|
||||||
private final CorpInfoQueryExe corpInfoQueryExe;
|
private final CorpInfoQueryExe corpInfoQueryExe;
|
||||||
private final UserCorpGateway userCorpGateway;
|
private final UserCorpGateway userCorpGateway;
|
||||||
|
private final UserCorpRepository userCorpRepository;
|
||||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -107,23 +90,74 @@ public class UserAddExe {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(AppUserAddCmd cmd) {
|
public boolean execute(AppUserRegisterCmd cmd) {
|
||||||
|
|
||||||
UserE userE = new UserE();
|
UserE userE = new UserE();
|
||||||
userE.checkPassword(cmd.getPassword(), cmd.getConfirmPassword());
|
userE.checkPassword(cmd.getPassword(), cmd.getConfirmPassword());
|
||||||
// 获取redis所有有效验证码
|
// 获取redis所有有效验证码
|
||||||
// 如果不能对上, 提示验证码已过期或错误
|
// 如果不能对上, 提示验证码已过期或错误
|
||||||
|
|
||||||
// CorpInfoDO corpInfoDO = corpInfoRepository.getCorpInfoByCorpName("相关方通用租户");
|
CorpInfoDO corpInfoDO = corpInfoRepository.getCorpInfoByCorpName("相关方通用租户");
|
||||||
// if(corpInfoDO == null){
|
if(corpInfoDO == null){
|
||||||
// throw new BizException("未创建相关方通用租户");
|
throw new BizException("未创建相关方通用租户");
|
||||||
// }
|
}
|
||||||
BeanUtils.copyProperties(cmd, userE);
|
BeanUtils.copyProperties(cmd, userE);
|
||||||
|
userE.setCorpinfoId(corpInfoDO.getId());
|
||||||
userGateway.register(userE);
|
userGateway.register(userE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(AppUserInfoCmd cmd) {
|
||||||
|
|
||||||
|
UserE userE = new UserE();
|
||||||
|
BeanUtils.copyProperties(cmd, userE);
|
||||||
|
|
||||||
|
userGateway.update(userE);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(AppUserOnboardingCmd cmd) {
|
||||||
|
|
||||||
|
// 如果是流动人员, 判断user_corp表是否有未离职的数据, 如果有则不能入职(0-离职)
|
||||||
|
List<UserCorpDO> userCorpDOS = userCorpRepository.listByUserIdAndCorpIdAndNoStatus(cmd.getId(), cmd.getCorpinfoId(), 0);
|
||||||
|
if(CollUtil.isNotEmpty(userCorpDOS)){
|
||||||
|
throw new BizException("该用户在当前企业存在未离职信息,无法入职");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 把user表和user_corp表相关企业,部门,岗位数据补充完整
|
||||||
|
UserE userE = new UserE();
|
||||||
|
BeanUtils.copyProperties(cmd, userE);
|
||||||
|
userGateway.update(userE);
|
||||||
|
|
||||||
|
// 查询用户信息, 获取是否流动人员
|
||||||
|
UserDO userDO = userRepository.getById(cmd.getId());
|
||||||
|
if(userDO.getEmploymentFlag() == 1){
|
||||||
|
// 插入user_corp表
|
||||||
|
UserCorpE userCorpE = new UserCorpE();
|
||||||
|
userCorpE.setUserId(userE.getId());
|
||||||
|
userCorpE.setEmploymentFlag(11);
|
||||||
|
userCorpE.setCorpinfoId(userE.getCorpinfoId());
|
||||||
|
userCorpE.setDepartmentId(userE.getDepartmentId());
|
||||||
|
userCorpE.setPostName(userE.getPostName());
|
||||||
|
userCorpE.setRoleId(userE.getRoleId());
|
||||||
|
userCorpE.setDepartmentLeaderFlag(0);
|
||||||
|
userCorpE.setSort(9999);
|
||||||
|
userCorpE.setEmploymentFlag(11);
|
||||||
|
userCorpGateway.add(userCorpE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入user_change_record表
|
||||||
|
UserChangeRecordE userChangeRecordE = new UserChangeRecordE();
|
||||||
|
userChangeRecordE.initUserAdd(userE, cmd.getCorpinfoName(), cmd.getDepartmentName());
|
||||||
|
userChangeRecordGateway.add(userChangeRecordE);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,19 @@ public class UserServiceImpl implements UserServiceI {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<UserCO> register(AppUserAddCmd cmd) {
|
public SingleResponse<UserCO> register(AppUserRegisterCmd cmd) {
|
||||||
|
userAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<UserCO> perfectUserInfo(AppUserInfoCmd cmd) {
|
||||||
|
userAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<UserCO> onboarding(AppUserOnboardingCmd cmd) {
|
||||||
userAddExe.execute(cmd);
|
userAddExe.execute(cmd);
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,11 @@ public interface UserServiceI {
|
||||||
|
|
||||||
SingleResponse<UserCO> add(UserAddCmd cmd);
|
SingleResponse<UserCO> add(UserAddCmd cmd);
|
||||||
|
|
||||||
SingleResponse<UserCO> register(AppUserAddCmd cmd);
|
SingleResponse<UserCO> register(AppUserRegisterCmd cmd);
|
||||||
|
|
||||||
|
SingleResponse<UserCO> perfectUserInfo(AppUserInfoCmd cmd);
|
||||||
|
|
||||||
|
SingleResponse<UserCO> onboarding(AppUserOnboardingCmd cmd);
|
||||||
|
|
||||||
SingleResponse<UserCO> verifyPhone(UserVerifyPhoneCmd cmd);
|
SingleResponse<UserCO> verifyPhone(UserVerifyPhoneCmd cmd);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
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 AppUserInfoCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键id", name = "id")
|
||||||
|
@NotNull(message = "主键id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户类型,1监管2企业3相关方", name = "userType", required = true)
|
||||||
|
@NotNull(message = "用户类型,1监管2企业3相关方不能为空")
|
||||||
|
private Integer userType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "人脸照片url", name = "userAvatarUrl")
|
||||||
|
@NotEmpty(message = "人脸照片url不能为空")
|
||||||
|
private String userAvatarUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名", name = "name", required = true)
|
||||||
|
@NotEmpty(message = "姓名不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "身份证号", name = "userIdCard", required = true)
|
||||||
|
@NotEmpty(message = "身份证号不能为空")
|
||||||
|
private String userIdCard;
|
||||||
|
|
||||||
|
@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 = "culturalLevel", required = true)
|
||||||
|
@NotEmpty(message = "文化程度 数据字典不能为空")
|
||||||
|
private String culturalLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文化程度名称", name = "culturalLevelName", required = true)
|
||||||
|
@NotEmpty(message = "文化程度名称不能为空")
|
||||||
|
private String culturalLevelName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "政治面貌", name = "politicalAffiliation", required = true)
|
||||||
|
@NotEmpty(message = "政治面貌不能为空")
|
||||||
|
private String politicalAffiliation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "政治面貌名称", name = "politicalAffiliationName", required = true)
|
||||||
|
@NotEmpty(message = "政治面貌名称不能为空")
|
||||||
|
private String politicalAffiliationName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "婚姻状态", name = "maritalStatus", required = true)
|
||||||
|
@NotEmpty(message = "婚姻状态不能为空")
|
||||||
|
private String maritalStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "婚姻状态名称", name = "maritalStatusName", required = true)
|
||||||
|
@NotEmpty(message = "婚姻状态名称不能为空")
|
||||||
|
private String maritalStatusName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否流动人员,1-流动,0-固定人员", required = true)
|
||||||
|
@NotNull(message = "是否流动人员,1-流动,0-固定人员不能为空")
|
||||||
|
private Integer flowFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "邮箱", name = "email")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "人员类型编码(主要负责人等)", name = "personnelType", required = true)
|
||||||
|
private String personnelType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "人员类型翻译", name = "personnelTypeName", required = true)
|
||||||
|
private String personnelTypeName;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "现住址", name = "currentAddress")
|
||||||
|
private String currentAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "户口所在地", name = "locationAddress")
|
||||||
|
private String locationAddress;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
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 AppUserOnboardingCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键id", name = "id")
|
||||||
|
@NotNull(message = "主键id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
||||||
|
@NotNull(message = "企业id不能为空")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称", name = "corpinfoName")
|
||||||
|
@NotEmpty(message = "企业名称不能为空")
|
||||||
|
private String corpinfoName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门id", name = "departmentId")
|
||||||
|
@NotNull(message = "部门id不能为空")
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称", name = "departmentName")
|
||||||
|
@NotEmpty(message = "部门名称不能为空")
|
||||||
|
private String departmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称", name = "departmentName")
|
||||||
|
@NotEmpty(message = "部门名称不能为空")
|
||||||
|
private String postName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -8,7 +8,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -20,7 +19,7 @@ import javax.validation.constraints.NotNull;
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class AppUserAddCmd extends Command {
|
public class AppUserRegisterCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "手机号", name = "phone")
|
@ApiModelProperty(value = "手机号", name = "phone")
|
||||||
@NotEmpty(message = "手机号不能为空")
|
@NotEmpty(message = "手机号不能为空")
|
||||||
|
|
@ -189,6 +189,7 @@ public class UserE extends BaseE {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验验证码
|
* 校验验证码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
import com.zcloud.basic.info.domain.model.UserE;
|
import com.zcloud.basic.info.domain.model.UserE;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
import com.zcloud.basic.info.persistence.dataobject.UserCorpDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,6 +19,11 @@ public interface UserCorpRepository extends BaseRepository<UserCorpDO> {
|
||||||
|
|
||||||
UserCorpDO getInfoByUserId(Long userId, Long tenantId);
|
UserCorpDO getInfoByUserId(Long userId, Long tenantId);
|
||||||
|
|
||||||
|
UserCorpDO getUserCorpInfoByUserId(Long userId);
|
||||||
|
|
||||||
|
List<UserCorpDO> listByUserIdAndCorpIdAndNoStatus(Long userId, Long corpinfoId, Integer status);
|
||||||
|
|
||||||
UserE executeResignation(Long id, Long corpinfoId);
|
UserE executeResignation(Long id, Long corpinfoId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,6 +46,22 @@ public class UserCorpRepositoryImpl extends BaseRepositoryImpl<UserCorpMapper, U
|
||||||
return userCorpMapper.getInfoByUserId(userId, corpinfoId);
|
return userCorpMapper.getInfoByUserId(userId, corpinfoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserCorpDO getUserCorpInfoByUserId(Long userId) {
|
||||||
|
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId);
|
||||||
|
return userCorpMapper.selectOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserCorpDO> listByUserIdAndCorpIdAndNoStatus(Long userId, Long corpinfoId, Integer status) {
|
||||||
|
QueryWrapper<UserCorpDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("user_id", userId);
|
||||||
|
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||||
|
queryWrapper.ne("employment_flag", status);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserE executeResignation(Long id, Long corpinfoId) {
|
public UserE executeResignation(Long id, Long corpinfoId) {
|
||||||
UserCorpDO userCorpDO = getInfoByUserId(id, corpinfoId);
|
UserCorpDO userCorpDO = getInfoByUserId(id, corpinfoId);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
import com.zcloud.gbscommon.utils.Query;
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
import com.zcloud.gbscommon.utils.Tools;
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
@ -229,6 +230,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
roleDeptAddCmd.setDeptId(0L);
|
roleDeptAddCmd.setDeptId(0L);
|
||||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||||
|
userAddCmd.setTenantId(userDO.getCorpinfoId());
|
||||||
|
|
||||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||||
userDO.setId(gbsResult.getData());
|
userDO.setId(gbsResult.getData());
|
||||||
|
|
@ -239,6 +241,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
userDO.setEmploymentFlag(11);
|
userDO.setEmploymentFlag(11);
|
||||||
// 默认不是主账号
|
// 默认不是主账号
|
||||||
userDO.setMainCorpFlag(0);
|
userDO.setMainCorpFlag(0);
|
||||||
|
userDO.setUserId(UuidUtil.get32UUID());
|
||||||
save(userDO);
|
save(userDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue