|
|
@ -79,10 +79,10 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public BsUser getUserByVFamilyOpenid(String vFamilyOpenid) { |
|
|
|
public BsUser getUserByOutsideOpenid(String outsideOpenid) { |
|
|
|
BsUserExample example = new BsUserExample(); |
|
|
|
BsUserExample example = new BsUserExample(); |
|
|
|
example.createCriteria() |
|
|
|
example.createCriteria() |
|
|
|
.andVFamilyOpenidEqualTo(vFamilyOpenid) |
|
|
|
.andOutsideOpenidEqualTo(outsideOpenid) |
|
|
|
.andStatusNotEqualTo(UserStatusEnum.status0.getCode()); |
|
|
|
.andStatusNotEqualTo(UserStatusEnum.status0.getCode()); |
|
|
|
List<BsUser> list = userMapper.selectByExample(example); |
|
|
|
List<BsUser> list = userMapper.selectByExample(example); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
if (!list.isEmpty()) { |
|
|
@ -129,15 +129,13 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
} |
|
|
|
} |
|
|
|
BsUser user = new BsUser(); |
|
|
|
BsUser user = new BsUser(); |
|
|
|
user.setPhone(phone); |
|
|
|
user.setPhone(phone); |
|
|
|
|
|
|
|
user.setName("嗨用户"); |
|
|
|
user.setPassword(password); |
|
|
|
user.setPassword(password); |
|
|
|
user.setIntegral(0L); |
|
|
|
user.setIntegral(0L); |
|
|
|
user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); |
|
|
|
user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); |
|
|
|
user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); |
|
|
|
user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
editData(user); |
|
|
|
editData(user); |
|
|
|
|
|
|
|
|
|
|
|
user.setName("用户"+user.getId()); |
|
|
|
|
|
|
|
editData(user); |
|
|
|
|
|
|
|
return user; |
|
|
|
return user; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -145,15 +143,13 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
public BsUser register(String outsideOpenid, Map<String, Object> other) { |
|
|
|
public BsUser register(String outsideOpenid, Map<String, Object> other) { |
|
|
|
// 查询手机号
|
|
|
|
// 查询手机号
|
|
|
|
BsUser user = new BsUser(); |
|
|
|
BsUser user = new BsUser(); |
|
|
|
user.setvFamilyOpenid(outsideOpenid); |
|
|
|
user.setOutsideOpenid(outsideOpenid); |
|
|
|
|
|
|
|
user.setName("嗨用户"); |
|
|
|
user.setIntegral(0L); |
|
|
|
user.setIntegral(0L); |
|
|
|
user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); |
|
|
|
user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); |
|
|
|
user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); |
|
|
|
user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
user.setStatus(UserStatusEnum.status1.getCode()); |
|
|
|
editData(user); |
|
|
|
editData(user); |
|
|
|
|
|
|
|
|
|
|
|
user.setName("用户"+user.getId()); |
|
|
|
|
|
|
|
editData(user); |
|
|
|
|
|
|
|
return user; |
|
|
|
return user; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -186,7 +182,7 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public SessionObject login(UserLoginPlatform platform, UserLoginType loginType, String outsideOpenid, Map<String, Object> other) throws Exception { |
|
|
|
public SessionObject login(UserLoginPlatform platform, UserLoginType loginType, String outsideOpenid, Map<String, Object> other) throws Exception { |
|
|
|
BsUser user = getUserByVFamilyOpenid(outsideOpenid); |
|
|
|
BsUser user = getUserByOutsideOpenid(outsideOpenid); |
|
|
|
if (user == null ) { |
|
|
|
if (user == null ) { |
|
|
|
user = register(outsideOpenid, other); |
|
|
|
user = register(outsideOpenid, other); |
|
|
|
} |
|
|
|
} |
|
|
@ -195,6 +191,15 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
UserSessionObject session = new UserSessionObject(); |
|
|
|
UserSessionObject session = new UserSessionObject(); |
|
|
|
session.setUser(user); |
|
|
|
session.setUser(user); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询汇联通工会卡
|
|
|
|
|
|
|
|
List<BsUserCard> hltCardList = userCardService.getCardList(user.getId(), UserCardTypeEnum.type1); |
|
|
|
|
|
|
|
if (hltCardList.isEmpty()) { |
|
|
|
|
|
|
|
session.setHltCardBind(false); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
session.setHltCardBind(true); |
|
|
|
|
|
|
|
session.setHltCard(hltCardList.get(0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SessionObject sessionObject = new SessionObject(token(user), session); |
|
|
|
SessionObject sessionObject = new SessionObject(token(user), session); |
|
|
|
userCenter.save(sessionObject); |
|
|
|
userCenter.save(sessionObject); |
|
|
|
// 异步记录登录信息
|
|
|
|
// 异步记录登录信息
|
|
|
|