Commit 4b38be29 authored by shiyu's avatar shiyu

去除了分销商的角色,默认为false

parent 70c062ca
...@@ -211,12 +211,16 @@ public class UserServiceImpl implements UserService { ...@@ -211,12 +211,16 @@ public class UserServiceImpl implements UserService {
user.setMobile(phone); user.setMobile(phone);
result.put("phone", phone); result.put("phone", phone);
boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(dto.getUserId()); boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(dto.getUserId());
int userLevel = UserEnum.LevelEnum.COMMON.getCode();
if (collectorWhiteListFlag) { if (collectorWhiteListFlag) {
result.put("isCollector", true); result.put("isCollector", true);
userLevel = UserEnum.LevelEnum.COLLECTOR.getCode();
} else { } else {
result.put("isCollector", false); result.put("isCollector", false);
} }
int userLevel = UserEnum.LevelEnum.COMMON.getCode(); result.put("isShop", false);
/*
//判断登录用户是否是分销商 //判断登录用户是否是分销商
if (shopWhiteListDao.isExisted(dto.getUserId())) { if (shopWhiteListDao.isExisted(dto.getUserId())) {
ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId()); ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId());
...@@ -259,7 +263,7 @@ public class UserServiceImpl implements UserService { ...@@ -259,7 +263,7 @@ public class UserServiceImpl implements UserService {
logger.error("根据用户id查询店铺信息失败error:{}", e); logger.error("根据用户id查询店铺信息失败error:{}", e);
result.put("isShop", false); result.put("isShop", false);
} }
} }*/
user.setLastLoginTime(new Date()); user.setLastLoginTime(new Date());
user.setUserLevel(userLevel); user.setUserLevel(userLevel);
//更新或插入登录的用户信息 //更新或插入登录的用户信息
...@@ -268,14 +272,14 @@ public class UserServiceImpl implements UserService { ...@@ -268,14 +272,14 @@ public class UserServiceImpl implements UserService {
// 缓存用户信息 // 缓存用户信息
String userKey = MessageFormat.format(CacheCodeConstants.USER_INFO_KEY, user.getId()); String userKey = MessageFormat.format(CacheCodeConstants.USER_INFO_KEY, user.getId());
redisUtil.set(userKey, user, 2 * 60 * 60); redisUtil.set(userKey, user, 2 * 60 * 60);
//判断用户是否在藏家白名单 /* //判断用户是否在藏家白名单
if (collectorWhiteListFlag ) { if (collectorWhiteListFlag ) {
result.put("isCollector", true); result.put("isCollector", true);
} else { } else {
if (!(Boolean) result.get("isShop")) { if (!(Boolean) result.get("isShop")) {
result.put("isCollector", false); result.put("isCollector", false);
} }
} }*/
//返回用户信息 //返回用户信息
user = userDao.queryById(dto.getUserId()); user = userDao.queryById(dto.getUserId());
result.put("avatar", com.xxdxxs.utils.StringUtils.isEmpty(user.getAvatar()) ? CommConsts.DEFAULT_AVATAR_URL : user.getAvatar()); result.put("avatar", com.xxdxxs.utils.StringUtils.isEmpty(user.getAvatar()) ? CommConsts.DEFAULT_AVATAR_URL : user.getAvatar());
......
...@@ -265,22 +265,8 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -265,22 +265,8 @@ public class SelfPageServiceImpl implements SelfPageService {
} else { } else {
map.put("isCollector", false); map.put("isCollector", false);
} }
if (shopWhiteListDao.isExisted(itemUserId)) { //现在没有分销商的角色,默认为false
map.put("isShop", true);
} else {
try {
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(itemUserId, new ShopQueryOption());
if (cloudServerResponse.isSuccess()) {
ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) {
map.put("isShop", true);
}
}
} catch (Exception e) {
logger.error("根据用户id查询店铺信息失败error:{}", e);
map.put("isShop", false); map.put("isShop", false);
}
}
return Result.success(map); return Result.success(map);
} catch (Exception e) { } catch (Exception e) {
logger.error("判断主客态 error : {}", e); logger.error("判断主客态 error : {}", e);
......
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