用户注册pc和app userid
parent
ca828a2814
commit
280bb5aa4f
|
|
@ -169,5 +169,11 @@ public class UserController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据手机号获取用户userId")
|
||||||
|
@PostMapping("/getUserIdByPhone")
|
||||||
|
public SingleResponse<UserCO> getUserIdByPhone(@Validated @RequestBody GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||||
|
return userService.getUserIdByPhone(getUserIdByPhoneCmd);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ public class UserAddExe {
|
||||||
UserDO user = firstUserWithIdCard.get();
|
UserDO user = firstUserWithIdCard.get();
|
||||||
BeanUtils.copyProperties(user, userE);
|
BeanUtils.copyProperties(user, userE);
|
||||||
userE.setId(null);
|
userE.setId(null);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(),userDO.getUserId());
|
||||||
userE.setFlowFlag(flowFlag);
|
userE.setFlowFlag(flowFlag);
|
||||||
userRepository.saveOnboardingUser(userE);
|
userRepository.saveOnboardingUser(userE);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -377,7 +377,7 @@ public class UserAddExe {
|
||||||
UserDO user = firstUserWithIdCard.get();
|
UserDO user = firstUserWithIdCard.get();
|
||||||
BeanUtils.copyProperties(user, userE);
|
BeanUtils.copyProperties(user, userE);
|
||||||
userE.setId(null);
|
userE.setId(null);
|
||||||
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), UuidUtil.get32UUID());
|
userE.initFormOnboarding(cmd.getCorpinfoId(), cmd.getDepartmentId(), cmd.getPostName(), userDO.getUserId());
|
||||||
userE.setFlowFlag(flowFlag);
|
userE.setFlowFlag(flowFlag);
|
||||||
userRepository.saveOnboardingUser(userE);
|
userRepository.saveOnboardingUser(userE);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -502,6 +502,7 @@ public class UserAddExe {
|
||||||
userDOUpdate = optionalUserDO.get();
|
userDOUpdate = optionalUserDO.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
userE.setUserId(userList.get(0).getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,12 @@ public class UserRemoveExe {
|
||||||
|
|
||||||
UserDO userDO = userRepository.getById(cmd.getId());
|
UserDO userDO = userRepository.getById(cmd.getId());
|
||||||
|
|
||||||
// 获取redis验证码
|
/*// 获取redis验证码
|
||||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||||
if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||||
throw new BizException("验证码已过期或错误");
|
throw new BizException("验证码已过期或错误");
|
||||||
}
|
}
|
||||||
zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//TODO 处理所有未完成的工作,如果是非固定人员,包括所有企业的未完成工作
|
//TODO 处理所有未完成的工作,如果是非固定人员,包括所有企业的未完成工作
|
||||||
|
|
|
||||||
|
|
@ -282,5 +282,11 @@ public class UserQueryExe {
|
||||||
captchaCO.setCaptchaKey(captchaKey);
|
captchaCO.setCaptchaKey(captchaKey);
|
||||||
return captchaCO;
|
return captchaCO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||||
|
UserDO userDO =userRepository.getUserIdByPhone(getUserIdByPhoneCmd.getPhone());
|
||||||
|
return SingleResponse.of(userCoConvertor.converDOToCO(userDO));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,5 +218,10 @@ public class UserServiceImpl implements UserServiceI {
|
||||||
|
|
||||||
return userQueryExe.generateCaptcha();
|
return userQueryExe.generateCaptcha();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd) {
|
||||||
|
return userQueryExe.getUserIdByPhone(getUserIdByPhoneCmd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,5 +84,7 @@ public interface UserServiceI {
|
||||||
List<UserCorpInfoCO> getUserCorpList(Long id);
|
List<UserCorpInfoCO> getUserCorpList(Long id);
|
||||||
|
|
||||||
CaptchaCO generateCaptcha();
|
CaptchaCO generateCaptcha();
|
||||||
|
|
||||||
|
SingleResponse<UserCO> getUserIdByPhone(GetUserIdByPhoneCmd getUserIdByPhoneCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import com.jjb.saas.security.starter.serialize.dto.MaskDTO;
|
||||||
|
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:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GetUserIdByPhoneCmd {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号", name = "phone")
|
||||||
|
@NotEmpty(message = "手机号不能为空")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -41,5 +41,7 @@ public interface UserMapper extends BaseMapper<UserDO> {
|
||||||
List<UserCorpInfoDO> getListByUserIds(List<Long> userIds);
|
List<UserCorpInfoDO> getListByUserIds(List<Long> userIds);
|
||||||
|
|
||||||
void deletedUserByPhone(String phone);
|
void deletedUserByPhone(String phone);
|
||||||
|
|
||||||
|
UserDO getUserIdByPhone(String phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,7 @@ public interface UserRepository extends BaseRepository<UserDO> {
|
||||||
void updateXgf(UserE userE);
|
void updateXgf(UserE userE);
|
||||||
|
|
||||||
void deletedUserByPhone(String phone);
|
void deletedUserByPhone(String phone);
|
||||||
|
|
||||||
|
UserDO getUserIdByPhone(@NotEmpty(message = "手机号不能为空") String phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -614,5 +614,10 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
public void deletedUserByPhone(String phone) {
|
public void deletedUserByPhone(String phone) {
|
||||||
userMapper.deletedUserByPhone(phone);
|
userMapper.deletedUserByPhone(phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDO getUserIdByPhone(String phone) {
|
||||||
|
return userMapper.getUserIdByPhone(phone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -365,5 +365,8 @@
|
||||||
<update id="deletedUserByPhone">
|
<update id="deletedUserByPhone">
|
||||||
update user set delete_enum = 'TRUE' where phone = #{phone}
|
update user set delete_enum = 'TRUE' where phone = #{phone}
|
||||||
</update>
|
</update>
|
||||||
|
<select id="getUserIdByPhone" resultType="com.zcloud.basic.info.persistence.dataobject.UserDO">
|
||||||
|
select * from user where phone = #{phone} limit 1;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue