Commit c5eb066a authored by Java—KA—李 青's avatar Java—KA—李 青

创建注册流程修改

parent c548ffe7
......@@ -12,6 +12,7 @@ import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.merchant.IMerchantService;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.ILkbUserService;
......@@ -64,6 +65,8 @@ public class AppController implements IBaseController {
private IMerchantService merchantService;
@Autowired
private IUserBtRegisterService userBtRegisterService;
@Autowired
private IUserRegisterService userRegisterService;
/**
* 第三方用户登录
*/
......@@ -82,7 +85,8 @@ public class AppController implements IBaseController {
LOGGER.info("app/login第三方用户登录, loginFrom:{},channelId:{},btRegisterChannelId:{} requestIp:{},idNo:{},name:{}", registerFrom,channelId,btRegisterChannelId, requestIp,idNo,name);
User user = userService.findByPhoneInDb(phoneNo);
if (user == null) {
user = register(registerFrom, phoneNo, idNo, name, channelId,btRegisterChannelId);
// user = register(registerFrom, phoneNo, idNo, name, channelId,btRegisterChannelId);
user = userRegisterService.register(registerFrom, phoneNo, idNo, name, channelId,btRegisterChannelId);
}
if (user == null) {
return JsonResult.buildErrorStateResult(USER_ERROR_OR_PASSWORD_ERROR, null);
......
......@@ -2,43 +2,94 @@ package cn.quantgroup.xyqb.service.register;
import cn.quantgroup.xyqb.service.register.handler.AbstractUserRegisterHandler;
import cn.quantgroup.xyqb.util.ApplicationContextHolder;
import com.google.common.collect.Maps;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import javax.annotation.PostConstruct;
import java.util.Map;
/**
* Created by liqing on 2017/12/5 0005.
*/
public abstract class AbstractUserRegisterService implements IUserRegisterService {
public abstract class AbstractUserRegisterService implements IUserRegisterService,ApplicationContextAware {
protected AbstractUserRegisterHandler getDefaultUserRegisterHandler(){
AbstractUserRegisterHandler baseUserRegisterHandler = ApplicationContextHolder.getBean("baseUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler detailUserRegisterHandler = ApplicationContextHolder.getBean("detailUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler btUserRegisterHandler = ApplicationContextHolder.getBean("btUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler smsUserRegisterHandler = ApplicationContextHolder.getBean("smsUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler mqUserRegisterHandler = ApplicationContextHolder.getBean("mqUserRegisterHandler", AbstractUserRegisterHandler.class);
private static Map<String, AbstractUserRegisterHandler> userRegisterHandlerMap = Maps.newConcurrentMap();
private static final String USER_REGISTER_HANDLER_DEFAULT_KEY = "default";
private static final String USER_REGISTER_HANDLER_EXT_KEY = "ext";
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
// 创建默认注册流程
createDefaultUserRegisterHandler(applicationContext);
// 创建扩展注册流程
createExtUserRegisterHandler(applicationContext);
}
/**
* 创建默认注册流程
* 1、保存基本信息 - 2、保存用户详情 - 3、保存白条信息 - 4、发送短信 - 5、发送mq
* @param applicationContext
*/
protected AbstractUserRegisterHandler createDefaultUserRegisterHandler(ApplicationContext applicationContext){
AbstractUserRegisterHandler baseUserRegisterHandler = applicationContext.getBean("baseUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler detailUserRegisterHandler = applicationContext.getBean("detailUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler btUserRegisterHandler = applicationContext.getBean("btUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler smsUserRegisterHandler = applicationContext.getBean("smsUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler mqUserRegisterHandler = applicationContext.getBean("mqUserRegisterHandler", AbstractUserRegisterHandler.class);
baseUserRegisterHandler.setSuccessor(detailUserRegisterHandler);
detailUserRegisterHandler.setSuccessor(btUserRegisterHandler);
btUserRegisterHandler.setSuccessor(smsUserRegisterHandler);
smsUserRegisterHandler.setSuccessor(mqUserRegisterHandler);
userRegisterHandlerMap.put(USER_REGISTER_HANDLER_DEFAULT_KEY, baseUserRegisterHandler);
return baseUserRegisterHandler;
}
protected AbstractUserRegisterHandler getExtUserRegisterHandler(){
AbstractUserRegisterHandler baseUserRegisterHandler = ApplicationContextHolder.getBean("baseUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler detailUserRegisterHandler = ApplicationContextHolder.getBean("detailUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler btUserRegisterHandler = ApplicationContextHolder.getBean("btUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler smsUserRegisterHandler = ApplicationContextHolder.getBean("smsUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler mqUserRegisterHandler = ApplicationContextHolder.getBean("mqUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler addressUserRegisterHandler = ApplicationContextHolder.getBean("addressUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler contactUserRegisterHandler = ApplicationContextHolder.getBean("contactUserRegisterHandler", AbstractUserRegisterHandler.class);
baseUserRegisterHandler.setSuccessor(btUserRegisterHandler);
/*detailUserRegisterHandler.setSuccessor(btUserRegisterHandler);
btUserRegisterHandler.setSuccessor(addressUserRegisterHandler);*/
btUserRegisterHandler.setSuccessor(detailUserRegisterHandler);
detailUserRegisterHandler.setSuccessor(addressUserRegisterHandler);
/**
* 创建扩展注册流程
* 1、保存基本信息 - 2、保存用户详情 - 3、保存白条信息 - 4、保存用户地址 - 5、保存联系人
* 5、发送短信 - 6、发送mq
* @param applicationContext
*/
protected AbstractUserRegisterHandler createExtUserRegisterHandler(ApplicationContext applicationContext){
AbstractUserRegisterHandler baseUserRegisterHandler = applicationContext.getBean("baseUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler detailUserRegisterHandler = applicationContext.getBean("detailUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler btUserRegisterHandler = applicationContext.getBean("btUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler smsUserRegisterHandler = applicationContext.getBean("smsUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler mqUserRegisterHandler = applicationContext.getBean("mqUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler addressUserRegisterHandler = applicationContext.getBean("addressUserRegisterHandler", AbstractUserRegisterHandler.class);
AbstractUserRegisterHandler contactUserRegisterHandler = applicationContext.getBean("contactUserRegisterHandler", AbstractUserRegisterHandler.class);
baseUserRegisterHandler.setSuccessor(detailUserRegisterHandler);
detailUserRegisterHandler.setSuccessor(btUserRegisterHandler);
btUserRegisterHandler.setSuccessor(addressUserRegisterHandler);
addressUserRegisterHandler.setSuccessor(contactUserRegisterHandler);
contactUserRegisterHandler.setSuccessor(smsUserRegisterHandler);
smsUserRegisterHandler.setSuccessor(mqUserRegisterHandler);
userRegisterHandlerMap.put(USER_REGISTER_HANDLER_EXT_KEY, baseUserRegisterHandler);
return baseUserRegisterHandler;
}
/**
* 获取默认注册流程
* @return
*/
protected AbstractUserRegisterHandler getDefaultUserRegisterHandler(){
AbstractUserRegisterHandler curUserRegisterHandler = userRegisterHandlerMap.get(USER_REGISTER_HANDLER_DEFAULT_KEY);
if (curUserRegisterHandler == null){
curUserRegisterHandler = createDefaultUserRegisterHandler(ApplicationContextHolder.getApplicationContext());
}
return curUserRegisterHandler;
}
/**
* 获取扩展注册流程
* @return
*/
protected AbstractUserRegisterHandler getExtUserRegisterHandler(){
AbstractUserRegisterHandler curUserRegisterHandler = userRegisterHandlerMap.get(USER_REGISTER_HANDLER_EXT_KEY);
if (curUserRegisterHandler == null){
curUserRegisterHandler = createExtUserRegisterHandler(ApplicationContextHolder.getApplicationContext());
}
return curUserRegisterHandler;
}
}
......@@ -14,7 +14,7 @@ public interface IUserRegisterService {
* @return
* @throws Exception
*/
User registerDefault(UserRegisterParam userRegisterParam) throws Exception;
User registerDefault(UserRegisterParam userRegisterParam);
/**
* 以扩展流程注册
......@@ -22,7 +22,7 @@ public interface IUserRegisterService {
* @return
* @throws Exception
*/
User registerExt(UserRegisterParam userRegisterParam) throws Exception;
User registerExt(UserRegisterParam userRegisterParam);
/**
* 替换AppController.register
......@@ -35,7 +35,7 @@ public interface IUserRegisterService {
* @param btRegisterChannelId
* @return
*/
User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId, Long btRegisterChannelId) throws Exception;
User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId, Long btRegisterChannelId);
/**
* 替换InnerController里的userService.registerAndReturn
......@@ -45,7 +45,7 @@ public interface IUserRegisterService {
* @param registerFrom
* @return
*/
User register(String phoneNo, String password, Long registerFrom) throws Exception;
User register(String phoneNo, String password, Long registerFrom);
/**
* 替换UserController.register里的userService.register
......@@ -59,7 +59,7 @@ public interface IUserRegisterService {
* @param dimension
* @return
*/
boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId,String dimension) throws Exception;
boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId,String dimension);
/**
* 替换UserController.loginFast里的registerFastWhenLogin
......@@ -72,7 +72,7 @@ public interface IUserRegisterService {
* @param dimension
* @return
*/
User register(String phoneNo, Long channelId, Long registerFrom, String appChannel, Long btRegisterChannelId,String dimension) throws Exception;
User register(String phoneNo, Long channelId, Long registerFrom, String appChannel, Long btRegisterChannelId,String dimension);
/**
* 替换InnerController.saveMulti里的userService.registerAndReturn
......@@ -92,7 +92,7 @@ public interface IUserRegisterService {
* @param contacts
* @return
*/
User register(Long registeredFrom, Long channelId, String phoneNo, String name, String idNo, String provinceCode, String province, String cityCode, String city, String districtCode, String district, String address, String contacts) throws Exception;
User register(Long registeredFrom, Long channelId, String phoneNo, String name, String idNo, String provinceCode, String province, String cityCode, String city, String districtCode, String district, String address, String contacts);
/**
* 替换MotanUserServiceImpl.appLoginAndFetchLoginInfo和MotanUserServiceImpl.appLogin里的register
......@@ -103,5 +103,5 @@ public interface IUserRegisterService {
* @param channelId
* @return
*/
User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId) throws Exception;
User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId);
}
......@@ -3,8 +3,6 @@ package cn.quantgroup.xyqb.service.register.handler;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import java.text.ParseException;
/**
* Created by liqing on 2017/12/4 0004.
*/
......@@ -16,5 +14,5 @@ public abstract class AbstractUserRegisterHandler {
this.successor = successor;
}
public abstract User handleRegister(UserRegisterParam userRegisterParam) throws Exception;
public abstract User handleRegister(UserRegisterParam userRegisterParam);
}
......@@ -27,7 +27,7 @@ public class AddressUserRegisterHandler extends AbstractUserRegisterHandler {
private IAddressRepository addressRepository;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
Address address = userRegisterParam.getAddress();
User user = userRegisterParam.getUser();
address.setUserId(user.getId());
......
......@@ -34,7 +34,7 @@ public class BaseUserRegisterHandler extends AbstractUserRegisterHandler {
private IUserService userService;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
String uuid = UUID.randomUUID().toString();
// 同步用户信息到Lkb
pushUserToLkb(uuid, userRegisterParam);
......
......@@ -27,7 +27,7 @@ public class BtUserRegisterHandler extends AbstractUserRegisterHandler {
private IUserBtRegisterService userBtRegisterService;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
Long channelId = userRegisterParam.getChannelId();
User user = userRegisterParam.getUser();
Long btRegisterChannelId = userRegisterParam.getBtRegisterChannelId();
......
......@@ -33,7 +33,7 @@ public class ContactUserRegisterHandler extends AbstractUserRegisterHandler {
private IContactRepository contactRepository;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
String contact_str = userRegisterParam.getContacts();
User user = userRegisterParam.getUser();
if (StringUtils.isNotBlank(contact_str)) {
......
......@@ -16,7 +16,6 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.sql.Timestamp;
import java.text.ParseException;
/**
* Created by liqing on 2017/12/4 0004.
......@@ -34,11 +33,11 @@ public class DetailUserRegisterHandler extends AbstractUserRegisterHandler {
private IUserDetailService userDetailService;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
try {
doHandleUserDetailRegister(userRegisterParam);
} catch (Exception e) {
// 用户详情注册失败不影响流程
// 用户详情注册失败不影响注册流程
log.error("[exception][detailUserRegisterHandler_exception]userRegisterParam={},error={}",
JsonUtil.toJson(userRegisterParam), e);
}
......
......@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.service.register.handler.impl;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.service.register.handler.AbstractUserRegisterHandler;
import cn.quantgroup.xyqb.util.JsonUtil;
import cn.quantgroup.xyqb.util.MqUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
......@@ -11,6 +12,8 @@ import org.springframework.stereotype.Component;
/**
* Created by liqing on 2017/12/4 0004.
* 注册 - 发送mq
* 失败不影响注册流程
*/
@Component("mqUserRegisterHandler")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
......@@ -18,15 +21,29 @@ import org.springframework.stereotype.Component;
public class MqUserRegisterHandler extends AbstractUserRegisterHandler {
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
Long channelId = userRegisterParam.getChannelId();
String dimension = userRegisterParam.getDimension();
User user = userRegisterParam.getUser();
MqUtils.sendRegisterMessage(channelId, dimension, user);
public User handleRegister(UserRegisterParam userRegisterParam) {
try {
doHandleMqUserRegister(userRegisterParam);
} catch (Exception e) {
// 发送Mq失败不影响注册流程
log.error("[exception][mqUserRegisterHandler_exception]userRegisterParam={},error={}",
JsonUtil.toJson(userRegisterParam), e);
}
if (successor != null){
return successor.handleRegister(userRegisterParam);
}
return userRegisterParam.getUser();
}
/**
* 执行注册发送mq
* @param userRegisterParam
*/
private void doHandleMqUserRegister(UserRegisterParam userRegisterParam) {
Long channelId = userRegisterParam.getChannelId();
String dimension = userRegisterParam.getDimension();
User user = userRegisterParam.getUser();
MqUtils.sendRegisterMessage(channelId, dimension, user);
}
}
......@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.service.register.handler.AbstractUserRegisterHandler;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
......@@ -12,6 +13,8 @@ import org.springframework.stereotype.Component;
/**
* Created by liqing on 2017/12/4 0004.
* 注册 - 发送短信
* 失败不影响注册流程
*/
@Component("smsUserRegisterHandler")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
......@@ -22,7 +25,25 @@ public class SmsUserRegisterHandler extends AbstractUserRegisterHandler {
private ISmsService smsService;
@Override
public User handleRegister(UserRegisterParam userRegisterParam) throws Exception {
public User handleRegister(UserRegisterParam userRegisterParam) {
try {
doHandleSmsUserRegister(userRegisterParam);
} catch (Exception e) {
// 发送短信失败不影响注册流程
log.error("[exception][smsUserRegisterHandler_exception]userRegisterParam={},error={}",
JsonUtil.toJson(userRegisterParam), e);
}
if (successor != null){
return successor.handleRegister(userRegisterParam);
}
return userRegisterParam.getUser();
}
/**
* 执行发送短信
* @param userRegisterParam
*/
private void doHandleSmsUserRegister(UserRegisterParam userRegisterParam) {
Long registerFrom = userRegisterParam.getRegisterFrom();
String phoneNo = userRegisterParam.getPhoneNo();
if (registerFrom != 645L && registerFrom != 900L && registerFrom != 158412L) {
......@@ -32,10 +53,6 @@ public class SmsUserRegisterHandler extends AbstractUserRegisterHandler {
smsService.sendAfterRegister(phoneNo, "123");
log.info("第三方(聚美)登录用户注册成功,registerFrom:{},phoneNo:{},并且已发送短信通知", registerFrom, phoneNo);
}
if (successor != null){
return successor.handleRegister(userRegisterParam);
}
return userRegisterParam.getUser();
}
}
......@@ -15,17 +15,17 @@ import org.springframework.stereotype.Service;
public class UserRegisterServiceImpl extends AbstractUserRegisterService {
@Override
public User registerDefault(UserRegisterParam userRegisterParam) throws Exception {
public User registerDefault(UserRegisterParam userRegisterParam) {
return getDefaultUserRegisterHandler().handleRegister(userRegisterParam);
}
@Override
public User registerExt(UserRegisterParam userRegisterParam) throws Exception {
public User registerExt(UserRegisterParam userRegisterParam) {
return getExtUserRegisterHandler().handleRegister(userRegisterParam);
}
@Override
public User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId, Long btRegisterChannelId) throws Exception {
public User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId, Long btRegisterChannelId) {
// 1、生成6位随机密码
// 2、同步lkb
// 3、保存user
......@@ -42,7 +42,7 @@ public class UserRegisterServiceImpl extends AbstractUserRegisterService {
}
@Override
public User register(String phoneNo, String password, Long registerFrom) throws Exception {
public User register(String phoneNo, String password, Long registerFrom) {
// 1、同步lkb
// 2、保存user
UserRegisterParam userRegisterParam = UserRegisterParam.builder()
......@@ -53,7 +53,7 @@ public class UserRegisterServiceImpl extends AbstractUserRegisterService {
}
@Override
public boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId, String dimension) throws Exception {
public boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId, String dimension) {
// 1、同步lkb
// 2、保存user
// 3、保存bt
......@@ -70,7 +70,7 @@ public class UserRegisterServiceImpl extends AbstractUserRegisterService {
}
@Override
public User register(String phoneNo, Long channelId, Long registerFrom, String appChannel, Long btRegisterChannelId, String dimension) throws Exception {
public User register(String phoneNo, Long channelId, Long registerFrom, String appChannel, Long btRegisterChannelId, String dimension) {
// 1、生成15位随机密码
// 2、同步lkb
// 3、保存user
......@@ -86,7 +86,7 @@ public class UserRegisterServiceImpl extends AbstractUserRegisterService {
}
@Override
public User register(Long registeredFrom, Long channelId, String phoneNo, String name, String idNo, String provinceCode, String province, String cityCode, String city, String districtCode, String district, String address, String contacts) throws Exception {
public User register(Long registeredFrom, Long channelId, String phoneNo, String name, String idNo, String provinceCode, String province, String cityCode, String city, String districtCode, String district, String address, String contacts) {
// 1、生成6位随机密码
// 2、同步lkb
// 3、保存user
......@@ -112,7 +112,7 @@ public class UserRegisterServiceImpl extends AbstractUserRegisterService {
}
@Override
public User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId) throws Exception {
public User register(Long registerFrom, String phoneNo, String idNo, String name, Long channelId) {
// 1、生成6位随机密码
// 2、同步lkb
// 3、保存user
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.model.JsonResult;
/**
* @author mengfan.feng
* @time 2015-08-19 17:44
......@@ -26,13 +24,6 @@ public interface ILkbUserService {
*/
void userUpdate(String uuid, String name, String idNo);
/**
* 同步用户信息
* @param uuid
* @param phoneNo
*/
boolean pushUser(String uuid, String phoneNo);
/**
* 同步用戶信息
* @param uuid
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.util.JsonUtil;
......@@ -86,11 +85,6 @@ public class LkbUserviceImpl implements ILkbUserService {
}
}
@Override
public boolean pushUser(String uuid, String phoneNo) {
return pushUser(uuid, phoneNo, null, null);
}
@Override
public boolean pushUser(String uuid, String phoneNo, String name, String idNo) {
String timeunit = System.currentTimeMillis() + "";
......@@ -106,8 +100,8 @@ public class LkbUserviceImpl implements ILkbUserService {
.build();
String response = httpService.get(clientUrl + userPushPath, parameters);
Optional<Map> resultOptional = JsonUtil.fromJson(response, Map.class);
if (!resultOptional.isPresent() || "0".equals(resultOptional.get().get("code"))) {
LOGGER.error("[lkb_user][lkb_user_push]向LKB同步用户失败, phoneNo:{},response={}", phoneNo, response);
if (!resultOptional.isPresent() || !"0000".equals(resultOptional.get().get("code"))) {
LOGGER.error("[lkb_user_push]向LKB同步用户失败,phoneNo:{},response={}", phoneNo, response);
return false;
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment