use of com.baomidou.mybatisplus.extension.plugins.pagination.Page in project kykms by mahonelau.
the class SysAnnouncementSendController method getMyAnnouncementSend.
/**
* @功能:获取我的消息
* @return
*/
@GetMapping(value = "/getMyAnnouncementSend")
public Result<IPage<AnnouncementSendModel>> getMyAnnouncementSend(AnnouncementSendModel announcementSendModel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Result<IPage<AnnouncementSendModel>> result = new Result<IPage<AnnouncementSendModel>>();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
announcementSendModel.setUserId(userId);
announcementSendModel.setPageNo((pageNo - 1) * pageSize);
announcementSendModel.setPageSize(pageSize);
Page<AnnouncementSendModel> pageList = new Page<AnnouncementSendModel>(pageNo, pageSize);
pageList = sysAnnouncementSendService.getMyAnnouncementSendPage(pageList, announcementSendModel);
result.setResult(pageList);
result.setSuccess(true);
return result;
}
use of com.baomidou.mybatisplus.extension.plugins.pagination.Page in project kykms by mahonelau.
the class SysOnlineController method list.
@RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<Page<SysOnlineVO>> list(@RequestParam(name = "username", required = false) String username, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Collection<String> keys = redisTemplate.keys(CommonConstant.PREFIX_USER_TOKEN + "*");
SysOnlineVO online;
List<SysOnlineVO> onlineList = new ArrayList<SysOnlineVO>();
for (String key : keys) {
online = new SysOnlineVO();
String token = (String) redisUtil.get(key);
if (!StringUtils.isEmpty(token)) {
online.setToken(token);
LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token));
BeanUtils.copyProperties(loginUser, online);
if (StringUtils.isNotEmpty(username)) {
if (StringUtils.equals(username, online.getUsername())) {
onlineList.add(online);
}
} else {
onlineList.add(online);
}
}
}
Page<SysOnlineVO> page = new Page<SysOnlineVO>(pageNo, pageSize);
int count = onlineList.size();
List<SysOnlineVO> pages = new ArrayList<>();
// 计算当前页第一条数据的下标
int currId = pageNo > 1 ? (pageNo - 1) * pageSize : 0;
for (int i = 0; i < pageSize && i < count - currId; i++) {
pages.add(onlineList.get(currId + i));
}
page.setSize(pageSize);
page.setCurrent(pageNo);
page.setTotal(count);
// 计算分页总页数
page.setPages(count % 10 == 0 ? count / 10 : count / 10 + 1);
page.setRecords(pages);
Collections.reverse(onlineList);
onlineList.removeAll(Collections.singleton(null));
Result<Page<SysOnlineVO>> result = new Result<Page<SysOnlineVO>>();
result.setSuccess(true);
result.setResult(page);
return result;
}
use of com.baomidou.mybatisplus.extension.plugins.pagination.Page in project kykms by mahonelau.
the class SysAnnouncementController method listByUser.
/**
* @功能:补充用户数据,并返回系统消息
* @return
*/
@RequestMapping(value = "/listByUser", method = RequestMethod.GET)
public Result<Map<String, Object>> listByUser() {
Result<Map<String, Object>> result = new Result<Map<String, Object>>();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
// 1.将系统消息补充到用户通告阅读标记表中
LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>();
// 全部人员
querySaWrapper.eq(SysAnnouncement::getMsgType, CommonConstant.MSG_TYPE_ALL);
// 未删除
querySaWrapper.eq(SysAnnouncement::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
// 已发布
querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND);
// 新注册用户不看结束通知
querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime());
// update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理--------------------
querySaWrapper.notInSql(SysAnnouncement::getId, "select annt_id from sys_announcement_send where user_id='" + userId + "'");
// update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理--------------------
List<SysAnnouncement> announcements = sysAnnouncementService.list(querySaWrapper);
if (announcements.size() > 0) {
for (int i = 0; i < announcements.size(); i++) {
// update-begin--Author:wangshuai Date:20200803 for: 通知公告消息重复LOWCOD-759--------------------
// 因为websocket没有判断是否存在这个用户,要是判断会出现问题,故在此判断逻辑
LambdaQueryWrapper<SysAnnouncementSend> query = new LambdaQueryWrapper<>();
query.eq(SysAnnouncementSend::getAnntId, announcements.get(i).getId());
query.eq(SysAnnouncementSend::getUserId, userId);
SysAnnouncementSend one = sysAnnouncementSendService.getOne(query);
if (null == one) {
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
announcementSend.setAnntId(announcements.get(i).getId());
announcementSend.setUserId(userId);
announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
sysAnnouncementSendService.save(announcementSend);
}
// update-end--Author:wangshuai Date:20200803 for: 通知公告消息重复LOWCOD-759------------
}
}
// 2.查询用户未读的系统消息
Page<SysAnnouncement> anntMsgList = new Page<SysAnnouncement>(0, 5);
// 通知公告消息
anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList, userId, "1");
Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0, 5);
// 系统消息
sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList, userId, "2");
Map<String, Object> sysMsgMap = new HashMap<String, Object>();
sysMsgMap.put("sysMsgList", sysMsgList.getRecords());
sysMsgMap.put("sysMsgTotal", sysMsgList.getTotal());
sysMsgMap.put("anntMsgList", anntMsgList.getRecords());
sysMsgMap.put("anntMsgTotal", anntMsgList.getTotal());
result.setSuccess(true);
result.setResult(sysMsgMap);
return result;
}
use of com.baomidou.mybatisplus.extension.plugins.pagination.Page in project kykms by mahonelau.
the class KmDocServiceImpl method searchESKmDoc.
/*
普通检索
*/
public KmSearchResultObjVO searchESKmDoc(Page<KmSearchResultVO> page, KmDocEsParamVO kmDocEsParamVO, HttpServletRequest req) throws IOException {
Map<String, String[]> parameterMap = req.getParameterMap();
List<KmDocEsVO> kmDocEsVOList = new ArrayList<>();
Page<KmSearchResultVO> resultVOPage = new Page<KmSearchResultVO>(page.getCurrent(), page.getSize());
KmSearchResultObjVO kmSearchResultObjVO = new KmSearchResultObjVO();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (sysUser == null) {
kmSearchResultObjVO.setSuccess(false);
kmSearchResultObjVO.setMessage("用户登陆信息异常");
return kmSearchResultObjVO;
}
KmSearchRecord kmSearchRecord = new KmSearchRecord();
// 在结果中检索的条件处理
HttpSession session = req.getSession();
// 最终条件
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
// 普通检索的条件,综合 : 标题、关键字、全文 合并检索
BoolQueryBuilder boolQueryBuilderDefault = QueryBuilders.boolQuery();
List<String> paramPaths = new ArrayList<>();
List<String> keywords = new ArrayList<>();
if (kmDocEsParamVO.getWithinSearchFlag() != null && kmDocEsParamVO.getWithinSearchFlag() == 1 && (session.getAttribute("searchParamsMust") != null || session.getAttribute("searchParamsFilter") != null || session.getAttribute("searchParamsShould") != null)) {
// 历史参数处理,历史参数全部用filter
Object paramObjMust = session.getAttribute("searchParamsMust");
List<QueryBuilder> must = (List<QueryBuilder>) paramObjMust;
if (must.size() > 0)
must.forEach(e -> boolQueryBuilder.filter().add(e));
Object paramObjFilter = session.getAttribute("searchParamsFilter");
List<QueryBuilder> filter = (List<QueryBuilder>) paramObjFilter;
if (filter.size() > 0)
filter.forEach(e -> boolQueryBuilder.filter().add(e));
Object paramObjShould = session.getAttribute("searchParamsShould");
List<QueryBuilder> should = (List<QueryBuilder>) paramObjShould;
if (should.size() > 0)
should.forEach(e -> boolQueryBuilder.filter().add(e));
// 参数路径处理
Object pathObj = session.getAttribute("paramPaths");
// Object pathObj = redisUtil.get(KMConstant.SearchParamPrefix + userId + "_" + "paramPaths");
if (pathObj != null) {
List<String> historyParamPath = (List<String>) pathObj;
if (historyParamPath.size() > 0) {
for (String s : historyParamPath) {
paramPaths.add(s);
}
}
}
// 搜索关键字处理
Object keywordObj = session.getAttribute("keywords");
// Object keywordObj = redisUtil.get(KMConstant.SearchParamPrefix + userId + "_" + "keywords");
if (keywordObj != null) {
List<String> historyKeywords = (List<String>) keywordObj;
if (historyKeywords.size() > 0) {
for (String s : historyKeywords) {
keywords.add(s);
}
}
}
}
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
String paramPath = "";
// 1、分类为必需条件 用filter
if (kmDocEsParamVO.getCategory() != null) {
paramPath = KMConstant.SearchTermSeprator + "分类: ";
List<String> categorys = kmDocEsParamVO.getCategory();
for (int i = 0; i < categorys.size(); i++) {
paramPath = paramPath.concat(dictUtils.getDicText("km_dict_category", categorys.get(i)));
paramPath = paramPath.concat(",");
}
paramPath = paramPath.substring(0, paramPath.length() - 1);
boolQueryBuilder.filter().add(QueryBuilders.termsQuery("category", categorys));
}
// 2、标题检索 高级用must,高级用should
if (kmDocEsParamVO.getTitle() != null && !kmDocEsParamVO.getTitle().isEmpty()) {
paramPath = KMConstant.SearchTermSeprator + "标题: " + kmDocEsParamVO.getTitle() + paramPath;
keywords.add(kmDocEsParamVO.getTitle());
kmSearchRecord.setTitle(kmDocEsParamVO.getTitle());
if (kmDocEsParamVO.getAdvSearchFlag() != null && kmDocEsParamVO.getAdvSearchFlag() == 1) {
boolQueryBuilder.must().add(QueryBuilders.matchQuery("title", kmDocEsParamVO.getTitle()).analyzer("ik_smart").boost(kmConstant.getTitleSearchBoost()));
} else {
boolQueryBuilderDefault.should().add(QueryBuilders.matchQuery("title", kmDocEsParamVO.getTitle()).analyzer("ik_smart").boost(kmConstant.getTitleSearchBoost()));
}
}
// 3、关键字检索 用term精确匹配; 高级用must,高级用should
String keywordString = "";
if (kmDocEsParamVO.getKeywords() != null && kmDocEsParamVO.getKeywords().size() > 0) {
keywordString = String.join(",", kmDocEsParamVO.getKeywords());
if ((kmDocEsParamVO.getTitle() != null && !kmDocEsParamVO.getTitle().isEmpty() && keywordString.equals(kmDocEsParamVO.getTitle())) || kmDocEsParamVO.getAdvSearchFlag() != 1) {
paramPath = KMConstant.SearchTermSeprator + "关键字" + paramPath;
} else {
paramPath = KMConstant.SearchTermSeprator + "关键字: " + keywordString + paramPath;
}
keywords.addAll(kmDocEsParamVO.getKeywords().subList(0, kmDocEsParamVO.getKeywords().size()));
kmSearchRecord.setKeywords(StringUtils.concatListToString(kmDocEsParamVO.getKeywords()));
BoolQueryBuilder boolQueryBuilderKeywords = QueryBuilders.boolQuery();
kmDocEsParamVO.getKeywords().forEach(e -> {
boolQueryBuilderKeywords.should().add(QueryBuilders.termsQuery("keywords", e).boost(kmConstant.getKeywordSearchBoost()));
});
if (kmDocEsParamVO.getAdvSearchFlag() != null && kmDocEsParamVO.getAdvSearchFlag() == 1) {
boolQueryBuilder.must().add(boolQueryBuilderKeywords);
} else {
boolQueryBuilderDefault.should().add(boolQueryBuilderKeywords);
}
}
// 4、全文检索 高级用must,高级用should
if (kmDocEsParamVO.getContent() != null && !kmDocEsParamVO.getContent().isEmpty()) {
if ((keywordString != null && !keywordString.isEmpty() && keywordString.equals(kmDocEsParamVO.getContent())) || kmDocEsParamVO.getAdvSearchFlag() != 1) {
paramPath = KMConstant.SearchTermSeprator + "全文" + paramPath;
} else {
paramPath = KMConstant.SearchTermSeprator + "全文: " + kmDocEsParamVO.getContent() + paramPath;
}
keywords.add(kmDocEsParamVO.getContent());
kmSearchRecord.setContent(kmDocEsParamVO.getContent());
if (kmDocEsParamVO.getAdvSearchFlag() != null && kmDocEsParamVO.getAdvSearchFlag() == 1) {
boolQueryBuilder.must().add(QueryBuilders.matchQuery("content", kmDocEsParamVO.getContent()).analyzer("ik_smart").boost(kmConstant.getContentSearchBoost()));
} else {
boolQueryBuilderDefault.should().add(QueryBuilders.matchQuery("content", kmDocEsParamVO.getContent()).analyzer("ik_smart").boost(kmConstant.getContentSearchBoost()));
}
}
// 处理普通检索的合并条件:标题、关键字、全文
if (kmDocEsParamVO.getAdvSearchFlag() == null || kmDocEsParamVO.getAdvSearchFlag() == 0) {
boolQueryBuilder.must().add(boolQueryBuilderDefault);
}
// 5、发布时间检索 用filter
if (parameterMap.containsKey("pubTimeEnd")) {
paramPath = KMConstant.SearchTermSeprator + "发布时间结束: " + kmDocEsParamVO.getPubTimeEnd() + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.rangeQuery("pubTime").lte(kmDocEsParamVO.getPubTimeEnd()));
}
if (parameterMap.containsKey("pubTimeStart")) {
paramPath = KMConstant.SearchTermSeprator + "发布时间开始: " + kmDocEsParamVO.getPubTimeStart() + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.rangeQuery("pubTime").gte(kmDocEsParamVO.getPubTimeStart()));
}
// 6、来源检索 用filter
if (kmDocEsParamVO.getSource() != null && !kmDocEsParamVO.getSource().isEmpty()) {
String tmpSource = "";
List<String> source = kmDocEsParamVO.getSource();
for (int i = 0; i < source.size(); i++) {
tmpSource = tmpSource.concat(dictUtils.getDicText("km_dict_source", source.get(i)));
tmpSource = tmpSource.concat(",");
}
paramPath = KMConstant.SearchTermSeprator + "来源: " + tmpSource.substring(0, tmpSource.length() - 1) + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.termsQuery("source", source));
}
// 7、业务类型检索(多选) 用filter
if (kmDocEsParamVO.getBusinessTypes() != null && kmDocEsParamVO.getBusinessTypes().size() > 0) {
String tmpBusinessType = "";
List<String> businessTypes = kmDocEsParamVO.getBusinessTypes();
for (int i = 0; i < businessTypes.size(); i++) {
tmpBusinessType = tmpBusinessType.concat(dictUtils.getDicText("km_dict_business", businessTypes.get(i)));
tmpBusinessType = tmpBusinessType.concat(",");
}
paramPath = KMConstant.SearchTermSeprator + "业务类型: " + tmpBusinessType.substring(0, tmpBusinessType.length() - 1) + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.termsQuery("businessTypes", businessTypes));
}
// 8、版本状态检索(多选) 用filter
if (kmDocEsParamVO.getVersions() != null && kmDocEsParamVO.getVersions().size() > 0) {
String tmpVersion = "";
List<String> versions = kmDocEsParamVO.getVersions();
for (int i = 0; i < versions.size(); i++) {
tmpVersion = tmpVersion.concat(dictUtils.getDicText("km_dict_versions", versions.get(i)));
tmpVersion = tmpVersion.concat(",");
}
paramPath = KMConstant.SearchTermSeprator + "版本: " + tmpVersion.substring(0, tmpVersion.length() - 1) + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.termsQuery("versions", versions));
}
// 9、专题检索(多选,前缀模糊匹配) 用filter
if (kmDocEsParamVO.getTopicCodes() != null && kmDocEsParamVO.getTopicCodes().size() > 0) {
String tmpTopicCodes = "";
kmSearchRecord.setTopicCodes(StringUtils.concatListToString(kmDocEsParamVO.getTopicCodes()));
BoolQueryBuilder boolQueryBuilderTopicCodes = QueryBuilders.boolQuery();
List<String> topicCodes = kmDocEsParamVO.getTopicCodes();
for (int i = 0; i < topicCodes.size(); i++) {
// 模糊匹配,匹配某个字符串开头的记录prefixQuery
boolQueryBuilderTopicCodes.should().add(QueryBuilders.prefixQuery("topicCodes", topicCodes.get(i)));
String topicName = sysBaseAPI.queryCategoryNameByCode(topicCodes.get(i));
if (topicName != null)
tmpTopicCodes = tmpTopicCodes.concat(topicName);
else
tmpTopicCodes = tmpTopicCodes.concat(topicCodes.get(i));
tmpTopicCodes = tmpTopicCodes.concat(",");
}
paramPath = KMConstant.SearchTermSeprator + "专题: " + tmpTopicCodes.substring(0, tmpTopicCodes.length() - 1) + paramPath;
boolQueryBuilder.filter().add(boolQueryBuilderTopicCodes);
}
// 10、文号,(前缀模糊匹配) 用filter
if (kmDocEsParamVO.getFileNo() != null && !kmDocEsParamVO.getFileNo().isEmpty()) {
paramPath = KMConstant.SearchTermSeprator + "文号: " + kmDocEsParamVO.getFileNo() + paramPath;
boolQueryBuilder.filter().add(QueryBuilders.wildcardQuery("fileNo", kmDocEsParamVO.getFileNo()));
}
// 去掉检索参数第一个+
if (!paramPath.isEmpty() && paramPath.length() > 3)
paramPath = paramPath.substring(3);
// 11、发布状态必须为1
boolQueryBuilder.filter().add(QueryBuilders.termQuery("releaseFlag", 1));
// 排序,对字典文本字段,去掉后缀
if (kmDocEsParamVO.getColumn() != null && !kmDocEsParamVO.getColumn().isEmpty() && kmDocEsParamVO.getOrder() != null && !kmDocEsParamVO.getOrder().isEmpty()) {
String column = kmDocEsParamVO.getColumn();
String order = kmDocEsParamVO.getOrder();
if (column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) {
column = column.substring(0, column.lastIndexOf(CommonConstant.DICT_TEXT_SUFFIX));
}
// if(column.equals("pubTimeTxt")) {
// column = "pubTime";
// }
FieldSortBuilder fieldSortBuilder = SortBuilders.fieldSort(column).order(SortOrder.fromString(order));
searchSourceBuilder.sort(fieldSortBuilder);
}
searchSourceBuilder.query(boolQueryBuilder);
// highlight field 仅对title
HighlightBuilder highlightBuilder = new HighlightBuilder().field("title").requireFieldMatch(false);
highlightBuilder.preTags("<span style=\"color:blue\">");
highlightBuilder.postTags("</span>");
searchSourceBuilder.highlighter(highlightBuilder);
// 分页
// 注意分页的坑,from要从0开始
long from = page.getCurrent() < 1 ? 0 : page.getSize() * (page.getCurrent() - 1);
long size = page.getSize() > 100 ? 100 : page.getSize();
size = size < 0 ? 10 : size;
searchSourceBuilder.from((int) from);
searchSourceBuilder.size((int) size);
// 超时 60S
searchSourceBuilder.timeout(new TimeValue(KMConstant.SearchTimeOutSeconds, TimeUnit.SECONDS));
// 过滤返回结果字段,去掉非必要信息,关键:去掉content
// {"content","keywords"};
String[] excludeFields = { "content" };
// {"id","title","source","versions","pubTime"};
String[] includeFields = {};
searchSourceBuilder.fetchSource(includeFields, excludeFields);
SearchRequest searchRequest = new SearchRequest();
searchRequest.source(searchSourceBuilder);
searchRequest.indices(KMConstant.DocIndexAliasName);
log.debug(searchRequest.source().toString());
// 分页、排序变换的时候不更新session,历史条件不叠加
if (paramPaths == null || paramPaths.size() == 0 || !paramPaths.get(paramPaths.size() - 1).equals(paramPath)) {
paramPaths.add(paramPath);
session.setAttribute("searchParamsMust", boolQueryBuilder.must());
session.setAttribute("searchParamsFilter", boolQueryBuilder.filter());
session.setAttribute("searchParamsShould", boolQueryBuilder.should());
session.setAttribute("paramPaths", paramPaths);
session.setAttribute("keywords", keywords);
}
kmSearchResultObjVO.setParamPath(paramPaths);
SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
if (searchResponse.status() != RestStatus.OK || searchResponse.getHits().getTotalHits().value <= 0) {
kmSearchResultObjVO.setKmSearchResultVOPage(resultVOPage);
kmSearchResultObjVO.setSuccess(true);
} else {
SearchHits hits = searchResponse.getHits();
SearchHit[] searchHits = hits.getHits();
for (SearchHit hit : searchHits) {
log.debug(hit.getSourceAsString());
KmDocEsVO kmDocEsVO = JSON.parseObject(hit.getSourceAsString(), KmDocEsVO.class);
Map<String, HighlightField> highlightFields = hit.getHighlightFields();
// 获取title高亮显示
if (highlightFields != null && highlightFields.size() > 0) {
HighlightField highlight = highlightFields.get("title");
// 获取高亮显示的字段
Text[] fragments = highlight.fragments();
String fragmentString = fragments[0].string();
kmDocEsVO.setTitle(fragmentString);
}
kmDocEsVOList.add(kmDocEsVO);
}
List<KmSearchResultVO> kmSearchResultVOList = retrieveDocDbInfo(kmDocEsVOList);
resultVOPage.setRecords(kmSearchResultVOList);
// set page
resultVOPage.setTotal(hits.getTotalHits().value);
resultVOPage.setHitCount(hits.getTotalHits().value > 0);
kmSearchResultObjVO.setKmSearchResultVOPage(resultVOPage);
kmSearchResultObjVO.setSuccess(true);
}
// 日志和限制
executorService.execute(() -> kmSearchRecordService.logSearch(kmSearchRecord.getKeywords(), kmSearchRecord.getTitle(), kmSearchRecord.getContent(), kmSearchRecord.getTopicCodes(), IpUtils.getIpAddr(req)));
return kmSearchResultObjVO;
}
use of com.baomidou.mybatisplus.extension.plugins.pagination.Page in project kykms by mahonelau.
the class KmDocController method searchDoc.
@ApiOperation(value = "km_doc-普通检索", notes = "km_doc-普通检索")
@GetMapping(value = "/searchDoc")
public Result<?> searchDoc(KmDocEsParamVO kmDocEsParamVO, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
try {
if (kmDocEsParamVO.getKeywords() != null && kmDocEsParamVO.getKeywords().size() > 0) {
kmDocEsParamVO.setKeywords(StringUtils.splitStrListToList(kmDocEsParamVO.getKeywords()));
}
Page<KmSearchResultVO> page = new Page<KmSearchResultVO>(pageNo, pageSize);
KmSearchResultObjVO kmSearchResultObjVO = kmDocService.searchESKmDoc(page, kmDocEsParamVO, req);
if (kmSearchResultObjVO.isSuccess()) {
dictUtils.parseDictText(kmSearchResultObjVO);
return Result.OK(kmSearchResultObjVO);
} else
return Result.error(kmSearchResultObjVO.getMessage());
} catch (IOException e) {
return Result.error(e.getMessage());
}
}
Aggregations