Browse Source

修改登录时用户查询逻辑

dev
yujintao 6 years ago
parent
commit
fb19d90743
  1. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

8
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -769,8 +769,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
* @date 2019/12/7 17:19 * @date 2019/12/7 17:19
*/ */
private UserDTO selectUserByWxInfo(String openId, String unionId) { private UserDTO selectUserByWxInfo(String openId, String unionId) {
if (!StringUtils.isNotBlank(openId) && !StringUtils.isNotBlank(unionId)) { if (StringUtils.isBlank(openId)) {
throw new RenException("openId、unionId不能同时为空"); throw new RenException("openId不能同时为空");
} }
QueryWrapper<UserEntity> wrapper = new QueryWrapper<>(); QueryWrapper<UserEntity> wrapper = new QueryWrapper<>();
UserEntity userEntity = null; UserEntity userEntity = null;
@ -779,9 +779,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity = this.baseDao.selectOne(wrapper); userEntity = this.baseDao.selectOne(wrapper);
} }
if (null == userEntity) { if (null == userEntity) {
wrapper.eq(UserFieldConsant.WX_UNION_ID, unionId) wrapper.eq(UserFieldConsant.WX_OPEN_ID, openId)
.or()
.eq(StringUtils.isNotBlank(openId), UserFieldConsant.WX_OPEN_ID, openId)
.orderByDesc(FieldConstant.CREATED_TIME); .orderByDesc(FieldConstant.CREATED_TIME);
userEntity = this.baseDao.selectOne(wrapper); userEntity = this.baseDao.selectOne(wrapper);
} }

Loading…
Cancel
Save