mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-16 18:30:03 +08:00
Merge branch 'develop' of github.com:cskefu/cskefu into develop
This commit is contained in:
commit
fdfff6ab13
@ -27,8 +27,10 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 坐席自动分配策略集
|
* 坐席自动分配策略集
|
||||||
@ -58,6 +60,8 @@ public class ACDPolicyService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrganProxy organProxy;
|
private OrganProxy organProxy;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrganRepository organRepository;
|
||||||
/**
|
/**
|
||||||
* 载入坐席 ACD策略配置
|
* 载入坐席 ACD策略配置
|
||||||
*
|
*
|
||||||
@ -85,12 +89,26 @@ public class ACDPolicyService {
|
|||||||
if ((sessionConfig = cache.findOneSessionConfig(organid)) == null) {
|
if ((sessionConfig = cache.findOneSessionConfig(organid)) == null) {
|
||||||
sessionConfig = sessionConfigRes.findBySkill(organid);
|
sessionConfig = sessionConfigRes.findBySkill(organid);
|
||||||
if (sessionConfig == null) {
|
if (sessionConfig == null) {
|
||||||
sessionConfig = new SessionConfig();
|
List<Organ> list = organRepository.findAll();
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return new SessionConfig();
|
||||||
|
} else {
|
||||||
|
Map<String, String> map = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item.getParent()));
|
||||||
|
List<SessionConfig> configList = sessionConfigRes.findAll();
|
||||||
|
if (CollectionUtils.isEmpty(configList)) {
|
||||||
|
return new SessionConfig();
|
||||||
|
} else {
|
||||||
|
Map<String, SessionConfig> skillMap = configList.stream().collect(Collectors.toMap(item -> item.getSkill(), item -> item));
|
||||||
|
if (map.get(organid) == null || skillMap.get(map.get(organid)) == null) {
|
||||||
|
return new SessionConfig();
|
||||||
|
}
|
||||||
|
return skillMap.get(map.get(organid));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cache.putSessionConfig(sessionConfig, organid);
|
cache.putSessionConfig(sessionConfig, organid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sessionConfig;
|
return sessionConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,4 +412,4 @@ public class ACDPolicyService {
|
|||||||
return agentUserRes.countByAgentnoAndStatusAndSkill(agentStatus.getAgentno(), MainContext.AgentUserStatusEnum.INSERVICE.toString(), skill);
|
return agentUserRes.countByAgentnoAndStatusAndSkill(agentStatus.getAgentno(), MainContext.AgentUserStatusEnum.INSERVICE.toString(), skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user