移动端修改消息推送的人员查询方式
This commit is contained in:
@@ -21,8 +21,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: message-center(消息中心) <br/>
|
* Project: message-center(消息中心) <br/>
|
||||||
@@ -312,8 +311,52 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
|
|||||||
IPage<AppMessageListQuery> iPage = PagerUtil.queryToPage(pq);
|
IPage<AppMessageListQuery> iPage = PagerUtil.queryToPage(pq);
|
||||||
IPage<AppMessageListVo> page = baseMapper.getAppMsgListByUserSid(iPage, qw);
|
IPage<AppMessageListVo> page = baseMapper.getAppMsgListByUserSid(iPage, qw);
|
||||||
PagerVo<AppMessageListVo> pagerVo = PagerUtil.pageToVo(page, null);
|
PagerVo<AppMessageListVo> pagerVo = PagerUtil.pageToVo(page, null);
|
||||||
pagerVo.getRecords().stream().forEach(vo -> {
|
//定义的app的sid的index集合
|
||||||
|
Map<String, List<Integer>> appVer = new HashMap<>();
|
||||||
|
List<AppMessageListVo> records = page.getRecords();
|
||||||
|
records.removeAll(Collections.singleton(null));
|
||||||
|
if (!records.isEmpty()) {
|
||||||
|
for (int i = 0; i < records.size(); i++) {
|
||||||
|
AppMessageListVo vo = records.get(i);
|
||||||
|
if (vo.getType().equals("2")) {
|
||||||
|
//插件
|
||||||
|
List<Integer> integers = appVer.get(vo.getModuleSid());
|
||||||
|
if (integers == null) {
|
||||||
|
integers = new ArrayList<>();
|
||||||
|
}
|
||||||
|
integers.add(i);
|
||||||
|
appVer.put(vo.getModuleSid(), integers);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(vo.getJson())) {
|
||||||
|
vo.setJson("{}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 循环取map:若为同一个app版本,则只查询一次
|
||||||
|
for (String key : appVer.keySet()) {
|
||||||
|
AppSubsetVersionVo appSubsetVersions = appSubsetVersionFeign.getLastByAppSid(key).getData();
|
||||||
|
if (appSubsetVersions != null) {
|
||||||
|
List<Integer> integers = appVer.get(key);
|
||||||
|
for (int i = 0; i < integers.size(); i++) {
|
||||||
|
Integer integer = integers.get(i);
|
||||||
|
String path = fileUploadComponent.getUrlPrefix();
|
||||||
|
records.get(integer).setPath(path + appSubsetVersions.getUpdateUrl());
|
||||||
|
records.get(integer).setModuleVersion(appSubsetVersions.getVersionCode());
|
||||||
|
records.get(integer).setModulePluginName(appSubsetVersions.getModulePluginName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* pagerVo.getRecords().stream().forEach(vo -> {
|
||||||
|
vo.setPath(fileUploadComponent.getUploadPath()+vo.getPath());
|
||||||
if (vo.getType().equals("2")) {
|
if (vo.getType().equals("2")) {
|
||||||
|
//插件
|
||||||
|
List<Integer> integers = appVer.get(vo.getModuleSid());
|
||||||
|
if (integers == null) {
|
||||||
|
integers = new ArrayList<>();
|
||||||
|
}
|
||||||
|
integers.add(i);
|
||||||
|
appVer.put(appSid2, integers);
|
||||||
AppSubsetVersionVo subsetVersionVo = appSubsetVersionFeign.getLastByAppSid(vo.getModuleSid()).getData();
|
AppSubsetVersionVo subsetVersionVo = appSubsetVersionFeign.getLastByAppSid(vo.getModuleSid()).getData();
|
||||||
vo.setPath(subsetVersionVo.getUpdateUrl());
|
vo.setPath(subsetVersionVo.getUpdateUrl());
|
||||||
vo.setModulePluginName(subsetVersionVo.getModulePluginName());
|
vo.setModulePluginName(subsetVersionVo.getModulePluginName());
|
||||||
@@ -324,7 +367,7 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
|
|||||||
if (StringUtils.isBlank(vo.getJson())) {
|
if (StringUtils.isBlank(vo.getJson())) {
|
||||||
vo.setJson("{}");
|
vo.setJson("{}");
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
pagerVo.setMsg("共查询出" + pagerVo.getTotal() + "条消息");
|
pagerVo.setMsg("共查询出" + pagerVo.getTotal() + "条消息");
|
||||||
return pagerVo;
|
return pagerVo;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user