Commit 4b38be29 authored by shiyu's avatar shiyu

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

parent 70c062ca
......@@ -211,12 +211,16 @@ public class UserServiceImpl implements UserService {
user.setMobile(phone);
result.put("phone", phone);
boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(dto.getUserId());
int userLevel = UserEnum.LevelEnum.COMMON.getCode();
if (collectorWhiteListFlag) {
result.put("isCollector", true);
userLevel = UserEnum.LevelEnum.COLLECTOR.getCode();
} else {
result.put("isCollector", false);
}
int userLevel = UserEnum.LevelEnum.COMMON.getCode();
result.put("isShop", false);
/*
//判断登录用户是否是分销商
if (shopWhiteListDao.isExisted(dto.getUserId())) {
ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId());
......@@ -259,7 +263,7 @@ public class UserServiceImpl implements UserService {
logger.error("根据用户id查询店铺信息失败error:{}", e);
result.put("isShop", false);
}
}
}*/
user.setLastLoginTime(new Date());
user.setUserLevel(userLevel);
//更新或插入登录的用户信息
......@@ -268,14 +272,14 @@ public class UserServiceImpl implements UserService {
// 缓存用户信息
String userKey = MessageFormat.format(CacheCodeConstants.USER_INFO_KEY, user.getId());
redisUtil.set(userKey, user, 2 * 60 * 60);
//判断用户是否在藏家白名单
/* //判断用户是否在藏家白名单
if (collectorWhiteListFlag ) {
result.put("isCollector", true);
} else {
if (!(Boolean) result.get("isShop")) {
result.put("isCollector", false);
}
}
}*/
//返回用户信息
user = userDao.queryById(dto.getUserId());
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 {
} else {
map.put("isCollector", false);
}
if (shopWhiteListDao.isExisted(itemUserId)) {
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);
}
}
//现在没有分销商的角色,默认为false
map.put("isShop", false);
return Result.success(map);
} catch (Exception 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