|
@@ -12,8 +12,10 @@ import com.minto.app.message.enums.MessageEnum.MessageStateEnum;
|
|
|
import com.minto.app.message.enums.MessageEnum.MessageTypeEnum;
|
|
|
import com.minto.app.message.enums.MessageResourceTypeEnum;
|
|
|
import com.minto.app.message.manager.MessageService;
|
|
|
+import com.minto.app.organization.OrgEnum;
|
|
|
import com.minto.app.organization.beans.OrgLevelBean;
|
|
|
import com.minto.app.organization.beans.OrgPersonBean;
|
|
|
+import com.minto.app.organization.beans.OrgRelationBean;
|
|
|
import com.minto.app.organization.bo.OrgTeamBO;
|
|
|
import com.minto.app.organization.manager.IOrgManager;
|
|
|
import com.minto.app.resource.bo.CommonResourceRelationBO;
|
|
@@ -28,6 +30,7 @@ import com.minto.core.base.BaseResultCode;
|
|
|
import com.minto.core.base.ListObject;
|
|
|
import com.minto.core.base.R;
|
|
|
import com.minto.core.common.AppContext;
|
|
|
+import com.minto.core.po.BasePO;
|
|
|
import com.minto.core.util.*;
|
|
|
import org.apache.ibatis.plugin.Intercepts;
|
|
|
import org.slf4j.Logger;
|
|
@@ -47,6 +50,7 @@ import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping
|
|
@@ -201,7 +205,7 @@ public class MessageController {
|
|
|
public ModelAndView getSystemMsg(HttpServletRequest req, HttpServletResponse res) throws Exception {
|
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
|
try {
|
|
|
- //0,1用于手机端 by chenx 2018年9月18日 17:24:22
|
|
|
+ //0,1用于手机端 by chenx 2018年9月18日 17:24:22
|
|
|
Integer[] types = new Integer[] {0,1,MessageTypeEnum.System.getKey(), MessageTypeEnum.System4News.getKey(),
|
|
|
MessageTypeEnum.System4Notice.getKey(),MessageTypeEnum.System4Share.getKey()};
|
|
|
Integer[] states = new Integer[] { MessageStateEnum.Readed.getKey(), MessageStateEnum.Unread.getKey() };
|
|
@@ -230,9 +234,20 @@ public class MessageController {
|
|
|
int count = PageUtil.getRangSize(req);
|
|
|
int page = ReqUtil.getInt(req, "page",1);
|
|
|
int start = (page-1)*count;
|
|
|
+
|
|
|
+ List<Long> leaderPersonIds = null;
|
|
|
+ boolean filterLeaderComment = ReqUtil.getBoolean(req, "filterLeaderComment", false);
|
|
|
+ if(filterLeaderComment){
|
|
|
+ IOrgManager orgManager = AppContext.getBean(IOrgManager.class);
|
|
|
+ List<OrgPersonBean> leaderPersonBeans = orgManager.findPersonsByRoleCode(
|
|
|
+ OrgEnum.OrgRoleEnum.AccountLeader.name(), AppContext.getCurrentUser().getAccountId());
|
|
|
+ leaderPersonIds = leaderPersonBeans.stream().map(BasePO::getId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
MessageService msgMmanager = AppContext.getBean(MessageService.class);
|
|
|
// 暂时取消resTypes屏蔽 V6.0 看一下怎么解决
|
|
|
- ListObject<MessageBean> msgs = msgMmanager.getMsgsWithSystem(userId, types, states, null, start, count);
|
|
|
+ ListObject<MessageBean> msgs = msgMmanager.getMsgsWithSystem(userId, types, states, null, start, count,
|
|
|
+ filterLeaderComment, leaderPersonIds);
|
|
|
if((page-1)*count>msgs.getCount()){
|
|
|
page = 0;
|
|
|
}
|