|
@ -465,6 +465,19 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void npmVerifyUserRegisterData(EpdcUserRegistFormDTO formDto) { |
|
|
|
|
|
// 校验身份证号码格式
|
|
|
|
|
|
String verification = IdentityNoUtils.IdentityNoVerification(formDto.getIdentityNo()); |
|
|
|
|
|
if (StringUtils.isNotBlank(verification)) { |
|
|
|
|
|
throw new RenException(verification); |
|
|
|
|
|
} |
|
|
|
|
|
// 校验身份证号、手机号是否已被注册
|
|
|
|
|
|
Result verifyUserRegisterData = userFeignClient.npmVerifyUserRegisterData(formDto); |
|
|
|
|
|
if (!verifyUserRegisterData.success()) { |
|
|
|
|
|
throw new RenException(verifyUserRegisterData.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 校验手机验证码 |
|
|
* 校验手机验证码 |
|
|
* |
|
|
* |
|
@ -1580,7 +1593,7 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<EpdcAppRegisterCallbackDTO> npmUserRegister(EpdcUserNpmRegisterFormDTO formDto) { |
|
|
public Result<EpdcAppRegisterCallbackDTO> npmUserRegister(EpdcUserNpmRegisterFormDTO formDto) { |
|
|
UserDTO userDTO = generateUserDTO(formDto); |
|
|
UserDTO userDTO = generateNpmUserDTO(formDto); |
|
|
return userFeignClient.nmpUserRegister(userDTO); |
|
|
return userFeignClient.nmpUserRegister(userDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1594,6 +1607,47 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
return userFeignClient.npmUserUpdate(userDTO); |
|
|
return userFeignClient.npmUserUpdate(userDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private UserDTO generateNpmUserDTO(EpdcUserNpmRegisterFormDTO formDto){ |
|
|
|
|
|
EpdcUserRegistFormDTO epdcUserRegistFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcUserRegistFormDTO.class); |
|
|
|
|
|
epdcUserRegistFormDTO.setRoad(""); |
|
|
|
|
|
if (null != formDto.getCouplingCommunity()) { |
|
|
|
|
|
epdcUserRegistFormDTO.setCouplingCommunity(String.join(",", formDto.getCouplingCommunity())); |
|
|
|
|
|
} |
|
|
|
|
|
npmVerifyUserRegisterData(epdcUserRegistFormDTO); |
|
|
|
|
|
|
|
|
|
|
|
Long deptId; |
|
|
|
|
|
if (formDto.getAllDeptIds() != null && formDto.getAllDeptIds().length > 1) { |
|
|
|
|
|
deptId = Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 1]); |
|
|
|
|
|
} else { |
|
|
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
|
|
deptId = user.getDeptId(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
WxMaJscode2SessionResult nmpWxUser = this.getNMPWxUser(formDto.getWxCode()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取网格机构详情
|
|
|
|
|
|
Result<CompleteDeptDTO> adminDeptResult = adminFeignClient.getCompleteDept(deptId); |
|
|
|
|
|
if (!adminDeptResult.success() || null == adminDeptResult.getData()) { |
|
|
|
|
|
throw new RenException("查询网格信息失败"); |
|
|
|
|
|
} |
|
|
|
|
|
CompleteDeptDTO completeDept = adminDeptResult.getData(); |
|
|
|
|
|
|
|
|
|
|
|
epdcUserRegistFormDTO.setGridId(deptId); |
|
|
|
|
|
UserDTO userDTO = this.packageUserDto(epdcUserRegistFormDTO, nmpWxUser.getUnionid(), nmpWxUser.getOpenid(), completeDept); |
|
|
|
|
|
userDTO.setDeptId(deptId); |
|
|
|
|
|
userDTO.setPartyFlag(String.valueOf(formDto.getPartyFlag())); |
|
|
|
|
|
userDTO.setShibei(formDto.getShibei()); |
|
|
|
|
|
userDTO.setWorkUnit(formDto.getWorkUnit()); |
|
|
|
|
|
userDTO.setWorkType(formDto.getWorkType()); |
|
|
|
|
|
userDTO.setWorkIndustry(formDto.getWorkIndustry()); |
|
|
|
|
|
userDTO.setWorkIndustryText(formDto.getWorkIndustryText()); |
|
|
|
|
|
// IP地址
|
|
|
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
|
|
|
|
|
userDTO.setLastLoginIp(IpUtils.getIpAddr(request)); |
|
|
|
|
|
|
|
|
|
|
|
return userDTO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private UserDTO generateUserDTO(EpdcUserNpmRegisterFormDTO formDto) { |
|
|
private UserDTO generateUserDTO(EpdcUserNpmRegisterFormDTO formDto) { |
|
|
EpdcUserRegistFormDTO epdcUserRegistFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcUserRegistFormDTO.class); |
|
|
EpdcUserRegistFormDTO epdcUserRegistFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcUserRegistFormDTO.class); |
|
|
epdcUserRegistFormDTO.setRoad(""); |
|
|
epdcUserRegistFormDTO.setRoad(""); |
|
|