Skip to content

Commit

Permalink
Merge pull request #991 from lecjy/feature/issue-988
Browse files Browse the repository at this point in the history
fix #988
  • Loading branch information
hailiang-wang committed Dec 9, 2023
2 parents 9f536ec + f595d6e commit 5cd40f5
Showing 1 changed file with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,46 +112,37 @@ public ModelAndView index(ModelMap map, HttpServletRequest request, String useri
MainContext.AgentUserStatusEnum.END.toString()));

AgentService agentService = agentServiceList.get(0);
if (StringUtils.isNotBlank(agentservice)) {
if (StringUtils.isNotEmpty(agentservice)) {
for (AgentService as : agentServiceList) {
if (as.getId().equals(agentservice)) {
agentService = as;
break;
}
}
AgentService service = agentServiceRes.findById(agentservice).orElse(null);
if (service != null) {
map.addAttribute("tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
}
}

if (agentService != null) {
List<AgentServiceSummary> summaries = serviceSummaryRes.findByAgentserviceid(
agentService.getId());
List<AgentServiceSummary> summaries = serviceSummaryRes.findByAgentserviceid(agentService.getId());
if (summaries.size() > 0) {
map.put("summary", summaries.get(0));
}

}

agentUserContactsRes.findOneByUserid(userid).ifPresent(p -> {
if (p.getContactsid() != null) {
map.put("contacts", contactsRes.findById(p.getContactsid()).orElse(null));
}
});
AgentService service = agentServiceRes.findById(agentservice).orElse(null);
if (service != null) {
map.addAttribute(
"tags", tagRes.findByTagtypeAndSkill(MainContext.ModelType.USER.toString(), service.getSkill()));
}
map.put(
"summaryTags",
tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
map.put("curAgentService", agentService);

map.put("summaryTags", tagRes.findByTagtype(MainContext.ModelType.SUMMARY.toString()));
map.put("curAgentService", agentService);

map.put(
"agentUserMessageList",
chatMessageRepository.findByAgentserviceid(agentService.getId(),
PageRequest.of(
0, 50, Direction.DESC,
"updatetime")));
map.put("agentUserMessageList", chatMessageRepository.findByAgentserviceid(agentService.getId(),
PageRequest.of(0, 50, Direction.DESC, "updatetime")));
}

if (MainContext.ChannelType.WEIXIN.toString().equals(channel)) {
Expand Down

0 comments on commit 5cd40f5

Please sign in to comment.