|
@ -154,7 +154,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
public void register(RegisterFormDTO formDTO) { |
|
|
public void register(RegisterFormDTO formDTO) { |
|
|
//1.根据手机号查询到用户信息,判断用户是否存
|
|
|
//1.根据手机号查询到用户信息,判断用户是否存
|
|
|
List<PaUserDTO> userList = paUserDao.selectUserByPhone(formDTO.getPhone()); |
|
|
List<PaUserDTO> userList = paUserDao.selectUserByPhone(formDTO.getPhone()); |
|
|
if (null != userList || userList.size() > NumConstant.ZERO) { |
|
|
if (null != userList && userList.size() > NumConstant.ZERO) { |
|
|
throw new RenException(PaConstant.PHONE_EXCEPTION); |
|
|
throw new RenException(PaConstant.PHONE_EXCEPTION); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -172,7 +172,9 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
userEntity.setPhone(formDTO.getPhone()); |
|
|
userEntity.setPhone(formDTO.getPhone()); |
|
|
userEntity.setRealName(formDTO.getSurName()); |
|
|
userEntity.setRealName(formDTO.getSurName()); |
|
|
userEntity.setGender(formDTO.getGender().toString()); |
|
|
userEntity.setGender(formDTO.getGender().toString()); |
|
|
paUserDao.updateById(userEntity); |
|
|
if (paUserDao.updateById(userEntity) < NumConstant.ONE) { |
|
|
|
|
|
throw new RenException(PaConstant.UPDATE_USER_EXCEPTION); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//2.访问记录表新增数据
|
|
|
//2.访问记录表新增数据
|
|
|
PaUserWechatDTO dto = new PaUserWechatDTO(); |
|
|
PaUserWechatDTO dto = new PaUserWechatDTO(); |
|
@ -186,7 +188,9 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
visitedEntity.setWxOpenId(wechatEntity.getWxOpenId()); |
|
|
visitedEntity.setWxOpenId(wechatEntity.getWxOpenId()); |
|
|
visitedEntity.setOpenId(wechatEntity.getWxOpenId()); |
|
|
visitedEntity.setOpenId(wechatEntity.getWxOpenId()); |
|
|
visitedEntity.setPhone(formDTO.getPhone()); |
|
|
visitedEntity.setPhone(formDTO.getPhone()); |
|
|
paUserVisitedDao.insert(visitedEntity); |
|
|
if (paUserVisitedDao.insert(visitedEntity) < NumConstant.ONE) { |
|
|
|
|
|
throw new RenException(PaConstant.SAVE_VISITED_EXCEPTION); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -266,7 +270,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
//获取缓存中的token
|
|
|
//获取缓存中的token
|
|
|
TokenDto redisTokenDTO = cpUserDetailRedis.get(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId(), TokenDto.class); |
|
|
TokenDto redisTokenDTO = cpUserDetailRedis.get(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId(), TokenDto.class); |
|
|
if (redisTokenDTO == null) { |
|
|
if (redisTokenDTO == null) { |
|
|
return null; |
|
|
throw new RenException(PaConstant.TOKEN_EXCEPTION); |
|
|
} |
|
|
} |
|
|
//5-2.添加customerId
|
|
|
//5-2.添加customerId
|
|
|
redisTokenDTO.setCustomerId(entity.getId()); |
|
|
redisTokenDTO.setCustomerId(entity.getId()); |
|
@ -274,7 +278,6 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
String key = RedisKeys.getCpUserKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId()); |
|
|
String key = RedisKeys.getCpUserKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId()); |
|
|
long expire = redisUtils.getExpire(key); |
|
|
long expire = redisUtils.getExpire(key); |
|
|
cpUserDetailRedis.set(redisTokenDTO, expire); |
|
|
cpUserDetailRedis.set(redisTokenDTO, expire); |
|
|
|
|
|
|
|
|
//6.接口返参
|
|
|
//6.接口返参
|
|
|
CreateAgencyResultDTO resultDTO = new CreateAgencyResultDTO(); |
|
|
CreateAgencyResultDTO resultDTO = new CreateAgencyResultDTO(); |
|
|
resultDTO.setCustomerId(entity.getId()); |
|
|
resultDTO.setCustomerId(entity.getId()); |
|
@ -306,6 +309,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust |
|
|
|
|
|
|
|
|
//3.封装结果信息
|
|
|
//3.封装结果信息
|
|
|
MyInfoResultDTO resultDTO = ConvertUtils.sourceToTarget(agencyDTO, MyInfoResultDTO.class); |
|
|
MyInfoResultDTO resultDTO = ConvertUtils.sourceToTarget(agencyDTO, MyInfoResultDTO.class); |
|
|
|
|
|
resultDTO.setPartyBranchNum(agencyDTO.getPartybranchnum()); |
|
|
for (CustomerMpDTO mp : listMpDTO) { |
|
|
for (CustomerMpDTO mp : listMpDTO) { |
|
|
if (PaConstant.CLIENT_RESI.equals(mp.getClient())) { |
|
|
if (PaConstant.CLIENT_RESI.equals(mp.getClient())) { |
|
|
resultDTO.setResiAuthorization(mp.getAuthorizationFlag()); |
|
|
resultDTO.setResiAuthorization(mp.getAuthorizationFlag()); |
|
|