|
|
|
@ -137,35 +137,77 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Long addSiqUser(JSONObject jsonObject) { |
|
|
|
if(UserConstants.USER_NAME_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("account")))){ |
|
|
|
//新增用户信息
|
|
|
|
UserBean userBean = new UserBean(); |
|
|
|
//设置默认用户权限,权限为默认值
|
|
|
|
userBean.setRoleId(178L); |
|
|
|
//用户姓名
|
|
|
|
userBean.setUserName(jsonObject.getString("userName")); |
|
|
|
//登录账号
|
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey,jsonObject.getString("phone")); |
|
|
|
if (StringUtils.isNotEmpty(jsonObject.getString("account"))) { |
|
|
|
userBean.setLoginName(jsonObject.getString("account")); |
|
|
|
} else { |
|
|
|
userBean.setLoginName(phone); |
|
|
|
//从进入添加程序判断
|
|
|
|
//1.先判断account账号是否为空,从而判断该判断语句是否可行,
|
|
|
|
// UserConstants.USER_NAME_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("account")))
|
|
|
|
//2.开始处理用户新增程序
|
|
|
|
//2.1 如果account 账号不为空的情况下,优先使用account来作程序判断
|
|
|
|
if(StringUtils.isNotEmpty(jsonObject.getString("account"))){ |
|
|
|
if(UserConstants.USER_NAME_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("account")))){ |
|
|
|
//新增用户信息
|
|
|
|
UserBean userBean = new UserBean(); |
|
|
|
//设置默认用户权限,权限为默认值
|
|
|
|
userBean.setRoleId(178L); |
|
|
|
//用户姓名
|
|
|
|
userBean.setUserName(jsonObject.getString("userName")); |
|
|
|
//登录账号
|
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey,jsonObject.getString("phone")); |
|
|
|
if (StringUtils.isNotEmpty(jsonObject.getString("account"))) { |
|
|
|
userBean.setLoginName(jsonObject.getString("account")); |
|
|
|
} else { |
|
|
|
userBean.setLoginName(phone); |
|
|
|
} |
|
|
|
//手机号码
|
|
|
|
userBean.setPhonenumber(phone); |
|
|
|
//设置为默认密码
|
|
|
|
userBean.setPassword("123456"); |
|
|
|
userBean.setCreateTime(DateUtils.getNowDate()); |
|
|
|
// userBean.setUserId(Long.valueOf(userId));
|
|
|
|
//部门ID设置为默认值
|
|
|
|
userBean.setDeptId("405"); |
|
|
|
UserBean ub = userApi.getUserByUserLoginName(userBean.getLoginName()); |
|
|
|
if (null != ub && null != ub.getUserId()) { |
|
|
|
return ub.getUserId(); |
|
|
|
} |
|
|
|
return userApi.insertUserResId(userBean); |
|
|
|
} |
|
|
|
//手机号码
|
|
|
|
userBean.setPhonenumber(phone); |
|
|
|
//设置为默认密码
|
|
|
|
userBean.setPassword("123456"); |
|
|
|
userBean.setCreateTime(DateUtils.getNowDate()); |
|
|
|
}else if (StringUtils.isNotEmpty(jsonObject.getString("phone"))){ |
|
|
|
if (UserConstants.USER_NAME_UNIQUE.equals(userApi.checkLoginNameUnique(jsonObject.getString("phone")))) { |
|
|
|
//新增用户信息
|
|
|
|
UserBean userBean = new UserBean(); |
|
|
|
//设置默认用户权限,权限为默认值
|
|
|
|
userBean.setRoleId(178L); |
|
|
|
//用户姓名
|
|
|
|
userBean.setUserName(jsonObject.getString("userName")); |
|
|
|
//登录账号
|
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey, jsonObject.getString("phone")); |
|
|
|
if (StringUtils.isNotEmpty(jsonObject.getString("account"))) { |
|
|
|
userBean.setLoginName(jsonObject.getString("account")); |
|
|
|
} else { |
|
|
|
userBean.setLoginName(phone); |
|
|
|
} |
|
|
|
//手机号码
|
|
|
|
userBean.setPhonenumber(phone); |
|
|
|
//设置为默认密码
|
|
|
|
userBean.setPassword("123456"); |
|
|
|
userBean.setCreateTime(DateUtils.getNowDate()); |
|
|
|
// userBean.setUserId(Long.valueOf(userId));
|
|
|
|
//部门ID设置为默认值
|
|
|
|
userBean.setDeptId("405"); |
|
|
|
UserBean ub = userApi.getUserByUserLoginName(userBean.getLoginName()); |
|
|
|
if (null != ub && null != ub.getUserId()) { |
|
|
|
return ub.getUserId(); |
|
|
|
//部门ID设置为默认值
|
|
|
|
userBean.setDeptId("405"); |
|
|
|
UserBean ub = userApi.getUserByUserLoginName(userBean.getLoginName()); |
|
|
|
if (null != ub && null != ub.getUserId()) { |
|
|
|
return ub.getUserId(); |
|
|
|
} |
|
|
|
return userApi.insertUserResId(userBean); |
|
|
|
} |
|
|
|
return userApi.insertUserResId(userBean); |
|
|
|
} |
|
|
|
UserBean tmp = userApi.getUserByUserLoginName(jsonObject.getString("account")); |
|
|
|
|
|
|
|
UserBean tmp = new UserBean(); |
|
|
|
if(StringUtils.isNotEmpty(jsonObject.getString("account"))){ |
|
|
|
tmp = userApi.getUserByUserLoginName(jsonObject.getString("account")); |
|
|
|
}else{ |
|
|
|
tmp = userApi.getUserByUserLoginName(jsonObject.getString("phone")); |
|
|
|
} |
|
|
|
return tmp.getUserId(); |
|
|
|
} |
|
|
|
|
|
|
|
|