Package com.bytedesk.service.statistic
Class ServiceStatisticService
java.lang.Object
com.bytedesk.service.statistic.ServiceStatisticService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AgentRepository
private final AgentStatusLogRepository
private final OrganizationRepository
private final QueueMemberRepository
private final ThreadRatingRepository
private final RobotRepository
private final ServiceStatisticRepository
private final ThreadTransferRepository
private final UidUtils
private final WorkgroupRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateAgentStatistic
(String orgUid, String agentUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算客服统计calculateOrgStatistic
(String orgUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算组织统计calculateRobotStatistic
(String orgUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算机器人统计private ServiceStatisticResponse
calculateStatistic
(String type, String orgUid, String workgroupUid, String agentUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 统一的统计计算方法计算状态持续时长void
计算今日统计calculateWorkgroupStatistic
(String orgUid, String workgroupUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算工作组统计queryAgentStatistics
(String orgUid, String agentUid, LocalDateTime startTime, LocalDateTime endTime) 查询处理人统计queryByDate
(ServiceStatisticRequest request) 查询某时间段统计queryOrgStatistics
(String orgUid, LocalDateTime startTime, LocalDateTime endTime) 查询组织统计queryRobotStatistics
(String orgUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime) 查询机器人统计queryWorkgroupStatistics
(String orgUid, String workgroupUid, LocalDateTime startTime, LocalDateTime endTime) 查询工作组统计private void
updateAgentStatusMetrics
(ServiceStatisticEntity statistic, Map<String, Long> statusDuration) 更新客服状态分布指标private void
updateBasicMetrics
(ServiceStatisticEntity statistic, String orgUid, LocalDateTime startTime, LocalDateTime endTime) 更新基础会话指标private void
updateMessageMetrics
(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新消息指标private void
updateQualityMetrics
(ServiceStatisticEntity statistic, String orgUid, LocalDateTime startTime, LocalDateTime endTime) 更新质量指标private void
updateRobotSpecificMetrics
(ServiceStatisticEntity statistic, List<QueueMemberEntity> robotMembers) 更新机器人特有指标private void
updateThreadFlowMetrics
(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新会话流转指标private void
updateTimeMetrics
(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新时间指标
-
Field Details
-
serviceStatisticRepository
-
queueMemberRepository
-
agentRepository
-
agentStatusLogRepository
-
ratingRepository
-
threadTransferRepository
-
organizationRepository
-
workgroupRepository
-
robotRepository
-
uidUtils
-
-
Constructor Details
-
ServiceStatisticService
public ServiceStatisticService()
-
-
Method Details
-
queryByDate
查询某时间段统计 -
queryOrgStatistics
public ServiceStatisticResponse queryOrgStatistics(String orgUid, LocalDateTime startTime, LocalDateTime endTime) 查询组织统计 -
queryWorkgroupStatistics
public ServiceStatisticResponse queryWorkgroupStatistics(String orgUid, String workgroupUid, LocalDateTime startTime, LocalDateTime endTime) 查询工作组统计 -
queryAgentStatistics
public ServiceStatisticResponse queryAgentStatistics(String orgUid, String agentUid, LocalDateTime startTime, LocalDateTime endTime) 查询处理人统计 -
queryRobotStatistics
public ServiceStatisticResponse queryRobotStatistics(String orgUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime) 查询机器人统计 -
calculateTodayStatistics
public void calculateTodayStatistics()计算今日统计 -
calculateOrgStatistic
@Transactional public ServiceStatisticResponse calculateOrgStatistic(String orgUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算组织统计 -
calculateWorkgroupStatistic
@Transactional public ServiceStatisticResponse calculateWorkgroupStatistic(String orgUid, String workgroupUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算工作组统计 -
calculateAgentStatistic
@Transactional public ServiceStatisticResponse calculateAgentStatistic(String orgUid, String agentUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算客服统计 -
calculateRobotStatistic
@Transactional public ServiceStatisticResponse calculateRobotStatistic(String orgUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 计算机器人统计 -
calculateStatistic
@Transactional private ServiceStatisticResponse calculateStatistic(String type, String orgUid, String workgroupUid, String agentUid, String robotUid, LocalDateTime startTime, LocalDateTime endTime, boolean shouldSave) 统一的统计计算方法 -
updateBasicMetrics
private void updateBasicMetrics(ServiceStatisticEntity statistic, String orgUid, LocalDateTime startTime, LocalDateTime endTime) 更新基础会话指标 -
updateThreadFlowMetrics
private void updateThreadFlowMetrics(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新会话流转指标 -
updateTimeMetrics
private void updateTimeMetrics(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新时间指标 -
updateQualityMetrics
private void updateQualityMetrics(ServiceStatisticEntity statistic, String orgUid, LocalDateTime startTime, LocalDateTime endTime) 更新质量指标 -
updateMessageMetrics
private void updateMessageMetrics(ServiceStatisticEntity statistic, List<QueueMemberEntity> queueMembers) 更新消息指标 -
calculateStatusDuration
计算状态持续时长 -
updateAgentStatusMetrics
private void updateAgentStatusMetrics(ServiceStatisticEntity statistic, Map<String, Long> statusDuration) 更新客服状态分布指标 -
updateRobotSpecificMetrics
private void updateRobotSpecificMetrics(ServiceStatisticEntity statistic, List<QueueMemberEntity> robotMembers) 更新机器人特有指标
-