lists删除

List<Map<String, Object>> trackList = bizFollowRepo.findList("trackFindPageList", params);
int trackNumber = Integer.valueOf(bizFollowRepo.count("trackFindPageListCount", params));


Iterator<Map<String, Object>> sListIterator = trackList.iterator();
while (sListIterator.hasNext()) {
Map<String, Object> trackMap = sListIterator.next();
String followType = trackMap.get("followType").toString();
String messageType = null;
if(DictConstants.FOLLOW_SOURCE_TYPE.FOLLOW_TRACK.equals(followType)){
messageType = DictConstants.AT_MESSAGE.APPLICATION_TYPE.AT_TRACK;
}else if(DictConstants.FOLLOW_SOURCE_TYPE.FOLLOW_TRACK_EVALUATE.equals(followType)){
messageType = DictConstants.AT_MESSAGE.APPLICATION_TYPE.AT_TRACK_EVALUATE;
}else if(DictConstants.FOLLOW_SOURCE_TYPE.FOLLOW_SCHEDULE.equals(followType)){
messageType = DictConstants.AT_MESSAGE.APPLICATION_TYPE.AT_SCHEDULE;
}else if(DictConstants.FOLLOW_SOURCE_TYPE.FOLLOW_SCHEDULE_REMIND.equals(followType)){
messageType = DictConstants.AT_MESSAGE.APPLICATION_TYPE.AT_SCHEDULE_REMINDTIME;
}

Object applicationId = trackMap.get("sourceId");
Map<String,Object> messageRequestMap = new HashMap<String,Object>();
messageRequestMap.put("applicationType", messageType);
messageRequestMap.put("applicationId", applicationId);
messageRequestMap.put("userId", userId);
List<BizMessage> messageList = bizMessageRepo.find(messageRequestMap);
if(messageList != null && messageList.size() >0){
trackMap.put("messageCreateTime", messageList.get(0).getCreateTime());
trackMap.put("messageContent", messageList.get(0).getContent());
}else{
// trackList.remove(trackMap);
sListIterator.remove();
trackNumber--;
}

}

posted @ 2016-03-21 18:04  为爱奋斗不息  阅读(237)  评论(0编辑  收藏  举报