mirror of
https://github.com/chatopera/cosin.git
synced 2025-07-24 08:31:45 +08:00
fix #492 ACD logic
This commit is contained in:
parent
924203737d
commit
dc9e06db49
@ -56,7 +56,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<b>:yum: TA 们这样评价春松客服</b><br>
|
<b>:yum: TA 们这样评价春松客服</b><br>
|
||||||
<a href="https://www.chatopera.com/customer.html" target="_blank">
|
<a href="https://www.chatopera.com/customer.html" target="_blank">
|
||||||
<img src="./public/assets/screenshot-20211026-103937.png" width="900">
|
<img src="./public/assets/cskefu-2021-08-23-10.12.45-AM.jpg" width="900">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import com.chatopera.cc.basic.MainUtils;
|
|||||||
import com.chatopera.cc.cache.Cache;
|
import com.chatopera.cc.cache.Cache;
|
||||||
import com.chatopera.cc.model.*;
|
import com.chatopera.cc.model.*;
|
||||||
import com.chatopera.cc.persistence.repository.*;
|
import com.chatopera.cc.persistence.repository.*;
|
||||||
|
import com.chatopera.cc.proxy.OrganProxy;
|
||||||
import com.chatopera.cc.util.HashMapUtils;
|
import com.chatopera.cc.util.HashMapUtils;
|
||||||
import com.chatopera.cc.util.WebIMReport;
|
import com.chatopera.cc.util.WebIMReport;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@ -57,6 +58,9 @@ public class ACDPolicyService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SNSAccountRepository snsAccountRes;
|
private SNSAccountRepository snsAccountRes;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrganProxy organProxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 载入坐席 ACD策略配置
|
* 载入坐席 ACD策略配置
|
||||||
*
|
*
|
||||||
@ -234,10 +238,15 @@ public class ACDPolicyService {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
SNSAccount snsAccount = snsAccountRes.findBySnsidAndOrgi(agentUser.getAppid(), orgi);
|
SNSAccount snsAccount = snsAccountRes.findBySnsidAndOrgi(agentUser.getAppid(), orgi);
|
||||||
|
Map<String, Organ> allOrgan = organProxy.findAllOrganByParentIdAndOrgi(snsAccount.getOrgan(), orgi);
|
||||||
|
// allOrgan.keySet().retainAll
|
||||||
|
|
||||||
// 对于该租户的所有客服
|
// 对于该租户的所有客服
|
||||||
for (final Map.Entry<String, AgentStatus> entry : map.entrySet()) {
|
for (final Map.Entry<String, AgentStatus> entry : map.entrySet()) {
|
||||||
if ((!entry.getValue().isBusy()) && (entry.getValue().getUsers() < sessionConfig.getMaxuser()) && entry.getValue().getSkills().containsKey(snsAccount.getOrgan())) {
|
Set<String> agentSkills = entry.getValue().getSkills().keySet();
|
||||||
|
agentSkills.retainAll(allOrgan.keySet());
|
||||||
|
|
||||||
|
if ((!entry.getValue().isBusy()) && (entry.getValue().getUsers() < sessionConfig.getMaxuser()) && agentSkills.size() > 0) {
|
||||||
agentStatuses.add(entry.getValue());
|
agentStatuses.add(entry.getValue());
|
||||||
logger.info(
|
logger.info(
|
||||||
"[filterOutAvailableAgentStatus] <Redundance> find ready agent {}, agentname {}, status {}, service {}/{}, skills {}",
|
"[filterOutAvailableAgentStatus] <Redundance> find ready agent {}, agentname {}, status {}, service {}/{}, skills {}",
|
||||||
|
@ -21,6 +21,7 @@ import com.chatopera.cc.basic.MainUtils;
|
|||||||
import com.chatopera.cc.controller.Handler;
|
import com.chatopera.cc.controller.Handler;
|
||||||
import com.chatopera.cc.model.*;
|
import com.chatopera.cc.model.*;
|
||||||
import com.chatopera.cc.persistence.repository.ConsultInviteRepository;
|
import com.chatopera.cc.persistence.repository.ConsultInviteRepository;
|
||||||
|
import com.chatopera.cc.persistence.repository.OrganRepository;
|
||||||
import com.chatopera.cc.persistence.repository.SNSAccountRepository;
|
import com.chatopera.cc.persistence.repository.SNSAccountRepository;
|
||||||
import com.chatopera.cc.persistence.repository.SecretRepository;
|
import com.chatopera.cc.persistence.repository.SecretRepository;
|
||||||
import com.chatopera.cc.proxy.OrganProxy;
|
import com.chatopera.cc.proxy.OrganProxy;
|
||||||
@ -61,6 +62,9 @@ public class SNSAccountIMController extends Handler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrganProxy organProxy;
|
private OrganProxy organProxy;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrganRepository organRes;
|
||||||
|
|
||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@Menu(type = "admin", subtype = "im", access = false, admin = true)
|
@Menu(type = "admin", subtype = "im", access = false, admin = true)
|
||||||
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) {
|
||||||
@ -81,6 +85,8 @@ public class SNSAccountIMController extends Handler {
|
|||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
@Menu(type = "admin", subtype = "send", access = false, admin = true)
|
@Menu(type = "admin", subtype = "send", access = false, admin = true)
|
||||||
public ModelAndView add(ModelMap map, HttpServletRequest request) {
|
public ModelAndView add(ModelMap map, HttpServletRequest request) {
|
||||||
|
Organ currentOrgan = super.getOrgan(request);
|
||||||
|
map.put("organ", currentOrgan);
|
||||||
return request(super.createView("/admin/channel/im/add"));
|
return request(super.createView("/admin/channel/im/add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +153,10 @@ public class SNSAccountIMController extends Handler {
|
|||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
@Menu(type = "admin", subtype = "send", access = false, admin = true)
|
@Menu(type = "admin", subtype = "send", access = false, admin = true)
|
||||||
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) {
|
||||||
map.addAttribute("snsAccount", snsAccountRes.findByIdAndOrgi(id, super.getOrgi(request)));
|
SNSAccount snsAccount = snsAccountRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||||
|
Organ organ = organRes.findOne(snsAccount.getOrgan());
|
||||||
|
map.put("organ", organ);
|
||||||
|
map.addAttribute("snsAccount", snsAccount);
|
||||||
return request(super.createView("/admin/channel/im/edit"));
|
return request(super.createView("/admin/channel/im/edit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,12 +49,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
@ -1195,7 +1190,6 @@ public class IMController extends Handler {
|
|||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/leavemsg/save")
|
@RequestMapping("/leavemsg/save")
|
||||||
@Menu(type = "admin", subtype = "user")
|
@Menu(type = "admin", subtype = "user")
|
||||||
public ModelAndView leavemsgsave(HttpServletRequest request,
|
public ModelAndView leavemsgsave(HttpServletRequest request,
|
||||||
|
@ -98,6 +98,14 @@ public class OrganProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Organ> findAllOrganByParentIdAndOrgi(String organId, String orgi) {
|
||||||
|
Map<String, Organ> result = new HashMap<>();
|
||||||
|
if (StringUtils.isNotBlank(organId)) {
|
||||||
|
processChild(result, organId, orgi);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public Map<String, Organ> findAllOrganByParentAndOrgi(Organ organ, String orgi) {
|
public Map<String, Organ> findAllOrganByParentAndOrgi(Organ organ, String orgi) {
|
||||||
Map<String, Organ> result = new HashMap<>();
|
Map<String, Organ> result = new HashMap<>();
|
||||||
if (organ != null) {
|
if (organ != null) {
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
.uk-layui-form
|
.uk-layui-form
|
||||||
form.layui-form(action="/admin/im/save.html", method="post")
|
form.layui-form(action="/admin/im/save.html", method="post")
|
||||||
|
.layui-form-item
|
||||||
|
.layui-inline
|
||||||
|
label.layui-form-label(style="width:150px;") 组织机构:
|
||||||
|
.layui-input-inline
|
||||||
|
input.layui-input(type="text", name="organ", required="", lay-verify="required", autocomplete="off",value="#{organ.name}",disabled="disabled")
|
||||||
|
.layui-form-mid.layui-word-aux
|
||||||
|
font(color="red") *
|
||||||
|
| 默认为当前组织机构,在右上角切换
|
||||||
.layui-form-item
|
.layui-form-item
|
||||||
.layui-inline
|
.layui-inline
|
||||||
label.layui-form-label(style="width:150px;") 网站名称:
|
label.layui-form-label(style="width:150px;") 网站名称:
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
.uk-layui-form
|
.uk-layui-form
|
||||||
form.layui-form(action="/admin/im/update.html", method="post")
|
form.layui-form(action="/admin/im/update.html", method="post")
|
||||||
input(type="hidden", name="id", value=snsAccount.id)
|
input(type="hidden", name="id", value=snsAccount.id)
|
||||||
|
.layui-form-item
|
||||||
|
.layui-inline
|
||||||
|
label.layui-form-label(style="width:150px;") 组织机构:
|
||||||
|
.layui-input-inline
|
||||||
|
input.layui-input(type="text", name="organ", required="", lay-verify="required", autocomplete="off",value="#{organ.name}",disabled="disabled")
|
||||||
|
.layui-form-mid.layui-word-aux
|
||||||
|
font(color="red") *
|
||||||
|
| 默认为当前组织机构,在右上角切换
|
||||||
.layui-form-item
|
.layui-form-item
|
||||||
.layui-inline
|
.layui-inline
|
||||||
label.layui-form-label(style="width:150px;") 网站名称:
|
label.layui-form-label(style="width:150px;") 网站名称:
|
||||||
|
@ -7,7 +7,7 @@ block content
|
|||||||
| 网站列表 (#{snsAccountList.totalElements})
|
| 网站列表 (#{snsAccountList.totalElements})
|
||||||
span(style="float:right;")
|
span(style="float:right;")
|
||||||
if user.superadmin || user.admin
|
if user.superadmin || user.admin
|
||||||
button.layui-btn.layui-btn-small.green(href="/admin/im/add.html", data-toggle="ajax", data-width="550", data-height="300", data-title="创建新网站") 创建新网站
|
button.layui-btn.layui-btn-small.green(href="/admin/im/add.html", data-toggle="ajax", data-width="600", data-height="300", data-title="创建新网站") 创建新网站
|
||||||
.ror(style="padding:5px;")
|
.ror(style="padding:5px;")
|
||||||
.col-lg-12
|
.col-lg-12
|
||||||
table.layui-table(lay-skin="line", style="table-layout: fixed; word-break: break-all")
|
table.layui-table(lay-skin="line", style="table-layout: fixed; word-break: break-all")
|
||||||
@ -30,7 +30,7 @@ block content
|
|||||||
i.layui-icon
|
i.layui-icon
|
||||||
| 接入
|
| 接入
|
||||||
if user.superadmin || user.admin
|
if user.superadmin || user.admin
|
||||||
a(href="/admin/im/edit.html?id=" + snsAccount.id, data-toggle="ajax", data-width="550", data-height="300", data-title="编辑网站")
|
a(href="/admin/im/edit.html?id=" + snsAccount.id, data-toggle="ajax", data-width="600", data-height="300", data-title="编辑网站")
|
||||||
i.layui-icon
|
i.layui-icon
|
||||||
| 编辑
|
| 编辑
|
||||||
if (user.superadmin || user.admin) && snsAccount.datastatus != true
|
if (user.superadmin || user.admin) && snsAccount.datastatus != true
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 184 KiB |
Loading…
x
Reference in New Issue
Block a user