Commit 6eed68c5 by shenjunjie

Merge branch 'feature' into 'release'

Feature

See merge request !62
parents 535f9309 53a223b9
......@@ -821,6 +821,7 @@ public class ChannelServiceImpl implements ChannelService {
@Override
public PageVO<ChannelVO> getChannelList(int page, int pageSize, String keyword, List<String> platforms, List<Integer> emotions, List<String> mediaTypes,
Integer[] articlesCount, String sorter) {
long s0 = System.currentTimeMillis();
String projectId = UserThreadLocal.getProjectId();
String contendId = "0";
String linkedGroupId = projectService.getProjectByContendId(projectId, contendId).getBrandLinkedGroupId();
......@@ -841,7 +842,11 @@ public class ChannelServiceImpl implements ChannelService {
long total = channelDao.count(query);
mongoUtil.start(page, pageSize, query);
channelDao.addSort(query, sorter);
long s1 = System.currentTimeMillis();
log.info("渠道准备查询耗时:" + (s1 - s0));
List<Channel> channelList = channelDao.findList(query);
long s2 = System.currentTimeMillis();
log.info("渠道查询耗时:" + (s2 - s1));
List<CompletableFuture<JSONObject>> futureList = channelList.stream().map(channel -> CompletableFuture.supplyAsync(() -> {
JSONObject result = new JSONObject();
result.put("id", channel.getId());
......@@ -858,6 +863,8 @@ public class ChannelServiceImpl implements ChannelService {
// result.put("lastArticle", markDataService.getLastMarkUrl(projectId, linkedGroupId, contendId, channel.getPlatform(), channel.getRealSource(), channel.getSource()));
// return result;
// }).collect(Collectors.toList());
long s3 = System.currentTimeMillis();
log.info("渠道发文查询耗时:" + (s3 - s2));
return PageVO.createPageVo(total, page, pageSize,
channelList.stream().map(channel -> ChannelVO.createFromChannelInfo(idMap.get(channel.getId()), projectId)).collect(Collectors.toList()));
}
......
......@@ -1485,6 +1485,8 @@ public class MarkDataServiceImpl implements MarkDataService {
if (StringUtils.isNotEmpty(emotion) && !EmotionEnum.ALL.getName().equals(emotion)) {
query.must(QueryBuilders.termQuery("brandkbs_mark_cache_maps.name.keyword", emotion));
}
searchHelper.setSize(0);
searchHelper.setQuery(query);
// 搜索结果
SearchResponse searchResponse = esClientDao.searchResponse(searchHelper);
......
......@@ -214,8 +214,8 @@ public class UserServiceImpl implements UserService {
if (null == userOld) {
ExceptionCast.cast(LoginCodeEnum.LOGIN_USERNAME_OR_PASSWORD_ERROR);
}
if (userOld.isBindUser()) {
ExceptionCast.cast(LoginCodeEnum.LOGIN_WX_WITH_USER_ERROR);
if (userOld.isBindUser() && !userOld.getNick().contains("admin")) {
ExceptionCast.cast(LoginCodeEnum.LOGIN_USER_WITH_WX_ERROR);
}
User user = userDao.findOneById(UserThreadLocal.getUserId());
if (null == user) {
......@@ -289,7 +289,9 @@ public class UserServiceImpl implements UserService {
// if (null == userId || null == projectId) {
// ExceptionCast.cast(LoginCodeEnum.LOGIN_EXPIRED_ERROR);
// }
return queryUserInfo(UserThreadLocal.getUserId(), UserThreadLocal.getProjectId()).toMap();
Map<String,Object> userInfoMap = queryUserInfo(UserThreadLocal.getUserId(), UserThreadLocal.getProjectId()).toMap();
return userInfoMap;
}
private User createNewUser(UserDTO userDTO) {
......
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