手机号验证及密码修改
parent
ce9f56000e
commit
f2d2404f48
|
|
@ -2,6 +2,7 @@ package com.zcloud.basic.info.command;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
|
|
@ -11,6 +12,9 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
|
|||
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.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdateQuitCmd;
|
||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||
import com.zcloud.basic.info.command.convertor.UserCoConvertor;
|
||||
import com.zcloud.basic.info.command.query.CorpInfoQueryExe;
|
||||
import com.zcloud.basic.info.constant.RedisConstant;
|
||||
|
|
@ -26,6 +30,7 @@ import com.zcloud.gbscommon.utils.DateUtil;
|
|||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
|
@ -43,6 +48,7 @@ import java.util.*;
|
|||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class UserAddExe {
|
||||
private final UserGateway userGateway;
|
||||
private UserCoConvertor userCoConvertor;
|
||||
|
|
@ -62,7 +68,8 @@ public class UserAddExe {
|
|||
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||
private ZcloudRedisUtil zcloudRedisUtil;
|
||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||
|
||||
@DubboReference(check = false)
|
||||
private UserFacade userFacade;
|
||||
// private final String sourceCode;
|
||||
// @Value("${seng.message:MS000087}")
|
||||
// public void setSourceCode(String sourceCode) {
|
||||
|
|
@ -423,6 +430,19 @@ public class UserAddExe {
|
|||
}else{
|
||||
//修改
|
||||
userGateway.updateByPhone(userE);
|
||||
//调用底座重新入职
|
||||
log.info("executeXgf,GBS获取用户信息{}",userE.getId());
|
||||
SingleResponse<UserDetailCO> detail = userFacade.getDetail(userE.getId());
|
||||
log.info("executeXgf,GBS获取用户信息返回: {}", JSONUtil.toJsonStr(detail));
|
||||
if(detail.isSuccess() && detail.getData() != null && !detail.getData().getJobStatusEnum()){
|
||||
UserUpdateQuitCmd userUpdateQuitCmd = new UserUpdateQuitCmd();
|
||||
userUpdateQuitCmd.setId(userDOUpdate.getId());
|
||||
log.info("executeXgf,GBS恢复用户入职请求: {}",JSONUtil.toJsonStr(userUpdateQuitCmd));
|
||||
Response response = userFacade.restoreJob(userUpdateQuitCmd);
|
||||
log.info("executeXgf,GBS恢复用户入职返回: {}",JSONUtil.toJsonStr(response));
|
||||
}else{
|
||||
log.info("executeXgf,GBS恢复用户入职不需要处理");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ 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.RoleDeptAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserUpdateQuitCmd;
|
||||
import com.jjb.saas.system.client.user.response.UserDetailCO;
|
||||
import com.jjb.saas.system.enums.user.UserAuditStatusEnum;
|
||||
import com.zcloud.basic.info.constant.RedisConstant;
|
||||
import com.zcloud.basic.info.command.convertor.UserJobHandoverCoConvertor;
|
||||
|
|
@ -404,30 +405,44 @@ public class UserUpdateExe {
|
|||
userChangeRecordE.executeReviewStatus(userEOld, UserEmploymentFlagEnum.ON.getCode(), UserChangeRecordStatusEnum.APPROVED.getCode());
|
||||
userCorpRecordE.setStartTime(LocalDateTime.now());
|
||||
userChangeRecordGateway.add(userChangeRecordE);
|
||||
|
||||
com.jjb.saas.system.client.user.request.UserAddCmd userAddCmd = new com.jjb.saas.system.client.user.request.UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getPhone());
|
||||
userAddCmd.setName(userDO.getPhone());
|
||||
RoleDeptAddCmd roleDeptAddCmd = new RoleDeptAddCmd();
|
||||
Long roleId = userRepository.getDefaultRoleId();
|
||||
roleDeptAddCmd.setRoleId(roleId);
|
||||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||
log.info("GBS获取用户信息开始,用户id:{}", userDO.getId());
|
||||
SingleResponse<UserDetailCO> detail = userFacade.getDetail(userDO.getId());
|
||||
log.info("GBS获取用户信息结束,用户id:{},结果:{}", userDO.getId(), JSONUtil.toJsonStr(detail));
|
||||
if (detail.isSuccess() && detail.getData() != null ) {
|
||||
if( !detail.getData().getJobStatusEnum()){
|
||||
//离职,重新入职
|
||||
UserUpdateQuitCmd userUpdateQuitCmd = new UserUpdateQuitCmd();
|
||||
userUpdateQuitCmd.setId(userDO.getId());
|
||||
log.info("executeXgf,GBS恢复用户入职请求: {}",JSONUtil.toJsonStr(userUpdateQuitCmd));
|
||||
Response response = userFacade.restoreJob(userUpdateQuitCmd);
|
||||
log.info("executeXgf,GBS恢复用户入职返回: {}",JSONUtil.toJsonStr(response));
|
||||
}else{
|
||||
//在职,不处理
|
||||
}
|
||||
}else{
|
||||
com.jjb.saas.system.client.user.request.UserAddCmd userAddCmd = new com.jjb.saas.system.client.user.request.UserAddCmd();
|
||||
userAddCmd.setAccount(userDO.getPhone());
|
||||
userAddCmd.setName(userDO.getPhone());
|
||||
RoleDeptAddCmd roleDeptAddCmd = new RoleDeptAddCmd();
|
||||
Long roleId = userRepository.getDefaultRoleId();
|
||||
roleDeptAddCmd.setRoleId(roleId);
|
||||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||
// userAddCmd.setTenantId(userDO.getCorpinfoId());
|
||||
userAddCmd.setPassword(userDO.getPassword());
|
||||
userAddCmd.setId(userDO.getId());
|
||||
log.info("GBS入职处理开始,用户id:{},请求参数:{}", userDO.getId(), JSONUtil.toJsonStr(userAddCmd));
|
||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||
userAddCmd.setPassword(userDO.getPassword());
|
||||
userAddCmd.setId(userDO.getId());
|
||||
log.info("GBS入职处理开始,用户id:{},请求参数:{}", userDO.getId(), JSONUtil.toJsonStr(userAddCmd));
|
||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||
// gbsResult.
|
||||
log.info("GBS入职处理结束,用户id:{},结果:{}", userDO.getId(), JSONUtil.toJsonStr(gbsResult));
|
||||
if(!gbsResult.isSuccess()){
|
||||
throw new IllegalArgumentException("GBS入职处理失败,用户id:"+userDO.getId()+",错误信息:"+gbsResult.getErrMessage());
|
||||
log.info("GBS入职处理结束,用户id:{},结果:{}", userDO.getId(), JSONUtil.toJsonStr(gbsResult));
|
||||
if(!gbsResult.isSuccess()){
|
||||
throw new IllegalArgumentException("GBS入职处理失败,用户id:"+userDO.getId()+",错误信息:"+gbsResult.getErrMessage());
|
||||
}
|
||||
userDO.setId(gbsResult.getData());
|
||||
}
|
||||
|
||||
|
||||
userDO.setId(gbsResult.getData());
|
||||
|
||||
} else {
|
||||
//驳回
|
||||
//驳回
|
||||
|
|
|
|||
Loading…
Reference in New Issue