diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0efdb5b9..00000000 --- a/.drone.yml +++ /dev/null @@ -1,20 +0,0 @@ -pipeline: - build-contact-center: - group: build - image: plugins/docker - context: contact-center - dockerfile: contact-center/Dockerfile - repo: chatopera/contact-center - tags: develop - secrets: [ docker_username, docker_password ] - - build-cc-switch: - group: build - image: plugins/docker - context: cc-switch/app - dockerfile: cc-switch/app/Dockerfile - repo: chatopera/cc-switch - tags: develop - secrets: [ docker_username, docker_password ] - -branches: develop \ No newline at end of file diff --git a/.gitignore b/.gitignore index f1331a46..11b7236c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ backups/ .env build.gradle .vscode/ +private diff --git a/.vscode/sftp.json b/.vscode/sftp.json deleted file mode 100644 index 56d10a59..00000000 --- a/.vscode/sftp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "sftp", - "remotePath": "git/cosinee", - "protocol": "sftp", - "uploadOnSave": true, - "port": 22, - "profiles": { - "gamera": { - "name": "gamera", - "host": "gamera", - "username": "hain", - "privateKeyPath": "/Users/hain/.ssh/id_rsa" - } - } -} diff --git a/README.md b/README.md index 9477606e..c2f8db9f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,247 @@ -# 春松客服企业版 +[![Docker Layers](https://images.microbadger.com/badges/image/chatopera/contact-center:develop.svg)](https://microbadger.com/images/chatopera/contact-center:develop "Get your own image badge on microbadger.com") [![Docker Version](https://images.microbadger.com/badges/version/chatopera/contact-center:develop.svg)](https://microbadger.com/images/chatopera/contact-center:develop "Get your own version badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/chatopera/contact-center.svg)](https://hub.docker.com/r/chatopera/contact-center/) [![Docker Stars](https://img.shields.io/docker/stars/chatopera/contact-center.svg)](https://hub.docker.com/r/chatopera/contact-center/) [![Docker Commit](https://images.microbadger.com/badges/commit/chatopera/contact-center:develop.svg)](https://microbadger.com/images/chatopera/contact-center:develop "Get your own commit badge on microbadger.com") -https://gitlab.chatopera.com/chatopera +

+ 春松客服QQ交流群:185659917, 点击链接加入群聊
+ +

-## License +# 春松客服: 全渠道智能客服 -Copyright 2019 北京华夏春松科技有限公司 . All rights reserved. -This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. +春松客服是帮助中小型企业快速而低成本的获得好用的智能客服系统。 + + + +春松客服是 Chatopera 自主研发以及基于且增强其它开源软件的方式实现的,春松客服会不断增强客服系统的智能化,这包括利用自然语言处理、机器学习和语音识别等技术让客服工作更有效率、客服满意度更高、成本更低。 + +**开源项目地址:** [https://github.com/chatopera/cosin](https://github.com/chatopera/cosin) + +**开发环境搭建:** [https://github.com/chatopera/cosin/wiki/春松客服:开发环境](https://github.com/chatopera/cosin/wiki/%E6%98%A5%E6%9D%BE%E5%AE%A2%E6%9C%8D%EF%BC%9A%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83) + +## 内容结构 + +[产品演示](https://github.com/chatopera/cosin#%E4%BA%A7%E5%93%81%E6%BC%94%E7%A4%BA) + +[功能](https://github.com/chatopera/cosin#%E5%8A%9F%E8%83%BD) + +[开发文档](https://github.com/chatopera/cosin#%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3) + +[产品截图](https://github.com/chatopera/cosin#%E4%BA%A7%E5%93%81%E6%88%AA%E5%9B%BE) + +[产品体系](https://github.com/chatopera/cosin#%E4%BA%A7%E5%93%81%E4%BD%93%E7%B3%BB) + +[立即部署](https://github.com/chatopera/cosin#%E7%AB%8B%E5%8D%B3%E9%83%A8%E7%BD%B2) + +[鸣谢](https://github.com/chatopera/cosin#%E9%B8%A3%E8%B0%A2) + +[开源许可协议](https://github.com/chatopera/cosin#%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE) + +## 产品演示 + +- 坐席工作台 + +[http://cc.chatopera.com/](http://cc.chatopera.com/) + +| **登录账号** | **密码** | +| ------------ | --------- | +| admin | admin1234 | + +- 网页端访客程序 + +[http://cc.chatopera.com/testclient.html](http://cc.chatopera.com/testclient.html) + +## 功能 + +- 账号及组织机构管理:按组织、角色分配账号权限 + +- 联系人管理:细粒度维护客户信息 + +- 网页聊天组件:一分钟接入对话窗口 + +- 坐席工作台:汇聚多渠道访客请求 + +- 机器人客服:集成机器人平台服务,完成多轮对话和知识库问答 + +- 外呼系统:自动外呼,手动外呼,监听和报表等 + + 《春松客服产品系列视频》 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号内容腾讯视频百度网盘
No. 1产品概述观看下载
No. 2安装部署观看下载
No. 3功能演示观看下载
No. 4账号体系观看下载
No. 5客户关系管理观看下载
No. 6即时通信观看下载
No. 7呼叫中心观看下载
No. 8数据报表观看下载
+ +[_下载视频合集_](https://pan.baidu.com/s/1YH7d7nMm5wZQp7P8kID3KA) + +## 使用说明 + +关于产品的具体使用说明,请参考[文档中心](https://docs.chatopera.com/omni-channel-customer-support-system.html)。 + +## 来自真实用户的反馈 + +``` +项目代码写的挺好的,容易维护,是不错的开源项目。 +``` + +-- 海洋 (深圳银之杰项目经理) + +``` +Amazing! 要的就是这个效果。 +``` + +-- 常经理 (某电器世界五百强企业) + +``` +我要在APP内集成,我看了好多项目了,就你们这个最好,基本就是一个商用化的项目。 +``` + +-- Engine X (某二手车出售平台技术负责人) + +## 开发文档 + +

+ 开发文档
+ + + +

+ +## 产品截图 + +

+ 欢迎页
+ +

+ +

+ 坐席工作台
+ +

+ +

+ 坐席监控
+ +

+ +

+ 外呼计划
+ +

+ +

+ 通话记录
+ +

+ +

+ 集成客服机器人
+ +

+ +

+ 客服机器人应答
+ +

+ +

+ 更多功能,敬请期待 ...
+ +

+ +## 产品体系 + +

+ 观看视频介绍
+ + + +

+ +## 立即部署 + +- 企业版 + +通过青云 AppCenter 部署,青云 AppCenter 是开发运维一体化(DevOps)管理企业应用的平台,Chatopera 的春松客服在 2018 年 10 月登录 AppCenter,并借助 PaaS 平台强大的计算能力实现计算节点集群、存储节点 HADR。从而保证了服务高可靠性、高性能、动态伸缩、一键备份和一键回滚等功能。 + +青云 AppCenter 以其提供的资源秒级计算特点,企业使用 AppCenter 中的春松客服应用,可以按需付费,灵活升配和降配,Chatopera 也非常推荐客户使用青云服务。 + +

+ 春松客服 on QingCloud
+ + + +

+ +更为详细的部署文档见[春松客服上架青云 AppCenter](https://github.com/chatopera/cosin/wiki/%E6%98%A5%E6%9D%BE%E5%AE%A2%E6%9C%8D%E4%B8%8A%E6%9E%B6%E9%9D%92%E4%BA%91AppCenter)。 + +- 社区版 + +参考部署[开源社区版本文档](https://github.com/chatopera/cosin/wiki/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%83%A8%E7%BD%B2)。 + +## 鸣谢 + +[优客服](https://gitee.com/beimigame/ukefu) + +[FreeSWITCH 中国社区](http://www.freeswitch.org.cn/) + +## 开源许可协议 + +Copyright (2018) 北京华夏春松科技有限公司 + +[Apache License Version 2.0](https://github.com/chatopera/cosin/blob/master/LICENSE) + +[![chatoper banner][co-banner-image]][co-url] + +[co-banner-image]: https://user-images.githubusercontent.com/3538629/42383104-da925942-8168-11e8-8195-868d5fcec170.png +[co-url]: https://www.chatopera.com diff --git a/cc-chatbot/.gitignore b/cc-chatbot/.gitignore deleted file mode 100644 index f5d7ffde..00000000 --- a/cc-chatbot/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -*.swp -*.swo -*.sublime-* -*.pyc -jmeter.log -__pycache__ -tmp/ -node_modules/ -sftp-config.json -.DS_Store -*.iml -*.ipr -*.iws -*.idea -~$*.xls* -~$*.ppt* -~$*.doc* -app/target/ diff --git a/cc-chatbot/README.md b/cc-chatbot/README.md deleted file mode 100644 index d0185eda..00000000 --- a/cc-chatbot/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# cc-chatbot -Chatopera智能问答引擎的Java SDK. -https://docs.chatopera.com/ - -支持 - -* 创建聊天机器人 -* 查询聊天机器人列表 -* 更新聊天机器人画像 -* 查询聊天机器人使用情况 -* 管理和检索多轮对话 -* 管理和检索知识库 -* 检索意图识别 - - -# 配置 - -使用maven,需要配置Chatopera的Nexus OSS仓库,具体见[文档](https://github.com/chatopera/cosin/wiki/%E6%98%A5%E6%9D%BE%E5%AE%A2%E6%9C%8D%EF%BC%9A%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83#%E4%BF%AE%E6%94%B9maven2%E9%85%8D%E7%BD%AE)。 - -``` - - com.chatopera.chatbot - sdk - 1.0-SNAPSHOT - -``` - -# API - -## Chatbot v1 - -聊天机器人类,构造参数(tcp协议,hostname, 端口, 版本) - -### Chatbot#getChatbots -获取聊天机器人列表,支持检索查询,分页 - -### Chatbot#getChatbot -通过聊天机器人ID获得聊天机器人详情 - -### Chatbot#conversation -与指定的聊天机器人进行多轮对话 - -### Chatbot#faq -与指定的聊天机器人进行知识库问答 - - -# 测试 - -``` -mvn test -``` - -# 示例 - -``` -Chatbot cb = new Chatbot("http", "lhc-dev", 8003, "v1"); -JSONObject resp = cb.conversation("co_bot_1", "sdktest", "华夏春松在哪里", false); -``` - -返回值参考 [智能问答引擎文档](https://docs.chatopera.com/chatbot-engine.html)。 - - -## 开源许可协议 - -Copyright (2018) 北京华夏春松科技有限公司 - -[Apache License Version 2.0](https://github.com/chatopera/cosin/blob/master/LICENSE) - -[![chatoper banner][co-banner-image]][co-url] - -[co-banner-image]: https://user-images.githubusercontent.com/3538629/42383104-da925942-8168-11e8-8195-868d5fcec170.png -[co-url]: https://www.chatopera.com - diff --git a/cc-chatbot/admin/deploy.sh b/cc-chatbot/admin/deploy.sh deleted file mode 100755 index e4ddd7a7..00000000 --- a/cc-chatbot/admin/deploy.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -########################################### -# -########################################### - -# constants -baseDir=$(cd `dirname "$0"`;pwd) -# functions - -# main -[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return -cd $baseDir/../app -mvn clean deploy -Dmaven.test.skip=true diff --git a/cc-chatbot/admin/gen-idea.sh b/cc-chatbot/admin/gen-idea.sh deleted file mode 100755 index 865f884c..00000000 --- a/cc-chatbot/admin/gen-idea.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -########################################### -# -########################################### - -# constants -baseDir=$(cd `dirname "$0"`;pwd) -# functions - -# main -[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return -cd $baseDir/../app -mvn idea:idea diff --git a/cc-chatbot/admin/package.sh b/cc-chatbot/admin/package.sh deleted file mode 100755 index fcd86068..00000000 --- a/cc-chatbot/admin/package.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -########################################### -# -########################################### - -# constants -baseDir=$(cd `dirname "$0"`;pwd) -# functions - -# main -[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return -cd $baseDir/../app -mvn package diff --git a/cc-chatbot/admin/test.sh b/cc-chatbot/admin/test.sh deleted file mode 100755 index d122e6a0..00000000 --- a/cc-chatbot/admin/test.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -########################################### -# -########################################### - -# constants -baseDir=$(cd `dirname "$0"`;pwd) -# functions - -# main -[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return -cd $baseDir/../app -mvn test diff --git a/cc-chatbot/app/.classpath b/cc-chatbot/app/.classpath deleted file mode 100644 index f0257c5a..00000000 --- a/cc-chatbot/app/.classpath +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cc-chatbot/app/.project b/cc-chatbot/app/.project deleted file mode 100644 index 5c1f81b8..00000000 --- a/cc-chatbot/app/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - sdk - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/cc-chatbot/app/.settings/org.eclipse.core.resources.prefs b/cc-chatbot/app/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index f9fe3459..00000000 --- a/cc-chatbot/app/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/test/java=UTF-8 -encoding/=UTF-8 diff --git a/cc-chatbot/app/.settings/org.eclipse.jdt.apt.core.prefs b/cc-chatbot/app/.settings/org.eclipse.jdt.apt.core.prefs deleted file mode 100644 index d4313d4b..00000000 --- a/cc-chatbot/app/.settings/org.eclipse.jdt.apt.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.apt.aptEnabled=false diff --git a/cc-chatbot/app/.settings/org.eclipse.jdt.core.prefs b/cc-chatbot/app/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5592a0a1..00000000 --- a/cc-chatbot/app/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.processAnnotations=disabled -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cc-chatbot/app/.settings/org.eclipse.m2e.core.prefs b/cc-chatbot/app/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1..00000000 --- a/cc-chatbot/app/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/cc-chatbot/app/pom.xml b/cc-chatbot/app/pom.xml deleted file mode 100644 index 09879747..00000000 --- a/cc-chatbot/app/pom.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - 4.0.0 - - com.chatopera.chatbot - sdk - 1.1.0 - jar - - sdk - Java SDK for Chatopera Conversational Engine. - https://www.chatopera.com - - - UTF-8 - 1.8 - 1.8 - - - - - org.apache.commons - commons-lang3 - 3.0 - - - org.apache.httpcomponents - httpclient - 4.3.6 - - - org.apache.httpcomponents - httpasyncclient - 4.0.2 - - - org.apache.httpcomponents - httpmime - 4.3.6 - - - org.json - json - 20140107 - - - com.mashape.unirest - unirest-java - 1.4.9 - - - junit - junit - 3.8.1 - - - junit - junit - 4.12 - test - - - - - - - - maven-clean-plugin - 3.0.0 - - - maven-site-plugin - 3.7 - - - maven-project-info-reports-plugin - 2.9 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.7.0 - - - maven-surefire-plugin - 2.20.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - - - - chatopera - http://192.168.2.217:8029/repository/maven-snapshots/ - - - chatopera - http://192.168.2.217:8029/repository/maven-releases/ - - - - - hain - Hai Liang Wang - hailiang.hl.wang@gmail.com - https://github.com/Samurais - Chatopera Inc. - http://www.chatopera.com - - architect - developer - - Asia/Shanghai - - - - - - maven-project-info-reports-plugin - - - - diff --git a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPI.java b/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPI.java deleted file mode 100644 index 1a65bea7..00000000 --- a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPI.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.chatbot; - -import com.mashape.unirest.http.exceptions.UnirestException; -import org.apache.commons.lang3.StringUtils; -import org.json.JSONObject; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; - -public class ChatbotAPI { - private String schema; - private String hostname; - private int port; - private String baseUrl; - - private ChatbotAPI() { - } - - - public ChatbotAPI(final String baseUrl) throws ChatbotAPIRuntimeException, MalformedURLException { - if (StringUtils.isBlank(baseUrl)) - throw new ChatbotAPIRuntimeException("智能问答引擎URL不能为空。"); - - URL url = new URL(baseUrl); - this.schema = url.getProtocol(); - this.hostname = url.getHost(); - this.port = url.getPort(); - - if (port == -1) { - this.baseUrl = this.schema + "://" + this.hostname + "/api/v1"; - } else { - this.baseUrl = this.schema + "://" + this.hostname + ":" + this.port + "/api/v1"; - } - - } - - public ChatbotAPI(final String schema, final String hostname, final int port, final String version) { - this.schema = schema; - this.hostname = hostname; - this.port = port; - this.baseUrl = schema + "://" + hostname + ":" + Integer.toString(this.port) + "/api/" + version; - } - - public ChatbotAPI(final String schema, final String hostname, final int port) { - this(schema, hostname, port, "v1"); - } - - public ChatbotAPI(final String hostname, final int port) { - this("http", hostname, port); - } - - public String getSchema() { - return schema; - } - - public String getHostname() { - return hostname; - } - - public int getPort() { - return port; - } - - public String getBaseUrl() { - return baseUrl; - } - - /** - * 获取聊天机器人列表 - * - * @return - * @throws ChatbotAPIRuntimeException - */ - public JSONObject getChatbots(final String fields, final String q, final int page, final int limit) throws ChatbotAPIRuntimeException { - try { - HashMap queryString = new HashMap(); - if (StringUtils.isNotBlank(fields)) { - queryString.put("fields", fields); - } - - if (StringUtils.isNotBlank(q)) { - queryString.put("q", q); - } - - queryString.put("page", page); - - if (limit > 0) { - queryString.put("limit", limit); - } - - return RestAPI.get(this.getBaseUrl() + "/chatbot", queryString); - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * 通过ChatbotID检查一个聊天机器人是否存在 - * - * @param chatbotID - * @return - */ - public boolean exists(final String chatbotID) throws ChatbotAPIRuntimeException { - try { - JSONObject result = this.getChatbot(chatbotID); - int rc = result.getInt("rc"); - if (rc == 0) { - return true; - } else if (rc == 3) { - return false; - } else { - throw new ChatbotAPIRuntimeException("查询聊天机器人异常返回。"); - } - } catch (Exception e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - - /** - * 创建聊天机器人 - * - * @param chatbotID 聊天机器人标识,由[a-zA-Z0-9-]组成,字母开头 - * @param name 拟人化的名字 - * @param primaryLanguage 首选语言,支持 [zh_CN|en_US] - * @param fallback 兜底回复 - * @param description 描述 - * @param welcome 欢迎语 - * @return - */ - public JSONObject createBot(final String chatbotID, - final String name, - final String primaryLanguage, - final String fallback, - final String description, - final String welcome) throws ChatbotAPIRuntimeException { - HashMap body = new HashMap(); - body.put("chatbotID", chatbotID); - body.put("name", name); - body.put("primaryLanguage", primaryLanguage); - body.put("description", description); - body.put("fallback", fallback); - body.put("welcome", welcome); - - try { - return RestAPI.post(this.getBaseUrl() + "/chatbot/" + chatbotID, body); - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * 更新聊天机器人 - * - * @param chatbotID - * @param description - * @param fallback - * @param welcome - * @return - * @throws ChatbotAPIRuntimeException - */ - public boolean updateByChatbotID(final String chatbotID, - final String name, - final String description, - final String fallback, - final String welcome) throws ChatbotAPIRuntimeException { - if (StringUtils.isBlank(chatbotID)) - throw new ChatbotAPIRuntimeException("不合法的参数,【chatbotID】不能为空。"); - - HashMap body = new HashMap(); - if (StringUtils.isNotBlank(description)) - body.put("description", description); - if (StringUtils.isNotBlank(fallback)) - body.put("fallback", fallback); - if (StringUtils.isNotBlank(welcome)) - body.put("welcome", welcome); - if (StringUtils.isNotBlank(name)) - body.put("name", name); - - try { - JSONObject result = RestAPI.put(this.baseUrl + "/chatbot/" + chatbotID, body, null); - if (result.getInt("rc") == 0) { - return true; - } else { - return false; - } - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - - } - - - /** - * 删除聊天机器人 - * - * @param chatbotID - * @return - * @throws ChatbotAPIRuntimeException - */ - public boolean deleteByChatbotID(final String chatbotID) throws ChatbotAPIRuntimeException { - if (StringUtils.isBlank(chatbotID)) - throw new ChatbotAPIRuntimeException("聊天机器人ID不能为空。"); - try { - JSONObject result = RestAPI.delete(this.getBaseUrl() + "/chatbot/" + chatbotID, null); - if (result.getInt("rc") == 0) - return true; - return false; - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * 获取聊天机器人详情 - * - * @param chatbotID - * @return - * @throws ChatbotAPIRuntimeException - */ - public JSONObject getChatbot(final String chatbotID) throws ChatbotAPIRuntimeException { - try { - return RestAPI.get(this.getBaseUrl() + "/chatbot/" + chatbotID); - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * validate params - * - * @param chatbotID - * @param fromUserId - * @param textMessage - */ - private void v(final String chatbotID, final String fromUserId, final String textMessage) throws ChatbotAPIRuntimeException { - if (StringUtils.isBlank(chatbotID)) - throw new ChatbotAPIRuntimeException("[conversation] 不合法的聊天机器人标识。"); - - if (StringUtils.isBlank(fromUserId)) - throw new ChatbotAPIRuntimeException("[conversation] 不合法的用户标识。"); - - if (StringUtils.isBlank(textMessage)) - throw new ChatbotAPIRuntimeException("[conversation] 不合法的消息内容。"); - } - - /** - * 与聊天机器人进行多轮对话 - * - * @param fromUserId - * @param textMessage - * @param debug - * @return - */ - public JSONObject conversation(final String chatbotID, final String fromUserId, final String textMessage, boolean debug) throws ChatbotAPIRuntimeException { - v(chatbotID, fromUserId, textMessage); - HashMap body = new HashMap(); - body.put("fromUserId", fromUserId); - body.put("textMessage", textMessage); - body.put("isDebug", debug); - - try { - JSONObject resp = RestAPI.post(this.getBaseUrl() + "/chatbot/" + chatbotID + "/conversation/query", body); - return resp; - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * 意图识别 - * @param chatbotID - * @param clientId - * @param textMessage - * @return - * @throws UnirestException - */ - public JSONObject intent(final String chatbotID, final String clientId, final String textMessage) throws ChatbotAPIRuntimeException { - if(StringUtils.isBlank(chatbotID) || StringUtils.isBlank(clientId) || StringUtils.isBlank(textMessage)) - throw new ChatbotAPIRuntimeException("参数不合法,不能为空。"); - - HashMap body = new HashMap(); - body.put("clientId", clientId); - body.put("query", textMessage); - try { - JSONObject result = RestAPI.post(this.baseUrl + "/chatbot/" + chatbotID, body); - return result; - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - - /** - * 检索知识库 - * - * @param chatbotID - * @param fromUserId - * @param textMessage - * @param isDebug - * @return - */ - public JSONObject faq(final String chatbotID, final String fromUserId, final String textMessage, final boolean isDebug) throws ChatbotAPIRuntimeException { - v(chatbotID, fromUserId, textMessage); - HashMap body = new HashMap(); - body.put("fromUserId", fromUserId); - body.put("query", textMessage); - body.put("isDebug", isDebug); - try { - JSONObject resp = RestAPI.post(this.getBaseUrl() + "/chatbot/" + chatbotID + "/faq/query", body); - return resp; - } catch (UnirestException e) { - throw new ChatbotAPIRuntimeException(e.toString()); - } - } - -} diff --git a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPIRuntimeException.java b/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPIRuntimeException.java deleted file mode 100644 index 7a7c73b9..00000000 --- a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/ChatbotAPIRuntimeException.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.chatbot; - -import com.mashape.unirest.http.exceptions.UnirestException; - -public class ChatbotAPIRuntimeException extends Exception{ - public ChatbotAPIRuntimeException(String msg) { - super(msg); - } -} diff --git a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/RestAPI.java b/cc-chatbot/app/src/main/java/com/chatopera/chatbot/RestAPI.java deleted file mode 100644 index ee5f7e57..00000000 --- a/cc-chatbot/app/src/main/java/com/chatopera/chatbot/RestAPI.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.chatbot; - -import com.mashape.unirest.http.HttpResponse; -import com.mashape.unirest.http.JsonNode; -import com.mashape.unirest.http.Unirest; -import com.mashape.unirest.http.exceptions.UnirestException; -import com.mashape.unirest.request.GetRequest; -import com.mashape.unirest.request.HttpRequestWithBody; -import org.json.JSONObject; - -import java.util.HashMap; - -/** - * RestAPI接口 - */ -public class RestAPI { - - /** - * patch headers - * - * @param headers - */ - private static void x(HashMap headers) { - if (headers == null) { - headers = new HashMap(); - headers.put("accept", "application/json"); - return; - } - - if (!headers.containsKey("Content-Type")) - headers.put("Content-Type", "application/json"); - - - if (!headers.containsKey("accept")) - headers.put("accept", "application/json"); - } - - - /** - * Post - * - * @param url - * @param body - * @param query - * @param headers - * @return - * @throws UnirestException - */ - public static JSONObject post(final String url, final HashMap body, final HashMap query, HashMap headers) throws UnirestException { - HttpRequestWithBody request = Unirest.post(url); - x(headers); - HttpResponse resp = request - .headers(headers) - .queryString(query) - .fields(body) - .asJson(); - - // parse response - JSONObject obj = resp.getBody().getObject(); - return obj; - } - - public static JSONObject post(final String url, final HashMap body) throws UnirestException { - return post(url, body, null, null); - } - - /** - * Get - * - * @param url - * @param queryString - * @param headers - * @return - * @throws UnirestException - */ - public static JSONObject get(final String url, final HashMap queryString, HashMap headers) throws UnirestException { - GetRequest request = Unirest.get(url); - x(headers); - HttpResponse resp = request - .headers(headers) - .queryString(queryString) - .asJson(); - // parse response - JSONObject obj = resp.getBody().getObject(); - return obj; - } - - public static JSONObject get(final String url) throws UnirestException { - return get(url, null, null); - } - - public static JSONObject get(final String url, HashMap queryString) throws UnirestException { - return get(url, queryString, null); - } - - public static JSONObject delete(final String url, HashMap headers) throws UnirestException { - x(headers); - return Unirest.delete(url).headers(headers).asJson().getBody().getObject(); - } - - public static JSONObject put(final String url, HashMap body, HashMap headers) throws UnirestException { - x(headers); - return Unirest.put(url).headers(headers).fields(body).asJson().getBody().getObject(); - } -} diff --git a/cc-chatbot/app/src/site/site.xml b/cc-chatbot/app/src/site/site.xml deleted file mode 100644 index 1be54a63..00000000 --- a/cc-chatbot/app/src/site/site.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - sdk - https://maven.apache.org/images/apache-maven-project.png - https://www.apache.org/ - - - - https://maven.apache.org/images/maven-logo-black-on-white.png - https://maven.apache.org/ - - - - org.apache.maven.skins - maven-fluido-skin - 1.7 - - - - - - - \ No newline at end of file diff --git a/cc-chatbot/app/src/test/java/com/chatopera/chatbot/ChatbotAPITest.java b/cc-chatbot/app/src/test/java/com/chatopera/chatbot/ChatbotAPITest.java deleted file mode 100644 index 303ed688..00000000 --- a/cc-chatbot/app/src/test/java/com/chatopera/chatbot/ChatbotAPITest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.chatbot; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.json.JSONObject; - -import java.net.MalformedURLException; - -/** - * Unit test for simple App. - */ -public class ChatbotAPITest - extends TestCase { - private ChatbotAPI cb; - - /** - * Create the test case - * - * @param testName name of the test case - */ - public ChatbotAPITest(String testName) { - super(testName); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() { - return new TestSuite(ChatbotAPITest.class); - } - - public void setUp() { - this.cb = new ChatbotAPI("http", "lhc-dev", 8003, "v1"); - } - - /** - * Rigourous Test :-) - */ - public void testChatbot() { - assertEquals(this.cb.getPort(), 8003); - } - - public void testGetChatbot() { - try { - JSONObject resp = this.cb.getChatbot("co_bot_1"); - System.out.println("[testGetChatbot] " + resp.toString()); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - public void testGetChatbots() { - try { - JSONObject resp = this.cb.getChatbots("name chatbotID", null, 0, 10); - System.out.println("[testGetChatbots] resp " + resp.toString()); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - public void testConversation() { - try { - JSONObject resp = this.cb.conversation("co_bot_1", "sdktest", "华夏春松在哪里", false); - System.out.println("[testConversation] resp " + resp.toString()); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - public void testFaq() { - try { - JSONObject resp = this.cb.faq("co_bot_1", "sdktest", "华夏春松在哪里", false); - System.out.print("[testFaq] resp " + resp.toString()); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - public void testParseUrl() { - try { - ChatbotAPI c = new ChatbotAPI("https://local:8000/"); - System.out.println("chatbot baseUrl " + c.getBaseUrl()); - assertEquals("https://local:8000/api/v1", c.getBaseUrl()); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - - public void testExists() { - JSONObject profile = null; - try { - assertTrue(this.cb.exists("co_bot_1")); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - public void testCreateBot() { - try { - JSONObject j = this.cb.createBot("cc_bot_2", - "小云2", - "zh_CN", - "我不了解。", - "小云机器人", - "你好,我是小云。"); - } catch (ChatbotAPIRuntimeException e) { - e.printStackTrace(); - } - } - - -} - - diff --git a/contact-center/admin/package.sh b/contact-center/admin/package.sh index 68d5183e..288dafad 100755 --- a/contact-center/admin/package.sh +++ b/contact-center/admin/package.sh @@ -7,7 +7,7 @@ baseDir=$(cd `dirname "$0"`;pwd) # functions -# main +# main [ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return cd $baseDir/../app mvn clean package diff --git a/contact-center/app/.gitignore b/contact-center/app/.gitignore index 41459fda..0fe12476 100644 --- a/contact-center/app/.gitignore +++ b/contact-center/app/.gitignore @@ -2,6 +2,7 @@ src/main/java/com/chatopera/cc/plugins/ # ignore views within plugins -!src/main/resources/templates/admin/channel/callout/ !src/main/resources/templates/admin/channel/im/ src/main/resources/templates/admin/channel/* +src/main/resources/templates/apps/callout +src/main/resources/templates/apps/chatbot diff --git a/contact-center/app/pom.xml b/contact-center/app/pom.xml index 889b08d5..006b67aa 100644 --- a/contact-center/app/pom.xml +++ b/contact-center/app/pom.xml @@ -6,7 +6,7 @@ 5.0.0 war cskefu - 春松客服企业版:多媒体呼叫中心,下一代呼叫中心 + 春松客服:多渠道智能客服系统 org.springframework.boot spring-boot-starter-parent diff --git a/contact-center/app/src/main/java/com/chatopera/cc/Application.java b/contact-center/app/src/main/java/com/chatopera/cc/Application.java index 9c7c6d1e..ee1b152b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/Application.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/Application.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,52 +65,34 @@ public class Application { /** * 记载模块 */ - // 外呼模块 - private final static boolean isCalloutModule = SystemEnvHelper.parseModuleFlag("cskefu.module.callout"); - - // CRM模块 - private final static boolean isContactsModule = SystemEnvHelper.parseModuleFlag("cskefu.module.contacts"); - - // 聊天机器人模块 - private final static boolean isChatbotModule = SystemEnvHelper.parseModuleFlag("cskefu.module.chatbot"); - - // 访客聊天监控模块 - private final static boolean isCcaModule = SystemEnvHelper.parseModuleFlag("cskefu.module.cca"); - - // 企业聊天模块 - private final static boolean isEntImModule = SystemEnvHelper.parseModuleFlag("cskefu.module.entim"); - - // 渠道:Skype渠道 - private final static boolean isSkypeModule = SystemEnvHelper.isClassExistByFullName( - PluginRegistry.PLUGIN_ENTRY_SKYPE); - static { - // 外呼模块 - if (isCalloutModule) { - MainContext.enableModule(Constants.CSKEFU_MODULE_CALLOUT); - } // CRM模块 - if (isContactsModule) { - MainContext.enableModule(Constants.CSKEFU_MODULE_CONTACTS); - } - // 聊天机器人模块 - if (isChatbotModule) { - MainContext.enableModule(Constants.CSKEFU_MODULE_CHATBOT); + MainContext.enableModule(Constants.CSKEFU_MODULE_CONTACTS); + + // 会话监控模块 Customer Chats Audit + MainContext.enableModule(Constants.CSKEFU_MODULE_CCA); + + // 企业聊天模块 + MainContext.enableModule(Constants.CSKEFU_MODULE_ENTIM); + + /** + * 插件组 + */ + // 外呼模块 + if (SystemEnvHelper.isClassExistByFullName( + PluginRegistry.PLUGIN_ENTRY_CALLOUT)) { + MainContext.enableModule(Constants.CSKEFU_MODULE_CALLOUT); } // skype模块 - if (isSkypeModule) { + if (SystemEnvHelper.isClassExistByFullName( + PluginRegistry.PLUGIN_ENTRY_SKYPE)) { MainContext.enableModule(Constants.CSKEFU_MODULE_SKYPE); } - // 会话监控模块 Customer Chats Audit - if (isCcaModule) { - MainContext.enableModule(Constants.CSKEFU_MODULE_CCA); - - } - // 企业聊天模块 - if (isEntImModule) { - MainContext.enableModule(Constants.CSKEFU_MODULE_ENTIM); + // 聊天机器人模块 + if (SystemEnvHelper.isClassExistByFullName(PluginRegistry.PLUGIN_ENTRY_CHATBOT)) { + MainContext.enableModule(Constants.CSKEFU_MODULE_CHATBOT); } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/ServletInitializer.java b/contact-center/app/src/main/java/com/chatopera/cc/ServletInitializer.java index f11e80c0..4394300e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/ServletInitializer.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/ServletInitializer.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/acd/AutomaticServiceDist.java b/contact-center/app/src/main/java/com/chatopera/cc/acd/AutomaticServiceDist.java index f166566c..439d2150 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/acd/AutomaticServiceDist.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/acd/AutomaticServiceDist.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/activemq/ChatbotEventSubscription.java b/contact-center/app/src/main/java/com/chatopera/cc/activemq/ChatbotEventSubscription.java deleted file mode 100644 index 3f798db2..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/activemq/ChatbotEventSubscription.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2019 Chatopera Inc, All rights reserved. - * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. - */ - -package com.chatopera.cc.activemq; - -import com.chatopera.bot.exception.ChatbotException; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.socketio.message.ChatMessage; -import com.chatopera.cc.proxy.ChatbotProxy; -import com.chatopera.cc.model.AgentUser; -import com.chatopera.cc.model.Chatbot; -import com.chatopera.cc.persistence.repository.AgentUserRepository; -import com.chatopera.cc.persistence.repository.ChatbotRepository; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.util.SerializeUtil; -import org.json.JSONException; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.jms.annotation.JmsListener; -import org.springframework.stereotype.Component; - -import java.net.MalformedURLException; - -/** - * 发送消息给聊天机器人并处理返回结果 - */ -@Component -public class ChatbotEventSubscription { - private final static Logger logger = LoggerFactory.getLogger(ChatbotEventSubscription.class); - - @Autowired - private Cache cache; - - @Autowired - private AgentUserRepository agentUserRes; - - @Autowired - private ChatbotRepository chatbotRes; - - @Value("${bot.baseurl}") - private static String botBaseUrl; - - @Autowired - private ChatbotProxy chatbotProxy; - - /** - * 接收发送消息给聊天机器人的请求 - * - * @param payload - */ - @JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_QUEUE_CHATBOT, containerFactory = "jmsListenerContainerQueue") - public void onMessage(final String payload) { - ChatMessage message = SerializeUtil.deserialize(payload); - try { - chat(message); - } catch (MalformedURLException e) { - logger.error("[onMessage] error", e); - } catch (ChatbotException e) { - logger.error("[onMessage] error", e); - } - } - - - private void chat(final ChatMessage request) throws MalformedURLException, ChatbotException, JSONException { - Chatbot c = chatbotRes - .findOne(request.getAiid()); - - logger.info( - "[chat] chat request baseUrl {}, chatbot {}, fromUserId {}, textMessage {}", botBaseUrl, c.getName(), - request.getUserid(), request.getMessage()); - // Get response from Conversational Engine. - com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot( - c.getClientId(), c.getSecret(), botBaseUrl); - JSONObject result = bot.conversation(request.getUserid(), request.getMessage()); - - // parse response - if (result != null) { - logger.info("[chat] chat response {}", result.toString()); - if (result.getInt(RestUtils.RESP_KEY_RC) == 0) { - // reply - JSONObject data = result.getJSONObject("data"); - ChatMessage resp = new ChatMessage(); - resp.setCalltype(MainContext.CallType.OUT.toString()); - resp.setAppid(resp.getAppid()); - resp.setOrgi(request.getOrgi()); - resp.setAiid(request.getAiid()); - resp.setMessage(data.getString("string")); - resp.setTouser(request.getUserid()); - resp.setAgentserviceid(request.getAgentserviceid()); - resp.setMsgtype(request.getMsgtype()); - resp.setUserid(request.getUserid()); - resp.setType(request.getType()); - resp.setChannel(request.getChannel()); - if (data.has("params")) { - resp.setExpmsg(data.get("params").toString()); - } - resp.setContextid(request.getContextid()); - resp.setSessionid(request.getSessionid()); - resp.setUsession(request.getUsession()); - resp.setUsername(c.getName()); - resp.setUpdatetime(System.currentTimeMillis()); - - // 更新聊天机器人累计值 - updateAgentUserWithRespData(request.getUserid(), request.getOrgi(), data); - // 保存并发送 - chatbotProxy.saveAndPublish(resp); - } else { - logger.warn("[chat] can not get expected response {}", result.toString()); - } - } - } - - /** - * 根据聊天机器人返回数据更新agentUser - * - * @param userid - * @param data - */ - private void updateAgentUserWithRespData(final String userid, final String orgi, final JSONObject data) throws JSONException { - cache.findOneAgentUserByUserIdAndOrgi(userid, orgi).ifPresent(p -> { - p.setChatbotround(p.getChatbotround() + 1); - if (data.has("logic_is_unexpected") && data.getBoolean("logic_is_unexpected")) { - p.setChatbotlogicerror(p.getChatbotlogicerror() + 1); - } - agentUserRes.save(p); - }); - - } - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/activemq/PbxEventSubscription.java b/contact-center/app/src/main/java/com/chatopera/cc/activemq/PbxEventSubscription.java deleted file mode 100644 index 37fe4e1c..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/activemq/PbxEventSubscription.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2019 Chatopera Inc, All rights reserved. - * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. - */ -package com.chatopera.cc.activemq; - -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.persistence.interfaces.CalloutWireEvent; -import com.chatopera.cc.schedule.CalloutWireTask; -import com.chatopera.cc.basic.Constants; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Conditional; -import org.springframework.jms.annotation.JmsListener; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; - -/** - * FreeSWITCH - */ -@Component -@Conditional(CalloutBeanCondition.class) -public class PbxEventSubscription { - - private final static Logger logger = LoggerFactory.getLogger(PbxEventSubscription.class); - - @PostConstruct - public void setup() { - logger.info("ActiveMQ Subscription is setup successfully."); - } - - @Autowired - private BrokerPublisher brokerPublisher; - - @Autowired - private CalloutWireTask callOutWireTask; - - public void publish(final String dest, final String payload) { - brokerPublisher.send(dest, payload); - } - - @JmsListener(destination = Constants.INSTANT_MESSAGING_MQ_QUEUE_PBX, containerFactory = "jmsListenerContainerQueue") - public void onMessage(final String payload) { - logger.info("[onMessage] payload {}", payload); - JsonParser parser = new JsonParser(); - JsonObject j = parser.parse(payload).getAsJsonObject(); - // validate message - if (!(j.has("type") - && j.has("to") - && j.has("ops") - && j.has("channel") - && j.has("createtime"))) { - logger.error(String.format("[callout wire] 接线数据格式不对, %s", payload)); - } else { - try { - CalloutWireEvent event = CalloutWireEvent.parse(j); - switch (event.getEventType()) { - case 1: // 自动外呼接通 - logger.info("[callout wire] 自动外呼接通 {}", j.toString()); - callOutWireTask.callOutConnect(event); - break; - case 2: // 自动外呼挂断 - logger.info("[callout wire] 自动外呼挂断 {}", j.toString()); - callOutWireTask.callOutDisconnect(event); - break; - case 3: // 自动外呼失败 - logger.info("[callout wire] 自动外呼失败 {}", j.toString()); - callOutWireTask.callOutFail(event); - break; - case 4: // 手动外呼接通 - logger.info("[callout wire] 手动外呼接通 {}", j.toString()); - callOutWireTask.callOutConnect(event); - break; - case 5: // 手动外呼挂断 - logger.info("[callout wire] 手动外呼挂断 {}", j.toString()); - callOutWireTask.callOutDisconnect(event); - break; - case 6: // 手动外呼失败 - logger.info("[callout wire] 手动外呼失败 {}", j.toString()); - callOutWireTask.callOutFail(event); - break; - case 7: // 呼入接通 - logger.info("[callin wire] 呼入接通 {}", j.toString()); - break; - case 8: // 呼入挂断 - logger.info("[callin wire] 呼入挂断 {}", j.toString()); - break; - case 9: // 呼入失败 - logger.info("[callin wire] 呼入失败 {}", j.toString()); - break; - } - } catch (Exception e) { - logger.error("[callout wire] ", e); - } - } - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/activemq/ConnectionEventSubscription.java b/contact-center/app/src/main/java/com/chatopera/cc/activemq/SocketioConnEventSubscription.java similarity index 95% rename from contact-center/app/src/main/java/com/chatopera/cc/activemq/ConnectionEventSubscription.java rename to contact-center/app/src/main/java/com/chatopera/cc/activemq/SocketioConnEventSubscription.java index 02757af4..c9ed4de5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/activemq/ConnectionEventSubscription.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/activemq/SocketioConnEventSubscription.java @@ -15,7 +15,6 @@ import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.cache.Cache; import com.chatopera.cc.model.AgentStatus; import com.chatopera.cc.persistence.repository.AgentStatusRepository; -import com.chatopera.cc.persistence.repository.UserRepository; import com.chatopera.cc.basic.Constants; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -33,16 +32,13 @@ import java.util.Date; * 处理SocketIO的离线事件 */ @Component -public class ConnectionEventSubscription { +public class SocketioConnEventSubscription { - private final static Logger logger = LoggerFactory.getLogger(ConnectionEventSubscription.class); + private final static Logger logger = LoggerFactory.getLogger(SocketioConnEventSubscription.class); @Autowired private AgentStatusRepository agentStatusRes; - @Autowired - private UserRepository userRes; - @Autowired private Cache cache; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/aop/OnlineUserAspect.java b/contact-center/app/src/main/java/com/chatopera/cc/aop/OnlineUserAspect.java index 3d21deac..76ae44a0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/aop/OnlineUserAspect.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/aop/OnlineUserAspect.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.aop; import com.chatopera.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/aop/SyncDatabaseAspect.java b/contact-center/app/src/main/java/com/chatopera/cc/aop/SyncDatabaseAspect.java index 9c924910..3d8a03dd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/aop/SyncDatabaseAspect.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/aop/SyncDatabaseAspect.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/Constants.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/Constants.java index 1aaca73b..643af7fe 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/Constants.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ public class Constants { /** * Modules */ - public final static String CSKEFU_MODULE_CALLOUT = "sales"; + public final static String CSKEFU_MODULE_CALLOUT = "callout"; public final static String CSKEFU_MODULE_CHATBOT = "chatbot"; public final static String CSKEFU_MODULE_CONTACTS = "contacts"; public final static String CSKEFU_MODULE_SKYPE = "skype"; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/I18N.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/I18N.java deleted file mode 100644 index 56973970..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/I18N.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.chatopera.cc.basic; - -/** - * 国际化字段 - */ -public class I18N { - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/MainContext.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/MainContext.java index 175413db..51450a3f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/MainContext.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/MainContext.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -786,6 +786,7 @@ public class MainContext { MESSAGE, END, TRANS, + TRANSOUT, // 当前会话被转接出去 STATUS, AGENTSTATUS, SERVICE, @@ -1031,26 +1032,6 @@ public class MainContext { return csKeFuResourceMap.get(resource); } - /** - * 是否开启机器人客服模块 - * - * @return - */ - public static boolean isEnableChatbotModule() { - return modules.contains(Constants.CSKEFU_MODULE_CHATBOT); - } - - - /** - * 是否开启外呼模块 - * - * @return - */ - public static boolean isEnableCalloutModule() { - return modules.contains(Constants.CSKEFU_MODULE_CALLOUT); - } - - /** * Redis底层接口 */ diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/MainUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/MainUtils.java index 5621d90b..dcb3e899 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/MainUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/MainUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/Viewport.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/Viewport.java index dc58e2fb..8db72d4d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/Viewport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/Viewport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/IPluginDescriptor.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/IPluginDescriptor.java index 4f8c6ab4..274b2202 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/IPluginDescriptor.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/IPluginDescriptor.java @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.basic.plugins; public interface IPluginDescriptor { String getPluginName(); + String getIOEventHandler(); } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginRegistry.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginRegistry.java index 85e7b6c6..efa6636f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginRegistry.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginRegistry.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.basic.plugins; /** @@ -10,5 +25,7 @@ public class PluginRegistry { */ public final static String PLUGIN_CHANNEL_MESSAGER_SUFFIX = "ChannelMessager"; public final static String PLUGIN_ENTRY_SKYPE = "com.chatopera.cc.plugins.skype.PluginDescriptor"; + public final static String PLUGIN_ENTRY_CALLOUT = "com.chatopera.cc.plugins.callout.PluginDescriptor"; + public final static String PLUGIN_ENTRY_CHATBOT = "com.chatopera.cc.plugins.chatbot.PluginDescriptor"; } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginsLoader.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginsLoader.java index 6fc0a1b9..77089e7a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginsLoader.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/plugins/PluginsLoader.java @@ -1,13 +1,72 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.basic.plugins; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + /** - * 插架装载器 - * TODO Placeholder + * 插架装载器 + * TODO Placeholder */ public class PluginsLoader { private final static Logger logger = LoggerFactory.getLogger(PluginsLoader.class); + + /** + * 通过插件entry获得PluginName + * + * @param pluginEntry + * @return + */ + public static String getPluginName(final String pluginEntry) { + Class clazz; + try { + clazz = Class.forName(pluginEntry); + IPluginDescriptor clazzInst = (IPluginDescriptor) clazz.newInstance(); + Method method = clazz.getMethod("getPluginName"); + return (String) method.invoke(clazzInst); + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { + logger.info("[postConstruct] error", e); + } + return null; + } + + + + /** + * 通过插件entry获得Plugin SocketIO Event Handler + * + * @param pluginEntry + * @return + */ + public static String getIOEventHandler(final String pluginEntry) { + Class clazz; + try { + clazz = Class.forName(pluginEntry); + IPluginDescriptor clazzInst = (IPluginDescriptor) clazz.newInstance(); + Method method = clazz.getMethod("getIOEventHandler"); + return (String) method.invoke(clazzInst); + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { + logger.info("[postConstruct] error", e); + } + return null; + } + } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/ActivityResource.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/ActivityResource.java index f6553d88..53cc7ea2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/ActivityResource.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/ActivityResource.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/BatchResource.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/BatchResource.java index 24d30087..48a5cbda 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/BatchResource.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/BatchResource.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/OutputTextFormat.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/OutputTextFormat.java index 4c2b7598..32454910 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/OutputTextFormat.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/OutputTextFormat.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/Resource.java b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/Resource.java index cc94ecf1..85047161 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/Resource.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/basic/resource/Resource.java @@ -1,12 +1,12 @@ -/** - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, * - * http://www.apache.org/licenses/LICENSE-2.0 - * webapps/LICENSE-Rivulet + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/ApiRequestMatchingFilter.java b/contact-center/app/src/main/java/com/chatopera/cc/config/ApiRequestMatchingFilter.java index 0f2979f9..84703580 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/ApiRequestMatchingFilter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/ApiRequestMatchingFilter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/AppCtxRefreshEventListener.java b/contact-center/app/src/main/java/com/chatopera/cc/config/AppCtxRefreshEventListener.java index bdab12a4..1f026eb7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/AppCtxRefreshEventListener.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/AppCtxRefreshEventListener.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/ApplicationStartupListener.java b/contact-center/app/src/main/java/com/chatopera/cc/config/ApplicationStartupListener.java index 3892e345..182873de 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/ApplicationStartupListener.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/ApplicationStartupListener.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/CSKeFuExceptionHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/config/CSKeFuExceptionHandler.java index fa2695de..8a75aecc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/CSKeFuExceptionHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/CSKeFuExceptionHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/DelegateRequestMatchingFilter.java b/contact-center/app/src/main/java/com/chatopera/cc/config/DelegateRequestMatchingFilter.java index 5c3a89d5..c11bb27a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/DelegateRequestMatchingFilter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/DelegateRequestMatchingFilter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/DruidConfiguration.java b/contact-center/app/src/main/java/com/chatopera/cc/config/DruidConfiguration.java index c0ec35f3..be5a17d5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/DruidConfiguration.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/DruidConfiguration.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/ExecutorConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/config/ExecutorConfig.java index 354c57c0..703870fc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/ExecutorConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/ExecutorConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ */ package com.chatopera.cc.config; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; +import com.chatopera.cc.config.plugins.CalloutPluginPresentCondition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; @@ -60,7 +60,7 @@ public class ExecutorConfig { * 外呼线程池 * @return */ - @Conditional(CalloutBeanCondition.class) + @Conditional(CalloutPluginPresentCondition.class) @Bean(name = "callOutTaskExecutor") public ThreadPoolTaskExecutor callout() { ThreadPoolTaskExecutor poolTaskExecutor = new ThreadPoolTaskExecutor(); diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/MessagingServerConfigure.java b/contact-center/app/src/main/java/com/chatopera/cc/config/MessagingServerConfigure.java index 1d548473..c946d15f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/MessagingServerConfigure.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/MessagingServerConfigure.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/RedisConfigure.java b/contact-center/app/src/main/java/com/chatopera/cc/config/RedisConfigure.java index e488007a..ddf9039f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/RedisConfigure.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/RedisConfigure.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/StringToDateConverter.java b/contact-center/app/src/main/java/com/chatopera/cc/config/StringToDateConverter.java index f636f1d9..27a557f1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/StringToDateConverter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/StringToDateConverter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/UKWebAppConfigurer.java b/contact-center/app/src/main/java/com/chatopera/cc/config/UKWebAppConfigurer.java index 47c07c5b..51d8c533 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/UKWebAppConfigurer.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/UKWebAppConfigurer.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/WebConfigBeans.java b/contact-center/app/src/main/java/com/chatopera/cc/config/WebConfigBeans.java index 9e2e3590..7b6d1e9d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/WebConfigBeans.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/WebConfigBeans.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/WebSecurityConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/config/WebSecurityConfig.java index 2bf17289..5045cc61 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/WebSecurityConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/WebSecurityConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerConfiguration.java b/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerConfiguration.java deleted file mode 100644 index 101651b5..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerConfiguration.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.util.Properties; - -import com.chatopera.cc.basic.MainUtils; -import org.apache.catalina.connector.Connector; -import org.apache.commons.lang3.StringUtils; -import org.apache.coyote.http11.Http11NioProtocol; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; -import org.springframework.boot.context.embedded.Ssl; -import org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer; -import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class WebServerConfiguration { - private Integer maxthread = 2000; - - private Integer maxconnections = 2000; - - @Value("${web.upload-path}") - private String path; - - @Bean - public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() throws IOException, NoSuchAlgorithmException { - TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory(); - tomcatFactory.addConnectorCustomizers(new UKeFuTomcatConnectorCustomizer(maxthread, maxconnections)); - File sslFile = new File(path, "ssl/https.properties"); - if (sslFile.exists()) { - Properties sslProperties = new Properties(); - FileInputStream in = new FileInputStream(sslFile); - sslProperties.load(in); - in.close(); - if (!StringUtils.isBlank(sslProperties.getProperty("key-store")) && !StringUtils.isBlank( - sslProperties.getProperty("key-store-password"))) { - Ssl ssl = new Ssl(); - ssl.setKeyStore(new File(path, "ssl/" + sslProperties.getProperty("key-store")).getAbsolutePath()); - ssl.setKeyStorePassword(MainUtils.decryption(sslProperties.getProperty("key-store-password"))); - tomcatFactory.setSsl(ssl); - } - } - return tomcatFactory; - } - -} - -class UKeFuTomcatConnectorCustomizer implements TomcatConnectorCustomizer { - private Integer maxthread; - private Integer maxconnection; - - UKeFuTomcatConnectorCustomizer(Integer maxthread, Integer maxconnection) { - this.maxthread = maxthread; - this.maxconnection = maxconnection; - } - - public void customize(Connector connector) { - Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler(); - //设置最大连接数 - protocol.setMaxConnections(maxthread != null ? maxthread : 2000); - //设置最大线程数 - protocol.setMaxThreads(maxconnection != null ? maxconnection : 2000); - protocol.setConnectionTimeout(30000); - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerContainerConfigure.java b/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerContainerConfigure.java new file mode 100644 index 00000000..6dbc057b --- /dev/null +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerContainerConfigure.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.chatopera.cc.config; + +import java.io.IOException; +import java.security.NoSuchAlgorithmException; + +import org.apache.catalina.connector.Connector; +import org.apache.coyote.http11.Http11NioProtocol; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; +import org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class WebServerContainerConfigure { + + @Value("${server.threads.max}") + private Integer maxthread; + + @Value("${server.connection.max}") + private Integer maxconnections; + + @Value("${web.upload-path}") + private String path; + + @Bean + public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() throws IOException, NoSuchAlgorithmException { + TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory(); + tomcatFactory.addConnectorCustomizers(new CSKeFuTomcatConnectorCustomizer(maxthread, maxconnections)); + return tomcatFactory; + } + + class CSKeFuTomcatConnectorCustomizer implements TomcatConnectorCustomizer { + private Integer maxthread; + private Integer maxconnection; + + CSKeFuTomcatConnectorCustomizer(Integer maxthread, Integer maxconnection) { + this.maxthread = maxthread; + this.maxconnection = maxconnection; + } + + public void customize(Connector connector) { + Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler(); + //设置最大连接数 + protocol.setMaxConnections(maxthread != null ? maxthread : 2000); + //设置最大线程数 + protocol.setMaxThreads(maxconnection != null ? maxconnection : 2000); + protocol.setConnectionTimeout(30000); + } + } +} + diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerSessionConfigure.java b/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerSessionConfigure.java index 432334a9..b494b359 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerSessionConfigure.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/WebServerSessionConfigure.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.config; import com.chatopera.cc.cache.RedisKey; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/conditions/CalloutBeanCondition.java b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/CalloutPluginPresentCondition.java similarity index 83% rename from contact-center/app/src/main/java/com/chatopera/cc/config/conditions/CalloutBeanCondition.java rename to contact-center/app/src/main/java/com/chatopera/cc/config/plugins/CalloutPluginPresentCondition.java index 5ff93e5a..716b94e9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/conditions/CalloutBeanCondition.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/CalloutPluginPresentCondition.java @@ -8,8 +8,9 @@ * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, * or decompilation of this software, unless required by law for interoperability, is prohibited. */ -package com.chatopera.cc.config.conditions; +package com.chatopera.cc.config.plugins; +import com.chatopera.cc.basic.Constants; import com.chatopera.cc.basic.MainContext; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; @@ -19,9 +20,9 @@ import org.springframework.core.type.AnnotatedTypeMetadata; * Init bean based on conditions * https://javapapers.com/spring/spring-conditional-annotation/ */ -public class CalloutBeanCondition implements Condition { +public class CalloutPluginPresentCondition implements Condition { @Override public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { - return MainContext.isEnableCalloutModule(); + return MainContext.hasModule(Constants.CSKEFU_MODULE_CALLOUT); } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/ChatbotPluginPresentCondition.java b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/ChatbotPluginPresentCondition.java new file mode 100644 index 00000000..940c1334 --- /dev/null +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/ChatbotPluginPresentCondition.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2019 Chatopera Inc, All rights reserved. + * + * This software and related documentation are provided under a license agreement containing + * restrictions on use and disclosure and are protected by intellectual property laws. + * Except as expressly permitted in your license agreement or allowed by law, you may not use, + * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, + * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, + * or decompilation of this software, unless required by law for interoperability, is prohibited. + */ +package com.chatopera.cc.config.plugins; + +import com.chatopera.cc.basic.Constants; +import com.chatopera.cc.basic.MainContext; +import org.springframework.context.annotation.Condition; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.type.AnnotatedTypeMetadata; + +/** + * Init bean based on conditions + * https://javapapers.com/spring/spring-conditional-annotation/ + */ +public class ChatbotPluginPresentCondition implements Condition { + @Override + public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { + return MainContext.hasModule(Constants.CSKEFU_MODULE_CHATBOT); + } +} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/SkypePluginPresentCondition.java b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/SkypePluginPresentCondition.java index 924aa065..31f938ed 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/SkypePluginPresentCondition.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/config/plugins/SkypePluginPresentCondition.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.chatopera.cc.config.plugins; import com.chatopera.cc.basic.Constants; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuCacheException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuCacheException.java index 0a7c9c91..0249844c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuCacheException.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuCacheException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuException.java index 64bbb6f9..9d9bf735 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuException.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuRestException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuRestException.java index 7590efe1..a2125616 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuRestException.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/exception/CSKefuRestException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRecordException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRecordException.java deleted file mode 100644 index f1ac7a93..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRecordException.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.exception; - -public class CalloutRecordException extends Exception { - - public CalloutRecordException(String msg){ - super(msg); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRuntimeException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRuntimeException.java deleted file mode 100644 index a9fefb7a..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/CalloutRuntimeException.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.exception; - -public class CalloutRuntimeException extends Exception { - - public CalloutRuntimeException(String msg){ - super(msg); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/FreeSwitchException.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/FreeSwitchException.java index 837d5909..f10f9314 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/FreeSwitchException.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/exception/FreeSwitchException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/exception/InstantMessagingExceptionListener.java b/contact-center/app/src/main/java/com/chatopera/cc/exception/InstantMessagingExceptionListener.java index 0fca911c..3af48eb3 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/exception/InstantMessagingExceptionListener.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/exception/InstantMessagingExceptionListener.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/ApplicationController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/ApplicationController.java index 3030e80b..ee80b6ea 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/ApplicationController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/ApplicationController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/Handler.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/Handler.java index 2251cf58..6c3604eb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/Handler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/Handler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.basic.Viewport; import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.handler.api.rest.QueryParams; +import com.chatopera.cc.handler.api.QueryParams; import com.chatopera.cc.model.StreamingFile; import com.chatopera.cc.model.SystemConfig; import com.chatopera.cc.model.Tenant; @@ -102,7 +102,7 @@ public class Handler { user.setSessionid(user.getId()); } } else { - user.setSessionid(user.getId()); + user.setSessionid(MainUtils.getContextID(request.getSession().getId())); } return user; } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/LoginController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/LoginController.java index 071438ec..cd9745a5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/LoginController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/LoginController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package com.chatopera.cc.handler; import com.chatopera.cc.acd.AutomaticServiceDist; import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.basic.I18N; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.cache.Cache; @@ -177,51 +176,54 @@ public class LoginController extends Handler { user.getUsername(), MainUtils.md5(user.getPassword()), false); if (loginUser != null && StringUtils.isNotBlank(loginUser.getId())) { view = this.processLogin(request, loginUser, referer); - if (StringUtils.isNotBlank(sla) && sla.equals("1")) { + + // 自动登录 + if (StringUtils.equals("1", sla)) { Cookie flagid = new Cookie( Constants.CSKEFU_SYSTEM_COOKIES_FLAG, MainUtils.encryption(loginUser.getId())); flagid.setMaxAge(7 * 24 * 60 * 60); response.addCookie(flagid); - // add authorization code for rest api - final String orgi = loginUser.getOrgi(); - String auth = MainUtils.getUUID(); - cache.putLoginUserByAuthAndOrgi(auth, loginUser, orgi); - userRepository.save(loginUser); // 更新登录状态到数据库 - response.addCookie((new Cookie("authorization", auth))); + } - // 该登录用户是坐席,并且具有坐席对话的角色 - if ((loginUser.isAgent() && - loginUser.getRoleAuthMap().containsKey("A01") && - ((boolean) loginUser.getRoleAuthMap().get("A01") == true)) - || loginUser.isSuperuser()) { - try { - /**************************************** - * 登录成功,设置该坐席为就绪状态(默认) - ****************************************/ - // https://gitlab.chatopera.com/chatopera/cosinee.w4l/issues/306 - final AgentStatus agentStatus = agentProxy.resolveAgentStatusByAgentnoAndOrgi( - loginUser.getId(), orgi, loginUser.getSkills()); - agentStatus.setBusy(false); - agentProxy.ready(loginUser, agentStatus); + // add authorization code for rest api + final String orgi = loginUser.getOrgi(); + String auth = MainUtils.getUUID(); + cache.putLoginUserByAuthAndOrgi(auth, loginUser, orgi); + userRepository.save(loginUser); // 更新登录状态到数据库 + response.addCookie((new Cookie("authorization", auth))); - // 更新缓存和数据库 - cache.putAgentStatusByOrgi(agentStatus, loginUser.getOrgi()); - agentStatusRes.save(agentStatus); + // 该登录用户是坐席,并且具有坐席对话的角色 + if ((loginUser.isAgent() && + loginUser.getRoleAuthMap().containsKey("A01") && + ((boolean) loginUser.getRoleAuthMap().get("A01") == true)) + || loginUser.isSuperuser()) { + try { + /**************************************** + * 登录成功,设置该坐席为就绪状态(默认) + ****************************************/ + // https://gitlab.chatopera.com/chatopera/cosinee.w4l/issues/306 + final AgentStatus agentStatus = agentProxy.resolveAgentStatusByAgentnoAndOrgi( + loginUser.getId(), orgi, loginUser.getSkills()); + agentStatus.setBusy(false); + agentProxy.ready(loginUser, agentStatus); - // 工作状态记录 - AutomaticServiceDist.recordAgentStatus(agentStatus.getAgentno(), - agentStatus.getUsername(), - agentStatus.getAgentno(), - user.isSuperuser(), // 0代表admin - agentStatus.getAgentno(), - MainContext.AgentStatusEnum.OFFLINE.toString(), - MainContext.AgentStatusEnum.READY.toString(), - MainContext.AgentWorkType.MEIDIACHAT.toString(), - orgi, null); + // 更新缓存和数据库 + cache.putAgentStatusByOrgi(agentStatus, loginUser.getOrgi()); + agentStatusRes.save(agentStatus); - } catch (Exception e) { - logger.error("[login] set agent status", e); - } + // 工作状态记录 + AutomaticServiceDist.recordAgentStatus(agentStatus.getAgentno(), + agentStatus.getUsername(), + agentStatus.getAgentno(), + user.isSuperuser(), // 0代表admin + agentStatus.getAgentno(), + MainContext.AgentStatusEnum.OFFLINE.toString(), + MainContext.AgentStatusEnum.READY.toString(), + MainContext.AgentWorkType.MEIDIACHAT.toString(), + orgi, null); + + } catch (Exception e) { + logger.error("[login] set agent status", e); } } } else { @@ -260,6 +262,8 @@ public class LoginController extends Handler { // 更新redis session信息,用以支持sso agentSessionProxy.updateUserSession( loginUser.getId(), MainUtils.getContextID(request.getSession().getId()), loginUser.getOrgi()); + loginUser.setSessionid(MainUtils.getContextID(request.getSession().getId())); + if (StringUtils.isNotBlank(referer)) { view = new ModelAndView("redirect:" + referer); @@ -327,7 +331,7 @@ public class LoginController extends Handler { * * @param request * @param response - * @param code 登出的代码 + * @param code 登出的代码 * @return */ @RequestMapping("/logout") diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AdminController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AdminController.java index b5e2ed32..d621b7d6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AdminController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AdminController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/skill/AgentSkillController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AgentSkillController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/admin/skill/AgentSkillController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AgentSkillController.java index 8df79f6f..ec8c1f59 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/skill/AgentSkillController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AgentSkillController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.admin.skill; +package com.chatopera.cc.handler.admin; import java.util.Date; import java.util.List; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/area/AreaController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AreaController.java similarity index 95% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/admin/area/AreaController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AreaController.java index 38e1f3f3..ad2af5bc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/area/AreaController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/AreaController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.admin.area; +package com.chatopera.cc.handler.admin; import java.io.IOException; import java.util.Date; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/organ/OrganController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/OrganController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/admin/organ/OrganController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/admin/OrganController.java index 0048dd62..5d41ebff 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/organ/OrganController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/OrganController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.admin.organ; +package com.chatopera.cc.handler.admin; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.cache.Cache; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/role/RoleController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/RoleController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/admin/role/RoleController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/admin/RoleController.java index a7450263..195b0b3e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/role/RoleController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/RoleController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.admin.role; +package com.chatopera.cc.handler.admin; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/users/UsersController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/UsersController.java similarity index 91% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/admin/users/UsersController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/admin/UsersController.java index 5d8cb6c2..6a68e6f7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/users/UsersController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/UsersController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.admin.users; +package com.chatopera.cc.handler.admin; +import com.chatopera.cc.basic.Constants; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.cache.Cache; @@ -78,8 +79,8 @@ public class UsersController extends Handler { Sort.Direction.ASC, "createtime" ) - ) - ); + ) + ); return request(super.createAdminTempletResponse("/admin/user/index")); } @@ -193,8 +194,10 @@ public class UsersController extends Handler { tempUser.setSipaccount(user.getSipaccount()); //切换成非坐席 判断是否坐席 以及 是否有对话 if (!user.isAgent()) { - AgentStatus agentStatus = cache.findOneAgentStatusByAgentnoAndOrig((super.getUser(request)).getId(), super.getOrgi(request)); - if (!(agentStatus == null && cache.getInservAgentUsersSizeByAgentnoAndOrgi(super.getUser(request).getId(), super.getOrgi(request)) == 0)) { + AgentStatus agentStatus = cache.findOneAgentStatusByAgentnoAndOrig( + (super.getUser(request)).getId(), super.getOrgi(request)); + if (!(agentStatus == null && cache.getInservAgentUsersSizeByAgentnoAndOrgi( + super.getUser(request).getId(), super.getOrgi(request)) == 0)) { return request(super.createRequestPageTempletResponse("redirect:/admin/user/index.html?msg=t1")); } } @@ -258,7 +261,9 @@ public class UsersController extends Handler { return msg; } - if (user.getUsername().equals(oldUser.getUsername()) && user.getEmail().equals(oldUser.getEmail()) && user.getMobile().equals(oldUser.getMobile()) && validUserCallcenterParams(user)) { + if (user.getUsername().equals(oldUser.getUsername()) && user.getEmail().equals( + oldUser.getEmail()) && user.getMobile().equals(oldUser.getMobile()) && validUserCallcenterParams( + user)) { return ""; } @@ -292,7 +297,7 @@ public class UsersController extends Handler { * @return */ private boolean validUserCallcenterParams(final User user) { - if (user.isCallcenter() && MainContext.isEnableCalloutModule()) { + if (user.isCallcenter() && MainContext.hasModule(Constants.CSKEFU_MODULE_CALLOUT)) { List tempUserList = userRepository.findBySipaccountAndDatastatus(user.getSipaccount(), false); return tempUserList.size() == 0 || user.getSipaccount() == ""; } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterAclController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterAclController.java index ea7df636..19ebcdd7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterAclController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterAclController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterBlackController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterBlackController.java index 931307d9..65d4077a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterBlackController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterBlackController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterController.java index 9cb6b992..a288d271 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterExtentionController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterExtentionController.java index 148bac96..b9a4c74d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterExtentionController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterExtentionController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.Extention; import com.chatopera.cc.model.PbxHost; import com.chatopera.cc.model.User; -import com.chatopera.cc.proxy.CalloutQueneProxy; +import com.chatopera.cc.proxy.CallcenterOutboundProxy; import com.chatopera.cc.persistence.repository.*; import com.chatopera.cc.util.Menu; import com.chatopera.cc.util.freeswitch.model.CallCenterAgent; @@ -187,7 +187,7 @@ public class CallCenterExtentionController extends Handler { ext.setUpdatetime(new Date()); extentionRes.save(ext); - List callOutAgentList = CalloutQueneProxy.extention(ext.getExtention()); + List callOutAgentList = CallcenterOutboundProxy.extention(ext.getExtention()); for (CallCenterAgent callOutAgent : callOutAgentList) { callOutAgent.setSiptrunk(ext.getSiptrunk()); cache.putCallCenterAgentByIdAndOrgi(callOutAgent.getUserid(), callOutAgent.getOrgi(), callOutAgent); diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterIvrController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterIvrController.java index a36f9f2d..c9192670 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterIvrController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterIvrController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterMediaController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterMediaController.java index 3906d4af..581ba141 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterMediaController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterMediaController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterResourceController.java index defbd1ef..b9531988 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterRouterController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterRouterController.java index ad3149bd..7de5087c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterRouterController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterRouterController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSipTrunkController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSipTrunkController.java index 41b0f738..21e82fad 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSipTrunkController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSipTrunkController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSkillController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSkillController.java index 639f1a6d..7568f785 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSkillController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/callcenter/CallCenterSkillController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/CalloutChannelController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/CalloutChannelController.java deleted file mode 100644 index 1790f1de..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/CalloutChannelController.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.admin.channel; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.basic.MainUtils; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.model.CousultInvite; -import com.chatopera.cc.model.SNSAccount; -import com.chatopera.cc.model.Secret; -import com.chatopera.cc.persistence.repository.ConsultInviteRepository; -import com.chatopera.cc.persistence.repository.SNSAccountRepository; -import com.chatopera.cc.persistence.repository.SecretRepository; -import com.chatopera.cc.exception.CSKefuException; -import com.chatopera.cc.util.Menu; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.PageRequest; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.security.NoSuchAlgorithmException; -import java.util.Date; -import java.util.List; - -@Controller -@RequestMapping("/admin/callout") -public class CalloutChannelController extends Handler { - @Autowired - private SNSAccountRepository snsAccountRes; - - @Autowired - private ConsultInviteRepository invite; - - @Autowired - private SecretRepository secRes; - - @RequestMapping("/index") - @Menu(type = "callout", subtype = "channel", access = false, admin = true) - public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String execute, @RequestParam(name = "status", required = false) String status) { - map.addAttribute("snsAccountList", snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.PHONE.toString(), super.getOrgi(request), new PageRequest(super.getP(request), super.getPs(request)))); - map.addAttribute("status", status); - List secretConfig = secRes.findByOrgi(super.getOrgi(request)); - if (secretConfig != null && secretConfig.size() > 0) { - map.addAttribute("secret", secretConfig.get(0)); - } - if (StringUtils.isNotBlank(execute) && execute.equals("false")) { - map.addAttribute("execute", execute); - } - return request(super.createAdminTempletResponse("/admin/channel/callout/index")); - } - - @RequestMapping("/add") - @Menu(type = "callout", subtype = "channel", access = false, admin = true) - public ModelAndView add(ModelMap map, HttpServletRequest request) { - return request(super.createRequestPageTempletResponse("/admin/channel/callout/add")); - } - - @RequestMapping("/save") - @Menu(type = "callout", subtype = "channel") - public ModelAndView save(HttpServletRequest request, @Valid SNSAccount snsAccount) throws NoSuchAlgorithmException, CSKefuException { - String status = "new_webim_fail"; - if (StringUtils.isNotBlank(snsAccount.getBaseURL())) { - snsAccount.setSnsid(snsAccount.getBaseURL()); // set sns ID the same SNSAccount - int count = snsAccountRes.countBySnsidAndOrgi(snsAccount.getSnsid(), super.getOrgi(request)); - if (count == 0) { - status = "new_webim_success"; - snsAccount.setOrgi(super.getOrgi(request)); - snsAccount.setSnstype(MainContext.ChannelType.PHONE.toString()); - snsAccount.setCreatetime(new Date()); - snsAccountRes.save(snsAccount); - - /** - * 同时创建CousultInvite 记录 - */ - CousultInvite coultInvite = invite.findBySnsaccountidAndOrgi(snsAccount.getSnsid(), super.getOrgi(request)); - if (coultInvite == null) { - coultInvite = new CousultInvite(); - coultInvite.setSnsaccountid(snsAccount.getSnsid()); - coultInvite.setCreate_time(new Date()); - coultInvite.setOrgi(super.getOrgi(request)); - coultInvite.setName(snsAccount.getName()); - invite.save(coultInvite); - } - } - } - return request(super.createRequestPageTempletResponse("redirect:/admin/callout/index.html?status=" + status)); - } - - @RequestMapping("/delete") - @Menu(type = "callout", subtype = "delete") - public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String confirm) { - boolean execute = false; - if (execute = MainUtils.secConfirm(secRes, super.getOrgi(request), confirm)) { - SNSAccount snsAccount = snsAccountRes.findByIdAndOrgi(id, super.getOrgi(request)); - if (snsAccountRes != null) { - snsAccountRes.delete(snsAccount); - CousultInvite coultInvite = invite.findBySnsaccountidAndOrgi(snsAccount.getSnsid(), super.getOrgi(request)); - if (coultInvite != null) { - invite.delete(coultInvite); - } - } - } - - return request(super.createRequestPageTempletResponse("redirect:/admin/callout/index.html?execute=" + execute)); - } - - @RequestMapping("/edit") - @Menu(type = "callout", subtype = "channel", access = false, admin = true) - public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) { - map.addAttribute("snsAccount", snsAccountRes.findByIdAndOrgi(id, super.getOrgi(request))); - return request(super.createRequestPageTempletResponse("/admin/channel/callout/edit")); - } - - @RequestMapping("/update") - @Menu(type = "callout", subtype = "channel", access = false, admin = true) - public ModelAndView update(HttpServletRequest request, @Valid SNSAccount snsAccount) throws NoSuchAlgorithmException { - SNSAccount oldSnsAccount = snsAccountRes.findByIdAndOrgi(snsAccount.getId(), super.getOrgi(request)); - if (oldSnsAccount != null) { - oldSnsAccount.setName(snsAccount.getName()); - oldSnsAccount.setBaseURL(snsAccount.getBaseURL()); - oldSnsAccount.setUpdatetime(new Date()); - /** - * SNSID如果有变更,需要同时变更 CoultInvite 表的 记录 - */ - if (StringUtils.isNotBlank(oldSnsAccount.getSnsid())) { - CousultInvite coultInvite = invite.findBySnsaccountidAndOrgi(oldSnsAccount.getSnsid(), super.getOrgi(request)); - if (coultInvite == null) { - /** - * 同时创建CousultInvite 记录 - */ - coultInvite = new CousultInvite(); - coultInvite.setSnsaccountid(oldSnsAccount.getSnsid()); - coultInvite.setCreate_time(new Date()); - coultInvite.setOrgi(super.getOrgi(request)); - coultInvite.setName(snsAccount.getName()); - invite.save(coultInvite); - } - } - - oldSnsAccount.setSnstype(MainContext.ChannelType.PHONE.toString()); - snsAccountRes.save(oldSnsAccount); - } - return request(super.createRequestPageTempletResponse("redirect:/admin/callout/index.html")); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/SNSAccountIMController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/SNSAccountIMController.java index 2e826e1a..83da70af 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/SNSAccountIMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/SNSAccountIMController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/WebIMController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/WebIMController.java index 9cf10861..d3040e5f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/WebIMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/channel/WebIMController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemConfigController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemConfigController.java index 3c8a70a8..1ebfd420 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemConfigController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemConfigController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemMessageController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemMessageController.java index 713bf5f3..79bb00db 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemMessageController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/config/SystemMessageController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/MetadataController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/MetadataController.java index ae288208..c0fb4702 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/MetadataController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/MetadataController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/SysDicController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/SysDicController.java index 78a1b490..cee0ad97 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/SysDicController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/SysDicController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/TemplateController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/TemplateController.java index 95335f3b..5dd8b8aa 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/TemplateController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/admin/system/TemplateController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAgentUserController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAgentUserController.java new file mode 100644 index 00000000..4a966951 --- /dev/null +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAgentUserController.java @@ -0,0 +1,371 @@ +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.chatopera.cc.handler.api; + +import com.chatopera.cc.acd.AutomaticServiceDist; +import com.chatopera.cc.basic.MainContext.*; +import com.chatopera.cc.basic.MainUtils; +import com.chatopera.cc.cache.Cache; +import com.chatopera.cc.exception.CSKefuException; +import com.chatopera.cc.handler.Handler; +import com.chatopera.cc.handler.api.request.RestUtils; +import com.chatopera.cc.model.*; +import com.chatopera.cc.peer.PeerSyncIM; +import com.chatopera.cc.persistence.repository.AgentServiceRepository; +import com.chatopera.cc.persistence.repository.AgentUserRepository; +import com.chatopera.cc.persistence.repository.UserRepository; +import com.chatopera.cc.proxy.AgentAuditProxy; +import com.chatopera.cc.proxy.AgentUserProxy; +import com.chatopera.cc.socketio.message.Message; +import com.chatopera.cc.util.Menu; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +/** + * ACD服务 获取当前对话中的访客 + */ +@RestController +@RequestMapping("/api/agentuser") +public class ApiAgentUserController extends Handler { + + private final static Logger logger = LoggerFactory.getLogger(ApiAgentUserController.class); + + @Autowired + private Cache cache; + + @Autowired + private PeerSyncIM peerSyncIM; + + @Autowired + private AgentUserRepository agentUserRes; + + @Autowired + private UserRepository userRes; + + @Autowired + private AgentServiceRepository agentServiceRes; + + @Autowired + private AgentUserProxy agentUserProxy; + + @Autowired + private AgentAuditProxy agentAuditProxy; + + /** + * 获取当前对话中的访客 + * 坐席相关 RestAPI + * + * @param request + * @return + */ + @RequestMapping(method = RequestMethod.POST) + @Menu(type = "apps", subtype = "agentuser", access = true) + public ResponseEntity operations(HttpServletRequest request, @RequestBody final String body, @Valid String q) { + logger.info("[operations] body {}, q {}", body, q); + final JsonObject j = StringUtils.isBlank(body) ? (new JsonObject()) : (new JsonParser()).parse( + body).getAsJsonObject(); + JsonObject json = new JsonObject(); + HttpHeaders headers = RestUtils.header(); + + if (!j.has("ops")) { + json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); + json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的请求参数。"); + } else { + switch (StringUtils.lowerCase(j.get("ops").getAsString())) { + case "inserv": + json = inserv(request, j); + break; + case "withdraw": + json = withdraw(request, j); + break; + case "end": + json = end(request, j); + break; + case "transout": + json = transout(request, j); + break; + default: + json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); + json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); + } + } + + return new ResponseEntity(json.toString(), headers, HttpStatus.OK); + } + + /** + * 执行坐席转接 + * 将会话转接给别人 + * + * @param request + * @param payload + * @return + */ + private JsonObject transout(final HttpServletRequest request, final JsonObject payload) { + logger.info("[transout] payload ", payload.toString()); + final String orgi = super.getOrgi(request); + final User logined = super.getUser(request); + JsonObject resp = new JsonObject(); + + /** + * 必填参数 + */ + // 目标坐席 + final String transAgentId = payload.get("agentno").getAsString(); + // 当前会话的ID + final String agentUserId = payload.get("agentUserId").getAsString(); + // 坐席服务ID + final String agentServiceId = payload.get("agentServiceId").getAsString(); + + if (StringUtils.isNotBlank(agentUserId) && + StringUtils.isNotBlank(transAgentId) && + StringUtils.isNotBlank(agentServiceId)) { + final User targetAgent = userRes.findOne(transAgentId); + final AgentService agentService = agentServiceRes.findByIdAndOrgi(agentServiceId, orgi); + + /** + * 更新AgentUser + */ + final AgentUser agentUser = agentUserProxy.findOne(agentUserId).orElseGet(null); + if (agentUser != null) { + final AgentUserAudit agentAudits = cache.findOneAgentUserAuditByOrgiAndId(orgi, agentUserId).orElseGet( + null); + + // 当前服务于访客的坐席 + final String currentAgentno = agentUser.getAgentno(); + // 当前访客的ID + final String userId = agentUser.getUserid(); + + // 检查权限 + if ((!logined.isSuperuser()) && (!StringUtils.equals( + agentUser.getAgentno(), + logined.getId())) && (!isTransPermissionAllowed( + agentAudits, logined))) { + // 1. 不是超级用户;2. 也是不是会话的所有者; 3. 也不是坐席监控人员 + logger.info("[end] Permission not fulfill."); + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); + resp.addProperty(RestUtils.RESP_KEY_ERROR, "Permission denied."); + return resp; + } + + agentUser.setAgentno(transAgentId); + agentUser.setAgentname(targetAgent.getUname()); + agentUserRes.save(agentUser); + + /** + * 坐席状态 + */ + // 转接目标坐席 + final AgentStatus transAgentStatus = cache.findOneAgentStatusByAgentnoAndOrig(transAgentId, orgi); + + // 转接源坐席 + final AgentStatus currentAgentStatus = cache.findOneAgentStatusByAgentnoAndOrig(currentAgentno, orgi); + + if (StringUtils.equals( + AgentUserStatusEnum.INSERVICE.toString(), + agentUser.getStatus())) { //转接 , 发送消息给 目标坐席 + // 更新当前坐席的服务访客列表 + if (currentAgentStatus != null) { + cache.deleteOnlineUserIdFromAgentStatusByUseridAndAgentnoAndOrgi(userId, currentAgentno, orgi); + AutomaticServiceDist.updateAgentStatus(currentAgentStatus, orgi); + } + + if (transAgentStatus != null) { + agentService.setAgentno(transAgentId); + agentService.setAgentusername(transAgentStatus.getUsername()); + } + + // 转接坐席提示消息 + Message outMessage = new Message(); + outMessage.setMessage( + AutomaticServiceDist.getSuccessMessage(agentService, agentUser.getChannel(), orgi)); + outMessage.setMessageType(MediaType.TEXT.toString()); + outMessage.setCalltype(CallType.IN.toString()); + outMessage.setCreatetime(MainUtils.dateFormate.format(new Date())); + outMessage.setAgentUser(agentUser); + outMessage.setAgentService(agentService); + + if (StringUtils.isNotBlank(agentUser.getUserid())) { + peerSyncIM.send( + ReceiverType.VISITOR, + ChannelType.toValue(agentUser.getChannel()), + agentUser.getAppid(), + MessageType.STATUS, + agentUser.getUserid(), + outMessage, + true); + } + + // 通知转接消息给新坐席 + outMessage.setChannelMessage(agentUser); + outMessage.setAgentUser(agentUser); + peerSyncIM.send( + ReceiverType.AGENT, ChannelType.WEBIM, + agentUser.getAppid(), MessageType.NEW, agentService.getAgentno(), + outMessage, true); + + // 通知消息给前坐席 + if (!StringUtils.equals(logined.getId(), currentAgentno)) { + // 如果当前坐席不是登录用户,因为登录用户会从RestAPI返回转接的结果 + // 该登录用户可能是坐席监控或当前坐席,那么,如果是坐席监控,就有必要 + // 通知前坐席这个事件 + peerSyncIM.send(ReceiverType.AGENT, ChannelType.WEBIM, agentUser.getAppid(), + MessageType.TRANSOUT, + currentAgentno, outMessage, true); + } + } + + if (agentService != null) { + agentService.setAgentno(transAgentId); + if (payload.has("memo") && StringUtils.isNotBlank(payload.get("memo").getAsString())) { + agentService.setTransmemo(payload.get("memo").getAsString()); + } + agentService.setTrans(true); + agentService.setTranstime(new Date()); + agentServiceRes.save(agentService); + } + + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); + resp.addProperty(RestUtils.RESP_KEY_DATA, "success"); + } else { + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); + resp.addProperty(RestUtils.RESP_KEY_ERROR, "Can not find agent user."); + } + } else { + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); + resp.addProperty(RestUtils.RESP_KEY_ERROR, "Invalid params."); + } + + return resp; + } + + /** + * 结束坐席会话 + * + * @param request + * @param payload + * @return + */ + private JsonObject end(final HttpServletRequest request, final JsonObject payload) { + logger.info("[end] payload ", payload.toString()); + final String orgi = super.getOrgi(request); + final User logined = super.getUser(request); + JsonObject resp = new JsonObject(); + + final AgentUser agentUser = agentUserRes.findByIdAndOrgi(payload.get("id").getAsString(), orgi); + if (agentUser != null) { + if ((StringUtils.equals( + logined.getId(), agentUser.getAgentno()) || logined.isSuperuser())) { + // 删除访客-坐席关联关系,包括缓存 + try { + AutomaticServiceDist.deleteAgentUser(agentUser, orgi); + } catch (CSKefuException e) { + // 未能删除成功 + logger.error("[end]", e); + } + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); + resp.addProperty(RestUtils.RESP_KEY_DATA, "success"); + } else { + logger.info("[end] Permission not fulfill."); + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); + resp.addProperty(RestUtils.RESP_KEY_ERROR, "Permission denied."); + } + } else { + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); + resp.addProperty(RestUtils.RESP_KEY_ERROR, "Agent User not found."); + } + + return resp; + } + + /** + * 撤退一个坐席 + * 将当前坐席服务中的访客分配给其他就绪的坐席 + * + * @param request + * @param j + * @return + */ + private JsonObject withdraw(final HttpServletRequest request, final JsonObject j) { + JsonObject resp = new JsonObject(); + AutomaticServiceDist.withdrawAgent(super.getOrgi(request), super.getUser(request).getId()); + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); + return resp; + } + + + /** + * 获得当前访客服务中的访客信息 + * 获取当前正在对话的访客信息,包含多种渠道来源的访客 + * + * @param request + * @param j + * @return + */ + private JsonObject inserv(final HttpServletRequest request, final JsonObject j) { + JsonObject resp = new JsonObject(); + JsonArray data = new JsonArray(); + + List lis = cache.findInservAgentUsersByAgentnoAndOrgi( + super.getUser(request).getId(), super.getOrgi(request)); + for (final AgentUser au : lis) { + JsonObject obj = new JsonObject(); + obj.addProperty("id", au.getId()); + obj.addProperty("userid", au.getUserid()); + obj.addProperty("status", au.getStatus()); + obj.addProperty("agentno", au.getAgentno()); + obj.addProperty("channel", au.getChannel()); + obj.addProperty("nickname", au.getNickname()); + data.add(obj); + } + resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); + resp.add("data", data); + + return resp; + } + + /** + * 检查是否具备该会话的坐席监控权限 + * + * @param agentUserAudit + * @param user + * @return + */ + private boolean isTransPermissionAllowed(final AgentUserAudit agentUserAudit, final User user) { + if (agentUserAudit != null && agentUserAudit.getSubscribers().containsKey(user.getId())) { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAppsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAppsController.java similarity index 98% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAppsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAppsController.java index 4deea505..ffd22404 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAppsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiAppsController.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Chatopera Inc, All rights reserved. + * Copyright (C) 2018-2019 Chatopera Inc, All rights reserved. * * This software and related documentation are provided under a license agreement containing * restrictions on use and disclosure and are protected by intellectual property laws. @@ -8,7 +8,7 @@ * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, * or decompilation of this software, unless required by law for interoperability, is prohibited. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.cache.Cache; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatMessageController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiChatMessageController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatMessageController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiChatMessageController.java index e666c071..10cc6905 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatMessageController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiChatMessageController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.persistence.repository.ChatMessageRepository; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactNotesController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactNotesController.java similarity index 99% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactNotesController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactNotesController.java index e749528f..4cc407fa 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactNotesController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactNotesController.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactTagsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactTagsController.java similarity index 98% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactTagsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactTagsController.java index 38694553..b1d9b0a7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactTagsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactTagsController.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactsController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactsController.java index 35563d29..7a1b3250 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiContactsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiContactsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.exception.CSKefuException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiLeavemsgController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLeavemsgController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiLeavemsgController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLeavemsgController.java index be06a71b..116f2d72 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiLeavemsgController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLeavemsgController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOnlineUserController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOnlineUserController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOnlineUserController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOnlineUserController.java index 13b500d0..59b73026 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOnlineUserController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOnlineUserController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOrganController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOrganController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOrganController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOrganController.java index 20bd9d12..c010fec4 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiOrganController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiOrganController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.Organ; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQualityController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQualityController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQualityController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQualityController.java index e22ed3cb..dde0619c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQualityController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQualityController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickReplyController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickReplyController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickReplyController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickReplyController.java index 466ba458..7e1b46b5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickReplyController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickReplyController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.QuickReply; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickTypeController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickTypeController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickTypeController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickTypeController.java index 9dcf2b2e..943ad374 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiQuickTypeController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiQuickTypeController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.QuickType; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiServiceQueneController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiServiceQueneController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiServiceQueneController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiServiceQueneController.java index f666f5e7..1a7bedbe 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiServiceQueneController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiServiceQueneController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.acd.AutomaticServiceDist; import com.chatopera.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiSysDicController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiSysDicController.java similarity index 95% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiSysDicController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiSysDicController.java index b2a05649..ffff48b9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiSysDicController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiSysDicController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.handler.admin.system.SysDicController; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiTagsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTagsController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiTagsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTagsController.java index 9aea20ed..fb48a091 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiTagsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTagsController.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.handler.api.request.RestUtils; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiUserController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiUserController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiUserController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiUserController.java index 8d46288e..5e4f99e5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiUserController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiUserController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWebIMController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWebIMController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWebIMController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWebIMController.java index 4d175419..da0326cc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWebIMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWebIMController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.CousultInvite; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWlContactsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWlContactsController.java similarity index 85% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWlContactsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWlContactsController.java index 3950c37d..a211f552 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiWlContactsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiWlContactsController.java @@ -1,17 +1,28 @@ -/** - * Contact Controller for Wonder4Life - * https://wiki.chatopera.com/display/W4L/Wonder4life - * Maintain more properties +/* + * Copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; + +import com.chatopera.cc.basic.Constants; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.handler.api.request.RestUtils; import com.chatopera.cc.model.Contacts; import com.chatopera.cc.model.User; import com.chatopera.cc.persistence.es.ContactsRepository; -import com.chatopera.cc.basic.Constants; import com.chatopera.cc.util.Menu; import com.chatopera.cc.util.RestResult; import com.chatopera.cc.util.RestResultType; @@ -37,8 +48,9 @@ import java.text.ParseException; import java.util.Date; /** - * WL联系人服务 - * Wonder4Life联系人管理功能 + * 联系人导入API + * 联系人管理功能 + * https://wiki.chatopera.com/display/W4L/Wonder4life */ @RestController @RequestMapping("/api/wl/contacts") @@ -62,9 +74,13 @@ public class ApiWlContactsController extends Handler { Page contactsList = null; if (StringUtils.isNotBlank(creater)) { User user = super.getUser(request); - contactsList = contactsRes.findByCreaterAndSharesAndOrgi(user.getId(), user.getId(), super.getOrgi(request), false, q, new PageRequest(super.getP(request), super.getPs(request))); + contactsList = contactsRes.findByCreaterAndSharesAndOrgi( + user.getId(), user.getId(), super.getOrgi(request), false, q, new PageRequest(super.getP(request), + super.getPs( + request))); } else { - contactsList = contactsRes.findByOrgi(super.getOrgi(request), false, q, new PageRequest(super.getP(request), super.getPs(request))); + contactsList = contactsRes.findByOrgi( + super.getOrgi(request), false, q, new PageRequest(super.getP(request), super.getPs(request))); } return new ResponseEntity<>(new RestResult(RestResultType.OK, contactsList), HttpStatus.OK); } @@ -110,9 +126,10 @@ public class ApiWlContactsController extends Handler { * @param j * @return */ - private JsonObject createContact(final String creator, - final String orgi, - final JsonObject j) { + private JsonObject createContact( + final String creator, + final String orgi, + final JsonObject j) { JsonObject result = new JsonObject(); if (j.has("uid") && j.has("sid")) { @@ -217,8 +234,9 @@ public class ApiWlContactsController extends Handler { } - if (j.has("gender")) + if (j.has("gender")) { record.setGender(j.get("gender").getAsString()); + } if (isNew) { record.setId(MainUtils.getUUID()); diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/QueryParams.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/QueryParams.java similarity index 87% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/QueryParams.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/QueryParams.java index 895e0740..1265c16e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/QueryParams.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/QueryParams.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; public class QueryParams { private String begin ; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/RequestValues.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/RequestValues.java similarity index 86% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/RequestValues.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/RequestValues.java index 340b5b26..0e13ee07 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/RequestValues.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/RequestValues.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import java.io.Serializable; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/UkefuApiTagsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/UkefuApiTagsController.java similarity index 92% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/UkefuApiTagsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/UkefuApiTagsController.java index 87405673..40c854c7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/UkefuApiTagsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/UkefuApiTagsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api.rest; +package com.chatopera.cc.handler.api; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLoginController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiLoginController.java similarity index 91% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLoginController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiLoginController.java index 1956447a..ff40821a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiLoginController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiLoginController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api; +package com.chatopera.cc.handler.api.auth; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; @@ -26,6 +26,8 @@ import com.chatopera.cc.persistence.repository.UserRepository; import com.chatopera.cc.persistence.repository.UserRoleRepository; import com.chatopera.cc.util.Menu; import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -47,6 +49,8 @@ import java.util.List; @RestController @RequestMapping("/tokens") public class ApiLoginController extends Handler { + private final static Logger logger = LoggerFactory.getLogger(ApiLoginController.class); + @Autowired private UserRepository userRepository; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTokensErrorController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiTokensErrorController.java similarity index 90% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTokensErrorController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiTokensErrorController.java index 4524fa94..335ab965 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/ApiTokensErrorController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/auth/ApiTokensErrorController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.api; +package com.chatopera.cc.handler.api.auth; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.util.Menu; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/QueryParams.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/QueryParams.java index 08dd4c84..76766666 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/QueryParams.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/QueryParams.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RequestValues.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RequestValues.java index f029e6c4..ef8f6b37 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RequestValues.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RequestValues.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RestUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RestUtils.java index e7331a2b..7a2b4249 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RestUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/request/RestUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAgentUserController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAgentUserController.java deleted file mode 100644 index 3f1c6959..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiAgentUserController.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.api.rest; - -import com.chatopera.cc.acd.AutomaticServiceDist; -import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.model.AgentUser; -import com.chatopera.cc.util.Menu; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -/** - * ACD服务 获取当前对话中的访客 - */ -@RestController -@RequestMapping("/api/agentuser") -public class ApiAgentUserController extends Handler { - - private final static Logger logger = LoggerFactory.getLogger(ApiAgentUserController.class); - - @Autowired - private Cache cache; - - /** - * 获取当前对话中的访客 - * 坐席相关 RestAPI - * - * @param request - * @return - */ - @RequestMapping(method = RequestMethod.POST) - @Menu(type = "apps", subtype = "agentuser", access = true) - public ResponseEntity operations(HttpServletRequest request, @RequestBody final String body, @Valid String q) { - logger.info("[operations] body {}, q {}", body, q); - final JsonObject j = StringUtils.isBlank(body) ? (new JsonObject()) : (new JsonParser()).parse(body).getAsJsonObject(); - JsonObject json = new JsonObject(); - HttpHeaders headers = RestUtils.header(); - - if (!j.has("ops")) { - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的请求参数。"); - } else { - switch (StringUtils.lowerCase(j.get("ops").getAsString())) { - case "inserv": - json = inserv(request, j); - break; - case "withdraw": - json = withdraw(request, j); - break; - default: - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); - } - } - - return new ResponseEntity(json.toString(), headers, HttpStatus.OK); - } - - /** - * 撤退一个坐席 - * 将当前坐席服务中的访客分配给其他就绪的坐席 - * - * @param request - * @param j - * @return - */ - private JsonObject withdraw(final HttpServletRequest request, final JsonObject j) { - JsonObject resp = new JsonObject(); - AutomaticServiceDist.withdrawAgent(super.getOrgi(request), super.getUser(request).getId()); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - return resp; - } - - - /** - * 获得当前访客服务中的访客信息 - * 获取当前正在对话的访客信息,包含多种渠道来源的访客 - * - * @param request - * @param j - * @return - */ - private JsonObject inserv(final HttpServletRequest request, final JsonObject j) { - JsonObject resp = new JsonObject(); - JsonArray data = new JsonArray(); - - List lis = cache.findInservAgentUsersByAgentnoAndOrgi(super.getUser(request).getId(), super.getOrgi(request)); - for (final AgentUser au : lis) { - JsonObject obj = new JsonObject(); - obj.addProperty("id", au.getId()); - obj.addProperty("userid", au.getUserid()); - obj.addProperty("status", au.getStatus()); - obj.addProperty("agentno", au.getAgentno()); - obj.addProperty("channel", au.getChannel()); - obj.addProperty("nickname", au.getNickname()); - data.add(obj); - } - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.add("data", data); - - return resp; - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallMonitorController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallMonitorController.java deleted file mode 100644 index 4b818125..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallMonitorController.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.api.rest; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.util.Menu; -import com.chatopera.cc.util.MathHelper; -import com.chatopera.cc.exception.CalloutRecordException; -import com.chatopera.cc.model.*; -import com.chatopera.cc.persistence.repository.*; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.proxy.UserProxy; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.HashOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.listener.ChannelTopic; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.PostConstruct; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -/** - * 通话记录 - * 语音渠道坐席监控 - * 监控语音渠道使用情况,支持监听等操作。 - */ -@RestController -@RequestMapping("/api/callout/monitor") -public class ApiCallMonitorController extends Handler { - private static final Logger logger = LoggerFactory.getLogger(ApiCallMonitorController.class); - private HashOperations redisHashOps; - - /** - * 使用StringRedisTemplate而不是RedisTemplate解决序列化问题 - * https://stackoverflow.com/questions/13215024/weird-redis-key-with-spring-data-jedis - */ - @Autowired - private StringRedisTemplate redis; - - @Autowired - private SNSAccountRepository snsAccountRes; - - @Autowired - private OrganRepository organRes; - - @Autowired - private UserRepository userRes; - - @Autowired - private AgentStatusRepository agentStatusRes; - - @Autowired - private StatusEventRepository statusEventRes; - - @PostConstruct - private void init() { - redisHashOps = redis.opsForHash(); - } - - - private AgentStatus getAgentStatus(final String agentId, final String orgi) { - List x = agentStatusRes.findByAgentnoAndOrgi(agentId, orgi); - if (x.size() > 0) - return x.get(0); - return null; - } - - /** - * 获取正在通话的数据 - * - * @param agentId - * @param sip - * @param status - * @return - */ - private JsonObject getStatusEvent(final String agentId, final String sip, final String status) { - JsonObject j = new JsonObject(); - StatusEvent s = statusEventRes.findByAgentAndSiptrunkAndStatus(agentId, sip, status); - if (s != null) { - j.addProperty("callid", s.getCallid()); - j.addProperty("called", s.getCalled()); - j.addProperty("direction", s.getDirection()); - // 格式化开始时间 - j.addProperty("createtime", Constants.DISPLAY_DATE_FORMATTER.format(s.getCreatetime())); - // 增加持续时间 - j.addProperty("duration", MathHelper.formatSecondsBetweenTwoDates(s.getCreatetime(), null)); - } - return j; - } - - /** - * @param organ - * @return - */ - private String getOrganName(final String organ) { - if (StringUtils.isBlank(organ)) - return "未设置"; - - Organ o = organRes.findOne(organ); - if (o == null) { - return ""; - } else { - return o.getName(); - } - } - - /** - * 查询通话记录 - * - * @return - */ - private JsonObject status(final JsonObject j) { - JsonObject resp = new JsonObject(); - try { - if (j.has("channel")) { - final String channel = j.get("channel").getAsString(); - SNSAccount snsAccount = snsAccountRes.findBySnsid(channel); - if (snsAccount == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不存在该语音渠道。"); - return resp; - } - - // 检查organ - String organ = null; - if (j.has("organ")) { - organ = j.get("organ").getAsString(); - if (StringUtils.isBlank(organ)) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_MSG, "部门参数是空字符串,不合法。"); - return resp; - } - if (organRes.findOne(organ) == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_MSG, "不存在该部门。"); - return resp; - } - } - - // 从Redis中取数据 - Map pbxSipStatusMap = redisHashOps.entries(String.format(Constants.FS_SIP_STATUS, channel)); - if (pbxSipStatusMap.keySet().size() == 0) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "软交换系统不存在该语音渠道的数据。"); - return resp; - } - - // 获取到数据,返回 - JsonArray ja = new JsonArray(); - - // 客服列表 - List agents = UserProxy.findAllByCallcenterIsTrueAndDatastatusIsFalseAndOrgan(organ); - - for (User g : agents) { - JsonObject x = new JsonObject(); - x.addProperty("name", g.getUname()); - - AgentStatus as = getAgentStatus(g.getId(), MainContext.SYSTEM_ORGI); - if (as == null) { - // 离线客服 - x.addProperty("web", MainContext.AgentStatusEnum.OFFLINE.zh()); - } else { - x.addProperty("web", as.isBusy() ? MainContext.AgentStatusEnum.BUSY.zh() : MainContext.AgentStatusEnum.IDLE.zh()); - } - - String sipaccount = g.getSipaccount(); - if (StringUtils.isNotBlank(sipaccount)) { - String sipstatus = pbxSipStatusMap.get(sipaccount); - if (StringUtils.isNotBlank(sipstatus)) { - x.addProperty("sip", sipaccount); - x.addProperty("status", sipstatus); - if (Constants.FS_LEG_INCALL_ZH.equals(sipstatus)) - x.add("current", getStatusEvent(g.getId(), sipaccount, MainContext.CallServiceStatus.INCALL.toString())); - } else { - x.addProperty("sip", sipaccount); - x.addProperty("status", MainContext.CallServiceStatus.OFFLINE.toString()); - } - } else { - x.addProperty("sip", "未设置"); - x.addProperty("status", "无"); - } - ja.add(x); - } - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.add(RestUtils.RESP_KEY_DATA, ja); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "缺少请求参数 [语音渠道标识]。"); - } - } catch (Exception e) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "检索数据返回异常。"); - logger.error("[callout monitor] 检索数据返回异常 {}", j.toString(), e); - } - return resp; - } - - /** - * 获取SIP账号状态 - * - * @param channel - * @param sipaccount - * @return - */ - private String getSipStatus(String channel, String sipaccount) { - logger.info("[callout monitor] getSipStatus hash {}, key {}", String.format(Constants.FS_SIP_STATUS, channel), sipaccount); - String s = redisHashOps.get(String.format(Constants.FS_SIP_STATUS, channel), sipaccount); - if (s == null) - return "SIP账号未注册到语音网关或离线中。"; - if (s.equals("空闲")) - return null; - return String.format("SIP账号的状态为【%s】,该状态不能完成监听。", s); - } - - /** - * 监听 - * - * @param request - * @param j - * @return - */ - private JsonObject dropin(HttpServletRequest request, final JsonObject j) { - logger.info("[callout] dropin data {}", j.toString()); - JsonObject resp = new JsonObject(); - String callid = null; - String channel = null; - // 分析参数 - if (!j.has("callid")) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "通话ID参数不存在。"); - return resp; - } else { - callid = j.get("callid").getAsString(); - } - - if (!j.has("channel")) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "语音渠道参数不存在。"); - return resp; - } else { - channel = j.get("channel").getAsString(); - if (snsAccountRes.findBySnsid(channel) == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "语音渠道不存在。"); - return resp; - } - } - - User current = super.getUser(request); - if (current == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "无法解析登录账号。"); - return resp; - } - - logger.info("[callout monitor] current isCallcenter {} , getSipaccount {}", current.isCallcenter(), current.getSipaccount()); - if (current.isCallcenter() && StringUtils.isNotBlank(current.getSipaccount())) { - String status = getSipStatus(channel, current.getSipaccount()); - if (status != null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_7); - resp.addProperty(RestUtils.RESP_KEY_ERROR, status); - return resp; - } - - ChannelTopic ct = new ChannelTopic(String.format(Constants.FS_CHANNEL_CC_TO_FS, channel)); - JsonObject payload = new JsonObject(); - payload.addProperty("ops", "monitor"); - payload.addProperty("uuid", callid); - payload.addProperty("sip", current.getSipaccount()); - payload.addProperty("channel", channel); - redis.convertAndSend(ct.getTopic(), payload.toString()); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_DATA, "监听任务已经下发,如果该线路还没有被监听,将您接入。"); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "未绑定SIP账号,无法监听。"); - return resp; - } - - return resp; - } - - - /** - * 通话记录 - * 通话记录查询 - * @param request - * @return - */ - @RequestMapping(method = RequestMethod.POST) - @Menu(type = "apps", subtype = "callout", access = true) - public ResponseEntity execute(HttpServletRequest request, @RequestBody final String body) throws CalloutRecordException { - logger.info("[callout monitor] raw payload {}", body); - final JsonObject j = (new JsonParser()).parse(body).getAsJsonObject(); - JsonObject json = new JsonObject(); - HttpHeaders headers = RestUtils.header(); - - if (!j.has("ops")) { - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的请求参数。"); - } else { - switch (StringUtils.lowerCase(j.get("ops").getAsString())) { - case "status": // 根据语音渠道获取状态 - json = status(j); - break; - case "dropin": - json = dropin(request, j); - break; - default: - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); - } - } - return new ResponseEntity(json.toString(), headers, HttpStatus.OK); - } - - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallRecordsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallRecordsController.java deleted file mode 100644 index 0ba67a68..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiCallRecordsController.java +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.api.rest; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.model.SNSAccount; -import com.chatopera.cc.model.StatusEvent; -import com.chatopera.cc.model.User; -import com.chatopera.cc.persistence.repository.OrganRepository; -import com.chatopera.cc.persistence.repository.SNSAccountRepository; -import com.chatopera.cc.persistence.repository.StatusEventRepository; -import com.chatopera.cc.persistence.repository.UserRepository; -import com.chatopera.cc.persistence.storage.MinioService; -import com.chatopera.cc.exception.CalloutRecordException; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.util.MathHelper; -import com.chatopera.cc.util.Menu; -import com.chatopera.cc.proxy.UserProxy; -import com.chatopera.cc.util.callout.CalloutHangupAggsResult; -import com.chatopera.cc.util.callout.CalloutHangupAuditResult; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import io.minio.errors.*; -import org.apache.commons.collections4.SetUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.time.DateUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import org.xmlpull.v1.XmlPullParserException; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.ParseException; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 通话记录 - * 按条件查询通话记录 - */ -@RestController -@RequestMapping("/api/callout/records") -public class ApiCallRecordsController extends Handler { - private static final Logger logger = LoggerFactory.getLogger(ApiCallRecordsController.class); - - @Autowired - StatusEventRepository statusEventRes; - - @Autowired - MinioService minioService; - - @Autowired - SNSAccountRepository snsAccountRes; - - @Autowired - OrganRepository organRes; - - @Autowired - UserRepository userRes; - - /** - * 处理日期格式 - * - * @return - */ - private Date enddate(final JsonObject j) throws ParseException { - if (j.has("enddate")) { - Date end = Constants.QUERY_DATE_FORMATTER.parse(j.get("enddate").getAsString()); - return end; - } - return null; - } - - /** - * 处理日期格式 - * - * @return - */ - private Date fromdate(final JsonObject j) throws ParseException { - if (j.has("fromdate")) { - Date from = Constants.QUERY_DATE_FORMATTER.parse(j.get("fromdate").getAsString()); - return from; - } - return null; - } - - /** - * 查询通话记录 - * - * @return - */ - private JsonObject query(final HttpServletRequest request, final JsonObject j) { - JsonObject resp = new JsonObject(); - Date fromdate, enddate; - - try { - // 分析查询起止日期 - try { - fromdate = fromdate(j); - } catch (ParseException e) { - fromdate = null; - } - - try { - enddate = enddate(j); - } catch (ParseException e) { - enddate = null; - } - - if ((fromdate != null) && (enddate != null)) { - if (fromdate.after(enddate)) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "开始日期不得晚于结束日期。"); - return resp; - } - } - - - // 其他查询参数 - String organ = j.has("organ") ? j.get("organ").getAsString() : null; - String agent = j.has("agent") ? j.get("agent").getAsString() : null; - String called = j.has("called") ? j.get("called").getAsString() : null; - - Page records = statusEventRes.queryCalloutDialplanSuccRecords(fromdate, - DateUtils.addDays(enddate, 1), - organ, - agent, - called, - MainContext.CallType.OUT.toString(),// 呼出 - MainContext.CallServiceStatus.HANGUP.toString(),// 挂机 - null, // Dialplan,null代表所有外呼 - new PageRequest(super.getP(request), super.getPs(request), Sort.Direction.DESC, "createtime")); - - JsonArray ja = new JsonArray(); - for (StatusEvent record : records) { - JsonObject jo = new JsonObject(); - jo.addProperty("id", record.getId()); - jo.addProperty("name", record.getName()); // 访客名字 - jo.addProperty("duration", record.getDuration()); // 通话时间,秒 - jo.addProperty("called", record.getCalled()); // 被叫号码 - jo.addProperty("calledcity", record.getCity()); - jo.addProperty("calledprovince", record.getProvince()); - jo.addProperty("agent", record.getAgent()); // 坐席ID - jo.addProperty("agentname", record.getAgentname()); // 坐席名字 - jo.addProperty("calltype", record.getCalltype()); // 呼叫类型 - jo.addProperty("direction", record.getDirection()); // 呼叫方向 - jo.addProperty("starttime", Constants.DISPLAY_DATE_FORMATTER.format(record.getStarttime())); // 开始时间 - jo.addProperty("endtime", Constants.DISPLAY_DATE_FORMATTER.format(record.getEndtime())); // 结束时间 - jo.addProperty("organ", record.getOrgan()); // 部门名字 - jo.addProperty("organid", record.getOrganid()); // 部门ID - jo.addProperty("recordingfile", record.getRecordingfile()); // 录音文件标识 - jo.addProperty("status", record.getStatus()); // 状态代码 - ja.add(jo); - } - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.add("data", ja); - resp.addProperty("size", records.getSize()); // 每页条数 - resp.addProperty("number", records.getNumber()); // 当前页 - resp.addProperty("totalPage", records.getTotalPages()); // 所有页 - resp.addProperty("totalElements", records.getTotalElements()); // 所有检索结果数量 - } catch (Exception e) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "检索数据返回异常。"); - logger.error("[callout records] 检索数据返回异常 {}", j.toString(), e); - } - return resp; - } - - /** - * 获取录音文件的路径 - * - * @param j - * @return - */ - private JsonObject wav(JsonObject j) { - JsonObject resp = new JsonObject(); - if (j.has("file")) { - final String file = j.get("file").getAsString(); - try { - String url = minioService.presignedGetObject(Constants.MINIO_BUCKET, file); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - JsonObject data = new JsonObject(); - data.addProperty("url", url); - resp.add(RestUtils.RESP_KEY_DATA, data); - } catch (InvalidBucketNameException e) { - logger.error("[callout records] 无效的bucket {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "无效的存储桶"); - } catch (NoSuchAlgorithmException e) { - logger.error("[callout records] NoSuchAlgorithmException {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "获取文件地址失败,请联系管理员。"); - } catch (InsufficientDataException e) { - logger.error("[callout records] 数据损坏 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "该数据已损坏。"); - } catch (IOException e) { - logger.error("[callout records] 读写异常 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "文件读写异常。"); - } catch (InvalidKeyException e) { - logger.error("[callout records] 密钥无效。 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "获取文件密钥无效,请联系管理员。"); - } catch (NoResponseException e) { - logger.error("[callout records] 存储服务无返回。 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "存储服务无返回。"); - } catch (XmlPullParserException e) { - logger.error("[callout records] XML解析错误 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "XML解析错误。"); - } catch (ErrorResponseException e) { - logger.error("[callout records] 存储服务错误返回 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "存储服务错误返回。"); - } catch (InternalException e) { - logger.error("[callout records] 内部异常 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "内部异常。"); - } catch (InvalidExpiresRangeException e) { - logger.error("[callout records] 过期时间设置错误 {}", j.toString(), e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "过期时间设置错误。"); - } - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "请求参数错误,没有文件标识。"); - } - - return resp; - } - - /** - * 验证聚合请求的参数 - * - * @param j - * @return - */ - private String validateAggBody(JsonObject j) { - // 检索语音渠道 - if (!j.has("channel")) { - return "语音渠道标识参数不存在。"; - } else { - SNSAccount snsAccount = snsAccountRes.findBySnsid(j.get("channel").getAsString()); - if (snsAccount == null) // 不存在该渠道 - return "该语音渠道不存在。"; - } - - // 检索日期 - if (!j.has("datestr")) { - return "日期参数不存在。"; - } else { - try { - Constants.QUERY_DATE_FORMATTER.parse(j.get("datestr").getAsString()); - } catch (ParseException e) { - return "日期参数不合法。"; - } - } - - // 呼叫类型 - if (!j.has("direction")) { - return "呼叫类型参数不存在。"; - } else if (Constants.CALL_DIRECTION_TYPES.contains(j.get("direction").getAsString())) { - return null; - } else { - return "呼叫类型不合法。"; - } - } - - /** - * 外呼日报:返回聚合数据 - * - * @param j - * @return - */ - private JsonObject agg(final JsonObject j) { - JsonObject resp = new JsonObject(); - String valid = validateAggBody(j); - - // 参数有误 - if (valid != null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - resp.addProperty(RestUtils.RESP_KEY_ERROR, valid); - return resp; - } - - // 解析参数 - final String channel = j.get("channel").getAsString(); - final String datestr = j.get("datestr").getAsString(); - final String direction = j.get("direction").getAsString(); - - List aggResult = statusEventRes.queryCallOutHangupAggsGroupByDialplanByDatestrAndChannelAndDirection(datestr, channel, direction); - logger.info("[callout records] aggResult size {}", aggResult.size()); - - List results = new ArrayList(); - - // 数据格式转化 - for (Object[] x : aggResult) { - CalloutHangupAggsResult result = null; - try { - logger.info("[callout records] 外呼日报[raw] dialplan {}, datestr {}, total {}, fails {}, totalDuration {}", x[0], x[1], x[2], x[3], x[4]); - result = CalloutHangupAggsResult.cast(x); - results.add(result); - } catch (CalloutRecordException e) { - logger.error("[callout records] 数据报表生成失败 {}", j, e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "数据报表生成失败,请联系管理员。"); - return resp; - } - } - - // 生成返回值 - int callout_auto = 0; // 自动外呼 - int callout_manu = 0; // 手动外呼 - int callout_auto_fails = 0; // 自动外呼失败 - int callout_manu_fails = 0; // 手动外呼失败 - int callout_auto_duration_seconds = 0; // 自动外呼分钟数 - int callout_manu_duration_seconds = 0; // 手动外呼分钟数 - - for (CalloutHangupAggsResult z : results) { - if (StringUtils.isNotBlank(z.getDialplan())) { // 自动外呼 -// logger.info("[callout records] 自动外呼 {}", z.getDialplan()); - callout_auto += z.getTotal(); - callout_auto_fails += z.getFails(); - callout_auto_duration_seconds += z.getDuration(); - } else { // 手动外呼 -// logger.info("[callout records] 手动外呼 {}", z.getDialplan()); - callout_manu += z.getTotal(); - callout_manu_fails += z.getFails(); - callout_manu_duration_seconds += z.getDuration(); - } - } - - final int callout_all = callout_auto + callout_manu; - final int callout_all_fails = callout_auto_fails + callout_manu_fails; - final int callout_all_succ = callout_all - callout_all_fails; - final int callout_all_duration_seconds = callout_auto_duration_seconds + callout_manu_duration_seconds; - - final int callout_auto_succ = callout_auto - callout_auto_fails; - final int callout_manu_succ = callout_manu - callout_manu_fails; - - // 呼通率 - String callout_all_succ_per = MathHelper.float_percentage_formatter(callout_all_succ, callout_all); // 所有外呼 - String callout_auto_succ_per = MathHelper.float_percentage_formatter(callout_auto_succ, callout_auto); // 自动外呼 - String callout_manu_succ_per = MathHelper.float_percentage_formatter(callout_manu_succ, callout_manu); // 手动外呼 - - JsonObject data = new JsonObject(); - JsonObject data_all = new JsonObject(); - JsonObject data_manu = new JsonObject(); - JsonObject data_auto = new JsonObject(); - - data_auto.addProperty("total", callout_auto); - data_auto.addProperty("fails", callout_auto_fails); - data_auto.addProperty("succ", callout_auto_succ); - data_auto.addProperty("succ_percentage", callout_auto_succ_per); - data_auto.addProperty("duration", Constants.DURATION_MINS_FORMATTER.format((float) callout_auto_duration_seconds / 60)); - - - data_manu.addProperty("total", callout_manu); - data_manu.addProperty("fails", callout_manu_fails); - data_manu.addProperty("succ", callout_manu_succ); - data_manu.addProperty("succ_percentage", callout_manu_succ_per); - data_manu.addProperty("duration", Constants.DURATION_MINS_FORMATTER.format((float) callout_manu_duration_seconds / 60)); - - - data_all.addProperty("total", callout_all); - data_all.addProperty("fails", callout_all_fails); - data_all.addProperty("succ", callout_all_succ); - data_all.addProperty("succ_percentage", callout_all_succ_per); - data_all.addProperty("duration", Constants.DURATION_MINS_FORMATTER.format((float) callout_all_duration_seconds / 60)); - - data.add("all", data_all); - data.add("manu", data_manu); - data.add("auto", data_auto); - resp.add("data", data); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - return resp; - } - - - /** - * 验证坐席报表参数 - * - * @param j - * @return - */ - private String validateAuditBody(JsonObject j) { - if (!j.has("channel")) { - return "语音渠道参数错误。"; - } else { - if (snsAccountRes.findBySnsid(j.get("channel").getAsString()) == null) - return "该语音渠道不存在。"; - } - - if (j.has("organ")) { - if (organRes.findByIdAndOrgi(j.get("organ").getAsString(), MainContext.SYSTEM_ORGI) == null) - return "该部门不存在。"; - } - - if (!j.has("fromdate")) - return "开始日期参数不存在。"; - - if (!j.has("enddate")) - return "结束日期参数不存在。"; - - try { - Date fromdate = Constants.QUERY_DATE_FORMATTER.parse(j.get("fromdate").getAsString()); - Date enddate = Constants.QUERY_DATE_FORMATTER.parse(j.get("enddate").getAsString()); - if (fromdate.after(enddate)) - return "开始日期不得晚于结束日期。"; - } catch (ParseException e) { - return "日期格式错误。"; - } - - return null; - } - - - /** - * 坐席报表 - * - * @param j - * @return - */ - private JsonObject audit(final JsonObject j) { - JsonObject resp = new JsonObject(); - - // 验证数据格式 - final String valid = validateAuditBody(j); - if (valid != null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, valid); - return resp; - } - - // 解析参数 - final String channel = j.get("channel").getAsString(); - final String fromdate = j.get("fromdate").getAsString(); - String enddate = null; - try { - enddate = Constants.QUERY_DATE_FORMATTER.format(DateUtils.addDays(enddate(j), 1)); - } catch (ParseException e) { - } - - final String organ = j.has("organ") ? j.get("organ").getAsString() : null; - - List z = statusEventRes.queryCalloutHangupAuditGroupByAgentAndDirection(channel, - fromdate, - enddate, - organ, - MainContext.SYSTEM_ORGI); - - // 查询结果序列化为聚合对象 - final Map out = new HashMap(); - final Map in = new HashMap(); - - for (Object[] x : z) { - try { - logger.info("[callout records] audit raw {} {} {} {} {} {} {} {}", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]); - CalloutHangupAuditResult y = CalloutHangupAuditResult.cast(x); - switch (y.getDirection()) { - case "呼出": - out.put(y.getAgentId(), y); - break; - case "呼入": - in.put(y.getAgentId(), y); - break; - default: - break; - } - } catch (CalloutRecordException e) { - logger.error("[callout records] ", e); - } - } - - final SetUtils.SetView x = SetUtils.union(out.keySet(), in.keySet()); - final Map k = new HashMap(); - final Map v = new HashMap(); - - JsonArray data = new JsonArray(); - for (String y : x) { - try { - JsonObject metric = new JsonObject(); - CalloutHangupAuditResult o = out.get(y); - CalloutHangupAuditResult i = in.get(y); - CalloutHangupAuditResult mix = CalloutHangupAuditResult.mix(o, i); - - metric.addProperty("name", mix.getAgentName()); - metric.addProperty("id", mix.getAgentId()); - metric.add("total", mix.toJson(false, false, false)); - - if (i != null) { - metric.add("in", i.toJson(false, false, false)); - } - - if (o != null) { - metric.add("out", o.toJson(false, false, false)); - } - k.put(mix.getAgentId(), metric); - v.put(mix.getAgentId(), mix.getSeconds()); - } catch (CalloutRecordException e) { - logger.error("[callout audit] error ", e); - } - } - - // sort - final List> s = v - .entrySet() - .stream() - .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) - .collect(Collectors.toList()); - - int r = 0; - for (Map.Entry i : s) { - JsonObject f = k.get(i.getKey()); - f.addProperty("rank", ++r); - data.add(f); - } - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.add("data", data); - return resp; - } - - - /** - * 根据用户ID获取部门名称 - * - * @param agentId - * @return - */ - private List getOrgansByAgentId(String agentId) { - User u = userRes.findById(agentId); - if (u != null) { - UserProxy.attachOrgansPropertiesForUser(u); - if (u.getOrgans().size() > 0){ - return null; - } - - return UserProxy.findOrgansByUserid(agentId); - } - return null; - } - - /** - * 通话记录 - * 通话记录查询 - * - * @param request - * @return - */ - @RequestMapping(method = RequestMethod.POST) - @Menu(type = "apps", subtype = "callout", access = true) - public ResponseEntity operations(HttpServletRequest request, @RequestBody final String body) { - final JsonObject j = (new JsonParser()).parse(body).getAsJsonObject(); - logger.info("[callout records] operations payload {}", j.toString()); - JsonObject json = new JsonObject(); - HttpHeaders headers = RestUtils.header(); - - if (!j.has("ops")) { - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的请求参数。"); - } else { - switch (StringUtils.lowerCase(j.get("ops").getAsString())) { - case "query": // 通话记录查询 - json = query(request, j); - break; - case "wav": // 获取录音文件地址 - json = wav(j); - break; - case "agg": // 外呼日报 - json = agg(j); - break; - case "audit": // 坐席报表 - json = audit(j); - break; - default: - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); - } - } - return new ResponseEntity(json.toString(), headers, HttpStatus.OK); - } - - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatbotController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatbotController.java deleted file mode 100644 index 806d1aab..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiChatbotController.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.api.rest; - -import com.chatopera.bot.exception.ChatbotException; -import com.chatopera.cc.basic.MainUtils; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.model.*; -import com.chatopera.cc.persistence.repository.*; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.proxy.OnlineUserProxy; -import com.chatopera.cc.util.Menu; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.lang.StringUtils; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.net.MalformedURLException; -import java.util.Date; -import java.util.List; - - -/** - * 聊天机器人 - * 请求聊天机器人服务 - */ -@RestController -@RequestMapping("/api/chatbot") -public class ApiChatbotController extends Handler { - private final static Logger logger = LoggerFactory.getLogger(ApiChatbotController.class); - - @Autowired - private ChatbotRepository chatbotRes; - - @Autowired - private SNSAccountRepository snsAccountRes; - - @Autowired - private UserRepository userRes; - - @Autowired - private OrganRepository organRes; - - @Autowired - private ConsultInviteRepository consultInviteRes; - - @Value("${bot.baseurl}") - private String botBaseUrl; - - /** - * 聊天机器人 - * - * @param request - * @param body - * @return - * @throws Exception - */ - @RequestMapping(method = RequestMethod.POST) - @Menu(type = "apps", subtype = "chatbot", access = true) - public ResponseEntity operations(HttpServletRequest request, @RequestBody final String body) throws Exception { - final JsonObject j = (new JsonParser()).parse(body).getAsJsonObject(); - logger.info("[chatbot] operations payload {}", j.toString()); - JsonObject json = new JsonObject(); - HttpHeaders headers = RestUtils.header(); - final User logined = super.getUser(request); - final String orgi = logined.getOrgi(); - - if (!j.has("ops")) { - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的请求参数。"); - } else { - switch (StringUtils.lowerCase(j.get("ops").getAsString())) { - case "create": - // TODO 支持将一个用户添加到多个部门后,此处需要在Payload中传入部门ID ,即 organ - // 2019-10-10 Wang Hai Liang - json = create(j, logined.getId(), logined.getOrgi()); - break; - case "delete": - json = delete(j, logined.getId(), logined.getOrgi()); - break; - case "fetch": - json = fetch(j, logined.getId(), logined.isSuperuser(), orgi, super.getP(request), super.getPs(request)); - break; - case "update": - json = update(j); - break; - case "enable": - json = enable(j, true); - break; - case "disable": - json = enable(j, false); - break; - case "vacant": - json = vacant(j, orgi, logined.isSuperuser()); - break; - default: - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); - } - } - return new ResponseEntity(json.toString(), headers, HttpStatus.OK); - } - - /** - * 获取空缺聊天机器人的网站渠道列表 - * - * @param j - * @param orgi - * @return - */ - private JsonObject vacant(final JsonObject j, String orgi, boolean isSuperuser) { - JsonObject resp = new JsonObject(); - if (!isSuperuser) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "您不具有访问该资源的权限。"); - return resp; - } - - List records = snsAccountRes.findBySnstypeAndOrgi(Constants.CHANNEL_TYPE_WEBIM, orgi); - JsonArray ja = new JsonArray(); - - for (SNSAccount r : records) { - if (!chatbotRes.existsBySnsAccountIdentifierAndOrgi(r.getSnsid(), orgi)) { - JsonObject o = new JsonObject(); - o.addProperty("id", r.getId()); - o.addProperty("snsid", r.getSnsid()); - o.addProperty("snsType", r.getSnstype()); - o.addProperty("snsurl", r.getBaseURL()); - ja.add(o); - } - } - - resp.add("data", ja); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - return resp; - } - - /** - * Enable Chatbot - * - * @param j - * @return - */ - private JsonObject enable(JsonObject j, boolean isEnabled) { - JsonObject resp = new JsonObject(); - if ((!j.has("id")) || StringUtils.isBlank(j.get("id").getAsString())) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作,id不能为空。"); - return resp; - } - - final String id = j.get("id").getAsString(); - Chatbot c = chatbotRes.findOne(id); - - if (c == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "该聊天机器人不存在。"); - return resp; - } - - try { - com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot(c.getClientId(), c.getSecret(), botBaseUrl); - if (bot.exists()) { - c.setEnabled(isEnabled); - chatbotRes.save(c); - - // 更新访客网站配置 - CousultInvite invite = OnlineUserProxy.consult(c.getSnsAccountIdentifier(), c.getOrgi()); - invite.setAi(isEnabled); - consultInviteRes.save(invite); - OnlineUserProxy.cacheConsult(invite); - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_DATA, "完成。"); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_7); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "智能问答引擎不存在该聊天机器人,未能正确设置。"); - } - } catch (MalformedURLException e) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_DATA, "设置不成功,智能问答引擎地址不合法。"); - } catch (ChatbotException e) { - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_DATA, "设置不成功,智能问答引擎服务异常。"); - } - return resp; - } - - /** - * 更新聊天机器人 - * - * @param j - * @return - */ - private JsonObject update(JsonObject j) throws Exception { - JsonObject resp = new JsonObject(); - if (!j.has("id")) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "非法参数,id不能为空。"); - return resp; - } - final String id = j.get("id").getAsString(); - - Chatbot c = chatbotRes.findOne(id); - - if (c == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "该聊天机器人不存在。"); - return resp; - } - - // update clientId and secret - if (j.has("clientId")) { - c.setClientId(j.get("clientId").getAsString()); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【clientId】。"); - return resp; - } - - if (j.has("secret")) { - c.setSecret(j.get("secret").getAsString()); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【secret】。"); - return resp; - } - - // 更新访客网站配置 - CousultInvite invite = OnlineUserProxy.consult(c.getSnsAccountIdentifier(), c.getOrgi()); - - if (j.has("workmode") && Constants.CHATBOT_VALID_WORKMODELS.contains(j.get("workmode").getAsString())) { - c.setWorkmode(j.get("workmode").getAsString()); - invite.setAifirst(StringUtils.equals(Constants.CHATBOT_CHATBOT_FIRST, c.getWorkmode())); - } - - if (j.has("enabled")) { - boolean enabled = j.get("enabled").getAsBoolean(); - c.setEnabled(enabled); - invite.setAi(enabled); - } - - try { - com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot(c.getClientId(), c.getSecret(), botBaseUrl); - if (bot.exists()) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_DATA, "更新成功。"); - JSONObject botDetails = bot.details(); - c.setDescription(botDetails.getJSONObject("data").getString("description")); - c.setFallback(botDetails.getJSONObject("data").getString("fallback")); - c.setWelcome(botDetails.getJSONObject("data").getString("welcome")); - invite.setAisuccesstip(botDetails.getJSONObject("data").getString("welcome")); - c.setName(botDetails.getJSONObject("data").getString("name")); - invite.setAiname(c.getName()); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "Chatopera开发者平台Chatopera开发者平台提示:无法访问该机器人,请确认【1】该服务器可以访问互联网,【2】该聊天机器人已经创建,【3】clientId和Secret正确设置。提示:该机器人不存在,请先创建机器人, 登录 https://bot.chatopera.com"); - return resp; - } - } catch (ChatbotException e) { - logger.error("bot create error", e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "Chatopera开发者平台提示:无法访问该机器人,请确认【1】该服务器可以访问互联网,【2】该聊天机器人已经创建,【3】clientId和Secret正确设置。"); - return resp; - } catch (MalformedURLException e) { - logger.error("bot request error", e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_7); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "更新智能问答引擎失败。" + e.toString()); - return resp; - } - - c.setUpdatetime(new Date()); - chatbotRes.save(c); - consultInviteRes.save(invite); - OnlineUserProxy.cacheConsult(invite); - - return resp; - } - - /** - * 获取聊天机器人列表 - * - * @param j - * @param id - * @param orgi - * @param p - * @param ps - * @return - */ - private JsonObject fetch(JsonObject j, String id, boolean isSuperuser, String orgi, int p, int ps) { - JsonObject resp = new JsonObject(); - if (!isSuperuser) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "当前登录用户不是管理员,无权访问机器人客服资源。"); - return resp; - } - - Page records = chatbotRes.findWithPagination(new PageRequest(p, ps, Sort.Direction.DESC, "createtime")); - - JsonArray ja = new JsonArray(); - for (Chatbot c : records) { - JsonObject o = new JsonObject(); - o.addProperty("id", c.getId()); - o.addProperty("name", c.getName()); - o.addProperty("primaryLanguage", c.getPrimaryLanguage()); - o.addProperty("description", c.getDescription()); - o.addProperty("fallback", c.getFallback()); - o.addProperty("welcome", c.getWelcome()); - o.addProperty("workmode", c.getWorkmode()); - o.addProperty("channel", c.getChannel()); - o.addProperty("snsid", c.getSnsAccountIdentifier()); - o.addProperty("enabled", c.isEnabled()); - - // SNSAccount - SNSAccount snsAccount = snsAccountRes.findBySnsidAndOrgi(c.getSnsAccountIdentifier(), orgi); - if (snsAccount == null) { - chatbotRes.delete(c); // 删除不存在snsAccount的机器人 - continue; // 忽略不存在snsAccount的机器人 - } - - o.addProperty("snsurl", snsAccount.getBaseURL()); - - // 创建人 - User user = userRes.findById(c.getCreater()); - if (user != null) { - o.addProperty("creater", c.getCreater()); - o.addProperty("creatername", user.getUname()); - } - - ja.add(o); - } - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.add("data", ja); - resp.addProperty("size", records.getSize()); // 每页条数 - resp.addProperty("number", records.getNumber()); // 当前页 - resp.addProperty("totalPage", records.getTotalPages()); // 所有页 - resp.addProperty("totalElements", records.getTotalElements()); // 所有检索结果数量 - - return resp; - } - - /** - * 删除聊天机器人 - * - * @param j - * @param uid - * @param orgi - * @return - */ - private JsonObject delete(final JsonObject j, final String uid, final String orgi) { - JsonObject resp = new JsonObject(); - if ((!j.has("id")) || StringUtils.isBlank(j.get("id").getAsString())) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入id。"); - return resp; - } - final String id = j.get("id").getAsString(); - - Chatbot c = chatbotRes.findOne(id); - if (c == null) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,不存在该聊天机器人。"); - return resp; - } - - // 更新访客网站配置 - CousultInvite invite = OnlineUserProxy.consult(c.getSnsAccountIdentifier(), c.getOrgi()); - if (invite != null) { - invite.setAi(false); - invite.setAiname(null); - invite.setAisuccesstip(null); - invite.setAifirst(false); - invite.setAiid(null); - consultInviteRes.save(invite); - OnlineUserProxy.cacheConsult(invite); - } - chatbotRes.delete(c); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_DATA, "删除成功。"); - return resp; - } - - /** - * 创建聊天机器人 - * - * @param j - * @param creater - * @param orgi - * @return - */ - private JsonObject create(final JsonObject j, final String creater, final String orgi) throws Exception { - JsonObject resp = new JsonObject(); - String snsid = null; - String workmode = null; - String clientId = null; - String secret = null; - - if ((!j.has("clientId")) || StringUtils.isBlank(j.get("clientId").getAsString())) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【clientId】。"); - return resp; - } else { - clientId = j.get("clientId").getAsString(); - } - - if ((!j.has("secret")) || StringUtils.isBlank(j.get("secret").getAsString())) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【secret】。"); - return resp; - } else { - secret = j.get("secret").getAsString(); - } - - if (!(j.has("workmode") && Constants.CHATBOT_VALID_WORKMODELS.contains(j.get("workmode").getAsString()))) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入有效【workmode】。"); - return resp; - } else { - workmode = j.get("workmode").getAsString(); - } - - if ((!j.has("snsid")) || StringUtils.isBlank(j.get("snsid").getAsString())) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,未传入【snsid】。"); - return resp; - } else { - snsid = j.get("snsid").getAsString(); - // #TODO 仅支持webim - if (!snsAccountRes.existsBySnsidAndSnstypeAndOrgi(snsid, Constants.CHANNEL_TYPE_WEBIM, orgi)) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,不存在【snsid】对应的网站渠道。"); - return resp; - } - - if (chatbotRes.existsBySnsAccountIdentifierAndOrgi(snsid, orgi)) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,该渠道【snsid】已经存在聊天机器人。"); - return resp; - } - } - - if (chatbotRes.existsByClientIdAndOrgi(clientId, orgi)) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的参数,数据库中存在该聊天机器人。"); - return resp; - } - - try { - logger.info("create bot with url {}", botBaseUrl); - com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot(clientId, secret, botBaseUrl); - - if (bot.exists()) { // 该机器人存在,clientId 和 Secret配对成功 - // 创建成功 - Chatbot c = new Chatbot(); - JSONObject botDetails = bot.details(); - c.setId(MainUtils.getUUID()); - c.setClientId(clientId); - c.setSecret(secret); - c.setBaseUrl(botBaseUrl); - c.setDescription(botDetails.getJSONObject("data").getString("description")); - c.setFallback(botDetails.getJSONObject("data").getString("fallback")); - c.setPrimaryLanguage(botDetails.getJSONObject("data").getString("primaryLanguage")); - c.setName(botDetails.getJSONObject("data").getString("name")); - c.setWelcome(botDetails.getJSONObject("data").getString("welcome")); - c.setCreater(creater); - c.setOrgi(orgi); - c.setChannel(Constants.CHANNEL_TYPE_WEBIM); - c.setSnsAccountIdentifier(snsid); - Date dt = new Date(); - c.setCreatetime(dt); - c.setUpdatetime(dt); - c.setWorkmode(workmode); - - // 默认不开启 - boolean enabled = false; - c.setEnabled(enabled); - - // 更新访客网站配置 - CousultInvite invite = OnlineUserProxy.consult(c.getSnsAccountIdentifier(), c.getOrgi()); - invite.setAi(enabled); - invite.setAifirst(StringUtils.equals(Constants.CHATBOT_CHATBOT_FIRST, workmode)); - invite.setAiid(c.getId()); - invite.setAiname(c.getName()); - invite.setAisuccesstip(c.getWelcome()); - consultInviteRes.save(invite); - OnlineUserProxy.cacheConsult(invite); - chatbotRes.save(c); - - JsonObject data = new JsonObject(); - data.addProperty("id", c.getId()); - resp.add(RestUtils.RESP_KEY_DATA, data); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - return resp; - } else { - // 创建失败 - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "Chatopera开发者平台提示:该机器人不存在,请先创建机器人, 登录 https://bot.chatopera.com"); - return resp; - } - } catch (ChatbotException e) { - logger.error("bot create error", e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "Chatopera开发者平台提示:无法访问该机器人,请确认【1】该服务器可以访问互联网,【2】该聊天机器人已经创建,【3】clientId和Secret正确设置。"); - return resp; - } catch (MalformedURLException e) { - logger.error("bot request error", e); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "Chatopera开发者平台提示:不合法的聊天机器人服务URL。"); - return resp; - } - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiDailplanRunController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiDailplanRunController.java deleted file mode 100644 index f268a931..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/api/rest/ApiDailplanRunController.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.handler.api.rest; - -import com.chatopera.cc.activemq.PbxEventSubscription; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.exception.CalloutRuntimeException; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.handler.api.request.RestUtils; -import com.chatopera.cc.model.CallOutDialplan; -import com.chatopera.cc.persistence.repository.CallOutDialplanRepository; -import com.chatopera.cc.persistence.repository.UserRepository; -import com.chatopera.cc.schedule.CalloutPlanTask; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.util.Menu; -import com.chatopera.cc.proxy.UserProxy; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Conditional; -import org.springframework.data.redis.core.HashOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.PostConstruct; -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * 管理外呼计划的执行过程 - */ -@RestController -@RequestMapping("/api/callout/dialplan") -@Conditional(CalloutBeanCondition.class) -public class ApiDailplanRunController extends Handler { - private final static Logger logger = LoggerFactory.getLogger(ApiDailplanRunController.class); - private HashOperations redisHashOps; - - @Autowired - private UserRepository userRes; - - @Autowired - private CallOutDialplanRepository callOutDialplanRes; - - @Autowired - private CalloutPlanTask callOutPlanTask; - - @Autowired - private StringRedisTemplate redis; - - @Autowired - private PbxEventSubscription pbxEventSubscription; - - @PostConstruct - private void init() { - redisHashOps = redis.opsForHash(); - } - - - /** - * 通过部门ID查询Sips账号列表 - * - * @param organ - * @param orgi - * @return - */ - private JsonArray getSipsByOrgan(final String organ, final String orgi) { - logger.info("[callout executor] getSipsByOrgan {}", organ); - JsonArray j = new JsonArray(); - List sips = UserProxy.findSipsByOrganAndDatastatusAndOrgi(organ, false, orgi); - for (String sip : sips) { - if (StringUtils.isNotBlank(sip)) - j.add(StringUtils.trim(sip)); - } - - logger.info("[callout executor] sips {}", j.toString()); - return j; - } - - /** - * 执行呼叫计划 - * - * @param dp - * @return - */ - protected JsonObject execute(final CallOutDialplan dp) { - JsonObject resp = new JsonObject(); - - if (dp.isIsarchive()) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_5); - resp.addProperty(RestUtils.RESP_KEY_ERROR, String.format("当前呼叫计划已删除,该情况下无法启动。", dp.getStatus())); - } else if (dp.getStatus().equals(MainContext.CalloutDialplanStatusEnum.STOPPED.toString())) { - - // 查询该技能组的SIP号码列表 - final JsonArray sips = getSipsByOrgan(dp.getOrgan().getId(), MainContext.SYSTEM_ORGI); - - if (sips.size() == 0) { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_6); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "当前呼叫计划的技能组不存在绑定SIP话机的客服人员。"); - return resp; - } - - // 并发数,获得该部门的在线客服数 X 坐席外呼并发比 - final long countagent = UserProxy.countByOrgiAndAgentAndDatastatusAndOrgan(MainContext.SYSTEM_ORGI, true, false, dp.getOrgan().getId()); - final int concurrency = (int) Math.ceil(countagent * dp.getConcurrenceratio()); - logger.info("[callout executor] 并发数 {}", concurrency); - if (concurrency >= 1) { - dp.setExecuted(dp.getExecuted() + 1); - // 非暂停中 - dp.setStatus(MainContext.CalloutDialplanStatusEnum.RUNNING.toString()); - dp.setCurconcurrence(concurrency); - - // 查看该计划是否为暂停中的计划 - String existed = redisHashOps.get(String.format(Constants.FS_DIALPLAN_STATUS, dp.getVoicechannel().getBaseURL()), dp.getId()); - if (existed != null) { - logger.info("[callout api] 【】 Redis中的前状态 {}", dp.getName(), existed); - JsonParser parser = new JsonParser(); - JsonObject pre = parser.parse(existed).getAsJsonObject(); - // 非RUNNING的状态 - if (pre.has("status") && !(pre.get("status").getAsString().equals( - MainContext.CalloutDialplanStatusEnum.RUNNING.toString()))) { - logger.info("[callout api] 从暂停状态恢复到启动 {} {}", dp.getName(), dp.getId()); - - // 设置持久化状态 - pre.addProperty("concurrency", concurrency); - pre.addProperty("status", MainContext.CalloutDialplanStatusEnum.RUNNING.toString()); - pre.addProperty("updatetime", (new Date()).toString()); - pre.add("sips", sips); - redisHashOps.put(String.format(Constants.FS_DIALPLAN_STATUS, dp.getVoicechannel().getBaseURL()), dp.getId(), pre.toString()); - - // 发送信号 - JsonObject payload = new JsonObject(); - payload.addProperty("dialplan", dp.getId()); - payload.addProperty("concurrency", concurrency); - payload.addProperty("ops", "start"); - payload.addProperty("channel", dp.getVoicechannel().getBaseURL()); - payload.add("sips", sips); - pbxEventSubscription.publish(String.format(Constants.FS_CHANNEL_CC_TO_FS, dp.getVoicechannel().getBaseURL()), payload.toString()); - } else { - logger.error("[callout api] Redis 存储的前状态不支持重新启动,或者该任务正在执行。 {}", pre.toString()); - } - } else { - logger.info("[callout api] 【{}】 Redis中不存在前状态,作为新任务开始。", dp.getName()); - try { - callOutPlanTask.run(dp, sips); - } catch (CalloutRuntimeException e) { - logger.error("[callout api] 呼叫计划无法启动", e); - } - } - callOutDialplanRes.save(dp); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_MSG, "开始执行"); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, String.format("当前该部门[%s]无坐席在线,该情况下无法启动。", dp.getOrgan().getName())); - } - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_4); - resp.addProperty(RestUtils.RESP_KEY_ERROR, String.format("当前呼叫计划状态为 [%s],该状态下无法启动。", dp.getStatus())); - } - return resp; - } - - /** - * 暂停执行中的呼叫计划 - * - * @param dp - * @return - */ - private JsonObject pause(final CallOutDialplan dp) { - JsonObject resp = new JsonObject(); - if (dp.getStatus().equals(MainContext.CalloutDialplanStatusEnum.RUNNING.toString())) { - JsonObject payload = new JsonObject(); - payload.addProperty("dialplan", dp.getId()); - payload.addProperty("ops", "pause"); - payload.addProperty("channel", dp.getVoicechannel().getBaseURL()); - pbxEventSubscription.publish(String.format(Constants.FS_CHANNEL_CC_TO_FS, dp.getVoicechannel().getBaseURL()), payload.toString()); - - Date dt = new Date(); - JsonObject payload2 = new JsonObject(); - payload2.addProperty("concurrency", dp.getCurconcurrence()); - payload2.addProperty("status", MainContext.CalloutDialplanStatusEnum.STOPPED.toString()); - payload2.addProperty("channel", dp.getVoicechannel().getBaseURL()); - payload2.addProperty("updatetime", dt.toString()); - callOutPlanTask.setHashKeyValue(String.format(Constants.FS_DIALPLAN_STATUS, dp.getVoicechannel().getBaseURL()), dp.getId(), payload2.toString()); - - dp.setUpdatetime(dt); - dp.setStatus(MainContext.CalloutDialplanStatusEnum.STOPPED.toString()); - callOutDialplanRes.save(dp); - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_MSG, "该呼叫计划被暂停。"); - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_3); - resp.addProperty(RestUtils.RESP_KEY_ERROR, "无法暂停非【执行中】的呼叫计划。"); - } - return resp; - } - - /** - * 删除呼叫计划 - * - * @param dp - * @return - */ - private JsonObject delete(final CallOutDialplan dp) { - JsonObject resp = new JsonObject(); - if (!dp.isIsarchive()) { - // 发送撤销信号 - JsonObject payload = new JsonObject(); - payload.addProperty("dialplan", dp.getId()); - payload.addProperty("ops", "cancel"); - payload.addProperty("channel", dp.getVoicechannel().getBaseURL()); - pbxEventSubscription.publish(String.format(Constants.FS_CHANNEL_CC_TO_FS, dp.getVoicechannel().getBaseURL()), payload.toString()); - - // 删除状态成员 - callOutPlanTask.delHashKey(String.format(Constants.FS_DIALPLAN_STATUS, dp.getVoicechannel().getBaseURL()), dp.getId()); - - // 更新数据库 - dp.setStatus(MainContext.CalloutDialplanStatusEnum.STOPPED.toString()); - dp.setIsarchive(true); - dp.setUpdatetime(new Date()); - callOutDialplanRes.save(dp); - - // 删除呼叫列表 - callOutPlanTask.delKey(String.format(Constants.FS_DIALPLAN_TARGET, dp.getVoicechannel().getBaseURL(), dp.getId())); - - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_MSG, "该呼叫计划删除成功。"); - - } else { - resp.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_SUCC); - resp.addProperty(RestUtils.RESP_KEY_MSG, "该呼叫计划已经删除。"); - } - return resp; - } - - - /** - * 执行呼叫计划 - * - * @param request - * @return - */ - @RequestMapping(method = RequestMethod.POST) - @Menu(type = "apps", subtype = "callout", access = true) - public ResponseEntity execute(HttpServletRequest request, @RequestBody final String body) throws CalloutRuntimeException { - final JsonObject j = (new JsonParser()).parse(body).getAsJsonObject(); - if (!(j.has("ops") && j.has("dialplanId"))) - throw new CalloutRuntimeException("Invalid body"); - final String ops = StringUtils.trim(j.get("ops").getAsString()).toLowerCase(); - final String dialplanId = StringUtils.trim(j.get("dialplanId").getAsString()); - JsonObject json = new JsonObject(); - HttpHeaders headers = RestUtils.header(); - - if (callOutDialplanRes.existsById(dialplanId)) { - CallOutDialplan dp = callOutDialplanRes.findOne(dialplanId); - switch (ops) { - case "execute": - json = execute(dp); - break; - case "pause": - json = pause(dp); - break; - case "delete": - json = delete(dp); - break; - default: - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_1); - json.addProperty(RestUtils.RESP_KEY_ERROR, "不合法的操作。"); - } - } else { - json.addProperty(RestUtils.RESP_KEY_RC, RestUtils.RESP_RC_FAIL_2); - json.addProperty(RestUtils.RESP_KEY_ERROR, "该呼叫计划不存在。"); - } - - return new ResponseEntity(json.toString(), headers, HttpStatus.OK); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/cca/AgentAuditController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentAuditController.java similarity index 95% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/cca/AgentAuditController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentAuditController.java index 61f2a2c5..da3f8794 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/cca/AgentAuditController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentAuditController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.cca; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.acd.AutomaticServiceDist; import com.chatopera.cc.basic.MainUtils; @@ -192,6 +192,110 @@ public class AgentAuditController extends Handler { return view; } + + @RequestMapping("/agentusers") + @Menu(type = "apps", subtype = "cca") + public ModelAndView agentusers(HttpServletRequest request, String userid) { + ModelAndView view = request(super.createRequestPageTempletResponse("/apps/cca/agentusers")); + User logined = super.getUser(request); + final String orgi = super.getOrgi(request); + Sort defaultSort = new Sort(Sort.Direction.DESC, "status"); + view.addObject( + "agentUserList", agentUserRes.findByOrgiAndStatusAndAgentnoIsNot( + orgi, MainContext.AgentUserStatusEnum.INSERVICE.toString(), logined.getId(), defaultSort)); + List agentUserList = agentUserRepository.findByUseridAndOrgi(userid, logined.getOrgi()); + view.addObject( + "curagentuser", agentUserList != null && agentUserList.size() > 0 ? agentUserList.get(0) : null); + + return view; + } + + @RequestMapping("/agentuser") + @Menu(type = "apps", subtype = "cca") + public ModelAndView agentuser( + ModelMap map, + HttpServletRequest request, + String id, + String channel) throws IOException, TemplateException { + String mainagentuser = "/apps/cca/mainagentuser"; + if (channel.equals("phone")) { + mainagentuser = "/apps/cca/mainagentuser_callout"; + } + ModelAndView view = request(super.createRequestPageTempletResponse(mainagentuser)); + final User logined = super.getUser(request); + final String orgi = logined.getOrgi(); + AgentUser agentUser = agentUserRepository.findByIdAndOrgi(id, orgi); + + if (agentUser != null) { + view.addObject("curagentuser", agentUser); + view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid(), agentUser.getOrgi())); + List agentUserTaskList = agentUserTaskRes.findByIdAndOrgi(id, orgi); + if (agentUserTaskList.size() > 0) { + AgentUserTask agentUserTask = agentUserTaskList.get(0); + agentUserTask.setTokenum(0); + agentUserTaskRes.save(agentUserTask); + } + + if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) { + List summarizes = this.serviceSummaryRes.findByAgentserviceidAndOrgi( + agentUser.getAgentserviceid(), orgi); + if (summarizes.size() > 0) { + view.addObject("summary", summarizes.get(0)); + } + } + + view.addObject( + "agentUserMessageList", + this.chatMessageRepository.findByUsessionAndOrgi(agentUser.getUserid(), orgi, + new PageRequest(0, 20, Sort.Direction.DESC, + "updatetime"))); + AgentService agentService = null; + if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) { + agentService = this.agentServiceRes.findOne(agentUser.getAgentserviceid()); + view.addObject("curAgentService", agentService); + if (agentService != null) { + /** + * 获取关联数据 + */ + agentServiceProxy.processRelaData(logined.getId(), orgi, agentService, map); + } + } + if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChannel())) { + OnlineUser onlineUser = onlineUserRes.findOne(agentUser.getUserid()); + if (onlineUser != null) { + if (onlineUser.getLogintime() != null) { + if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(onlineUser.getStatus())) { + onlineUser.setBetweentime( + (int) (onlineUser.getUpdatetime().getTime() - onlineUser.getLogintime().getTime())); + } else { + onlineUser.setBetweentime( + (int) (System.currentTimeMillis() - onlineUser.getLogintime().getTime())); + } + } + view.addObject("onlineUser", onlineUser); + } + + view.addObject("serviceCount", Integer + .valueOf(this.agentServiceRes + .countByUseridAndOrgiAndStatus(agentUser + .getUserid(), orgi, + MainContext.AgentUserStatusEnum.END + .toString()))); + } + + SessionConfig sessionConfig = AutomaticServiceDist.initSessionConfig(super.getOrgi(request)); + + view.addObject("sessionConfig", sessionConfig); + if (sessionConfig.isOtherquickplay()) { + view.addObject("topicList", OnlineUserProxy.search(null, orgi, super.getUser(request))); + } + + view.addObject("tags", tagRes.findByOrgiAndTagtype(orgi, MainContext.ModelType.USER.toString())); + } + return view; + } + + /** * 坐席转接窗口 * @@ -410,107 +514,7 @@ public class AgentAuditController extends Handler { agentServiceRes.save(agentService); } } - return request(super.createRequestPageTempletResponse("redirect:/cca/index.html")); - } + return request(super.createRequestPageTempletResponse("redirect:/apps/cca/index.html")); - - @RequestMapping("/agentusers") - @Menu(type = "apps", subtype = "cca") - public ModelAndView agentusers(HttpServletRequest request, String userid) { - ModelAndView view = request(super.createRequestPageTempletResponse("/apps/cca/agentusers")); - User logined = super.getUser(request); - view.addObject( - "agentUserList", agentUserRepository.findByAgentnoAndOrgi(logined.getId(), logined.getOrgi(), - new Sort(Sort.Direction.DESC, "status"))); - List agentUserList = agentUserRepository.findByUseridAndOrgi(userid, logined.getOrgi()); - view.addObject( - "curagentuser", agentUserList != null && agentUserList.size() > 0 ? agentUserList.get(0) : null); - - return view; - } - - @RequestMapping("/agentuser") - @Menu(type = "apps", subtype = "cca") - public ModelAndView agentuser( - ModelMap map, - HttpServletRequest request, - String id, - String channel) throws IOException, TemplateException { - String mainagentuser = "/apps/cca/mainagentuser"; - if (channel.equals("phone")) { - mainagentuser = "/apps/cca/mainagentuser_callout"; - } - ModelAndView view = request(super.createRequestPageTempletResponse(mainagentuser)); - final User logined = super.getUser(request); - final String orgi = logined.getOrgi(); - AgentUser agentUser = agentUserRepository.findByIdAndOrgi(id, orgi); - - if (agentUser != null) { - view.addObject("curagentuser", agentUser); - view.addObject("inviteData", OnlineUserProxy.consult(agentUser.getAppid(), agentUser.getOrgi())); - List agentUserTaskList = agentUserTaskRes.findByIdAndOrgi(id, orgi); - if (agentUserTaskList.size() > 0) { - AgentUserTask agentUserTask = agentUserTaskList.get(0); - agentUserTask.setTokenum(0); - agentUserTaskRes.save(agentUserTask); - } - - if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) { - List summarizes = this.serviceSummaryRes.findByAgentserviceidAndOrgi( - agentUser.getAgentserviceid(), orgi); - if (summarizes.size() > 0) { - view.addObject("summary", summarizes.get(0)); - } - } - - view.addObject( - "agentUserMessageList", - this.chatMessageRepository.findByUsessionAndOrgi(agentUser.getUserid(), orgi, - new PageRequest(0, 20, Sort.Direction.DESC, - "updatetime"))); - AgentService agentService = null; - if (StringUtils.isNotBlank(agentUser.getAgentserviceid())) { - agentService = this.agentServiceRes.findOne(agentUser.getAgentserviceid()); - view.addObject("curAgentService", agentService); - if (agentService != null) { - /** - * 获取关联数据 - */ - agentServiceProxy.processRelaData(logined.getId(), orgi, agentService, map); - } - } - if (MainContext.ChannelType.WEBIM.toString().equals(agentUser.getChannel())) { - OnlineUser onlineUser = onlineUserRes.findOne(agentUser.getUserid()); - if (onlineUser != null) { - if (onlineUser.getLogintime() != null) { - if (MainContext.OnlineUserStatusEnum.OFFLINE.toString().equals(onlineUser.getStatus())) { - onlineUser.setBetweentime( - (int) (onlineUser.getUpdatetime().getTime() - onlineUser.getLogintime().getTime())); - } else { - onlineUser.setBetweentime( - (int) (System.currentTimeMillis() - onlineUser.getLogintime().getTime())); - } - } - view.addObject("onlineUser", onlineUser); - } - - view.addObject("serviceCount", Integer - .valueOf(this.agentServiceRes - .countByUseridAndOrgiAndStatus(agentUser - .getUserid(), orgi, - MainContext.AgentUserStatusEnum.END - .toString()))); - } - - SessionConfig sessionConfig = AutomaticServiceDist.initSessionConfig(super.getOrgi(request)); - - view.addObject("sessionConfig", sessionConfig); - if (sessionConfig.isOtherquickplay()) { - view.addObject("topicList", OnlineUserProxy.search(null, orgi, super.getUser(request))); - } - - view.addObject("tags", tagRes.findByOrgiAndTagtype(orgi, MainContext.ModelType.USER.toString())); - } - return view; } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/agent/AgentController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentController.java similarity index 90% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/agent/AgentController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentController.java index a1975ded..db0d7965 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/agent/AgentController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.chatopera.cc.handler.apps.agent; + package com.chatopera.cc.handler.apps; import com.alibaba.fastjson.JSONObject; import com.chatopera.cc.acd.AutomaticServiceDist; @@ -1209,116 +1209,6 @@ } - /** - * 执行坐席转接 - * - * @param map - * @param request - * @param userid - * @param agentserviceid - * @param agentuserid - * @param agentno - * @param memo - * @return - */ - @RequestMapping(value = "/transfer/save") - @Menu(type = "apps", subtype = "transfersave") - public ModelAndView transfersave( - final ModelMap map, HttpServletRequest request, - @Valid final String userid, // 访客ID - @Valid final String agentserviceid, // 服务记录ID - @Valid final String agentuserid, // 坐席访客ID - @Valid final String agentno, // 会话转接给下一个坐席 - @Valid final String memo) throws CSKefuException { - final String currentAgentno = super.getUser(request).getId(); // 当前坐席的agentno - - final String orgi = super.getOrgi(request); - - if (StringUtils.isNotBlank(userid) && - StringUtils.isNotBlank(agentuserid) && - StringUtils.isNotBlank(agentno)) { - final User targetAgent = userRes.findOne(agentno); - final AgentService agentService = agentServiceRes.findByIdAndOrgi(agentserviceid, super.getOrgi(request)); - /** - * 更新AgentUser - */ - final AgentUser agentUser = agentUserProxy.resolveAgentUser(userid, agentuserid, orgi); - agentUser.setAgentno(agentno); - agentUser.setAgentname(targetAgent.getUname()); - agentUserRes.save(agentUser); - - /** - * 坐席状态 - */ - // 转接目标坐席 - final AgentStatus transAgentStatus = cache.findOneAgentStatusByAgentnoAndOrig(agentno, orgi); - - // 转接源坐席 - final AgentStatus currentAgentStatus = cache.findOneAgentStatusByAgentnoAndOrig(currentAgentno, orgi); - - if (StringUtils.equals( - MainContext.AgentUserStatusEnum.INSERVICE.toString(), agentUser.getStatus())) { //转接 , 发送消息给 目标坐席 - - // 更新当前坐席的服务访客列表 - if (currentAgentStatus != null) { - cache.deleteOnlineUserIdFromAgentStatusByUseridAndAgentnoAndOrgi(userid, currentAgentno, orgi); - AutomaticServiceDist.updateAgentStatus(currentAgentStatus, super.getOrgi(request)); - } - - if (transAgentStatus != null) { - agentService.setAgentno(agentno); - agentService.setAgentusername(transAgentStatus.getUsername()); - } - - // 转接坐席提示消息 - try { - Message outMessage = new Message(); - outMessage.setMessage( - AutomaticServiceDist.getSuccessMessage(agentService, agentUser.getChannel(), orgi)); - outMessage.setMessageType(MainContext.MediaType.TEXT.toString()); - outMessage.setCalltype(MainContext.CallType.IN.toString()); - outMessage.setCreatetime(MainUtils.dateFormate.format(new Date())); - outMessage.setAgentUser(agentUser); - outMessage.setAgentService(agentService); - - if (StringUtils.isNotBlank(agentUser.getUserid())) { - peerSyncIM.send( - MainContext.ReceiverType.VISITOR, - MainContext.ChannelType.toValue(agentUser.getChannel()), - agentUser.getAppid(), - MainContext.MessageType.STATUS, - agentUser.getUserid(), - outMessage, - true); - } - - // 通知转接消息给新坐席 - outMessage.setChannelMessage(agentUser); - outMessage.setAgentUser(agentUser); - peerSyncIM.send( - MainContext.ReceiverType.AGENT, MainContext.ChannelType.WEBIM, - agentUser.getAppid(), MainContext.MessageType.NEW, agentService.getAgentno(), - outMessage, true); - - } catch (Exception ex) { - logger.error("[transfersave]", ex); - } - } - - if (agentService != null) { - agentService.setAgentno(agentno); - if (StringUtils.isNotBlank(memo)) { - agentService.setTransmemo(memo); - } - agentService.setTrans(true); - agentService.setTranstime(new Date()); - agentServiceRes.save(agentService); - } - } - return request(super.createRequestPageTempletResponse("redirect:/agent/index.html")); - } - - @RequestMapping("/quicklist") @Menu(type = "setting", subtype = "quickreply", admin = true) public ModelAndView quicklist(ModelMap map, HttpServletRequest request, @Valid String typeid) { diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/quality/AgentQualityController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentQualityController.java similarity index 95% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/quality/AgentQualityController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentQualityController.java index fe60a740..47d0d6a8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/quality/AgentQualityController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AgentQualityController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.quality; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.acd.AutomaticServiceDist; import com.chatopera.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AppsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AppsController.java index 9301989f..d485fab8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AppsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/AppsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,12 +81,16 @@ public class AppsController extends Handler { ****************************/ // TODO 此处为从数据库加载 - final Page onlineUserList = onlineUserRes.findByOrgiAndStatus(super.getOrgi(request), - MainContext.OnlineUserStatusEnum.ONLINE.toString(), - new PageRequest(super.getP(request), + final Page onlineUserList = onlineUserRes.findByOrgiAndStatus( + super.getOrgi(request), + MainContext.OnlineUserStatusEnum.ONLINE.toString(), + new PageRequest( + super.getP(request), super.getPs(request), Sort.Direction.DESC, - "createtime")); + "createtime" + ) + ); final long msec = System.currentTimeMillis(); final List contactIds = new ArrayList(); @@ -251,16 +255,23 @@ public class AppsController extends Handler { msg = "username_exist"; return msg; } - tempUser = userRes.findByEmailAndDatastatus(user.getEmail(), false); - if (tempUser != null && !user.getEmail().equals(oldUser.getEmail())) { - msg = "email_exist"; - return msg; + + if (StringUtils.isNotBlank(user.getEmail())) { + tempUser = userRes.findByEmailAndDatastatus(user.getEmail(), false); + if (tempUser != null && !user.getEmail().equals(oldUser.getEmail())) { + msg = "email_exist"; + return msg; + } } - tempUser = userRes.findByMobileAndDatastatus(user.getMobile(), false); - if (tempUser != null && !user.getMobile().equals(oldUser.getMobile())) { - msg = "mobile_exist"; - return msg; + + if (StringUtils.isNotBlank(user.getMobile())) { + tempUser = userRes.findByMobileAndDatastatus(user.getMobile(), false); + if (tempUser != null && !user.getMobile().equals(oldUser.getMobile())) { + msg = "mobile_exist"; + return msg; + } } + return msg; } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/contacts/ContactsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ContactsController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/contacts/ContactsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ContactsController.java index 464ea0a9..a6e366b1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/contacts/ContactsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ContactsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.apps.contacts; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.exception.CSKefuException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/customer/CustomerController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/CustomerController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/customer/CustomerController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/CustomerController.java index 2383bc8f..b76ab8b8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/customer/CustomerController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/CustomerController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.customer; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/entim/EntIMController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/EntIMController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/entim/EntIMController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/EntIMController.java index 627871e7..0f027a4d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/entim/EntIMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/EntIMController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.entim; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.handler.Handler; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/ExtentionController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ExtentionController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/ExtentionController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ExtentionController.java index 79278f5e..796dec13 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/ExtentionController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/ExtentionController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.callcenter; +package com.chatopera.cc.handler.apps; import java.util.List; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/IMAgentController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMAgentController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/IMAgentController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMAgentController.java index 84a982ae..1f69f460 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/IMAgentController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMAgentController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.apps.setting; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.acd.AutomaticServiceDist; import com.chatopera.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/internet/IMController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/internet/IMController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMController.java index b5df8429..9e41b47f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/internet/IMController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/IMController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.internet; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.proxy.OnlineUserProxy; import com.chatopera.cc.acd.AutomaticServiceDist; @@ -55,7 +55,6 @@ import javax.annotation.PostConstruct; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.swing.text.html.Option; import javax.validation.Valid; import java.io.File; import java.io.IOException; @@ -157,7 +156,7 @@ public class IMController extends Handler { @Valid String title, @Valid String aiid) { ModelAndView view = request(super.createRequestPageTempletResponse("/apps/im/point")); - final String sessionid = request.getSession().getId(); + final String sessionid = MainUtils.getContextID(request.getSession().getId()); logger.info("[point] session snsid {}, session {}", id, sessionid); if (StringUtils.isNotBlank(id)) { diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/job/JobController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/JobController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/job/JobController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/JobController.java index 35121b45..69457b52 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/job/JobController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/JobController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.job; +package com.chatopera.cc.handler.apps; import java.text.ParseException; import java.util.Date; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/KbsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/KbsController.java similarity index 96% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/KbsController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/KbsController.java index b4015f8b..71d00614 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/KbsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/KbsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.kbs; +package com.chatopera.cc.handler.apps; import java.io.File; import java.io.IOException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/message/MessageController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/MessageController.java similarity index 88% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/message/MessageController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/MessageController.java index 5fe4c696..9a02db97 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/message/MessageController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/MessageController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.message; +package com.chatopera.cc.handler.apps; import javax.servlet.http.HttpServletRequest; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/organization/OrganizationController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/OrganizationController.java similarity index 94% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/organization/OrganizationController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/OrganizationController.java index 2a335cf9..67e9f1f2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/organization/OrganizationController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/OrganizationController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.organization; +package com.chatopera.cc.handler.apps; import java.io.IOException; import java.security.NoSuchAlgorithmException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/QuickReplyController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/QuickReplyController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/QuickReplyController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/QuickReplyController.java index f945bbf7..9dab8bd4 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/setting/QuickReplyController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/QuickReplyController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.apps.setting; +package com.chatopera.cc.handler.apps; import java.io.File; import java.io.IOException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/SipTrunkController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/SipTrunkController.java similarity index 93% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/SipTrunkController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/SipTrunkController.java index d0c2879a..32ccd753 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callcenter/SipTrunkController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/SipTrunkController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,13 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.callcenter; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.cache.Cache; import com.chatopera.cc.handler.Handler; import com.chatopera.cc.model.SipTrunk; import com.chatopera.cc.model.User; -import com.chatopera.cc.proxy.CalloutQueneProxy; +import com.chatopera.cc.proxy.CallcenterOutboundProxy; import com.chatopera.cc.persistence.repository.ExtentionRepository; import com.chatopera.cc.persistence.repository.SipTrunkRepository; import com.chatopera.cc.persistence.repository.UserRepository; @@ -103,7 +103,7 @@ public class SipTrunkController extends Handler { /** * 名单未分配 , 转给网关进来的任何一个坐席 , 从当前登录系统的 坐席中选取一个 */ - List agentList = CalloutQueneProxy.service(sipTrunk.getId()); + List agentList = CallcenterOutboundProxy.service(sipTrunk.getId()); if (agentList.size() > 0) { CallCenterAgent callCenterAgent = agentList.get(0); agent = callCenterAgent.getExtno(); diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/tenant/TenantController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TenantController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/tenant/TenantController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TenantController.java index dc806e65..4582d2d1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/tenant/TenantController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TenantController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.chatopera.cc.handler.apps.tenant; +package com.chatopera.cc.handler.apps; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.cache.Cache; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/TopicController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TopicController.java similarity index 97% rename from contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/TopicController.java rename to contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TopicController.java index 634ecadb..3985bc44 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/kbs/TopicController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/TopicController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.chatopera.cc.handler.apps.kbs; +package com.chatopera.cc.handler.apps; import java.io.File; import java.io.IOException; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callout/CalloutController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callout/CalloutController.java deleted file mode 100644 index a4beff4c..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/callout/CalloutController.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.chatopera.cc.handler.apps.callout; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.exception.CalloutRuntimeException; -import com.chatopera.cc.util.Menu; -import com.chatopera.cc.schedule.CallOutSheetTask; -import com.chatopera.cc.persistence.repository.*; -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.model.CallOutDialplan; -import com.chatopera.cc.model.CallOutLogDialPlan; -import org.apache.commons.lang.StringUtils; -import org.apache.poi.ss.usermodel.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Conditional; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.io.IOException; -import java.util.Date; - -@Conditional(CalloutBeanCondition.class) -@Controller -@RequestMapping(value = "/apps/callout") -public class CalloutController extends Handler { - static final Logger logger = LoggerFactory.getLogger(CalloutController.class); - - @Autowired - private CallOutDialplanRepository callOutDialplanRes; - - @Autowired - private CallOutLogDialPlanRepository dialPlanLogRepository; - - @Autowired - private OrganRepository organRes; - - @Autowired - private SNSAccountRepository snsAccountRes; - - @Autowired - private CallOutSheetTask callOutSheetTask; - - @Autowired - private UserRepository userRepositoryRes; - - /** - * 处理潜在客户Excel数据 - * - * @param file - * @return - */ - private boolean processTargetList(final CallOutDialplan dp, final MultipartFile file) { - try { - // store the bytes somewhere - final Sheet sheet; - final String filename = file.getOriginalFilename(); - if(filename.endsWith(".xlsx")){ - callOutSheetTask.run(dp.getId(), - dp.getOrgi(), - dp.getOrgan().getId(), - file); - } else { - throw new CalloutRuntimeException("[callout] Invalid file format, 仅支持 .xlsx的文件。"); - } - } catch (Exception e) { - return false; - } - return true; - } - - @RequestMapping(value = "/index") - @Menu(type = "callout", subtype = "index", access = true) - public ModelAndView index(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/index")); - } - - @RequestMapping(value = "/resources/agents") - @Menu(type = "callout", subtype = "agents", access = true) - public ModelAndView agents(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/resources/agents")); - } - - @RequestMapping(value = "/resources/switchboard") - @Menu(type = "callout", subtype = "switchboard", access = true) - public ModelAndView switchboard(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/resources/switchboard")); - } - - @RequestMapping(value = "/resources/skillgroups") - @Menu(type = "callout", subtype = "skillgroups", access = true) - public ModelAndView skillgroups(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/resources/skillgroups")); - } - - @RequestMapping(value = "/dialplan/index") - @Menu(type = "callout", subtype = "dialplan", access = true) - public ModelAndView dialplan(ModelMap map, HttpServletRequest request) { - Page data = callOutDialplanRes.findAllByIsarchiveNot( - true, - new PageRequest( - super.getP(request), - super.getPs(request), - Sort.Direction.ASC, - "createtime" - ) - ); - map.addAttribute("vm", data); - return request(super.createAppsTempletResponse("/apps/callout/dialplan/index")); - } - - @RequestMapping(value = "/dialplan/add") - @Menu(type = "callout", subtype = "dialplan", access = true) - public ModelAndView add(ModelMap map, HttpServletRequest request) { - - // 添加技能组 - map.addAttribute("departments", organRes.findByOrgiAndSkill(MainContext.SYSTEM_ORGI, true)); - - // 添加语音渠道 - map.addAttribute("voicechannels", - snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.PHONE.toString(), MainContext.SYSTEM_ORGI)); - - return request(super.createRequestPageTempletResponse("/apps/callout/dialplan/add")); - } - - @RequestMapping(value = "/dialplan/edit") - @Menu(type = "callout", subtype = "dialplan", access = true) - public ModelAndView edit(ModelMap map, HttpServletRequest request, @Valid String id) { - ModelAndView view = request(super.createRequestPageTempletResponse("/apps/callout/dialplan/edit")); - view.addObject("callOutDialplanData", callOutDialplanRes.findOne(id)); - return view; - } - - @RequestMapping(value = "/dialplan/save", method = RequestMethod.POST) - @Menu(type = "callout", subtype = "dialplan", access = true) - public ModelAndView save(ModelMap map, HttpServletRequest request, - @Valid String name, - @Valid String voicechannelid, - @Valid String organid, - @Valid boolean isrecord, - @Valid int maxconcurrence, - @Valid float concurrenceratio, - @RequestParam("target") MultipartFile target) throws IOException, CalloutRuntimeException { - logger.info("save name {}, voicechannelid {}, organid {}, isrecord {} concurrenceratio {}", name, voicechannelid, organid, isrecord, concurrenceratio); - if(StringUtils.isBlank(name)) - throw new CalloutRuntimeException("[callout] 呼叫计划名字不能为空"); - - CallOutDialplan dp = new CallOutDialplan(); - Date dt = new Date(); - dp.setCreater(super.getUser(request)); - dp.setCreatetime(dt); - dp.setUpdatetime(dt); - dp.setConcurrenceratio(concurrenceratio); - dp.setMaxconcurrence(maxconcurrence); - dp.setIsrecord(isrecord); - dp.setExecuted(0); - dp.setVoicechannel(snsAccountRes.findByIdAndOrgi(voicechannelid, MainContext.SYSTEM_ORGI)); - dp.setOrgan(organRes.findByIdAndOrgi(organid, MainContext.SYSTEM_ORGI)); - dp.setName(name); - dp.setIsarchive(false); - dp.setOrgi(MainContext.SYSTEM_ORGI); - dp.setStatus(MainContext.CalloutDialplanStatusEnum.INITIALIZATION.toString()); - callOutDialplanRes.save(dp); - logger.info("[callout] dialplan id {}", dp.getId()); - - if (!target.isEmpty()) { - if (!processTargetList(dp, target)) { - // TODO 文件格式不对 - } - } else { - // TODO 异常返回 - } - return request(super.createRequestPageTempletResponse("redirect:/apps/callout/dialplan/index.html")); - } - - @RequestMapping(value = "/dialplan/update", method = RequestMethod.POST) - @Menu(type = "callout", subtype = "dialplan", access = true) - public ModelAndView update(HttpServletRequest request, @Valid CallOutDialplan callOutDialplan) { - CallOutDialplan callOutDialplanTmp = callOutDialplanRes.getOne(callOutDialplan.getId()); - if(callOutDialplanTmp != null){ - callOutDialplanTmp.setMaxconcurrence(callOutDialplan.getMaxconcurrence()); - callOutDialplanTmp.setConcurrenceratio(callOutDialplan.getConcurrenceratio()); - callOutDialplanTmp.setUpdatetime(new Date()); - callOutDialplanRes.save(callOutDialplanTmp); - } - return request(super.createRequestPageTempletResponse("redirect:/apps/callout/dialplan/index.html")); - } - - @RequestMapping(value = "/dialplan/archive") - @Menu(type = "callout", subtype = "dialplan-archive", access = true) - public ModelAndView dialplanhistory(ModelMap map, HttpServletRequest request) { - Page data = callOutDialplanRes.findByIsarchive( - true, - new PageRequest( - super.getP(request), - super.getPs(request), - Sort.Direction.ASC, - "createtime" - ) - ); - map.addAttribute("vm", data); - return request(super.createAppsTempletResponse("/apps/callout/dialplan/archive")); - } - - @RequestMapping(value = "/reports/agents") - @Menu(type = "callout", subtype = "reports-agents", access = true) - public ModelAndView reportsagents(ModelMap map, HttpServletRequest request) { - // 技能组list - map.addAttribute("departments", organRes.findByOrgiAndSkill(MainContext.SYSTEM_ORGI, true)); - // 添加语音渠道 - map.addAttribute("voicechannels", - snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.PHONE.toString(), MainContext.SYSTEM_ORGI)); - return request(super.createAppsTempletResponse("/apps/callout/reports/agents")); - } - - @RequestMapping(value = "/reports/daily-summary") - @Menu(type = "callout", subtype = "reports-ds", access = true) - public ModelAndView dailysummary(ModelMap map, HttpServletRequest request) { - // 添加语音渠道 - map.addAttribute("voicechannels", - snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.PHONE.toString(), MainContext.SYSTEM_ORGI)); - return request(super.createAppsTempletResponse("/apps/callout/reports/daily-summary")); - } - - @RequestMapping(value = "/reports/agent-monitor") - @Menu(type = "callout", subtype = "reports-agent-monitor", access = true) - public ModelAndView agentMonitor(ModelMap map, HttpServletRequest request, @Valid String channel, @Valid String organ) { - // 技能组list - map.addAttribute("departments", organRes.findByOrgiAndSkill(MainContext.SYSTEM_ORGI, true)); - - // 添加语音渠道 - map.addAttribute("voicechannels", - snsAccountRes.findBySnstypeAndOrgi(MainContext.ChannelType.PHONE.toString(), MainContext.SYSTEM_ORGI)); - - return request(super.createAppsTempletResponse("/apps/callout/reports/agent-monitor")); - } - - @RequestMapping(value = "/reports/system") - @Menu(type = "callout", subtype = "reports-system", access = true) - public ModelAndView system(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/reports/system")); - } - - @RequestMapping(value = "/reports/recording") - @Menu(type = "callout", subtype = "reports-rec", access = true) - public ModelAndView recording(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - return request(super.createAppsTempletResponse("/apps/callout/reports/recording")); - } - - @RequestMapping(value = "/reports/communicate") - @Menu(type = "callout", subtype = "reports-comm", access = true) - public ModelAndView communicate(ModelMap map, HttpServletRequest request, @Valid String hostname, @Valid String key_value) { - // 技能组list - map.addAttribute("departments", organRes.findByOrgiAndSkill(MainContext.SYSTEM_ORGI, true)); - - // 坐席list - map.addAttribute("sipAccounts", userRepositoryRes.findBySipaccountIsNotNullAndDatastatusIsFalse()); - - return request(super.createAppsTempletResponse("/apps/callout/reports/communicate")); - } - - @RequestMapping(value = "/reports/dialplan") - @Menu(type = "callout", subtype = "reports-dail", access = true) - public ModelAndView reportsdialplan(ModelMap map, HttpServletRequest request) { - Page dialPlanList = dialPlanLogRepository.findAll( - new PageRequest( - super.getP(request), - super.getPs(request), - Sort.Direction.ASC, - "createtime" - ) - - ); - - map.addAttribute("dialPlanList", dialPlanList); - - return request( - super.createAppsTempletResponse( - "/apps/callout/reports/dialplan" - ) - ); - } - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/chatbot/ChatbotController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/chatbot/ChatbotController.java deleted file mode 100644 index bf045c57..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/chatbot/ChatbotController.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.chatopera.cc.handler.apps.chatbot; - -import com.chatopera.cc.handler.Handler; -import com.chatopera.cc.model.Chatbot; -import com.chatopera.cc.model.SNSAccount; -import com.chatopera.cc.model.User; -import com.chatopera.cc.persistence.repository.ChatbotRepository; -import com.chatopera.cc.persistence.repository.SNSAccountRepository; -import com.chatopera.cc.util.Menu; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.validation.Valid; -import java.util.List; - -@Controller -@RequestMapping(value = "/apps/chatbot") -public class ChatbotController extends Handler { - - private final static Logger logger = LoggerFactory.getLogger(ChatbotController.class); - - @Autowired - private ChatbotRepository chatbotRes; - - @Autowired - private SNSAccountRepository snsAccountRes; - - @RequestMapping(value = "/index") - @Menu(type = "chatbot", subtype = "index", access = true) - public ModelAndView index(ModelMap map, HttpServletRequest request) { - ModelAndView view = request(super.createAppsTempletResponse("/apps/chatbot/index")); - List chatbots = chatbotRes.findByOrgi(super.getOrgi(request)); - - logger.info("[index] chatbot size {}", chatbots.size()); - view.addObject("chatbots", chatbots); - - return view; - } - - @RequestMapping(value = "/edit") - @Menu(type = "chatbot", subtype = "index", access = true) - public ModelAndView eidt(ModelMap map, HttpServletRequest request, @Valid String id) { - User curruser = super.getUser(request); - - ModelAndView view = request(super.createAppsTempletResponse("/apps/chatbot/edit")); - if (id != null) { - Chatbot c = chatbotRes.findOne(id); - SNSAccount snsAccount = snsAccountRes.findBySnsidAndOrgi(c.getSnsAccountIdentifier(), curruser.getOrgi()); - view.addObject("snsurl", snsAccount.getBaseURL()); - view.addObject("bot", c); - } - - view.addObject("id", id); - - return view; - } -} - - diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeController.java index 2090a41d..6beac8a6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeLevelController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeLevelController.java index d2625d95..fd21a024 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeLevelController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeLevelController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeMeasureController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeMeasureController.java index 6807dafa..334e9fe5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeMeasureController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/CubeMeasureController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/DimensionController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/DimensionController.java index 85fc2de1..810e1a19 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/DimensionController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/DimensionController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportController.java index 14e54ff6..5469041e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportDesignController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportDesignController.java index fabc3572..395a2a3a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportDesignController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportDesignController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportViewController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportViewController.java index c4802997..b19ae475 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportViewController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/report/ReportViewController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/AgentSummaryController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/AgentSummaryController.java index 81411124..a1dcee23 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/AgentSummaryController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/AgentSummaryController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ChatServiceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ChatServiceController.java index 970fedec..79fcd0e0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ChatServiceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ChatServiceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/CommentController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/CommentController.java index 3e985207..92b052ce 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/CommentController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/CommentController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/OnlineUserController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/OnlineUserController.java index 03f521e2..c8d854d2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/OnlineUserController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/OnlineUserController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,9 @@ public class OnlineUserController extends Handler { @Autowired private Cache cache; + @Autowired + private AgentUserRepository agentUserRes; + @RequestMapping("/online/index") @Menu(type = "service", subtype = "online", admin = true) public ModelAndView index(ModelMap map, HttpServletRequest request, String userid, String agentservice, @Valid String channel) { @@ -108,8 +111,8 @@ public class OnlineUserController extends Handler { if (agentServiceList.size() > 0) { map.put("serviceCount", Integer .valueOf(this.agentServiceRes - .countByUseridAndOrgiAndStatus(userid, orgi, - MainContext.AgentUserStatusEnum.END.toString()))); + .countByUseridAndOrgiAndStatus(userid, orgi, + MainContext.AgentUserStatusEnum.END.toString()))); AgentService agentService = agentServiceList.get(0); if (StringUtils.isNotBlank(agentservice)) { @@ -147,9 +150,9 @@ public class OnlineUserController extends Handler { map.put( "agentUserMessageList", chatMessageRepository.findByAgentserviceidAndOrgi(agentService.getId(), orgi, - new PageRequest( - 0, 50, Direction.DESC, - "updatetime"))); + new PageRequest( + 0, 50, Direction.DESC, + "updatetime"))); } if (MainContext.ChannelType.WEIXIN.toString().equals(channel)) { @@ -164,10 +167,12 @@ public class OnlineUserController extends Handler { map.put("onlineUser", onlineUser); } } - AgentUser agentUser = cache.findOneAgentUserByUserIdAndOrgi(userid, orgi).orElseGet(null); - map.put("agentUser", agentUser); - map.put("curragentuser", agentUser); + cache.findOneAgentUserByUserIdAndOrgi(userid, orgi).ifPresent(agentUser -> { + map.put("agentUser", agentUser); + }); + + } return request(super.createAppsTempletResponse("/apps/service/online/index")); } @@ -201,8 +206,8 @@ public class OnlineUserController extends Handler { map.put( "agentUserMessageList", chatMessageRepository.findByAgentserviceidAndOrgi(agentService.getId(), super.getOrgi(request), - new PageRequest(0, 50, Direction.DESC, - "updatetime"))); + new PageRequest(0, 50, Direction.DESC, + "updatetime"))); return request(super.createRequestPageTempletResponse("/apps/service/online/chatmsg")); } @@ -217,7 +222,7 @@ public class OnlineUserController extends Handler { if (StringUtils.isNotBlank(sessionid)) { map.addAttribute( "traceHisList", userEventRes.findBySessionidAndOrgi(sessionid, super.getOrgi(request), - new PageRequest(0, 100))); + new PageRequest(0, 100))); } return request(super.createRequestPageTempletResponse("/apps/service/online/trace")); } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ProcessedSummaryController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ProcessedSummaryController.java index 33279435..6168f34f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ProcessedSummaryController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/ProcessedSummaryController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/StatsController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/StatsController.java index def00d4e..88b46ac9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/StatsController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/apps/service/StatsController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CallAgentResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CallAgentResourceController.java index 15e8324d..2d709b72 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CallAgentResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CallAgentResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/ContactsResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/ContactsResourceController.java index 75fb3e23..bd4f8771 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/ContactsResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/ContactsResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CssResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CssResourceController.java index a08910b8..ac4643b0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CssResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/CssResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/MediaController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/MediaController.java index 6d7bf4a2..97715e37 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/MediaController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/MediaController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/QuickReplyResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/QuickReplyResourceController.java index 166a724e..750d7910 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/QuickReplyResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/QuickReplyResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/SysDicResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/SysDicResourceController.java index 05ec5152..0d493f05 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/SysDicResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/SysDicResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/UsersResourceController.java b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/UsersResourceController.java index c343fc60..bd70f6a8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/UsersResourceController.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/handler/resource/UsersResourceController.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/CrossInterceptorHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/CrossInterceptorHandler.java index b018c163..215efaff 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/CrossInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/CrossInterceptorHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/LogIntercreptorHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/LogIntercreptorHandler.java index cc4d4144..2d70cca6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/LogIntercreptorHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/LogIntercreptorHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,8 @@ import com.chatopera.cc.persistence.repository.RequestLogRepository; import com.chatopera.cc.basic.Constants; import com.chatopera.cc.util.Menu; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.ModelAndView; @@ -41,6 +43,7 @@ import java.util.Enumeration; */ public class LogIntercreptorHandler implements org.springframework.web.servlet.HandlerInterceptor { + private final static Logger logger = LoggerFactory.getLogger(LogIntercreptorHandler.class); private static RequestLogRepository requestLogRes; @@ -109,7 +112,7 @@ public class LogIntercreptorHandler implements org.springframework.web.servlet.H @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, - Object arg2) throws Exception { + Object arg2) { HandlerMethod handlerMethod = (HandlerMethod) arg2; Object hander = handlerMethod.getBean(); if (hander instanceof Handler) { diff --git a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/UserInterceptorHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/UserInterceptorHandler.java index f1b8f806..d2e1a413 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/interceptor/UserInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/interceptor/UserInterceptorHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +17,13 @@ package com.chatopera.cc.interceptor; import com.chatopera.cc.acd.AutomaticServiceDist; -import com.chatopera.cc.basic.I18N; +import com.chatopera.cc.basic.Constants; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.basic.MainUtils; import com.chatopera.cc.config.MessagingServerConfigure; import com.chatopera.cc.model.Dict; import com.chatopera.cc.model.SystemConfig; import com.chatopera.cc.model.User; -import com.chatopera.cc.basic.Constants; import com.chatopera.cc.util.Menu; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -36,7 +35,6 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.net.URLEncoder; public class UserInterceptorHandler extends HandlerInterceptorAdapter { diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Acl.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Acl.java index 55951ce7..0fa765fc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Acl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Acl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AdType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AdType.java index eb484724..3850647c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AdType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AdType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentReport.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentReport.java index 575d5c69..410120ce 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentReport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentReport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentService.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentService.java index 5a21c883..fe010b0b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentService.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSatis.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSatis.java index 1ec9e803..647e5989 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSatis.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSatis.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSummary.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSummary.java index e2a51786..382a115e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSummary.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentServiceSummary.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentStatus.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentStatus.java index 7fe718ca..0c98486a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentStatus.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentStatus.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUser.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUser.java index ec113148..8f96aa1c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUser.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUser.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserAudit.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserAudit.java index b108a19b..2524205d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserAudit.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserAudit.java @@ -41,8 +41,9 @@ public class AgentUserAudit implements Serializable { * @param userId */ public void removeSubscriber(final String userId) { - if (subscribers != null) + if (subscribers != null) { subscribers.remove(userId); + } } /** @@ -52,8 +53,9 @@ public class AgentUserAudit implements Serializable { * @param permission 浏览消息:R, 发送消息 S, 转接消息 T */ public void addSubscriber(final String userId, final String permission) { - if (subscribers == null) + if (subscribers == null) { subscribers = new HashMap<>(); + } subscribers.put(userId, permission); } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserContacts.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserContacts.java index 9bedfc9c..ec3e7190 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserContacts.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserContacts.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserTask.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserTask.java index 614366cf..5a4313f6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserTask.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AgentUserTask.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AiConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AiConfig.java index 79b2b32e..fb3ac730 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AiConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AiConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AiSNSAccount.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AiSNSAccount.java index 191ef074..24fd4c27 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AiSNSAccount.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AiSNSAccount.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AreaType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AreaType.java index 44321ad9..fdf302cc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AreaType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AreaType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/AttachmentFile.java b/contact-center/app/src/main/java/com/chatopera/cc/model/AttachmentFile.java index 0449cd7f..d827bdb4 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/AttachmentFile.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/AttachmentFile.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/BlackEntity.java b/contact-center/app/src/main/java/com/chatopera/cc/model/BlackEntity.java index e4cc147d..927ac93a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/BlackEntity.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/BlackEntity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallAgent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallAgent.java index be67ac6a..288423ad 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallAgent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallAgent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallCenterSkill.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallCenterSkill.java index ad5c836a..489f15a6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallCenterSkill.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallCenterSkill.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitor.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitor.java index 302fc2a7..3cd1354c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitor.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitorPerformance.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitorPerformance.java index 84fd65bd..a30036f0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitorPerformance.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallMonitorPerformance.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutDialplan.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutDialplan.java index d34488b5..c85f3e9d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutDialplan.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutDialplan.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutLogDialPlan.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutLogDialPlan.java index 63f14c7d..874721ed 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutLogDialPlan.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutLogDialPlan.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutTarget.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutTarget.java index 1ccb36ef..ec9100aa 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutTarget.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CallOutTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ChartProperties.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ChartProperties.java index 8cf721c6..89362a2a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ChartProperties.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ChartProperties.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Chatbot.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Chatbot.java index ff7b3aeb..deac4622 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Chatbot.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Chatbot.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ColumnProperties.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ColumnProperties.java index 9fdb0196..735f10bb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ColumnProperties.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ColumnProperties.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ContactNotes.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ContactNotes.java index d9cf19c2..636d74f8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ContactNotes.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ContactNotes.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Contacts.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Contacts.java index 7661afc0..6f3bab0c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Contacts.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Contacts.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CousultInvite.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CousultInvite.java index b832a70e..e8b272ec 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CousultInvite.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CousultInvite.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Cube.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Cube.java index 62397dd7..1eda019c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Cube.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Cube.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeLevel.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeLevel.java index dbd8df19..bc6d2a82 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeLevel.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeLevel.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMeasure.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMeasure.java index e594b5f4..b0897b44 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMeasure.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMeasure.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMetadata.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMetadata.java index 00778805..77ce0237 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMetadata.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeMetadata.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeType.java index 55100bbc..e35208aa 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CubeType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CubeType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/CustomerGroupForm.java b/contact-center/app/src/main/java/com/chatopera/cc/model/CustomerGroupForm.java index a424b731..47dc594e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/CustomerGroupForm.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/CustomerGroupForm.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/DataDic.java b/contact-center/app/src/main/java/com/chatopera/cc/model/DataDic.java index 4a17cf99..65e0ca70 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/DataDic.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/DataDic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/DataEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/DataEvent.java index 4ea7e72d..f869c38b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/DataEvent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/DataEvent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Dict.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Dict.java index 11060ccd..751a8687 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Dict.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Dict.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,7 +111,7 @@ public class Dict extends HashMap { if (obj instanceof List) { List sysDics = (List) obj; for (SysDic dic : sysDics) { - if (dic.getDicid().equals(id)) { + if (dic.getParentid().equals(id)) { result.add(dic); } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Dimension.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Dimension.java index 076ac7cd..f2eeb056 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Dimension.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Dimension.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/DrillDown.java b/contact-center/app/src/main/java/com/chatopera/cc/model/DrillDown.java index 34cef37a..8bb8d38d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/DrillDown.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/DrillDown.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ESBean.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ESBean.java index 2c06c0f2..5398884d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ESBean.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ESBean.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/EntCustomer.java b/contact-center/app/src/main/java/com/chatopera/cc/model/EntCustomer.java index f5978db3..9aeb1717 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/EntCustomer.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/EntCustomer.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Extention.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Extention.java index b8127f0c..cf10e978 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Extention.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Extention.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java index 027cb0c9..cda03d0a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilter.java b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilter.java index 78d4fb46..8e4aeb00 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterItem.java b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterItem.java index 43ae3a7f..df4e8ca7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterItem.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterItem.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterRequest.java b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterRequest.java index 7a42ef82..a2bdee75 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterRequest.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/FormFilterRequest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Generation.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Generation.java index 835ff213..e29a7cec 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Generation.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Generation.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroup.java b/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroup.java index ba058dcd..5fd332af 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroup.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroup.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroupUser.java b/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroupUser.java index 1e3a7019..f0cc8fa8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroupUser.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/IMGroupUser.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Instruction.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Instruction.java index 53a40089..fff7bb07 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Instruction.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Instruction.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/InviteRecord.java b/contact-center/app/src/main/java/com/chatopera/cc/model/InviteRecord.java index 2a96c245..5c633912 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/InviteRecord.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/InviteRecord.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/IvrMenu.java b/contact-center/app/src/main/java/com/chatopera/cc/model/IvrMenu.java index bba70789..b6aa81b4 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/IvrMenu.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/IvrMenu.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/JobDetail.java b/contact-center/app/src/main/java/com/chatopera/cc/model/JobDetail.java index b89fddbd..c8714fec 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/JobDetail.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/JobDetail.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/JobTask.java b/contact-center/app/src/main/java/com/chatopera/cc/model/JobTask.java index f254e527..dc52e872 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/JobTask.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/JobTask.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsExpert.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsExpert.java index bea1bb4b..749bbf88 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsExpert.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsExpert.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopic.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopic.java index e2b15fdf..c393be73 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopic.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java index d3e6131a..140a8aa0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsType.java index 7b33b999..74cfbb41 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KnowledgeType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KnowledgeType.java index fbc76cb1..01d70d43 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KnowledgeType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KnowledgeType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/LeaveMsg.java b/contact-center/app/src/main/java/com/chatopera/cc/model/LeaveMsg.java index 9e9f4df7..e3b488c3 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/LeaveMsg.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/LeaveMsg.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Media.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Media.java index 464b9c85..619559b3 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Media.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Media.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/MetadataTable.java b/contact-center/app/src/main/java/com/chatopera/cc/model/MetadataTable.java index c95e8912..7cfdb373 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/MetadataTable.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/MetadataTable.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUser.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUser.java index 1fff569d..36771b06 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUser.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUser.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUserHis.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUserHis.java index b575fed6..b7c28ac6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUserHis.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OnlineUserHis.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java index 657f5120..f9b9db95 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Organ.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Organ.java index 3e79a037..0bc81e56 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Organ.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Organ.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OrganRole.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OrganRole.java index 7f4f1870..d1a8615a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OrganRole.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OrganRole.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Organization.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Organization.java index 9224d9db..1df6d96e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Organization.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Organization.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OrgiSkillRel.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OrgiSkillRel.java index 82f62392..665866f1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OrgiSkillRel.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OrgiSkillRel.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/PbxHost.java b/contact-center/app/src/main/java/com/chatopera/cc/model/PbxHost.java index 214fc8c8..13a3844a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/PbxHost.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/PbxHost.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ProcessContent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ProcessContent.java index 737513f1..e9f09145 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ProcessContent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ProcessContent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Product.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Product.java index 27238545..e16e8986 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Product.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Product.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/PropertiesEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/PropertiesEvent.java index eda74651..1d7b7e76 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/PropertiesEvent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/PropertiesEvent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedCube.java b/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedCube.java index 08129f0b..33b144dd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedCube.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedCube.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedReport.java b/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedReport.java index 8a1eb778..04dbe745 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedReport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/PublishedReport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Quality.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Quality.java index 4e375f35..c176a59a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Quality.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Quality.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QualityRequest.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QualityRequest.java index fc3abbb6..6c4af854 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QualityRequest.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QualityRequest.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyAnswer.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyAnswer.java index 5cebb89e..e1ea6a21 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyAnswer.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyAnswer.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyProcess.java index bf403885..122d7da9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyQuestion.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyQuestion.java index 34dd4c83..6750376a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyQuestion.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QueSurveyQuestion.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QuickReply.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QuickReply.java index c3ffef5c..544e3749 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QuickReply.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QuickReply.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/QuickType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/QuickType.java index a65442a9..bba7a5b9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/QuickType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/QuickType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/RecentUser.java b/contact-center/app/src/main/java/com/chatopera/cc/model/RecentUser.java index 01bc70ee..85463de1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/RecentUser.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/RecentUser.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Report.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Report.java index 3ce9dd47..c7ec4f67 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Report.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Report.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ReportFilter.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ReportFilter.java index a1eb481c..489e5c43 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ReportFilter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ReportFilter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ReportModel.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ReportModel.java index dc1af107..15882031 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ReportModel.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ReportModel.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/RequestLog.java b/contact-center/app/src/main/java/com/chatopera/cc/model/RequestLog.java index f20d193d..5604f75f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/RequestLog.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/RequestLog.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Role.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Role.java index 235ecf85..49474dda 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Role.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Role.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/RoleAuth.java b/contact-center/app/src/main/java/com/chatopera/cc/model/RoleAuth.java index 870afcda..b80fc65c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/RoleAuth.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/RoleAuth.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/RouterRules.java b/contact-center/app/src/main/java/com/chatopera/cc/model/RouterRules.java index 7d00776f..a1afa15f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/RouterRules.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/RouterRules.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SNSAccount.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SNSAccount.java index bb6f35f8..a43db5c1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SNSAccount.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SNSAccount.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SaleStatus.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SaleStatus.java index a2ea936f..6612cbdd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SaleStatus.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SaleStatus.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Scene.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Scene.java index c98bb1dc..7c2fed0a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Scene.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Scene.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SceneType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SceneType.java index 1cdb1d59..c291d866 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SceneType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SceneType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Secret.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Secret.java index 1e51e61a..cd1cbb51 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Secret.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Secret.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/ServiceAi.java b/contact-center/app/src/main/java/com/chatopera/cc/model/ServiceAi.java index ac1a0ebb..4c6e88db 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/ServiceAi.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/ServiceAi.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SessionConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SessionConfig.java index 00dac2e8..7707d5ce 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SessionConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SessionConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SipTrunk.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SipTrunk.java index 4589ec0e..71daaf47 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SipTrunk.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SipTrunk.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Skill.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Skill.java index ccb4c683..51a6fb18 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Skill.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Skill.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SkillExtention.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SkillExtention.java index d66259ba..883c2c40 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SkillExtention.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SkillExtention.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEvent.java index 57121e59..1c79b4ec 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEvent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEvent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEventSatisf.java b/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEventSatisf.java index 622c9d77..fc021214 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEventSatisf.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/StatusEventSatisf.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/StreamingFile.java b/contact-center/app/src/main/java/com/chatopera/cc/model/StreamingFile.java index a9f0e7ba..50c8216c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/StreamingFile.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/StreamingFile.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SysDic.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SysDic.java index ae9212b3..658b1933 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SysDic.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SysDic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SystemConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SystemConfig.java index 73b0b4fd..f2b15c35 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SystemConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SystemConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/SystemMessage.java b/contact-center/app/src/main/java/com/chatopera/cc/model/SystemMessage.java index 03ef345e..0fe6a290 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/SystemMessage.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/SystemMessage.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/TableProperties.java b/contact-center/app/src/main/java/com/chatopera/cc/model/TableProperties.java index 77c65e7c..59774e21 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/TableProperties.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/TableProperties.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Tag.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Tag.java index ef477699..04e8d020 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Tag.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Tag.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/TagRelation.java b/contact-center/app/src/main/java/com/chatopera/cc/model/TagRelation.java index 8aec8737..7f84436b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/TagRelation.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/TagRelation.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Template.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Template.java index 566a864d..cb460c89 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Template.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Template.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Tenant.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Tenant.java index 1227c844..7e8689da 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Tenant.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Tenant.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Topic.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Topic.java index fede8309..fb351f5d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Topic.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Topic.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/TopicItem.java b/contact-center/app/src/main/java/com/chatopera/cc/model/TopicItem.java index 143afb16..d8766134 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/TopicItem.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/TopicItem.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKAgg.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKAgg.java index f4836167..1afd25e3 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKAgg.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKAgg.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutConfig.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutConfig.java index ac12dc3d..ae00e7b1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutConfig.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutConfig.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutFilter.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutFilter.java index 3611e081..b773aacf 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutFilter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutFilter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutNames.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutNames.java index 7ea70a77..841fb64f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutNames.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutNames.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutRole.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutRole.java index 6acacab6..20dd9a95 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutRole.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutRole.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutTask.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutTask.java index 5b6ccdf8..dbc5d986 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutTask.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UKefuCallOutTask.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UploadStatus.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UploadStatus.java index 27547946..0ae1689f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UploadStatus.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UploadStatus.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/User.java b/contact-center/app/src/main/java/com/chatopera/cc/model/User.java index 24950881..b10c529e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/User.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/User.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UserHistory.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UserHistory.java index c29b5921..77358102 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UserHistory.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UserHistory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UserRole.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UserRole.java index f484d231..8e2d6693 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UserRole.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UserRole.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/UserTraceHistory.java b/contact-center/app/src/main/java/com/chatopera/cc/model/UserTraceHistory.java index 75b870ae..445f8fa5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/UserTraceHistory.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/UserTraceHistory.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WebIMReport.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WebIMReport.java index 7396f079..b26bff9c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WebIMReport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WebIMReport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WeiXinUser.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WeiXinUser.java index ad8c139c..cc2a2c4a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WeiXinUser.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WeiXinUser.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkMonitor.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkMonitor.java index 9c337f2a..05a711a2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkMonitor.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkMonitor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrderType.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrderType.java index 17d91cb5..8db78b62 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrderType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrderType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrders.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrders.java index 9c60b000..8f9a3f81 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrders.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkOrders.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkSession.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkSession.java index a1048c41..a15ff1aa 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkSession.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkSession.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkTime.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkTime.java index 9f229642..0d394c18 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WorkTime.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WorkTime.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/WxMpEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/model/WxMpEvent.java index 13487604..41022237 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/WxMpEvent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/WxMpEvent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/peer/PeerSyncIM.java b/contact-center/app/src/main/java/com/chatopera/cc/peer/PeerSyncIM.java index 48e0f781..af02b6ba 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/peer/PeerSyncIM.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/peer/PeerSyncIM.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import com.chatopera.cc.basic.MainContext.MessageType; import com.chatopera.cc.basic.MainContext.ReceiverType; import com.chatopera.cc.basic.MainContext.ChannelType; import com.chatopera.cc.basic.plugins.PluginRegistry; +import com.chatopera.cc.basic.plugins.PluginsLoader; import com.chatopera.cc.socketio.message.Message; import com.chatopera.cc.peer.im.ComposeMw1; import com.chatopera.cc.peer.im.ComposeMw2; @@ -82,16 +83,9 @@ public class PeerSyncIM implements ApplicationContextAware { // 通过Skype发送消息 if (MainContext.hasModule(Constants.CSKEFU_MODULE_SKYPE)) { - Class clazz; - try { - clazz = Class.forName(PluginRegistry.PLUGIN_ENTRY_SKYPE); - IPluginDescriptor clazzInst = (IPluginDescriptor) clazz.newInstance(); - Method method = clazz.getMethod("getPluginName"); - composer.use((Middleware) applicationContext.getBean( - (String) method.invoke(clazzInst) + PluginRegistry.PLUGIN_CHANNEL_MESSAGER_SUFFIX)); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { - logger.info("[postConstruct] error", e); - } + composer.use((Middleware) applicationContext.getBean( + PluginsLoader.getPluginName( + PluginRegistry.PLUGIN_ENTRY_SKYPE) + PluginRegistry.PLUGIN_CHANNEL_MESSAGER_SUFFIX)); } composer.use(imMw3); diff --git a/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw2.java b/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw2.java index d5b2e5ad..e3833e95 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw2.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw2.java @@ -14,7 +14,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; - /** * 向访客发送WebIM消息 */ diff --git a/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw3.java b/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw3.java index 70d56ad2..7a29b832 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw3.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/peer/im/ComposeMw3.java @@ -52,10 +52,11 @@ public class ComposeMw3 implements Middleware { /** * 发送消息给会话监控 + * * @param ctx * @return */ - private boolean sendAgentAuditMessage(final PeerContext ctx) { + private void sendAgentAuditMessage(final PeerContext ctx) { boolean send = true; if (ctx.getMessage().getChannelMessage() instanceof ChatMessage) { final ChatMessage msg = (ChatMessage) ctx.getMessage().getChannelMessage(); @@ -65,13 +66,18 @@ public class ComposeMw3 implements Middleware { } if (send) { - agentAuditProxy.publishMessage( - ctx.getMessage().getAgentUser(), - ctx.getMessage().getChannelMessage(), - MainContext.MessageType.toValue( - ("audit_" + ctx.getMsgType().toString())) - ); + switch (ctx.getMsgType()) { + case TRANSOUT: + // 忽略坐席转出事件 + break; + default: + agentAuditProxy.publishMessage( + ctx.getMessage().getAgentUser(), + ctx.getMessage().getChannelMessage(), + MainContext.MessageType.toValue( + ("audit_" + ctx.getMsgType().toString())) + ); + } } - return send; } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/blob/JpaBlobHelper.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/blob/JpaBlobHelper.java index a7dbb40c..4ed56d52 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/blob/JpaBlobHelper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/blob/JpaBlobHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactNotesRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactNotesRepository.java index 139f44b7..3ca13d47 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactNotesRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactNotesRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsEsCommonRepository.java index b59c483f..20cee2c8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsIndependRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsIndependRepository.java index 827bc55d..bba2a578 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsIndependRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsIndependRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepository.java index d4f63702..8cee9198 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepositoryImpl.java index bdec3e6f..e474ca05 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/ContactsRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerEsCommonRepository.java index 3917323a..6677400b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepository.java index a6c629fb..92c82027 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepositoryImpl.java index 16520626..76973888 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/EntCustomerRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentEsCommonRepository.java index 89d12c7e..4906216a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepository.java index 8f681d6a..d16e694d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepositoryImpl.java index d263933b..d2b3a331 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicCommentRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicEsCommonRepository.java index 9c776210..e315f025 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepository.java index 2f3bceff..587e7985 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepositoryImpl.java index eb63290e..60d993f8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/KbsTopicRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyEsCommonRepository.java index aab9e1bc..7a11bc01 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java index 26ae895a..ed673e8d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepositoryImpl.java index 0379f942..4814763d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicEsCommonRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicEsCommonRepository.java index c56964d5..d6366e9d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicEsCommonRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicEsCommonRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepository.java index 998ae303..3c7844d1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepositoryImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepositoryImpl.java index 8a211152..f9fcde19 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepositoryImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/TopicRepositoryImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggResultExtractor.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggResultExtractor.java index 2181638c..e1a9ae00 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggResultExtractor.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggResultExtractor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggTopResultExtractor.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggTopResultExtractor.java index aef808f5..753110e7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggTopResultExtractor.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKAggTopResultExtractor.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKResultMapper.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKResultMapper.java index 0cd33dec..132d69a2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKResultMapper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/UKResultMapper.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/hibernate/BaseService.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/hibernate/BaseService.java index cd1916ed..4a48eddd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/hibernate/BaseService.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/hibernate/BaseService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/BatchDataProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/BatchDataProcess.java index e62423c1..83306c59 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/BatchDataProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/BatchDataProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/DataBatProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/DataBatProcess.java index 939cb867..359f5e9f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/DataBatProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/DataBatProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ESDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ESDataExchangeImpl.java index 63307dcb..714cf9bd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ESDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ESDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/OrganDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/OrganDataExchangeImpl.java index e3b4a5b2..092cb535 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/OrganDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/OrganDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/QuickTypeDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/QuickTypeDataExchangeImpl.java index d2d995d8..4662bd28 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/QuickTypeDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/QuickTypeDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ServiceDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ServiceDataExchangeImpl.java index 46d8b6bb..e9e5bfe6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ServiceDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/ServiceDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicDataExchangeImpl.java index 9303afef..4ac7a236 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicMoreDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicMoreDataExchangeImpl.java index c6e28b68..0248152c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicMoreDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicMoreDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicTypeDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicTypeDataExchangeImpl.java index 1ab4943e..b03e3e62 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicTypeDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/TopicTypeDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/UserDataExchangeImpl.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/UserDataExchangeImpl.java index 4371e55d..f1b56430 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/UserDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/impl/UserDataExchangeImpl.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CallCenterInterface.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CallCenterInterface.java index f568f10e..a468a15c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CallCenterInterface.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CallCenterInterface.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CalloutWireEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CalloutWireEvent.java deleted file mode 100644 index a03d94c0..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/CalloutWireEvent.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.persistence.interfaces; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.basic.MainContext.CallType; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.exception.CalloutRuntimeException; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Date; - -public class CalloutWireEvent { - private static final Logger logger = LoggerFactory.getLogger(CalloutWireEvent.class); - // 必须字段 - private String direction; // 呼叫方向 - private String status; // channel状态 - private String dialplan; // 是否是呼叫计划 - private Date createtime; // 发起时间 - private int eventType; // CallWireEventType - private String channel; // 语音渠道标识 - - - // 可选字段 - private String uuid; // 软交换系统通话唯一标识,callid - private String from; // 主叫 - private String to; // 被叫 - private String record; // 录音文件 - - private CalloutWireEvent() { - - } - -// public CalloutWireEvent(final String direction, -// final String status, -// final boolean isDialplan) throws CalloutRuntimeException { -// this.setDirection(direction); -// this.setStatus(status); -// this.isDialplan = isDialplan; -// } - - public String getDirection() { - return direction; - } - - public void setDirection(String direction) throws CalloutRuntimeException { - if (!Constants.CALL_DIRECTION_TYPES.contains(direction)) - throw new CalloutRuntimeException("不合法的呼叫方向 " + direction); - this.direction = direction; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) throws CalloutRuntimeException { - if (!Constants.CALL_SERVICE_STAUTS.contains(status)) - throw new CalloutRuntimeException("不合法的状态 " + status); - this.status = status; - } - - public static CalloutWireEvent parse(final JsonObject j) throws CalloutRuntimeException { - CalloutWireEvent c = new CalloutWireEvent(); - - /** - * 必须字段 - */ - // 语音渠道标识 - if (j.has("channel")){ - c.setChannel(j.get("channel").getAsString()); - } else { - throw new CalloutRuntimeException("未知的语音渠道标识。 " + j.toString()); - } - - - // 呼叫方向 - if (j.has("type")) { - switch (j.get("type").getAsString()) { - case "callout": // 呼出 - c.setDirection(CallType.OUT.toString()); - break; - case "callin": // 呼入 - c.setDirection(CallType.IN.toString()); - break; - } - } - - if (c.getDirection() == null) { - throw new CalloutRuntimeException("位置的呼叫方向。 " + j.toString()); - } - - // 创建时间 - if (j.has("createtime")) { - c.setCreatetime(new Date(j.get("createtime").getAsLong())); - } else { - throw new CalloutRuntimeException("未知的创建时间。"); - } - - // 识别线路状态 - if (j.has("ops")) { - String ops = j.get("ops").getAsString(); - switch (ops) { - case "hangup": - c.setStatus(MainContext.CallServiceStatus.HANGUP.toString()); - break; - case "answer": - c.setStatus(MainContext.CallServiceStatus.INCALL.toString()); - break; - default: - // 其他类型的问题 - break; - } - } - - if (c.getStatus() == null) { - throw new CalloutRuntimeException("未知的线路状态类型。 " + j.toString()); - } - - // 是否是呼叫计划 - if (j.has("dialplan") && StringUtils.isNotBlank(j.get("dialplan").getAsString())) { - c.setDialplan(j.get("dialplan").getAsString()); - } - - /** - * 条件字段 - */ - if (j.has("uuid")) { - c.setUuid(j.get("uuid").getAsString()); - } - - if (j.has("from")) { - c.setFrom(j.get("from").getAsString()); - } - - if (j.has("record")) { - c.setRecord(j.get("record").getAsString()); - } - - if (j.has("to")) { - c.setTo(j.get("to").getAsString()); - } - - /** - * 判断事件类型 - */ - if (CallType.IN.toString().equals(c.getDirection())) { // 呼入 - // 暂不处理 - if (MainContext.CallServiceStatus.INCALL.toString().equals(c.getStatus())) { - // 呼入应答 - c.setEventType(MainContext.CallWireEventType.CALLIN_CONN.getIndex()); - } else if (MainContext.CallServiceStatus.HANGUP.toString().equals(c.getStatus())) { - if (c.getTo() != null) { - // 呼入挂断 - c.setEventType(MainContext.CallWireEventType.CALLIN_DIST.getIndex()); - } else { - // 呼入失败 - c.setEventType(MainContext.CallWireEventType.CALLIN_FAIL.getIndex()); - } - } - - } else { // 呼出 - if (c.isDialplan()) { // 自动外呼 - if (MainContext.CallServiceStatus.INCALL.toString().equals(c.getStatus())) { - // 自动外呼应答 - c.setEventType(MainContext.CallWireEventType.DIALPLAN_CONN.getIndex()); - } else if (MainContext.CallServiceStatus.HANGUP.toString().equals(c.getStatus())) { - if (c.getFrom() == null) { - // 自动外呼失败 - c.setEventType(MainContext.CallWireEventType.DIALPLAN_FAIL.getIndex()); - } else { - // 自动外呼挂断 - c.setEventType(MainContext.CallWireEventType.DIALPLAN_DISC.getIndex()); - } - } - } else { // 手动外呼 - if (MainContext.CallServiceStatus.INCALL.toString().equals(c.getStatus())) { - // 手动外呼应答 - c.setEventType(MainContext.CallWireEventType.MANUDIAL_CONN.getIndex()); - } else if (MainContext.CallServiceStatus.HANGUP.toString().equals(c.getStatus())) { - if (c.getFrom() == null) { - // 手动外呼失败 - c.setEventType(MainContext.CallWireEventType.MANUDIAL_FAIL.getIndex()); - } else { - c.setEventType(MainContext.CallWireEventType.MANUDIAL_DISC.getIndex()); - } - } - } - } - - if(c.getEventType() == 0) - throw new CalloutRuntimeException("无法确定事件类型。" + j.toString()); - - return c; - } - - public static CalloutWireEvent parse(final String j) throws CalloutRuntimeException { - JsonParser jp = new JsonParser(); - JsonObject js = jp.parse(j).getAsJsonObject(); - return parse(js); - } - - public JsonObject toJson() { - JsonObject j = new JsonObject(); - j.addProperty("direction", this.direction); - j.addProperty("status", this.status); - j.addProperty("isDialplan", this.dialplan); - return j; - } - - public boolean isDialplan(){ - return StringUtils.isNotBlank(this.dialplan); - } - - public String getDialplan() { - return dialplan; - } - - public void setDialplan(String dialplan) { - this.dialplan = dialplan; - } - - public Date getCreatetime() { - return createtime; - } - - public void setCreatetime(Date createtime) { - this.createtime = createtime; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getTo() { - return to; - } - - public void setTo(String to) { - this.to = to; - } - - public int getEventType() { - return eventType; - } - - public void setEventType(int eventType) { - this.eventType = eventType; - } - - public String getRecord() { - return record; - } - - public void setRecord(String record) { - this.record = record; - } - - public String getChannel() { - return channel; - } - - public void setChannel(String channel) { - this.channel = channel; - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/DataExchangeInterface.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/DataExchangeInterface.java index e0964f0e..5b76072c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/DataExchangeInterface.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/interfaces/DataExchangeInterface.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AclRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AclRepository.java index 83424835..f8a1a1fb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AclRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AclRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AdTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AdTypeRepository.java index 264e6eb9..f38f0938 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AdTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AdTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentReportRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentReportRepository.java index 4a0a1c9e..1d3cefca 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentReportRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentReportRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceRepository.java index 76bd4000..d44206dc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceSatisRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceSatisRepository.java index 5a505447..02373395 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceSatisRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentServiceSatisRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentStatusRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentStatusRepository.java index a4c233dc..3a885519 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentStatusRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentStatusRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserContactsRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserContactsRepository.java index ea53da81..d1092c55 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserContactsRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserContactsRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserRepository.java index 51af30fe..cdc95028 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserTaskRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserTaskRepository.java index 34e02757..f67e72a1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserTaskRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AgentUserTaskRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiConfigRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiConfigRepository.java index bf0aa66f..f61be771 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiConfigRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiConfigRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiSNSAccountRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiSNSAccountRepository.java index 5685137c..936faf8b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiSNSAccountRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AiSNSAccountRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AreaTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AreaTypeRepository.java index 54b367e0..4d717378 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AreaTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AreaTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AttachmentRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AttachmentRepository.java index d331e884..b380878f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AttachmentRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/AttachmentRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BaseRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BaseRepository.java index 8ca933df..2cb3bb44 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BaseRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BaseRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BlackListRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BlackListRepository.java index e187e982..7c33e4eb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BlackListRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/BlackListRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallAgentRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallAgentRepository.java index 38778ad0..332f607c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallAgentRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallAgentRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallCenterSkillRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallCenterSkillRepository.java index dc1798d7..b8532d84 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallCenterSkillRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallCenterSkillRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorPerformanceRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorPerformanceRepository.java index f879d61a..6089f103 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorPerformanceRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorPerformanceRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorRepository.java index fba9fc06..c20b54fe 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallMonitorRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutDialplanRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutDialplanRepository.java index 4ac45851..09afcb25 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutDialplanRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutDialplanRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutLogDialPlanRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutLogDialPlanRepository.java index bc3e1a71..356f3172 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutLogDialPlanRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutLogDialPlanRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutTargetRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutTargetRepository.java index 7d0ac8f8..019994c2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutTargetRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CallOutTargetRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ChatMessageRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ChatMessageRepository.java index a053259b..df07bf5b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ChatMessageRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ChatMessageRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ColumnPropertiesRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ColumnPropertiesRepository.java index 8bdbd3d4..b974bd1c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ColumnPropertiesRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ColumnPropertiesRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ConsultInviteRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ConsultInviteRepository.java index fe4325a5..b35bf479 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ConsultInviteRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ConsultInviteRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeLevelRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeLevelRepository.java index 109d5f3e..bff9802b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeLevelRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeLevelRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMeasureRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMeasureRepository.java index bf8e6bd0..e6554ed1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMeasureRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMeasureRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMetadataRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMetadataRepository.java index 5ba2af73..685decd6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMetadataRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeMetadataRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeRepository.java index 02d52495..49213c74 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeService.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeService.java index a44317e1..78582c59 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeService.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeTypeRepository.java index 575f070e..93a42f80 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/CubeTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataDicRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataDicRepository.java index 764db205..e133a080 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataDicRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataDicRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataEventRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataEventRepository.java index eba71850..4961768f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataEventRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataEventRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataSourceService.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataSourceService.java index 683d0624..f20f1078 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataSourceService.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DataSourceService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DbDataRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DbDataRepository.java index 9cebc279..c6f4e6e6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DbDataRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DbDataRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DimensionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DimensionRepository.java index 3167b5b3..f4c453c0 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DimensionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DimensionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DrilldownRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DrilldownRepository.java index f6ee7d57..8802dd8d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DrilldownRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/DrilldownRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ExtentionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ExtentionRepository.java index b5567880..b9e4f54a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ExtentionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ExtentionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterItemRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterItemRepository.java index 916baa1c..afb15ecd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterItemRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterItemRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterRepository.java index 418f47bf..21973f25 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/FormFilterRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/GenerationRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/GenerationRepository.java index 295324f7..e3156b49 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/GenerationRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/GenerationRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupRepository.java index cdd304ea..55a7bde7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupUserRepository.java index 1bd9878a..8b8137f7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IMGroupUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InstructionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InstructionRepository.java index 0e65aad0..442a76df 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InstructionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InstructionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InviteRecordRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InviteRecordRepository.java index 4e899813..64982e6d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InviteRecordRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/InviteRecordRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IvrMenuRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IvrMenuRepository.java index f8141b65..19296517 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IvrMenuRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/IvrMenuRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/JobDetailRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/JobDetailRepository.java index 279fa945..337226cd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/JobDetailRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/JobDetailRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsExpertRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsExpertRepository.java index c09e5e87..7853dd4c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsExpertRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsExpertRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsTypeRepository.java index 06adf7c4..0838a433 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KbsTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KnowledgeTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KnowledgeTypeRepository.java index 5dcd9b17..92e25264 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KnowledgeTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/KnowledgeTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/LeaveMsgRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/LeaveMsgRepository.java index 5a9288c7..6430b521 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/LeaveMsgRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/LeaveMsgRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MediaRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MediaRepository.java index 38db486a..23a5dc22 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MediaRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MediaRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MetadataRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MetadataRepository.java index 5a947997..d699b61b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MetadataRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/MetadataRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserHisRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserHisRepository.java index 60ea33ab..fd43288a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserHisRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserHisRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserRepository.java index 53d02ac3..d41fd47a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OnlineUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRepository.java index 0d74fe1a..52b08dab 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRoleRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRoleRepository.java index 3b3acab8..cc763d7d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRoleRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganRoleRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganUserRepository.java index 9a2a4d7b..d068f072 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganizationRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganizationRepository.java index 4afb9490..9f695a19 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganizationRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrganizationRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrgiSkillRelRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrgiSkillRelRepository.java index a5944268..b9198c29 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrgiSkillRelRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/OrgiSkillRelRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PbxHostRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PbxHostRepository.java index d765ad9e..79620682 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PbxHostRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PbxHostRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProcessContentRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProcessContentRepository.java index 533c939f..fd18dc79 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProcessContentRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProcessContentRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProductRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProductRepository.java index 0f958875..832f9eef 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProductRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ProductRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PropertiesEventRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PropertiesEventRepository.java index 636707e0..b13f017a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PropertiesEventRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PropertiesEventRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedCubeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedCubeRepository.java index e3d29828..c044437e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedCubeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedCubeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedReportRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedReportRepository.java index 56466e39..0edc4625 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedReportRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/PublishedReportRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QualityRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QualityRepository.java index 7696eef4..1c8d8162 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QualityRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QualityRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyAnswerRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyAnswerRepository.java index e7fa3694..c917e4fc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyAnswerRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyAnswerRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyProcessRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyProcessRepository.java index accd520f..e9615253 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyProcessRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyProcessRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyQuestionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyQuestionRepository.java index 0383e680..e6418b0c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyQuestionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QueSurveyQuestionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QuickTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QuickTypeRepository.java index 18f14ee4..4484293a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QuickTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/QuickTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RecentUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RecentUserRepository.java index 216f8f8d..a7d7ebeb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RecentUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RecentUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportCubeService.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportCubeService.java index 1e1f4619..f0dbe33d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportCubeService.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportCubeService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportFilterRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportFilterRepository.java index 98c4ef5a..07cf7057 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportFilterRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportFilterRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportModelRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportModelRepository.java index 1f527d97..c5150ffc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportModelRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportModelRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportRepository.java index 06bf05e8..55914106 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReportRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReporterRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReporterRepository.java index 7b2a3a9e..78bf810c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReporterRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ReporterRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RequestLogRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RequestLogRepository.java index 6689f478..5f264893 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RequestLogRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RequestLogRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleAuthRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleAuthRepository.java index 6c500cd3..0a56fae8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleAuthRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleAuthRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleRepository.java index 01f33973..c9ce0b9c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RoleRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RouterRulesRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RouterRulesRepository.java index cb3313af..82aa0af4 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RouterRulesRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/RouterRulesRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SNSAccountRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SNSAccountRepository.java index 0d48cdda..e3dce19e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SNSAccountRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SNSAccountRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SaleStatusRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SaleStatusRepository.java index c0a1c92a..cdb06022 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SaleStatusRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SaleStatusRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SceneRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SceneRepository.java index a81f1ddc..3dbe523c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SceneRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SceneRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SecretRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SecretRepository.java index c5405c64..8c215d71 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SecretRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SecretRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceAiRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceAiRepository.java index 00913383..ef092a8b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceAiRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceAiRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceSummaryRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceSummaryRepository.java index 21787114..23681ba1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceSummaryRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/ServiceSummaryRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SessionConfigRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SessionConfigRepository.java index 5f2cb44d..0b79d789 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SessionConfigRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SessionConfigRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SipTrunkRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SipTrunkRepository.java index 27f94910..5c4bec88 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SipTrunkRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SipTrunkRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillExtentionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillExtentionRepository.java index 4c4bc18a..f5fdeff9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillExtentionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillExtentionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillRepository.java index 4f690dd1..d333db01 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SkillRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventRepository.java index 7ec585ea..fb85eb27 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventSatisfRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventSatisfRepository.java index 30fc5bfe..24c2cf89 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventSatisfRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StatusEventSatisfRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StreamingFileRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StreamingFileRepository.java index f7d2fc2b..99273829 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StreamingFileRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/StreamingFileRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SysDicRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SysDicRepository.java index 995fcf7d..ddd6bacc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SysDicRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SysDicRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemConfigRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemConfigRepository.java index b99279dc..9a176f29 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemConfigRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemConfigRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemMessageRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemMessageRepository.java index 851d9a1b..624d2907 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemMessageRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/SystemMessageRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TablePropertiesRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TablePropertiesRepository.java index 1aeeb714..f0650c2d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TablePropertiesRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TablePropertiesRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRelationRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRelationRepository.java index 7ddbeb89..8580a2ff 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRelationRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRelationRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRepository.java index ef42d609..7eb720a8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TagRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TemplateRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TemplateRepository.java index 777400f8..50332adb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TemplateRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TemplateRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TenantRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TenantRepository.java index f2da8e42..2a2f9673 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TenantRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TenantRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TopicItemRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TopicItemRepository.java index cd6db9ca..26d07c63 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TopicItemRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/TopicItemRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutConfigRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutConfigRepository.java index 1ccfbccf..83bc5f74 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutConfigRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutConfigRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutFilterRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutFilterRepository.java index 0280c930..db2e13a8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutFilterRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutFilterRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutNamesRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutNamesRepository.java index 83079386..7cd8d011 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutNamesRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutNamesRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutRoleRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutRoleRepository.java index 80a80247..8013a643 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutRoleRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutRoleRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutTaskRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutTaskRepository.java index 5e6d89ee..d4573244 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutTaskRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UKefuCallOutTaskRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserEventRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserEventRepository.java index 2849c223..9aad5250 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserEventRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserEventRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserHistoryRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserHistoryRepository.java index 7a365e28..c8248d23 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserHistoryRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserHistoryRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRepository.java index 73cc1659..75c40930 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRoleRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRoleRepository.java index ea6efb36..68a3f02e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRoleRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserRoleRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserTraceRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserTraceRepository.java index 3f01672a..440fb5b7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserTraceRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/UserTraceRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WeiXinUserRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WeiXinUserRepository.java index e9240d9c..e3776bee 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WeiXinUserRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WeiXinUserRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkMonitorRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkMonitorRepository.java index 54f81962..76e34f87 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkMonitorRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkMonitorRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkOrderTypeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkOrderTypeRepository.java index 8ca3b1d9..3c003851 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkOrderTypeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkOrderTypeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkSessionRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkSessionRepository.java index 95c155dd..84620624 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkSessionRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkSessionRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkTimeRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkTimeRepository.java index 786a2a0d..0c176dca 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkTimeRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WorkTimeRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WxMpEventRepository.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WxMpEventRepository.java index ad973938..58802b43 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WxMpEventRepository.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/WxMpEventRepository.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/XiaoEUKResultMapper.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/XiaoEUKResultMapper.java index 106726c0..da130236 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/XiaoEUKResultMapper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/persistence/repository/XiaoEUKResultMapper.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/persistence/storage/MinioService.java b/contact-center/app/src/main/java/com/chatopera/cc/persistence/storage/MinioService.java deleted file mode 100644 index 2fd64832..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/persistence/storage/MinioService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.persistence.storage; - -import io.minio.MinioClient; -import io.minio.errors.InvalidEndpointException; -import io.minio.errors.InvalidPortException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -@Component -@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) -public class MinioService extends MinioClient { - private static final Logger logger = LoggerFactory.getLogger(MinioService.class); - - public MinioService(@Value("${storage.minio.url}") String endpoint, @Value("${storage.minio.access_key}") String accessKey, @Value("${storage.minio.secret_key}") String secretKey) throws InvalidEndpointException, InvalidPortException { - super(endpoint, accessKey, secretKey); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/AgentSessionProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/AgentSessionProxy.java index 35464050..f78aeca6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/AgentSessionProxy.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/proxy/AgentSessionProxy.java @@ -86,7 +86,7 @@ public class AgentSessionProxy { boolean result = true; if (cache.existUserSessionByAgentnoAndOrgi(userid, orgi)) { final String curr = cache.findOneSessionIdByAgentnoAndOrgi(userid, orgi); - logger.info("[isInvalidSessionId] current session {}", curr); +// logger.info("[isInvalidSessionId] current session {}", curr); result = !StringUtils.equals(curr, session); } else { // 不存在该用户的Session diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutQueneProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/CallcenterOutboundProxy.java similarity index 92% rename from contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutQueneProxy.java rename to contact-center/app/src/main/java/com/chatopera/cc/proxy/CallcenterOutboundProxy.java index 59d96153..5916070a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutQueneProxy.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/proxy/CallcenterOutboundProxy.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ import java.util.List; import java.util.Map; @SuppressWarnings("deprecation") -@Service("calloutquene") -public class CalloutQueneProxy { +@Service("callcenterOutboundQueue") +public class CallcenterOutboundProxy { /** * 为外呼坐席分配名单 diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutProxy.java deleted file mode 100644 index 0f02965f..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/CalloutProxy.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.proxy; - -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.socketio.client.NettyClients; -import com.chatopera.cc.model.*; -import com.chatopera.cc.persistence.repository.*; -import com.chatopera.cc.util.es.UKDataBean; -import com.chatopera.cc.util.freeswitch.model.CallCenterAgent; -import org.apache.commons.lang.StringUtils; - -import java.util.Date; -import java.util.List; - -public class CalloutProxy { - /** - * AI配置 - * - * @param orgi - * @return - */ - public static UKefuCallOutConfig initCallOutConfig(String dataid, String orgi) { - UKefuCallOutConfig ukefuCallOutConfig = MainContext.getCache().findOneSystemByIdAndOrgi(Constants.SYSTEM_CACHE_CALLOUT_CONFIG + "_" + dataid, orgi); - if (MainContext.getContext() != null && ukefuCallOutConfig == null) { - UKefuCallOutConfigRepository ukefuCallOutConfigRepository = MainContext.getContext().getBean(UKefuCallOutConfigRepository.class); - List ukefuCallOutConfigList = ukefuCallOutConfigRepository.findByDataidAndOrgi(dataid, orgi); - if (ukefuCallOutConfigList.size() == 0) { - ukefuCallOutConfig = new UKefuCallOutConfig(); - } else { - ukefuCallOutConfig = ukefuCallOutConfigList.get(0); - MainContext.getCache().putSystemByIdAndOrgi(Constants.SYSTEM_CACHE_CALLOUT_CONFIG + "_" + ukefuCallOutConfig.getDataid(), orgi, ukefuCallOutConfig); - } - } - return ukefuCallOutConfig; - } - - /** - * AI配置 - * - * @param orgi - * @return - */ - public static UKefuCallOutConfig initCallOutConfig(String orgi) { - UKefuCallOutConfig ukefuCallOutConfig = MainContext.getCache().findOneSystemByIdAndOrgi(Constants.SYSTEM_CACHE_CALLOUT_CONFIG + "_" + orgi, orgi); - if (MainContext.getContext() != null && ukefuCallOutConfig == null) { - UKefuCallOutConfigRepository ukefuCallOutConfigRepository = MainContext.getContext().getBean(UKefuCallOutConfigRepository.class); - List ukefuCallOutConfigList = ukefuCallOutConfigRepository.findByOrgi(orgi); - if (ukefuCallOutConfigList.size() == 0) { - ukefuCallOutConfig = new UKefuCallOutConfig(); - } else { - ukefuCallOutConfig = ukefuCallOutConfigList.get(0); - MainContext.getCache().putSystemByIdAndOrgi(Constants.SYSTEM_CACHE_CALLOUT_CONFIG + "_" + orgi, orgi, ukefuCallOutConfig); - } - } - return ukefuCallOutConfig; - } - - /** - * AI配置 - * - * @return - */ - public static List initCallOutConfig() { - UKefuCallOutConfigRepository ukefuCallOutConfigRepository = MainContext.getContext().getBean(UKefuCallOutConfigRepository.class); - return ukefuCallOutConfigRepository.findAll(); - } - - - public static UKefuCallOutNames processNames(UKDataBean name, CallCenterAgent agent, String orgi, int leavenames) { - String batid = (String) name.getValues().get("batid"); - String taskid = (String) name.getValues().get("taskid"); - JobDetail batch = MainContext.getContext().getBean(JobDetailRepository.class).findByIdAndOrgi(batid, orgi); - UKefuCallOutTask task = MainContext.getContext().getBean(UKefuCallOutTaskRepository.class).findByIdAndOrgi(taskid, orgi); - UKefuCallOutNames callOutName = new UKefuCallOutNames(); - UKefuCallOutNamesRepository callOutNamesRes = MainContext.getContext().getBean(UKefuCallOutNamesRepository.class); - - List callNamesList = callOutNamesRes.findByDataidAndCreaterAndOrgi((String) name.getValues().get("id"), (String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT), orgi); - if (callNamesList.size() > 0) { - callOutName = callNamesList.get(0); - } - if (callOutName != null) { - callOutName.setOrgi(orgi); - if (task != null) { - callOutName.setName(task.getName()); //任务名称 - } - if (batch != null) { - callOutName.setBatname(batch.getName()); - callOutName.setMetaname(batch.getActid()); - } - - - callOutName.setActid(task.getActid()); - callOutName.setBatid(batid); - - callOutName.setTaskid(taskid); - - callOutName.setFilterid((String) name.getValues().get("filterid")); - callOutName.setDataid((String) name.getValues().get("id")); - - callOutName.setStatus(MainContext.NamesProcessStatusEnum.DIS.toString()); - - callOutName.setCreater((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - callOutName.setOrgan((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_ORGAN)); - callOutName.setCreatetime(new Date()); - callOutName.setUpdatetime(new Date()); - Object apstatus = name.getValues().get("apstatus"); - if (apstatus != null && apstatus.toString().equals("true")) { - callOutName.setReservation(true); - } else { - callOutName.setReservation(false); - } - callOutName.setMemo((String) name.getValues().get("apmemo")); - - callOutName.setOwneruser((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - callOutName.setOwnerdept((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - } - - callOutName.setLeavenum(leavenames); - - String dial_number = null; - boolean disphonenum = false; - String distype = null; - - if (batch != null && !StringUtils.isBlank(batch.getActid())) { - MetadataTable table = MainContext.getContext().getBean(MetadataRepository.class).findByTablename(batch.getActid()); - for (TableProperties tp : table.getTableproperty()) { - if (tp.isPhonenumber()) { - dial_number = (String) name.getValues().get(tp.getFieldname()); - disphonenum = tp.isSecfield(); - distype = tp.getSecdistype(); - break; - } - } - } - - if (!StringUtils.isBlank(dial_number)) { - callOutName.setPhonenumber(dial_number); - if (disphonenum) { - callOutName.setDistype(distype); - } - if (agent != null) { - NettyClients.getInstance().sendCallCenterMessage(agent.getExtno(), "preview", callOutName); - } - } else if (agent != null) { - agent.setWorkstatus(MainContext.WorkStatusEnum.IDLE.toString()); - NettyClients.getInstance().sendCallCenterMessage(agent.getExtno(), "error", "nophonenumber"); - - NettyClients.getInstance().sendCallCenterMessage(agent.getExtno(), "docallout", agent); - } - callOutNamesRes.save(callOutName); - if (agent != null) { - agent.setNameid(callOutName.getId()); - } - return callOutName; - } - - public static UKefuCallOutNames processNames(UKDataBean name, String orgi, int leavenames, UKefuCallOutNamesRepository callOutNamesRes) { - String batid = (String) name.getValues().get("batid"); - String taskid = (String) name.getValues().get("taskid"); - JobDetail batch = MainContext.getContext().getBean(JobDetailRepository.class).findByIdAndOrgi(batid, orgi); - UKefuCallOutTask task = MainContext.getContext().getBean(UKefuCallOutTaskRepository.class).findByIdAndOrgi(taskid, orgi); - UKefuCallOutNames callOutName = new UKefuCallOutNames(); - - List callNamesList = callOutNamesRes.findByDataidAndCreaterAndOrgi((String) name.getValues().get("id"), (String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT), orgi); - if (callNamesList.size() > 0) { - callOutName = callNamesList.get(0); - } - if (callOutName != null) { - callOutName.setOrgi(orgi); - if (task != null) { - callOutName.setName(task.getName()); //任务名称 - } - if (batch != null) { - callOutName.setBatname(batch.getName()); - } - - - callOutName.setActid(task.getActid()); - callOutName.setBatid(batid); - - callOutName.setTaskid(taskid); - - callOutName.setMetaname(batch.getActid()); - - callOutName.setFilterid((String) name.getValues().get("filterid")); - callOutName.setDataid((String) name.getValues().get("id")); - - callOutName.setStatus(MainContext.NamesProcessStatusEnum.DIS.toString()); - - callOutName.setCreater((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - callOutName.setOrgan((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_ORGAN)); - callOutName.setCreatetime(new Date()); - callOutName.setUpdatetime(new Date()); - String apstatus = (String) name.getValues().get("apstatus"); - if (!StringUtils.isBlank(apstatus) && apstatus.equals("true")) { - callOutName.setReservation(true); - } else { - callOutName.setReservation(false); - } - callOutName.setMemo((String) name.getValues().get("apmemo")); - - callOutName.setOwneruser((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - callOutName.setOwnerdept((String) name.getValues().get(Constants.CSKEFU_SYSTEM_DIS_AGENT)); - } - - callOutName.setLeavenum(leavenames); - - String dial_number = null; - boolean disphonenum = false; - String distype = null; - - if (batch != null && !StringUtils.isBlank(batch.getActid())) { - MetadataTable table = MainContext.getContext().getBean(MetadataRepository.class).findByTablename(batch.getActid()); - for (TableProperties tp : table.getTableproperty()) { - if (tp.isPhonenumber()) { - dial_number = (String) name.getValues().get(tp.getFieldname()); - disphonenum = tp.isSecfield(); - distype = tp.getSecdistype(); - break; - } - } - } - - if (!StringUtils.isBlank(dial_number)) { - callOutName.setPhonenumber(dial_number); - if (disphonenum) { - callOutName.setDistype(distype); - } - - } - callOutNamesRes.save(callOutName); - return callOutName; - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/ChatbotProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/ChatbotProxy.java deleted file mode 100644 index 2599181b..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/ChatbotProxy.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.proxy; - -import com.chatopera.cc.activemq.BrokerPublisher; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.socketio.client.NettyClients; -import com.chatopera.cc.socketio.message.ChatMessage; -import com.chatopera.cc.model.AgentUser; -import com.chatopera.cc.model.Chatbot; -import com.chatopera.cc.socketio.message.Message; -import com.chatopera.cc.persistence.repository.ChatMessageRepository; -import com.chatopera.cc.persistence.repository.ChatbotRepository; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.util.SerializeUtil; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -@Component -public class ChatbotProxy { - private final static Logger logger = LoggerFactory.getLogger(ChatbotProxy.class); - - - @Value("${bot.baseurl}") - private static String botBaseUrl; - - @Autowired - private static BrokerPublisher brokerPublisher; - - @Autowired - private ChatbotRepository chatbotRes; - - @Autowired - private ChatMessageRepository chatMessageRes; - - @Autowired - private Cache cache; - - /** - * publish Message into ActiveMQ - * - * @param data - * @param eventType - */ - public void publishMessage(final ChatMessage data, final String eventType) { - brokerPublisher.send(Constants.INSTANT_MESSAGING_MQ_QUEUE_CHATBOT, SerializeUtil.serialize(data)); - } - - /** - * 使用chatbotID得到snsid - * - * @param chatbotID - * @return - */ - public static String resolveSnsidWithChatbotID(String chatbotID, String clientId) { - return StringUtils.remove(chatbotID, clientId.toLowerCase() + "_"); - } - - /** - * @param data - * @param direction - * @return - */ - public Message createMessage(ChatMessage data, String direction) { - if (!cache.findOneAgentUserByUserIdAndOrgi(data.getUserid(), data.getOrgi()).isPresent()) { - return null; - } - - // 设置发送消息体 - Message outMessage = new Message(); - outMessage.setMessage(data.getMessage()); - outMessage.setMessageType(data.getMsgtype()); - outMessage.setCalltype(direction); - outMessage.setAgentUser(null); - outMessage.setSnsAccount(null); - if (StringUtils.isNotBlank(data.getSuggestmsg())) { - outMessage.setSuggest(data.getSuggest()); - } - - outMessage.setContextid(data.getContextid()); - // FIXME 设置onlineUserName等信息 -// outMessage.setFromUser(data.getUserid()); -// outMessage.setToUser(data.getTouser()); - outMessage.setChannelMessage(data); - outMessage.setCreatetime(Constants.DISPLAY_DATE_FORMATTER.format(data.getCreatetime())); - - /** - * 保存消息 - */ - chatMessageRes.save(data); - - //将消息发送给 访客 - NettyClients.getInstance().sendChatbotEventMessage( - data.getUserid(), MainContext.MessageType.MESSAGE.toString(), data); - - return outMessage; - } - - - /** - * 发送聊天机器人消息 - * - * @param data - * @param appid - * @param channel - * @param direction - * @param chatype - * @param msgtype - * @param userid - * @return - */ - public Message createMessage( - final ChatMessage data, - final String appid, - final String channel, - final String direction, - final String chatype, - final String msgtype, - final String userid, - final String orgi) { - final Chatbot c = chatbotRes.findBySnsAccountIdentifierAndOrgi(appid, orgi); - if (c == null) // ignore event if chatbot not exist. - { - return null; - } - - data.setAiid(c.getId()); - data.setOrgi(orgi); - data.setUserid(userid); - data.setAgentserviceid(data.getContextid()); - data.setChatype(chatype); - data.setChannel(channel); - data.setMsgtype(msgtype); - data.setUsession(data.getUserid()); //agentUser作为 session id - data.setCalltype(direction); - data.setUpdatetime(System.currentTimeMillis()); - return createMessage(data, direction); - } - - /** - * 发送文字消息 - * - * @param data - * @param direction - * @return - */ - public Message createTextMessage(final ChatMessage data, final String direction) { - data.setMsgtype(MainContext.MediaType.TEXT.toString()); - return createMessage(data, direction); - } - - /** - * 保存到数据库,发送到ChatMessage - * - * @param resp - */ - public void saveAndPublish(final ChatMessage resp) { - NettyClients.getInstance().sendChatbotEventMessage( - resp.getUserid(), MainContext.MessageType.MESSAGE.toString(), resp); - chatMessageRes.save(resp); - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/OnlineUserProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/OnlineUserProxy.java index d96c08bd..391ada30 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/OnlineUserProxy.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/proxy/OnlineUserProxy.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/proxy/OrganProxy.java b/contact-center/app/src/main/java/com/chatopera/cc/proxy/OrganProxy.java index 3cd8c667..037990f9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/proxy/OrganProxy.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/proxy/OrganProxy.java @@ -1,7 +1,6 @@ package com.chatopera.cc.proxy; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.handler.admin.organ.OrganController; +import com.chatopera.cc.handler.admin.OrganController; import com.chatopera.cc.model.Organ; import com.chatopera.cc.model.User; import com.chatopera.cc.persistence.repository.OrganRepository; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CallOutSheetTask.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/CallOutSheetTask.java deleted file mode 100644 index ffe69bd4..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CallOutSheetTask.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.schedule; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.util.mobile.MobileAddress; -import com.chatopera.cc.util.mobile.MobileNumberUtils; -import com.chatopera.cc.persistence.es.ContactsRepository; -import com.chatopera.cc.persistence.repository.CallOutDialplanRepository; -import com.chatopera.cc.persistence.repository.CallOutTargetRepository; -import com.chatopera.cc.model.CallOutDialplan; -import com.chatopera.cc.model.CallOutTarget; -import org.apache.commons.lang.StringUtils; -import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.apache.poi.openxml4j.exceptions.OpenXML4JException; -import org.apache.poi.openxml4j.opc.OPCPackage; -import org.apache.poi.util.SAXHelper; -import org.apache.poi.xssf.eventusermodel.XSSFReader; -import org.apache.poi.xssf.model.SharedStringsTable; -import org.apache.poi.xssf.usermodel.XSSFRichTextString; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Conditional; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.web.multipart.MultipartFile; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.DefaultHandler; -import org.xml.sax.Attributes; - -import javax.xml.parsers.ParserConfigurationException; -import java.io.IOException; -import java.io.InputStream; -import java.util.LinkedHashMap; -import java.util.Map; - - -/** - * 外呼系统表格任务处理 - * 使用Apache POI SAX mode处理大文件 - * http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java - */ -@Component -@Conditional(CalloutBeanCondition.class) -public class CallOutSheetTask { - private final static Logger logger = LoggerFactory.getLogger(CallOutSheetTask.class); - - @Autowired - private CallOutTargetRepository callOutTargetRes; - - @Autowired - private CallOutDialplanRepository callOutDialplanRes; - - @Autowired - private ContactsRepository contactsRes; - - /** - * Do the workloads - * - * @return - */ - @Async("callOutTaskExecutor") - public void run(final String dialplanId, - final String orgi, - final String organId, - final MultipartFile file) { - logger.info("[callout sheet] process file to create targets {}", dialplanId); - try (OPCPackage pkg = OPCPackage.open(file.getInputStream())) { - XSSFReader r = new XSSFReader(pkg); - SharedStringsTable sst = r.getSharedStringsTable(); - - XMLReader parser = fetchSheetParser(sst, dialplanId, orgi, organId); - - // Just process the first sheet - try (InputStream sheet = r.getSheetsData().next()) { - logger.info("[callout sheet] start to process sheet"); - InputSource sheetSource = new InputSource(sheet); - parser.parse(sheetSource); - } - } catch (IOException e) { - e.printStackTrace(); - } catch (ParserConfigurationException e) { - e.printStackTrace(); - } catch (InvalidFormatException e) { - e.printStackTrace(); - } catch (OpenXML4JException e) { - e.printStackTrace(); - } catch (SAXException e) { - e.printStackTrace(); - } - } - - private XMLReader fetchSheetParser(final SharedStringsTable sst, final String dialplan, final String orgi, final String organId) throws ParserConfigurationException, SAXException { - XMLReader parser = SAXHelper.newXMLReader(); - ContentHandler handler = new SheetHandler(sst, dialplan, orgi, organId); - parser.setContentHandler(handler); - return parser; - } - - /** - * See org.xml.sax.helpers.DefaultHandler javadocs - */ - private class SheetHandler extends DefaultHandler { - private final SharedStringsTable sst; - private final String dialplanId; - private final String orgi; - private final String organId; - private String lastContents; - private boolean nextIsString; - private boolean inlineStr; - private boolean isIgnoreCurrentTransaction; - private int targetnum; - private final LruCache lruCache = new LruCache<>(50); - - private class LruCache extends LinkedHashMap { - private final int maxEntries; - - public LruCache(final int maxEntries) { - super(maxEntries + 1, 1.0f, true); - this.maxEntries = maxEntries; - } - - @Override - protected boolean removeEldestEntry(final Map.Entry eldest) { - return super.size() > maxEntries; - } - } - - private SheetHandler(final SharedStringsTable sst, final String dialplanId, final String orgi, final String organId) { - this.sst = sst; - this.dialplanId = dialplanId; - this.orgi = orgi; - this.organId = organId; - } - - @Override - public void startElement(String uri, String localName, String name, - Attributes attributes) throws SAXException { - // c => cell - if (name.equals("c")) { - // Print the cell reference -// logger.info("[callout sheet] cell ref {}", attributes.getValue("r")); - // 增加限制,只处理第一列,忽略其它列 - if (!attributes.getValue("r").startsWith("A")) { - isIgnoreCurrentTransaction = true; - lastContents = ""; - return; - } - isIgnoreCurrentTransaction = false; - // Figure out if the value is an index in the SST - String cellType = attributes.getValue("t"); - nextIsString = cellType != null && cellType.equals("s"); - inlineStr = cellType != null && cellType.equals("inlineStr"); - } - // Clear contents cache - lastContents = ""; - } - - /** - * 阶段性的更新目标客户数,让前端感知状态 - */ - private void dumpTargetNumToDb(){ - if(targetnum % 500 == 0){ - CallOutDialplan dp = callOutDialplanRes.findOne(dialplanId); - dp.setTargetnum(targetnum); - callOutDialplanRes.save(dp); - } - } - - @Override - public void endElement(String uri, String localName, String name) - throws SAXException { - // Process the last contents as required. - // Do now, as characters() may be called more than once - if (isIgnoreCurrentTransaction) - return; - - if (nextIsString) { - Integer idx = Integer.valueOf(lastContents); - lastContents = lruCache.get(idx); - if (lastContents == null && !lruCache.containsKey(idx)) { - lastContents = new XSSFRichTextString(sst.getEntryAt(idx)).toString(); - lruCache.put(idx, lastContents); - } - nextIsString = false; - } - - // v => contents of a cell - // Output after we've seen the string contents - if (name.equals("v") || (inlineStr && name.equals("c"))) { -// logger.info("[callout sheet] last contents {}", lastContents); - // #TODO 当前 elasticsearch repo不支持 existsBy的方法,导致这里检索量很大 - String phone = StringUtils.trim(lastContents); - if (StringUtils.isNumeric(phone)) { - if (StringUtils.length(phone) == 11) { - if (contactsRes.countByDatastatusIsFalseAndPhoneAndOrgi(phone, orgi) == 0) { - // 不是已有联系人 - CallOutTarget ct = new CallOutTarget(); - MobileAddress ma = MobileNumberUtils.getAddress(phone); - ct.setCalls(0); - ct.setCountry(ma.getCountry()); - ct.setProvince(ma.getProvince()); - ct.setCity(ma.getCity()); - ct.setPhone(phone); - ct.setDialplan(dialplanId); - ct.setInvalid(false); - ct.setOrgi(orgi); - ct.setOrganid(organId); - callOutTargetRes.save(ct); - // 目标客户总数递增 - targetnum += 1; - dumpTargetNumToDb(); -// logger.info("[callout sheet] create a new target phone [{}], target size {}", phone, targetnum); - } - } - } - } - } - - @Override - public void endDocument(){ - logger.info("[callout sheet] 目标客户电话号处理完毕."); - CallOutDialplan dp = callOutDialplanRes.findOne(dialplanId); - dp.setTargetnum(targetnum); - dp.setStatus(MainContext.CalloutDialplanStatusEnum.STOPPED.toString()); - callOutDialplanRes.save(dp); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { // NOSONAR - lastContents += new String(ch, start, length); - } - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutPlanTask.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutPlanTask.java deleted file mode 100644 index 11b74e95..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutPlanTask.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.schedule; - - -import com.chatopera.cc.activemq.PbxEventSubscription; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.exception.CalloutRuntimeException; -import com.chatopera.cc.proxy.CalloutQueneProxy; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.persistence.repository.CallOutDialplanRepository; -import com.chatopera.cc.persistence.repository.CallOutTargetRepository; -import com.chatopera.cc.model.CallOutDialplan; -import com.chatopera.cc.model.CallOutTarget; -import com.chatopera.cc.util.freeswitch.model.CallCenterAgent; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Conditional; -import org.springframework.core.task.TaskExecutor; -import org.springframework.data.redis.core.HashOperations; -import org.springframework.data.redis.core.ListOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import javax.transaction.Transactional; -import java.util.Date; -import java.util.List; -import java.util.stream.Stream; - -/** - * 外呼系统计划任务处理 - */ - -@Component -@EnableScheduling -@Conditional(CalloutBeanCondition.class) -public class CalloutPlanTask { - private final static Logger logger = LoggerFactory.getLogger(CalloutPlanTask.class); - - private ListOperations redisListOps; - private HashOperations redisHashOps; - - @Value("${spring.redis.host}") - private String redisHost; - - @Value("${spring.redis.port}") - private String redisPort; - - @Value("${spring.redis.database}") - private String redisDB; - - @Autowired - private TaskExecutor callOutTaskExecutor; - - @Autowired - private PbxEventSubscription pbxEventSubscription; - - @Autowired - private CallOutDialplanRepository callOutDialplanRes; - - @Autowired - private CallOutTargetRepository callOutTargetRes; - - - /** - * 使用StringRedisTemplate而不是RedisTemplate解决序列化问题 - * https://stackoverflow.com/questions/13215024/weird-redis-key-with-spring-data-jedis - */ - @Autowired - private StringRedisTemplate redis; - - @PostConstruct - private void init() { - redisListOps = redis.opsForList(); - redisHashOps = redis.opsForHash(); - } - - @Scheduled(fixedDelayString = "${cskefu.callout.watch.interval}") // 每分钟执行一次 - public void watch() { - if(MainContext.isEnableCalloutModule()){ - logger.debug("[callout executor] check dialplan job running status ..."); - // load all jobs - List dps = callOutDialplanRes.findByStatusAndIsarchive( - MainContext.CalloutDialplanStatusEnum.RUNNING.toString(), false); - for (CallOutDialplan dp : dps) { - Long size = redisListOps.size(String.format(Constants.FS_DIALPLAN_TARGET, dp.getVoicechannel().getBaseURL(), dp.getId())); - if (size > 0) { - logger.info("[callout executor] job [{}] is not done yet, remaining [{}]", dp.getName(), size); - } else { - dp.setStatus(MainContext.CalloutDialplanStatusEnum.STOPPED.toString()); - dp.setUpdatetime(new Date()); - callOutDialplanRes.save(dp); - - // 删除状态成员 - delHashKey(String.format(Constants.FS_DIALPLAN_STATUS, dp.getVoicechannel().getBaseURL()), dp.getId()); - } - } - } - } - - @Async("callOutTaskExecutor") - @Transactional - public void run(final CallOutDialplan dp, final JsonArray sips) throws CalloutRuntimeException { - logger.info("[callout executor] dialplan name {}, id {}, concurrency {}", dp.getName(), dp.getId(), dp.getCurconcurrence()); - final String dialplanId = dp.getId(); - final String dialplanVoiceChannelIdef = dp.getVoicechannel().getBaseURL(); - final int curconcurrence = dp.getCurconcurrence(); - final String key = String.format(Constants.FS_DIALPLAN_TARGET, dialplanVoiceChannelIdef, dialplanId); - - if(sips.size() == 0) - throw new CalloutRuntimeException("SIP话机列表没有成员。"); - - try (Stream stream = callOutTargetRes.findAllByOrgiAndInvalidAndDialplan(MainContext.SYSTEM_ORGI, false, dialplanId)) { - // forEach是并行执行,无法使用上层变量,除非是final - stream.forEach(target -> { - logger.info("[callout executor] target phone {}, redis {}:{} database {}", target.getPhone(), redisHost, redisPort, redisDB); - JsonObject payload = new JsonObject(); - payload.addProperty("to", target.getPhone()); - payload.addProperty("channel", dialplanVoiceChannelIdef); - payload.addProperty("type", Constants.FS_CALL_TYPE_CALLOUT); - redisListOps.leftPush(key, payload.toString()); - }); - - JsonObject payload2 = new JsonObject(); - payload2.addProperty("concurrency", curconcurrence); - payload2.addProperty("status", MainContext.CalloutDialplanStatusEnum.RUNNING.toString()); - payload2.addProperty("channel", dialplanVoiceChannelIdef); - payload2.addProperty("updatetime", (new Date()).toString()); - payload2.add("sips", sips); - setHashKeyValue(String.format(Constants.FS_DIALPLAN_STATUS, dialplanVoiceChannelIdef), dialplanId, payload2.toString()); - - // 所有目标计划推到LIST中,再发送信号 - JsonObject payload = new JsonObject(); - payload.addProperty("dialplan", dialplanId); - payload.addProperty("concurrency", curconcurrence); - payload.addProperty("ops", "start"); - payload.addProperty("channel", dialplanVoiceChannelIdef); - payload.add("sips", sips); - - // 下达语音拨号任务到语音网关 - pbxEventSubscription.publish(String.format(Constants.FS_CHANNEL_CC_TO_FS, dp.getVoicechannel().getBaseURL()), payload.toString()); - } - } - - /** - * Delete List by Key - * - * @param key - */ - public void delKey(final String key) { - redis.delete(key); - } - - - public void delHashKey(final String hash, final String key) { - logger.info("[callout executor] delete hash [{}] key [{}]", hash, key); - redisHashOps.delete(hash, key); - } - - /** - * Set Hash Key Value - * - * @param hash - * @param key - * @param value - */ - public void setHashKeyValue(final String hash, final String key, final String value) { - logger.info("[callout executor] set hash {} key {} value {}", hash, key, value); - redisHashOps.put(hash, key, value); - } - - - @Scheduled(fixedDelay = 5000, initialDelay = 20000) // 每三秒 , 加载 标记为执行中的任务何 即将执行的 计划任务 - public void callOut() { - if (MainContext.isEnableCalloutModule()) { - /** - * 遍历 队列, 然后推送 名单 - */ - List agents = CalloutQueneProxy.service(); - for (final CallCenterAgent agent : agents) { - callOutTaskExecutor.execute(new NamesTask(agent)); - } - logger.info("call out is on"); - } else { - logger.info("call out is off"); - } - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutWireTask.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutWireTask.java deleted file mode 100644 index 4a48e74d..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/CalloutWireTask.java +++ /dev/null @@ -1,573 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.schedule; - -import com.chatopera.cc.acd.AutomaticServiceDist; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.basic.MainUtils; -import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; -import com.chatopera.cc.exception.CSKefuException; -import com.chatopera.cc.exception.CalloutRuntimeException; -import com.chatopera.cc.exception.FreeSwitchException; -import com.chatopera.cc.model.*; -import com.chatopera.cc.persistence.es.ContactsRepository; -import com.chatopera.cc.persistence.interfaces.CalloutWireEvent; -import com.chatopera.cc.persistence.repository.*; -import com.chatopera.cc.proxy.OnlineUserProxy; -import com.chatopera.cc.socketio.client.NettyClients; -import com.chatopera.cc.util.mobile.MobileAddress; -import com.chatopera.cc.util.mobile.MobileNumberUtils; -import com.google.gson.JsonObject; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Conditional; -import org.springframework.stereotype.Component; - -import java.nio.charset.CharacterCodingException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - - -/** - * 外呼系统接线任务处理 - */ -@Component -@Conditional(CalloutBeanCondition.class) -public class CalloutWireTask { - private static final Logger logger = LoggerFactory.getLogger(CalloutWireTask.class); - - @Autowired - private CallOutDialplanRepository callOutDialplanRes; - - @Autowired - private UserRepository userRes; - - @Autowired - OnlineUserRepository onlineUserRes; - - @Autowired - AgentUserRepository agentUserRes; - - @Autowired - ConsultInviteRepository consultInviteRes; - - @Autowired - AgentServiceRepository agentServiceRes; - - @Autowired - ContactsRepository contactsRes; - - @Autowired - AgentUserContactsRepository agentUserContactsRes; - - @Autowired - private AgentUserRepository agentUserRepository; - - @Autowired - AgentStatusRepository agentStatusRes; - - - @Autowired - StatusEventRepository statusEventRes; - - @Autowired - OrganRepository organRes; - - @Autowired - private Cache cache; - - /** - * 绑定服务记录 - * - * @return - */ - private String bindAgentService(final AgentUser agentUser, - final String orgi, - final String channel, - final String organ, - final String organid, - final CallOutDialplan dp, - final String code, - final String isp, - final String caller, - final String called, - final String sip, - final Date createtime, - final String callid, - final Contacts lxr) { - final String statusEventId = MainUtils.getUUID(); - final String serviceId = MainUtils.getUUID(); - - // 通话记录 - StatusEvent statusEvent = new StatusEvent(); - statusEvent.setId(statusEventId); - statusEvent.setCalltype(MainContext.CallCenterCallType.OUTSIDELINE.toString()); - statusEvent.setDirection(MainContext.CallType.OUT.toString()); - statusEvent.setServiceid(serviceId); - statusEvent.setCode(code); - statusEvent.setOrgi(orgi); - statusEvent.setOrgan(organ); - statusEvent.setOrganid(organid); - statusEvent.setCountry(agentUser.getCountry()); - statusEvent.setProvince(agentUser.getProvince()); - statusEvent.setCity(agentUser.getCity()); - statusEvent.setAgent(agentUser.getAgentno()); - - // 设定联系人ID - if (lxr != null) { - statusEvent.setContactsid(lxr.getId()); - } - - // 设定坐席名字 - User agent = userRes.findById(agentUser.getAgentno()); - if (agent != null) - statusEvent.setAgentname(agent.getUname()); - - Date now = new Date(); - statusEvent.setUpdatetime(now); - statusEvent.setIsp(isp); - statusEvent.setRecord(true); // 开启录音 - statusEvent.setStatus(MainContext.CallServiceStatus.INCALL.toString()); - statusEvent.setCaller(caller); // 呼叫发起号码 - statusEvent.setDiscaller(caller); - statusEvent.setCalled(called); // 被叫号码 - statusEvent.setDiscalled(called); - if (dp != null) // 自动外呼 - statusEvent.setDialplan(dp.getId()); - statusEvent.setVoicechannel(channel); - statusEvent.setCallid(callid); - statusEvent.setName(agentUser.getName()); // 坐席的名字 - // 坐席通话日期(yyyy-MM-dd)用于每小时通话数量折线图 - statusEvent.setDatestr(new SimpleDateFormat("yyyy-MM-dd").format(createtime)); - // 坐席通话时间小时(HH)用于每小时通话数量折线图 - statusEvent.setHourstr(new SimpleDateFormat("HH").format(createtime)); - statusEvent.setLocaldatetime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createtime)); - statusEvent.setStarttime(createtime); - statusEvent.setSiptrunk(sip); - - statusEventRes.save(statusEvent); - - - // 服务记录 - AgentService as = new AgentService(); - as.setOrgi(orgi); - as.setId(serviceId); - MainUtils.copyProperties(agentUser, as); - as.setAgentuserid(agentUser.getId()); - as.setAgentserviceid(serviceId); - as.setQualitystatus(MainContext.QualityStatusEnum.NO.toString()); // 不做质检 - as.setInitiator(MainContext.ChatInitiatorType.USER.toString()); - as.setName(agentUser.getUsername()); - as.setDataid(agentUser.getUserid()); - as.setSessiontype(MainContext.AgentUserStatusEnum.INSERVICE.toString()); - as.setAgentusername(agentUser.getUsername()); - as.setOwner(statusEvent.getId()); - as.setAppid(channel); - - if (lxr != null) { - // 创建联系人,坐席服务关联 - AgentUserContacts auc = new AgentUserContacts(); - auc.setId(MainUtils.getUUID()); - auc.setContactsid(lxr.getId()); - auc.setAppid(channel); - auc.setCreatetime(now); - auc.setOrgi(orgi); - auc.setUserid(agentUser.getUserid()); - auc.setUsername(agentUser.getUsername()); - agentUserContactsRes.save(auc); - } - - agentServiceRes.save(as); - - return as.getId(); - } - - - private boolean validatePhoneNumber(String visitorPhoneNumber) { - return StringUtils.length(visitorPhoneNumber) == 11; - } - - /** - * 访客上线,创建咨询记录,分配坐席 - * - * @param visitorPhoneNumber - * @param agentId - * @return - */ - private AgentUser online( -// HttpServletRequest request, - final String visitorPhoneNumber, - final String agentId, - final String channel, - final String organ, - final String organid, - final CallOutDialplan dp, - final String caller, - final String called, - final String sip, - final Date createtime, - final String callid) throws CSKefuException, CharacterCodingException { - // Define source - MobileAddress ma = MobileNumberUtils.getAddress(visitorPhoneNumber); - - // 创建在线访客 - OnlineUser onlineUser = onlineUserRes.findByPhoneAndOrgi(visitorPhoneNumber, MainContext.SYSTEM_ORGI); - if (onlineUser == null) { - onlineUser = new OnlineUser(); - onlineUser.setId(MainUtils.getUUID()); - onlineUser.setUserid(onlineUser.getId()); - onlineUser.setUsertype(MainContext.OnlineUserType.TELECOM.toString()); - -// if(request.getSession().getAttribute("Sessionusername") != null){ -// String str=(String)request.getSession().getAttribute("Sessionusername"); -// onlineUser.setUsername(str); -// }else{ -// onlineUser.setUsername(MainContext.GUEST_USER + "_" + MainUtils.genIDByKey(onlineUser.getId())); -// } - AgentUser agentUser = this.agentUserRepository.findOneByUserid(onlineUser.getUserid()); - if (agentUser != null) { - onlineUser.setUsername(agentUser.getUsername()); - } else { - onlineUser.setUsername(Constants.GUEST_USER + "_" + MainUtils.genIDByKey(onlineUser.getId())); - } - onlineUser.setOrgi(MainContext.SYSTEM_ORGI); - onlineUser.setMobile("0"); // 不是 移动客户端 - onlineUser.setPhone(visitorPhoneNumber); - onlineUser.setCountry(ma.getCountry()); - onlineUser.setProvince(ma.getProvince()); - onlineUser.setCity(ma.getCity()); - onlineUser.setIsp(ma.getIsp()); - onlineUser.setSessionid(onlineUser.getId()); - onlineUser.setDatestr(new SimpleDateFormat("yyyyMMdd").format(createtime)); - onlineUser.setChannel(MainContext.ChannelType.PHONE.toString()); // telcom - onlineUser.setInvitetimes(0); - onlineUser.setCreater(onlineUser.getId()); - onlineUser.setCreatetime(createtime); - onlineUser.setUpdatetime(createtime); - onlineUser.setOptype(MainContext.OptType.HUMAN.toString()); - onlineUser.setAppid(channel); - } else { - onlineUser.setOlduser("1"); // 不是 老访客 - onlineUser.setInvitetimes(onlineUser.getInvitetimes() + 1); - } - - onlineUser.setLogintime(createtime); - onlineUser.setUpdatetime(createtime); - onlineUser.setUpdateuser(onlineUser.getUsername()); - onlineUser.setSessionid(onlineUser.getId()); - - // 获取该访客对应的联系人 - List lxrs = contactsRes.findOneByDatastatusIsFalseAndPhoneAndOrgi(visitorPhoneNumber, MainContext.SYSTEM_ORGI); - Contacts lxr = null; - if (lxrs.size() >= 1) { - lxr = lxrs.get(0); - onlineUser.setContactsid(lxr.getId()); - } - - onlineUser.setStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString()); - - // save and cache - logger.info("[callout wire] save and cache onlineUser: id [{}]", onlineUser.getId()); - onlineUserRes.save(onlineUser); - - // 在线客服状态 -// AgentStatus agentStatus = getAgentStatus(agentId, MainContext.SYSTEM_ORGI); -// -// if (agentStatus == null) { -// throw new CSKefuException(String.format("[callout wire] 客服人员处于离线状态,id [%s]", agentId)); -// } -// -// if (agentStatus.isBusy()) { -// throw new CSKefuException(String.format("[callout wire] 客服人员在线忙碌,不进行委派,名字 [%s] id [%s]", agentStatus.getUsername(), agentId)); -// } - - // 在线客服访客咨询记录 - AgentUser agentUser = new AgentUser(onlineUser.getId(), - MainContext.ChannelType.PHONE.toString(), // callout - onlineUser.getId(), - onlineUser.getUsername(), - MainContext.SYSTEM_ORGI, - channel); - agentUser.setNickname(onlineUser.getUsername()); - agentUser.setCountry(ma.getCountry()); // set source - agentUser.setProvince(ma.getProvince()); - agentUser.setCity(ma.getCity()); - agentUser.setPhone(visitorPhoneNumber); - agentUser.setRegion(String.format("%s [%s]", ma.getProvince(), visitorPhoneNumber)); - agentUser.setLogindate(createtime); - agentUser.setLastgetmessage(createtime); - final User agent = userRes.findOne(agentId); - agentUser.setAgentname(agent.getUname()); - agentUser.setAgentno(agentId); - agentUser.setStatus(MainContext.AgentUserStatusEnum.INSERVICE.toString()); - agentUser.setOnline(true); - agentUser.setSessionid(onlineUser.getId()); - agentUser.setServicetime(new Date()); - - // bind user service - agentUser.setAgentserviceid(bindAgentService(agentUser, - MainContext.SYSTEM_ORGI, - channel, - organ, - organid, - dp, - ma.getCode(), - ma.getIsp(), - caller, - called, - sip, - createtime, - callid, - lxr)); - - agentUserRes.save(agentUser); // save and cache - return agentUser; - } - - /** - * 访客下线 - * 设置访客离线,清缓存 - */ - public void offline(final CalloutWireEvent event) throws Exception { - OnlineUser onlineUser = onlineUserRes.findByPhoneAndOrgiAndStatus(event.getTo(), - MainContext.SYSTEM_ORGI, - MainContext.OnlineUserStatusEnum.ONLINE.toString()); - Date dt = new Date(); - - if (onlineUser != null) { - // 已经接通的用户 - onlineUser.setStatus(MainContext.OnlineUserStatusEnum.OFFLINE.toString()); - onlineUser.setUpdatetime(dt); - onlineUserRes.save(onlineUser); - - // there should only have one record, - // unless bad things happen. - List agentUsers = agentUserRes.findByUseridAndStatus(onlineUser.getId(), - MainContext.AgentUserStatusEnum.INSERVICE.toString()); - for (AgentUser au : agentUsers) { - cache.deleteAgentUserByUserIdAndOrgi(au.getId(), MainContext.SYSTEM_ORGI); - AutomaticServiceDist.serviceFinish(au, MainContext.SYSTEM_ORGI); - // update Status Events,更新通话记录 - if (StringUtils.isNotBlank(au.getAgentserviceid())) - closeStatusEvent(au, event.getCreatetime(), event.getRecord()); - } - } else { - logger.info("[callout wire] 手动外呼挂断处理 callOutFail"); - callOutFail(event); - } - } - - /** - * 关闭通话记录票据 - * - * @param au - * @param recordingfile - */ - private void closeStatusEvent(AgentUser au, final Date endtime, final String recordingfile) { - AgentService as = agentServiceRes.findByIdAndOrgi(au.getAgentserviceid(), au.getOrgi()); - if (as == null) - return; - - StatusEvent se = statusEventRes.findById(as.getOwner()); - if (se != null) { - se.setStatus(MainContext.CallServiceStatus.HANGUP.toString()); - se.setEndtime(endtime); - se.setDuration((int) (endtime.getTime() - se.getStarttime().getTime()) / 1000); - se.setRecordingfile(recordingfile); - // 设置录音文件位置 - statusEventRes.save(se); - } - } - - public void callOutConnect(final CalloutWireEvent event) throws FreeSwitchException, CSKefuException, CalloutRuntimeException, CharacterCodingException { - if (!((event.getFrom() != null) - && (event.getTo() != null) - && (event.getUuid() != null))) - throw new FreeSwitchException("[callout wire] invalid payload in callOutConnect data."); - - final String sip = event.getFrom(); - final String visitorPhoneNumber = event.getTo(); - final String channel = event.getChannel(); - // 呼叫计划,手动外呼:dialplan为null,自动外呼:dialplan不是null - final String dialplan = event.getDialplan(); - final String callid = event.getUuid(); // FreeSwitch 连线的唯一ID, 用于监听等 - final String caller = null; // 主叫号码 - final Date createtime = event.getCreatetime(); - CallOutDialplan dp = null; - if (dialplan != null) { - dp = callOutDialplanRes.findOne(dialplan); - if (dp == null) - throw new CalloutRuntimeException(String.format("不存在该呼叫计划。 %s", dialplan)); - } - - logger.info("[callout wire] bridge to sip account: {}, phone {}, localdatetime {}.", sip, visitorPhoneNumber, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createtime)); - if (!validatePhoneNumber(visitorPhoneNumber)) { - throw new FreeSwitchException(String.format("[callout wire] Invalid phone number [%s], should be 11 length.", visitorPhoneNumber)); - } - - // 验证语音渠道ID的有效性 - if (StringUtils.isBlank(channel)) - throw new FreeSwitchException("[callout wire] channel is blank string."); - - CousultInvite invite = OnlineUserProxy.consult(channel, MainContext.SYSTEM_ORGI); - if (invite == null) { - throw new FreeSwitchException(String.format("[callout wire] Invalid channel [%s]", channel)); - } - - if (StringUtils.isNotBlank(sip)) { // 发送通知给浏览器客户端 - logger.info("[callout wire] push exchange to sip account {} ...", sip); - List users = userRes.findBySipaccountAndDatastatus(sip, false); - if (users.size() == 0) { - throw new FreeSwitchException(String.format("[callout wire] User does not exist for Sip Account [%s]", sip)); - } else if (users.size() > 1) { - throw new FreeSwitchException(String.format("[callout wire] Get multi users for Sip Account [%s]", sip)); - } - - User agent = users.get(0); - String organname = null; - logger.info("[callout wire] Resolve Sip Account {}: {}", sip, agent.getUsername()); - - // 设置上线 - AgentUser au = online(visitorPhoneNumber, - agent.getId(), - channel, - organname, - agent.getOrgi(), - dp, - caller, - visitorPhoneNumber, - sip, - createtime, - callid); - - JsonObject payload = new JsonObject(); - payload.addProperty("type", Constants.FS_BRIDGE_CONNECT); - payload.addProperty("phone", visitorPhoneNumber); - payload.addProperty("userid", au.getUserid()); - payload.addProperty("username", au.getUsername()); - payload.addProperty("usession", au.getUserid()); - payload.addProperty("touser", au.getUserid()); - payload.addProperty("orgi", au.getOrgi()); - payload.addProperty("calltype", MainContext.CallType.OUT.toString()); - payload.addProperty("channel", au.getChannel()); - - /** - * 其他情况,存在一个有效账号 - * 发送事件到浏览器 - */ - NettyClients.getInstance() - .sendCalloutEventMessage(agent.getId(), - MainContext.MessageType.NEW.toString(), - payload.toString()); - } else { - throw new FreeSwitchException(String.format("[callout wire] Sip Accout Not Found in data. %s", event.toJson().toString())); - } - } - - /** - * 失败任务 - * 通话记录中,创建呼叫失败 - */ - public void callOutFail(final CalloutWireEvent event) throws CalloutRuntimeException { - StatusEvent se = new StatusEvent(); - se.setId(MainUtils.getUUID()); - se.setStatus(event.getStatus()); - se.setDuration(0); - se.setDirection(event.getDirection()); - se.setCalltype(event.getDirection()); - se.setVoicechannel(event.getChannel()); - - // 没有呼叫计划外呼的通话被认为是手动外呼 - if (event.isDialplan()) { - final String dialplan = event.getDialplan(); - se.setDialplan(dialplan); - CallOutDialplan dp = callOutDialplanRes.findOne(dialplan); - se.setOrganid(dp.getOrgan().getId()); - se.setOrgan(dp.getOrgan().getName()); - se.setVoicechannel(dp.getVoicechannel().getBaseURL()); - } - - se.setCallid(event.getUuid()); // 呼叫标识 - se.setRecordingfile(event.getRecord()); // 呼叫文件 - - if (event.getFrom() != null) { // 手动外呼 - List users = userRes.findBySipaccountAndDatastatus(event.getFrom(), false); - if (users.size() == 0) { - throw new CalloutRuntimeException(String.format("[callout wire] User does not exist for Sip Account [%s]", event.getFrom())); - } else if (users.size() > 1) { - throw new CalloutRuntimeException(String.format("[callout wire] Get multi users for Sip Account [%s]", event.getFrom())); - } else { - User u = users.get(0); - se.setAgentname(u.getUname()); - se.setAgent(u.getId()); - } - } - - // 被叫号码 - if (event.getTo() != null) { - final String phone = event.getTo(); - se.setCalled(phone); - MobileAddress ma = MobileNumberUtils.getAddress(phone); - if (ma != null) { - se.setProvince(ma.getProvince()); - se.setCode(ma.getCode()); - se.setCity(ma.getCity()); - se.setCountry(ma.getCountry()); - se.setIsp(ma.getIsp()); - } - } - - se.setStarttime(event.getCreatetime()); - se.setEndtime(event.getCreatetime()); - se.setLocaldatetime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(event.getCreatetime())); - statusEventRes.save(se); - } - - - public void callOutDisconnect(final CalloutWireEvent event) throws Exception { - String sip = event.getFrom(); - String visitorPhoneNumber = event.getTo(); - String recordingfile = event.getRecord(); - - logger.info("[callout wire] callOutDisconnect sip account: {}, phone {}.", sip, visitorPhoneNumber); - if (!validatePhoneNumber(visitorPhoneNumber)) { - throw new FreeSwitchException(String.format("Invalid phone number [%s], should be 11 length.", visitorPhoneNumber)); - } - - if (StringUtils.isNotBlank(sip)) { // 发送通知给浏览器客户端 - List users = userRes.findBySipaccountAndDatastatus(sip, false); - if (users.size() == 0) { - throw new FreeSwitchException(String.format("User does not exist for Sip Account [%s]", sip)); - } else if (users.size() > 1) { - throw new FreeSwitchException(String.format("Get multi users for Sip Account [%s]", sip)); - } - - User agent = users.get(0); - logger.info("[callout wire] callOutDisconnect resolve sip {} account {}", sip, agent.getUsername()); - - // 设置离线 - offline(event); - } - - } - - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/Fetcher.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/Fetcher.java index 79a59b46..ba930e05 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/Fetcher.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/schedule/Fetcher.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/NamesTask.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/NamesTask.java deleted file mode 100644 index 47ecb505..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/NamesTask.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.schedule; - -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.cache.Cache; -import com.chatopera.cc.socketio.client.NettyClients; -import com.chatopera.cc.proxy.CalloutProxy; -import com.chatopera.cc.util.es.SearchTools; -import com.chatopera.cc.util.es.UKDataBean; -import com.chatopera.cc.util.freeswitch.model.CallCenterAgent; -import org.springframework.data.domain.Page; - -public class NamesTask implements Runnable { - - private CallCenterAgent agent; - private static Cache cache; - - public NamesTask(CallCenterAgent agent) { - this.agent = agent; - } - - @Override - public void run() { - if (agent != null) { - /** - * 更新状态 - */ - agent.setWorkstatus(MainContext.WorkStatusEnum.PREVIEW.toString()); - /** - * 根据策略拉取名单 , - * 1、拨打时间 - * 2、允许或禁止拨打 - * 3、优先拨打新名单/老名单/预约名单/未拨打成功的名单 - */ - Page names = SearchTools.agentapsearch(this.agent.getOrgi(), agent.getUserid(), 0, 1); - if (names.getTotalElements() == 0) { - names = SearchTools.agentsearch(this.agent.getOrgi(), true, agent.getUserid(), 0, 1); - } - /** - * 找到名单,生成拨打任务,工作界面上,坐席只能看到自己的名单 - */ - if (names != null && names.getContent().size() > 0) { - UKDataBean name = names.getContent().get(0); - - CalloutProxy.processNames(name, agent, agent.getOrgi(), (int) (names.getTotalElements() - 1)); - } else { - agent.setWorkstatus(MainContext.WorkStatusEnum.IDLE.toString()); - NettyClients.getInstance().sendCallCenterMessage(agent.getExtno(), "error", "nonames"); - - NettyClients.getInstance().sendCallCenterMessage(agent.getExtno(), "docallout", agent); - } - - NamesTask.getCache().putCallCenterAgentByIdAndOrgi(agent.getUserid(), agent.getOrgi(), agent); - } - } - - private static Cache getCache() { - if (cache == null) { - cache = MainContext.getContext().getBean(Cache.class); - } - - return cache; - } - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/Task.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/Task.java index cbf1dbc3..e37a3485 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/Task.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/schedule/Task.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import java.util.Date; public class Task implements Runnable { private static final Logger logger = LoggerFactory.getLogger(Task.class); - private static Cache cache; private JobDetail jobDetail; private JobDetailRepository jobDetailRes; @@ -87,13 +86,7 @@ public class Task implements Runnable { /** * 存储历史信息 */ - Task.getCache().deleteJobByJobIdAndOrgi(this.jobDetail.getId(), this.jobDetail.getOrgi()); + MainContext.getCache().deleteJobByJobIdAndOrgi(this.jobDetail.getId(), this.jobDetail.getOrgi()); } } - - private static Cache getCache() { - if (cache == null) - cache = MainContext.getContext().getBean(Cache.class); - return cache; - } } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/schedule/WebIMTask.java b/contact-center/app/src/main/java/com/chatopera/cc/schedule/WebIMTask.java index bc3817d5..b836d598 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/schedule/WebIMTask.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/schedule/WebIMTask.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/ServerRunner.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/ServerRunner.java index 9419bacf..de54c710 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/ServerRunner.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/ServerRunner.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,17 @@ package com.chatopera.cc.socketio; import com.chatopera.cc.basic.Constants; import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.config.conditions.CalloutBeanCondition; +import com.chatopera.cc.basic.plugins.PluginRegistry; +import com.chatopera.cc.basic.plugins.PluginsLoader; +import com.chatopera.cc.config.plugins.CalloutPluginPresentCondition; +import com.chatopera.cc.config.plugins.ChatbotPluginPresentCondition; import com.chatopera.cc.socketio.handler.AgentEventHandler; import com.chatopera.cc.socketio.handler.EntIMEventHandler; import com.chatopera.cc.socketio.handler.IMEventHandler; import com.corundumstudio.socketio.SocketIONamespace; import com.corundumstudio.socketio.SocketIOServer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Bean; @@ -35,6 +40,8 @@ import java.lang.reflect.InvocationTargetException; @Component public class ServerRunner implements CommandLineRunner { + private final static Logger logger = LoggerFactory.getLogger(ServerRunner.class); + private final SocketIOServer server; private final SocketIONamespace imSocketNameSpace; private final SocketIONamespace agentSocketIONameSpace; @@ -50,7 +57,7 @@ public class ServerRunner implements CommandLineRunner { agentSocketIONameSpace = server.addNamespace(MainContext.NameSpaceEnum.AGENT.getNamespace()); entIMSocketIONameSpace = server.addNamespace(MainContext.NameSpaceEnum.ENTIM.getNamespace()); - if (MainContext.isEnableCalloutModule()) { + if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLOUT)) { calloutSocketIONameSpace = server.addNamespace(MainContext.NameSpaceEnum.CALLOUT.getNamespace()); } else { calloutSocketIONameSpace = null; @@ -62,7 +69,7 @@ public class ServerRunner implements CommandLineRunner { callCenterSocketIONameSpace = null; } - if (MainContext.isEnableChatbotModule()) { + if (MainContext.hasModule(Constants.CSKEFU_MODULE_CHATBOT)) { chatbotSocketIONameSpace = server.addNamespace(MainContext.NameSpaceEnum.CHATBOT.getNamespace()); } else { chatbotSocketIONameSpace = null; @@ -88,16 +95,17 @@ public class ServerRunner implements CommandLineRunner { } @Bean(name = "chatbotNamespace") + @Conditional(ChatbotPluginPresentCondition.class) public SocketIONamespace getChatbotSocketIONameSpace(SocketIOServer server) { - if (MainContext.isEnableChatbotModule()) { - Constructor constructor; - try { - constructor = Class.forName("com.chatopera.cc.socketio.handler.ChatbotEventHandler").getConstructor(SocketIOServer.class); - chatbotSocketIONameSpace.addListeners(constructor.newInstance(server)); - } catch (NoSuchMethodException | SecurityException - | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - e.printStackTrace(); - } + Constructor constructor; + try { + constructor = Class.forName( + PluginsLoader.getIOEventHandler(PluginRegistry.PLUGIN_ENTRY_CHATBOT)).getConstructor( + SocketIOServer.class); + chatbotSocketIONameSpace.addListeners(constructor.newInstance(server)); + } catch (NoSuchMethodException | SecurityException + | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + e.printStackTrace(); } return chatbotSocketIONameSpace; @@ -108,7 +116,9 @@ public class ServerRunner implements CommandLineRunner { if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLCENTER)) { Constructor constructor; try { - constructor = Class.forName("com.chatopera.cc.socketio.server.handler.CallCenterEventHandler").getConstructor(SocketIOServer.class); + constructor = Class.forName( + "com.chatopera.cc.socketio.server.handler.CallCenterEventHandler").getConstructor( + SocketIOServer.class); callCenterSocketIONameSpace.addListeners(constructor.newInstance(server)); } catch (NoSuchMethodException | SecurityException | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { @@ -118,17 +128,19 @@ public class ServerRunner implements CommandLineRunner { return callCenterSocketIONameSpace; } - @Conditional(CalloutBeanCondition.class) + @Conditional(CalloutPluginPresentCondition.class) @Bean(name = "calloutNamespace") public SocketIONamespace getCalloutIMSocketIONameSpace(SocketIOServer server) { if (MainContext.hasModule(Constants.CSKEFU_MODULE_CALLOUT)) { Constructor constructor; try { - constructor = Class.forName("com.chatopera.cc.socketio.handler.CalloutEventHandler").getConstructor(SocketIOServer.class); + constructor = Class.forName( + PluginsLoader.getIOEventHandler(PluginRegistry.PLUGIN_ENTRY_CALLOUT)).getConstructor( + SocketIOServer.class); calloutSocketIONameSpace.addListeners(constructor.newInstance(server)); } catch (NoSuchMethodException | SecurityException | ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - e.printStackTrace(); + logger.error("[calloutNamespace] error", e); } } return calloutSocketIONameSpace; diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyAgentClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyAgentClient.java index b9831a16..7dcf2e64 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyAgentClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyAgentClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCallCenterClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCallCenterClient.java index 78739b51..61062d77 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCallCenterClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCallCenterClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCalloutClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCalloutClient.java index 54c10b51..7584bcea 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCalloutClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyCalloutClient.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyChatbotClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyChatbotClient.java index 4758c9a8..0a0f86bb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyChatbotClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyChatbotClient.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClient.java index 61cbba0c..b1b10a0d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClients.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClients.java index 517200f4..e48f47c9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClients.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyClients.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyIMClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyIMClient.java index 35cf7f19..25f43a6b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyIMClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/NettyIMClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/UserClient.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/UserClient.java index fa9a90ec..e63d64bb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/UserClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/client/UserClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/AgentEventHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/AgentEventHandler.java index a1284ceb..f1f71e6e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/AgentEventHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/AgentEventHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/CalloutEventHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/CalloutEventHandler.java deleted file mode 100644 index e2db7e02..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/CalloutEventHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.chatopera.cc.socketio.handler; - -import com.chatopera.cc.basic.MainUtils; -import com.chatopera.cc.socketio.client.NettyClients; -import com.corundumstudio.socketio.SocketIOClient; -import com.corundumstudio.socketio.SocketIOServer; -import com.corundumstudio.socketio.annotation.OnConnect; -import com.corundumstudio.socketio.annotation.OnDisconnect; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; - -import java.net.InetSocketAddress; - -public class CalloutEventHandler -{ - protected SocketIOServer server; - private final Logger logger = LoggerFactory.getLogger(CalloutEventHandler.class); - - @Autowired - public CalloutEventHandler(SocketIOServer server) - { - this.server = server ; - } - - @OnConnect - public void onConnect(SocketIOClient client) - { - String user = client.getHandshakeData().getSingleUrlParam("userid") ; - String orgi = client.getHandshakeData().getSingleUrlParam("orgi") ; - String session = client.getHandshakeData().getSingleUrlParam("session") ; - String admin = client.getHandshakeData().getSingleUrlParam("admin") ; - logger.info("onConnect userid {}, orgi {}.", user, orgi); - - if(StringUtils.isNotBlank(user) && StringUtils.isNotBlank(user)){ - client.set("agentno", user); - InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress() ; - String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ; - - NettyClients.getInstance().putCalloutEventClient(user, client); - } - } - - //添加@OnDisconnect事件,客户端断开连接时调用,刷新客户端信息 - @OnDisconnect - public void onDisconnect(SocketIOClient client) - { - String user = client.getHandshakeData().getSingleUrlParam("userid") ; - String orgi = client.getHandshakeData().getSingleUrlParam("orgi") ; - String session = client.getHandshakeData().getSingleUrlParam("session") ; - String admin = client.getHandshakeData().getSingleUrlParam("admin") ; - logger.info("onDisconnect userid {}, orgi {}", user, orgi); - NettyClients.getInstance().removeCalloutEventClient(user, MainUtils.getContextID(client.getSessionId().toString())); - - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/ChatbotEventHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/ChatbotEventHandler.java deleted file mode 100644 index 8e8f3ad8..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/ChatbotEventHandler.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.socketio.handler; - -import com.chatopera.cc.acd.AutomaticServiceDist; -import com.chatopera.cc.basic.Constants; -import com.chatopera.cc.basic.MainContext; -import com.chatopera.cc.basic.MainUtils; -import com.chatopera.cc.model.*; -import com.chatopera.cc.persistence.repository.AgentUserRepository; -import com.chatopera.cc.persistence.repository.ChatbotRepository; -import com.chatopera.cc.persistence.repository.OnlineUserRepository; -import com.chatopera.cc.proxy.ChatbotProxy; -import com.chatopera.cc.proxy.OnlineUserProxy; -import com.chatopera.cc.socketio.client.NettyClients; -import com.chatopera.cc.socketio.message.AgentStatusMessage; -import com.chatopera.cc.socketio.message.ChatMessage; -import com.chatopera.cc.socketio.message.Message; -import com.chatopera.cc.socketio.util.IMServiceUtils; -import com.chatopera.cc.util.IP; -import com.chatopera.cc.util.IPTools; -import com.corundumstudio.socketio.AckRequest; -import com.corundumstudio.socketio.SocketIOClient; -import com.corundumstudio.socketio.SocketIOServer; -import com.corundumstudio.socketio.annotation.OnConnect; -import com.corundumstudio.socketio.annotation.OnDisconnect; -import com.corundumstudio.socketio.annotation.OnEvent; -import org.apache.commons.lang.StringUtils; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; - -import java.net.InetSocketAddress; -import java.util.Date; - -public class ChatbotEventHandler { - private static final Logger logger = LoggerFactory.getLogger(ChatbotEventHandler.class); - - protected SocketIOServer server; - - private static AgentUserRepository agentUserRes; - private static OnlineUserRepository onlineUserRes; - private static ChatbotRepository chatbotRes; - private static ChatbotProxy chatbotProxy; - - @Autowired - public ChatbotEventHandler(SocketIOServer server) { - this.server = server; - } - - @OnConnect - public void onConnect(SocketIOClient client) { - try { - - String user = client.getHandshakeData().getSingleUrlParam("userid"); - String nickname = client.getHandshakeData().getSingleUrlParam("nickname"); - String orgi = client.getHandshakeData().getSingleUrlParam("orgi"); - String session = client.getHandshakeData().getSingleUrlParam("session"); - String appid = client.getHandshakeData().getSingleUrlParam("appid"); - String aiid = client.getHandshakeData().getSingleUrlParam("aiid"); - logger.info("onConnect userid {}, nickname {}", user, nickname); - Date now = new Date(); - - if (StringUtils.isNotBlank(user)) { - /** - * 加入到 缓存列表 - */ - NettyClients.getInstance().putChatbotEventClient(user, client); - CousultInvite invite = OnlineUserProxy.consult(appid, orgi); - - /** - * 更新坐席服务类型 - */ - IMServiceUtils.shiftOpsType(user, orgi, MainContext.OptType.CHATBOT); - - // send out tip - Message tip = new Message(); - tip.setMessage("您正在使用机器人客服!"); - tip.setMessageType(MainContext.MessageType.MESSAGE.toString()); - tip.setCalltype(MainContext.CallType.IN.toString()); - tip.setCreatetime(MainUtils.dateFormate.format(now)); - - client.sendEvent(MainContext.MessageType.STATUS.toString(), tip); - - // send out welcome message - if (invite != null) { - Chatbot chatbot = getChatbotRes().findOne(invite.getAiid()); - com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot( - chatbot.getClientId(), chatbot.getSecret(), chatbot.getBaseUrl()); - JSONObject details = bot.details(); - - // 发送欢迎语 - if (details.has("rc") && - details.getInt("rc") == 0) { - ChatMessage welcome = new ChatMessage(); - String welcomeTextMessage = details.getJSONObject("data").getString("welcome"); - if (StringUtils.isNotBlank(welcomeTextMessage)) { - welcome.setCalltype(MainContext.CallType.OUT.toString()); - welcome.setAppid(appid); - welcome.setOrgi(orgi); - welcome.setAiid(aiid); - welcome.setMessage(welcomeTextMessage); - welcome.setTouser(user); - welcome.setMsgtype(MainContext.MessageType.MESSAGE.toString()); - welcome.setUserid(user); - welcome.setUsername(invite.getAiname()); - welcome.setUpdatetime(System.currentTimeMillis()); - client.sendEvent(MainContext.MessageType.MESSAGE.toString(), welcome); - } - - // 发送常见问题列表 - JSONObject faqhotresp = bot.conversation(user, "__faq_hot_list"); - logger.info("faqhot {}", faqhotresp.toString()); - if (faqhotresp.getInt("rc") == 0) { - JSONObject faqhotdata = faqhotresp.getJSONObject("data"); - if ((!faqhotdata.getBoolean("logic_is_fallback")) && - faqhotdata.has("string") && - faqhotdata.has("params")) { - ChatMessage faqhotmsg = new ChatMessage(); - faqhotmsg.setCalltype(MainContext.CallType.OUT.toString()); - faqhotmsg.setAppid(appid); - faqhotmsg.setOrgi(orgi); - faqhotmsg.setAiid(aiid); - faqhotmsg.setMessage(faqhotdata.getString("string")); - faqhotmsg.setExpmsg(faqhotdata.getJSONArray("params").toString()); - faqhotmsg.setTouser(user); - faqhotmsg.setMsgtype(MainContext.MessageType.MESSAGE.toString()); - faqhotmsg.setUserid(user); - faqhotmsg.setUsername(invite.getAiname()); - faqhotmsg.setUpdatetime(System.currentTimeMillis()); - client.sendEvent(MainContext.MessageType.MESSAGE.toString(), faqhotmsg); - } - } - } - } - - InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress(); - String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()); - OnlineUser onlineUser = getOnlineUserRes().findOne(user); - - if (onlineUser == null) { - onlineUser = new OnlineUser(); - onlineUser.setAppid(appid); - if (StringUtils.isNotBlank(nickname)) { - onlineUser.setUsername(nickname); - } else { - onlineUser.setUsername(Constants.GUEST_USER + "_" + MainUtils.genIDByKey(user)); - } - - onlineUser.setSessionid(session); - onlineUser.setOptype(MainContext.OptType.CHATBOT.toString()); - onlineUser.setUserid(user); - onlineUser.setId(user); - onlineUser.setOrgi(orgi); - onlineUser.setChannel(MainContext.ChannelType.WEBIM.toString()); - onlineUser.setIp(ip); - onlineUser.setUpdatetime(now); - onlineUser.setLogintime(now); - onlineUser.setCreatetime(now); - IP ipdata = IPTools.getInstance().findGeography(ip); - onlineUser.setCity(ipdata.getCity()); - onlineUser.setCountry(ipdata.getCountry()); - onlineUser.setProvince(ipdata.getProvince()); - onlineUser.setIsp(ipdata.getIsp()); - onlineUser.setRegion(ipdata.getRegion()); - onlineUser.setStatus(MainContext.OnlineUserStatusEnum.ONLINE.toString()); - } - - // 在线客服访客咨询记录 - AgentUser agentUser = new AgentUser( - onlineUser.getId(), - MainContext.ChannelType.WEBIM.toString(), // callout - onlineUser.getId(), - onlineUser.getUsername(), - MainContext.SYSTEM_ORGI, - appid); - - agentUser.setServicetime(now); - agentUser.setCreatetime(now); - agentUser.setUpdatetime(now); - agentUser.setSessionid(session); - agentUser.setRegion(onlineUser.getRegion()); - - // 聊天机器人处理的请求 - agentUser.setOpttype(MainContext.OptType.CHATBOT.toString()); - agentUser.setAgentno(aiid); // 聊天机器人ID - agentUser.setAgentname(invite != null ? invite.getAiname() : "机器人客服"); - agentUser.setCity(onlineUser.getCity()); - agentUser.setProvince(onlineUser.getProvince()); - agentUser.setCountry(onlineUser.getCountry()); - AgentService agentService = AutomaticServiceDist.processChatbotService( - invite != null ? invite.getAiname() : "机器人客服", agentUser, orgi); - agentUser.setAgentserviceid(agentService.getId()); - - // 标记为机器人坐席 - agentUser.setChatbotops(true); - - // 保存到MySQL - getAgentUserRes().save(agentUser); - getOnlineUserRes().save(onlineUser); - } - } catch (Exception e) { - logger.info("[onConnect] error", e); - } - } - - // 添加 @OnDisconnect 事件,客户端断开连接时调用,刷新客户端信息 - @OnDisconnect - public void onDisconnect(SocketIOClient client) { - String user = client.getHandshakeData().getSingleUrlParam("userid"); - String orgi = client.getHandshakeData().getSingleUrlParam("orgi"); - if (StringUtils.isNotBlank(user)) { - NettyClients.getInstance().removeChatbotEventClient( - user, MainUtils.getContextID(client.getSessionId().toString())); - OnlineUser onlineUser = MainContext.getCache().findOneOnlineUserByUserIdAndOrgi(user, orgi); - - MainContext.getCache().findOneAgentUserByUserIdAndOrgi(user, orgi).ifPresent(p -> { - AutomaticServiceDist.processChatbotService(null, p, orgi); - - MainContext.getCache().deleteAgentUserByUserIdAndOrgi(user, orgi); - MainContext.getCache().deleteOnlineUserByIdAndOrgi(user, orgi); - - p.setStatus(MainContext.OnlineUserStatusEnum.OFFLINE.toString()); - onlineUser.setStatus(MainContext.OnlineUserStatusEnum.OFFLINE.toString()); - - getAgentUserRes().save(p); - getOnlineUserRes().save(onlineUser); - }); - } - client.disconnect(); - } - - // 消息接收入口,网站有新用户接入对话 - @OnEvent(value = "new") - public void onEvent(SocketIOClient client, AckRequest request, Message data) { - - } - - // 消息接收入口,坐席状态更新 - @OnEvent(value = "agentstatus") - public void onEvent(SocketIOClient client, AckRequest request, AgentStatusMessage data) { - logger.info("[onEvent] agentstatus: ", data.getMessage()); - } - - // 消息接收入口,收发消息,用户向坐席发送消息和 坐席向用户发送消息 - @OnEvent(value = "message") - public void onEvent(SocketIOClient client, AckRequest request, ChatMessage data) { - String orgi = client.getHandshakeData().getSingleUrlParam("orgi"); - String aiid = client.getHandshakeData().getSingleUrlParam("aiid"); - String user = client.getHandshakeData().getSingleUrlParam("userid"); - String sessionid = MainUtils.getContextID(client.getSessionId().toString()); - logger.info("[onEvent] message: orgi {}, aiid {}, userid {}, dataType {}", orgi, aiid, user, data.getType()); - // ignore event if dataType is not message. - if (!StringUtils.equals(data.getType(), Constants.IM_MESSAGE_TYPE_MESSAGE)) { - return; - } - - MainContext.getCache().findOneAgentUserByUserIdAndOrgi(user, orgi).ifPresent(p -> { - /** - * 以下代码主要用于检查 访客端的字数限制 - */ - CousultInvite invite = OnlineUserProxy.consult(data.getAppid(), data.getOrgi()); - // ignore event if no invite found. - if (invite == null) { - return; - } - - // ignore if Chatbot is turnoff. - if (!invite.isAi()) { - return; - } - - Date now = new Date(); - if (invite.getMaxwordsnum() > 0) { - if (StringUtils.isNotBlank(data.getMessage()) && data.getMessage().length() > invite.getMaxwordsnum()) { - data.setMessage(data.getMessage().substring(0, invite.getMaxwordsnum())); - } - } else if (StringUtils.isNotBlank(data.getMessage()) && data.getMessage().length() > 300) { - data.setMessage(data.getMessage().substring(0, 300)); - } - - data.setUsession(user); // 绑定唯一用户 - data.setSessionid(sessionid); - data.setMessage(MainUtils.processEmoti(data.getMessage())); // 处理表情 - data.setTouser(aiid); - data.setUsername(p.getUsername()); - data.setAiid(aiid); - data.setAgentserviceid(p.getAgentserviceid()); - data.setChannel(p.getChannel()); - data.setContextid(p.getAgentserviceid()); // 一定要设置 ContextID - data.setCalltype(MainContext.CallType.IN.toString()); - - // 保存并发送消息给访客 - getChatbotProxy().createTextMessage( - data, - MainContext.CallType.IN.toString()); - - // 更新访客咨询记录 - p.setUpdatetime(now); - p.setLastmessage(now); - p.setLastmsg(data.getMessage()); - getAgentUserRes().save(p); - - // 发送消息给Bot - getChatbotProxy().publishMessage(data, Constants.CHATBOT_EVENT_TYPE_CHAT); - }); - - - } - - /** - * Lazy load - * - * @return - */ - private AgentUserRepository getAgentUserRes() { - if (agentUserRes == null) { - agentUserRes = MainContext.getContext().getBean(AgentUserRepository.class); - } - - return agentUserRes; - } - - /** - * Lazy load - * - * @return - */ - private ChatbotProxy getChatbotProxy() { - if (chatbotProxy == null) { - chatbotProxy = MainContext.getContext().getBean(ChatbotProxy.class); - } - return chatbotProxy; - } - - private OnlineUserRepository getOnlineUserRes() { - if (onlineUserRes == null) { - onlineUserRes = MainContext.getContext().getBean(OnlineUserRepository.class); - } - - return onlineUserRes; - } - - private ChatbotRepository getChatbotRes() { - if (chatbotRes == null) { - chatbotRes = MainContext.getContext().getBean(ChatbotRepository.class); - } - - return chatbotRes; - } - -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/EntIMEventHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/EntIMEventHandler.java index 8ff23384..49f5d2d6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/EntIMEventHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/EntIMEventHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/IMEventHandler.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/IMEventHandler.java index 9deea1d1..94e12d39 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/IMEventHandler.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/handler/IMEventHandler.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/AgentStatusMessage.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/AgentStatusMessage.java index 17f49bf9..32d540e7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/AgentStatusMessage.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/AgentStatusMessage.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/Message.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/Message.java index c2f35a4e..db04987f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/Message.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/Message.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/OtherMessageItem.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/OtherMessageItem.java index 25d69334..fca25b7d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/OtherMessageItem.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/message/OtherMessageItem.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/HumanUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/HumanUtils.java index fabc5ad4..22f0b53e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/HumanUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/HumanUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/RichMediaUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/RichMediaUtils.java index 04e85962..c0243085 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/RichMediaUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/socketio/util/RichMediaUtils.java @@ -17,19 +17,13 @@ package com.chatopera.cc.socketio.util; import com.chatopera.cc.basic.MainContext; import com.chatopera.cc.socketio.message.ChatMessage; -import com.chatopera.cc.model.AgentUser; -import com.chatopera.cc.proxy.ChatbotProxy; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Optional; - public class RichMediaUtils { private final static Logger logger = LoggerFactory.getLogger(RichMediaUtils.class); - private static ChatbotProxy chatbotProxy; - /** * 上传图片 * @@ -172,21 +166,15 @@ public class RichMediaUtils { if (MainContext.getCache().findOneAgentUserByUserIdAndOrgi( userid, MainContext.SYSTEM_ORGI).filter(p -> StringUtils.equals( p.getOpttype(), MainContext.OptType.CHATBOT.toString())).isPresent()) { - getChatbotProxy().createMessage( - data, appid, channel, MainContext.CallType.IN.toString(), - MainContext.ChatbotItemType.USERINPUT.toString(), msgtype, data.getUserid(), orgi); + // TODO 给聊天机器人发送图片或文字 + // #652 创建聊天机器人插件时去掉了对它的支持,需要将来实现 +// getChatbotProxy().createMessage( +// data, appid, channel, MainContext.CallType.IN.toString(), +// MainContext.ChatbotItemType.USERINPUT.toString(), msgtype, data.getUserid(), orgi); } else { HumanUtils.processMessage(data, msgtype, userid); } } return data; } - - private static ChatbotProxy getChatbotProxy() { - if (chatbotProxy == null) { - chatbotProxy = MainContext.getContext().getBean(ChatbotProxy.class); - } - return chatbotProxy; - } - } diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/AMRConvert.java b/contact-center/app/src/main/java/com/chatopera/cc/util/AMRConvert.java index 7e3788a3..4e7bdf16 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/AMRConvert.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/AMRConvert.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/Base62.java b/contact-center/app/src/main/java/com/chatopera/cc/util/Base62.java index c70c8643..8f8b8ded 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/Base62.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/Base62.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/BrowserClient.java b/contact-center/app/src/main/java/com/chatopera/cc/util/BrowserClient.java index 85f3c89c..93cb5e0f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/BrowserClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/BrowserClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/CallCenterUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/util/CallCenterUtils.java index 0dd735c6..cc67446f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/CallCenterUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/CallCenterUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/CronTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/CronTools.java index bbe2f8d7..48785216 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/CronTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/CronTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuIdGenerator.java b/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuIdGenerator.java index 2f444add..8e086160 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuIdGenerator.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuIdGenerator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuList.java b/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuList.java index c3221230..e652b35c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuList.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/CskefuList.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/DateConverter.java b/contact-center/app/src/main/java/com/chatopera/cc/util/DateConverter.java index d98723bb..8200d47f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/DateConverter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/DateConverter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/FFmpegCmdExecuter.java b/contact-center/app/src/main/java/com/chatopera/cc/util/FFmpegCmdExecuter.java index fdae5765..85082b8b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/FFmpegCmdExecuter.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/FFmpegCmdExecuter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/HttpClientUtil.java b/contact-center/app/src/main/java/com/chatopera/cc/util/HttpClientUtil.java index aafce031..d5ca5e05 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/HttpClientUtil.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/HttpClientUtil.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/IP.java b/contact-center/app/src/main/java/com/chatopera/cc/util/IP.java index b9c666eb..e78a31d5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/IP.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/IP.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/IPTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/IPTools.java index e12cd008..706f6338 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/IPTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/IPTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/MD5.java b/contact-center/app/src/main/java/com/chatopera/cc/util/MD5.java index cc82a236..dc30849a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/MD5.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/MD5.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/MathHelper.java b/contact-center/app/src/main/java/com/chatopera/cc/util/MathHelper.java index 8f50ced7..c582f4ed 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/MathHelper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/MathHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/Menu.java b/contact-center/app/src/main/java/com/chatopera/cc/util/Menu.java index b6d4ea40..f941989a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/Menu.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/Menu.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/MobileDevice.java b/contact-center/app/src/main/java/com/chatopera/cc/util/MobileDevice.java index ffa8e533..97c80535 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/MobileDevice.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/MobileDevice.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/PinYinTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/PinYinTools.java index 3d342ba3..0419e773 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/PinYinTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/PinYinTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/PropertiesEventUtil.java b/contact-center/app/src/main/java/com/chatopera/cc/util/PropertiesEventUtil.java index 4c09bbe3..1dbc66bf 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/PropertiesEventUtil.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/PropertiesEventUtil.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/RestResult.java b/contact-center/app/src/main/java/com/chatopera/cc/util/RestResult.java index d4610995..7a7b039f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/RestResult.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/RestResult.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/RestResultType.java b/contact-center/app/src/main/java/com/chatopera/cc/util/RestResultType.java index e91dcf6c..1f5fc99b 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/RestResultType.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/RestResultType.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/StreamingFileUtil.java b/contact-center/app/src/main/java/com/chatopera/cc/util/StreamingFileUtil.java index 7ee90c28..0d378db6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/StreamingFileUtil.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/StreamingFileUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java b/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java index b98cb330..c3b44881 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/SystemEnvHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ public class SystemEnvHelper { /** * 根据类的全名查找是否存在 + * * @param classFullName * @return */ @@ -42,18 +43,24 @@ public class SystemEnvHelper { } } + /** - * 分析是否加载模块,在变量为不存在或变量值为true的情况下加载 - * 也就是说,该变量值不为空或为true时时加载 + * 获得环境变量的值,如果不存在,返回默认值 * - * @param property + * @param variable + * @param defaultvalue * @return */ - public static boolean parseModuleFlag(final String property) { - String val = parseFromApplicationProps(property); - return StringUtils.isNotBlank(val) && StringUtils.equalsIgnoreCase(val, "true"); + public static String getenv(final String variable, final String defaultvalue) { + final String val = System.getenv(variable); + + if (StringUtils.isBlank(val)) { + return defaultvalue; + } + return val; } + /** * 加载配置,先检查环境变量,再从application properties加载 * diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/TaskTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/TaskTools.java index b01c956d..0241241e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/TaskTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/TaskTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/Templet.java b/contact-center/app/src/main/java/com/chatopera/cc/util/Templet.java index 8aa79b23..92f8c8e6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/Templet.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/Templet.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/TempletLoader.java b/contact-center/app/src/main/java/com/chatopera/cc/util/TempletLoader.java index 156ed8e2..0da8f047 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/TempletLoader.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/TempletLoader.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMClient.java b/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMClient.java index 6f869d67..63035696 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMClient.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMClient.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMReport.java b/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMReport.java index ba67e1fc..a05f096f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMReport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/WebIMReport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/WechatUtil.java b/contact-center/app/src/main/java/com/chatopera/cc/util/WechatUtil.java index 2c3a3996..2770945e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/WechatUtil.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/WechatUtil.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/WeiXinReport.java b/contact-center/app/src/main/java/com/chatopera/cc/util/WeiXinReport.java index 8b0bdc08..c87ad17c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/WeiXinReport.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/WeiXinReport.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/asr/AsrResult.java b/contact-center/app/src/main/java/com/chatopera/cc/util/asr/AsrResult.java index c3ae81a4..ca865a7e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/asr/AsrResult.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/asr/AsrResult.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/CubeReportData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/CubeReportData.java index 5b057fbf..16a51a6e 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/CubeReportData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/CubeReportData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/ReportData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/ReportData.java index 705556b5..82753dc2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/ReportData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/ReportData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/UKExcelUtil.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/UKExcelUtil.java index bd8f7b15..8eac4820 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/UKExcelUtil.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/UKExcelUtil.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/FirstTitle.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/FirstTitle.java index 150ff521..fb262789 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/FirstTitle.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/FirstTitle.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/Level.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/Level.java index c863fdec..5850b841 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/Level.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/Level.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/RequestData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/RequestData.java index e33022d8..a4433c71 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/RequestData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/RequestData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/ValueData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/ValueData.java index 73dfe6a4..7f076c37 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/ValueData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/bi/model/ValueData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAggsResult.java b/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAggsResult.java deleted file mode 100644 index e6f0b5fd..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAggsResult.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.util.callout; - -import com.chatopera.cc.exception.CalloutRecordException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.math.BigDecimal; -import java.math.BigInteger; - -public class CalloutHangupAggsResult { - private final static Logger logger = LoggerFactory.getLogger(CalloutHangupAggsResult.class); - private String dialplan; - private String datestr; - private int total; - private int fails; - private int duration; - - private CalloutHangupAggsResult() { - - } - - public CalloutHangupAggsResult(final String dialplan, // 呼叫计划 - final String datestr, // 目标日期 - final int total, // 总呼叫 - final int fails, // 失败通话 - final int duration) { // 总通话事件,秒 - this.dialplan = dialplan; - this.datestr = datestr; - this.total = total; - this.fails = fails; - this.duration = duration; - } - - public static CalloutHangupAggsResult cast(Object[] x) throws CalloutRecordException { - CalloutHangupAggsResult y = new CalloutHangupAggsResult(); - try { - y.setDialplan((String) x[0]); - y.setDatestr((String) x[1]); - y.setTotal(((BigInteger) x[2]).intValue()); - y.setFails(((BigInteger) x[3]).intValue()); - y.setDuration(((BigDecimal) x[4]).intValue()); - } catch (Exception e) { - logger.error("[callout agg] cast error", e); - throw new CalloutRecordException("[Ljava.lang.Object; cannot be cast to " + CalloutHangupAggsResult.class.getSimpleName()); - } - return y; - } - - public String getDialplan() { - return dialplan; - } - - public void setDialplan(String dialplan) { - this.dialplan = dialplan; - } - - public String getDatestr() { - return datestr; - } - - public void setDatestr(String datestr) { - this.datestr = datestr; - } - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public int getFails() { - return fails; - } - - public void setFails(int fails) { - this.fails = fails; - } - - public int getDuration() { - return duration; - } - - public void setDuration(int duration) { - this.duration = duration; - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAuditResult.java b/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAuditResult.java deleted file mode 100644 index b00de7e9..00000000 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/callout/CalloutHangupAuditResult.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (C) 2018 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.chatopera.cc.util.callout; - -import com.chatopera.cc.exception.CalloutRecordException; -import com.chatopera.cc.util.MathHelper; -import com.google.gson.JsonObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.math.BigDecimal; -import java.math.BigInteger; - -public class CalloutHangupAuditResult { - private final static Logger logger = LoggerFactory.getLogger(CalloutHangupAuditResult.class); - private final static String DIRECTION_ALL = "呼出和呼入"; - private String agentId; // 坐席ID - private String agentName; // 坐席名字 - private String direction; // 呼叫方向 ['呼入', '呼出'] - private int dialplan; // 自动呼叫个数 - private int total; // 总数 - private int seconds; // 总时长,单位:秒 - private int fails; // 失败数 - private int gt60; // 长于1分钟个数 - private int maxduration; // 最长通话时间,单位:秒 - private int avgduration; // 平均时长,单位:秒 - - private CalloutHangupAuditResult() { - - } - - public CalloutHangupAuditResult(String agentId, - String direction, - int dialplan, - int total, - int seconds, - int fails, - int gt60, - int maxduration) { - this.agentId = agentId; - this.direction = direction; - this.dialplan = dialplan; - this.total = total; - this.seconds = seconds; - this.fails = fails; - this.gt60 = gt60; - this.maxduration = maxduration; - - } - - public static CalloutHangupAuditResult cast(Object[] x) throws CalloutRecordException { - CalloutHangupAuditResult y = new CalloutHangupAuditResult(); - try { - y.setAgentId((String) x[0]); - y.setDirection((String) x[1]); - y.setDialplan(((BigInteger) x[2]).intValue()); - y.setTotal(((BigInteger) x[3]).intValue()); - y.setSeconds(((BigDecimal) x[4]).intValue()); - y.setFails(((BigInteger) x[5]).intValue()); - y.setGt60(((BigInteger) x[6]).intValue()); - y.setMaxduration((int) x[7]); - y.setAvgduration(((BigDecimal) x[8]).intValue()); - y.setAgentName((String) x[9]); - } catch (Exception e) { - logger.error("[callout audit] cast error ", e); - throw new CalloutRecordException("[Ljava.lang.Object; cannot be cast to " + CalloutHangupAuditResult.class.getSimpleName()); - } - return y; - } - - /** - * 合并同一个Agent的两个不同direction的数据 - */ - public static CalloutHangupAuditResult mix(final CalloutHangupAuditResult x, final CalloutHangupAuditResult y) throws CalloutRecordException { - if (x == null) - return y; - if (y == null) - return x; - if (x.getDirection() == y.getDirection()) - throw new CalloutRecordException("CalloutHangupAuditResult.mix 呼叫方向不能相同。"); - - if (!x.getAgentId().equals(y.getAgentId())) - throw new CalloutRecordException("CalloutHangupAuditResult.mix 坐席ID必须相同。"); - - CalloutHangupAuditResult z = new CalloutHangupAuditResult(); - z.setDirection(DIRECTION_ALL); - z.setAgentId(x.getAgentId()); - z.setAgentName(x.getAgentName()); - z.setMaxduration(x.getMaxduration() > y.getMaxduration() ? x.getMaxduration() : y.getMaxduration()); - z.setSeconds(x.getSeconds() + y.getSeconds()); - z.setGt60(x.getGt60() + y.getGt60()); - z.setTotal(x.getTotal() + y.getTotal()); - z.setFails(x.getFails() + y.getFails()); - z.setDialplan(x.getDialplan() + y.getDialplan()); - z.setAvgduration((int) ((x.getAvgduration() + y.getAvgduration()) / 2)); - return z; - } - - - public JsonObject toJson(boolean id, boolean name, boolean direction) { - JsonObject j = new JsonObject(); - - if (direction) - j.addProperty("direction", this.getDirection()); - - if (id) - j.addProperty("agentId", this.agentId); - - if (name) - j.addProperty("agentName", this.agentName); - - int succ = this.getTotal() - this.getFails(); - j.addProperty("total", this.getTotal()); - j.addProperty("answer", succ); - j.addProperty("rate", MathHelper.float_percentage_formatter(succ, this.getTotal())); - j.addProperty("dur", MathHelper.formatSeconds(this.getSeconds())); - j.addProperty("avg", MathHelper.formatSeconds(this.avgduration)); - j.addProperty("max", MathHelper.formatSeconds(this.getMaxduration())); - j.addProperty("gt60", this.getGt60()); - - return j; - } - - public String getAgentId() { - return agentId; - } - - public void setAgentId(String agentId) { - this.agentId = agentId; - } - - public String getDirection() { - return direction; - } - - public void setDirection(String direction) { - this.direction = direction; - } - - public int getDialplan() { - return dialplan; - } - - public void setDialplan(int dialplan) { - this.dialplan = dialplan; - } - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public int getSeconds() { - return seconds; - } - - public void setSeconds(int seconds) { - this.seconds = seconds; - } - - public int getFails() { - return fails; - } - - public void setFails(int fails) { - this.fails = fails; - } - - public int getGt60() { - return gt60; - } - - public void setGt60(int gt60) { - this.gt60 = gt60; - } - - public int getMaxduration() { - return maxduration; - } - - public void setMaxduration(int maxduration) { - this.maxduration = maxduration; - } - - public int getAvgduration() { - return avgduration; - } - - public void setAvgduration(int avgduration) { - this.avgduration = avgduration; - } - - public String getAgentName() { - return agentName; - } - - public void setAgentName(String agentName) { - this.agentName = agentName; - } -} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSData.java index 6f6ce95b..9c961e2a 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSDataEvent.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSDataEvent.java index 7bcae71a..6ab39db9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSDataEvent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DSDataEvent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DataProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DataProcess.java index d3bb289b..064975b1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DataProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/DataProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportProecess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportProecess.java index 0d8baa43..cfe36189 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportProecess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportProecess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportUtils.java index 4c6e23e8..7f919438 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/ExcelImportUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExcelExporterProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExcelExporterProcess.java index e7752013..eae2f5a6 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExcelExporterProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExcelExporterProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExportData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExportData.java index a51914d6..a7dcf020 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExportData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/export/ExportData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/ContactsProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/ContactsProcess.java index 07d22772..a0cf2b6c 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/ContactsProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/ContactsProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/EntCustomerProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/EntCustomerProcess.java index 7c1aa30c..6facf0ce 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/EntCustomerProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/EntCustomerProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/JPAProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/JPAProcess.java index f6513c52..22c290eb 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/JPAProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/JPAProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/QuickReplyProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/QuickReplyProcess.java index 006dbf21..5226e4a5 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/QuickReplyProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/QuickReplyProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/TopicProcess.java b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/TopicProcess.java index 40dc2d94..b173fd51 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/TopicProcess.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/dsdata/process/TopicProcess.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/es/ESTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/es/ESTools.java index 6518d214..624dc8e1 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/es/ESTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/es/ESTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/es/SearchTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/es/SearchTools.java index faa6a479..4f76a8a9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/es/SearchTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/es/SearchTools.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/es/UKDataBean.java b/contact-center/app/src/main/java/com/chatopera/cc/util/es/UKDataBean.java index bfb79a7e..9a0537c8 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/es/UKDataBean.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/es/UKDataBean.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/freeswitch/model/CallCenterAgent.java b/contact-center/app/src/main/java/com/chatopera/cc/util/freeswitch/model/CallCenterAgent.java index 88eca6e0..6fc4913f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/freeswitch/model/CallCenterAgent.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/freeswitch/model/CallCenterAgent.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/json/GsonTools.java b/contact-center/app/src/main/java/com/chatopera/cc/util/json/GsonTools.java index d7a62e36..073df911 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/json/GsonTools.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/json/GsonTools.java @@ -1,6 +1,6 @@ package com.chatopera.cc.util.json; /* - * Copyright (C) 2018 Chatopera Inc, + * Copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/Mail.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/Mail.java index 4452de9b..d38f7b6d 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/Mail.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/Mail.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailAuthenticator.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailAuthenticator.java index 0d49962f..1601475f 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailAuthenticator.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailAuthenticator.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailInfo.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailInfo.java index 3cf95a40..69f31512 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailInfo.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailInfo.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailSender.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailSender.java index 227cc628..d5f216dd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailSender.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mail/MailSender.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKColumnMetadata.java b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKColumnMetadata.java index dee0b6a2..b10a8fa7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKColumnMetadata.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKColumnMetadata.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKDatabaseMetadata.java b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKDatabaseMetadata.java index f53a3e92..95d63bdc 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKDatabaseMetadata.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKDatabaseMetadata.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKTableMetaData.java b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKTableMetaData.java index f981c24f..a82bdaf9 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKTableMetaData.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/metadata/UKTableMetaData.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileAddress.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileAddress.java index 497fdb6e..7f534b50 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileAddress.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileAddress.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileNumberUtils.java b/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileNumberUtils.java index a08a64eb..d4349061 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileNumberUtils.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/util/mobile/MobileNumberUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018 Chatopera Inc, + * Modifications copyright (C) 2018-2019 Chatopera Inc, * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/contact-center/app/src/main/resources/application.properties b/contact-center/app/src/main/resources/application.properties index cac9a5e4..3cf5decc 100644 --- a/contact-center/app/src/main/resources/application.properties +++ b/contact-center/app/src/main/resources/application.properties @@ -26,26 +26,14 @@ application.env=production ############################################## # cookie加密 application.security.password=cskefu -server.servlet.session.cookie.secure=true + # security management.security.enabled=false server.session-timeout=86400 +server.threads.max=2000 +server.connection.max=2000 -############################################## -# 模块化设置 -############################################## -# 联系人 -cskefu.module.contacts=true -# 聊天机器人 -cskefu.module.chatbot=true -# 外呼 -cskefu.module.callout=false -# 会话监控 -cskefu.module.cca=false -# 企业聊天 -cskefu.module.entim=false - ############################################## # 服务端口 ############################################## @@ -79,13 +67,6 @@ server.log.path=../logs server.log.level=INFO web.upload-path=../data -############################################## -# 分布式存储 -############################################## -storage.minio.url=http://192.168.2.217:9000 -storage.minio.access_key=M19Q8YJ8FzLyQtST7r0 -storage.minio.secret_key=KHv6qjddHD4HfR1m7fjY7HglSO1WOSzIeTERRUUc - ############################################## # FREEMARKER (FreeMarkerAutoConfiguration) ############################################## diff --git a/contact-center/app/src/main/resources/banner.txt b/contact-center/app/src/main/resources/banner.txt index 2d8ab398..842005b7 100644 --- a/contact-center/app/src/main/resources/banner.txt +++ b/contact-center/app/src/main/resources/banner.txt @@ -6,7 +6,7 @@ \____\___/|_| |_|\__\__,_|\___|\__| \____\___|_| |_|\__\___|_| ==================== Powered by Chatopera Inc. ================= -春松客服: 全渠道智能客服 v${git.build.version} build ${git.commit.id.abbrev} +春松客服: 多渠道智能客服 v${git.build.version} build ${git.commit.id.abbrev} 版权所有 © 北京华夏春松科技有限公司️ https://www.chatopera.com/ 商业许可授权联系 info@chatopera.com ---------------------------------------------------------------- \ No newline at end of file diff --git a/contact-center/app/src/main/resources/static/js/CSKeFu_IM.v1.js b/contact-center/app/src/main/resources/static/js/CSKeFu_IM.v1.js index 50938df4..546fbdeb 100644 --- a/contact-center/app/src/main/resources/static/js/CSKeFu_IM.v1.js +++ b/contact-center/app/src/main/resources/static/js/CSKeFu_IM.v1.js @@ -19,55 +19,60 @@ $(document).ready(function(){ }).on('task', function(data) { }).on('new', function(data) { - // if($('#multiMediaDialogWin').length > 0 && multiMediaDialogWin.$ &&multiMediaDialogWin.$('#agentusers').length > 0){ - // multiMediaDialogWin.Proxy.newAgentUserService(data); - // }else{ - // //来电弹屏 - // $('#agentdesktop').attr('data-href' , '/agent/index.html?userid='+data.userid).click(); - // } - $('#agentdesktop').attr('data-href' , '/agent/index.html?userid='+data.userid).click(); - WebIM.audioplayer('audioplane', newuser, false); // 播放 - }).on('status', function(data) { - if(orgi == data.orgi){ - $('#agents_status').html("服务中的人数:"+data.users+"人,当前排队人数:"+data.inquene+"人,在线坐席数:"+data.agents+"人,坐席忙:"+data.busy+"人"); - } - }).on('message', function(data) { - console.log("receive message: ", data); - if($('#multiMediaDialogWin').length > 0 && multiMediaDialogWin != null && multiMediaDialogWin.$ && multiMediaDialogWin.$('#agentusers').length > 0){ - multiMediaDialogWin.Proxy.newAgentUserMessage(data); - if(data.type == 'message'){ - WebIM.audioplayer('audioplane', newmessage, false); // 播放 - } + if($('#multiMediaDialogWin').length > 0 && multiMediaDialogWin != null && multiMediaDialogWin.$ &&multiMediaDialogWin.$('#agentusers').length > 0){ + multiMediaDialogWin.Proxy.newAgentUserService(data,"agent"); }else{ //来电弹屏 - $('#agentdesktop').attr('data-href' , '/agent/index.html?userid='+data.userid).click(); - } - }).on('workorder', function(data) { - - }).on('audit_message', function(data){ - // 会话监控:消息 - if($('#customerChatAudit').length > 0 && customerChatAudit != null && customerChatAudit.$ && customerChatAudit.$('#agentusers').length > 0){ - customerChatAudit.Proxy.newAgentUserMessagecca(data); + $('#agentdesktop').attr('data-href' , '/agent/index.html?userid='+data.userid).click(); + WebIM.audioplayer('audioplane', newuser, false); // 播放 + } + }).on('status', function(data) { + if(orgi == data.orgi){ + $('#agents_status').html("服务中的人数:"+data.users+"人,当前排队人数:"+data.inquene+"人,在线坐席数:"+data.agents+"人,坐席忙:"+data.busy+"人"); + } + }).on('message', function(data) { + if($('#multiMediaDialogWin').length > 0 && multiMediaDialogWin != null && multiMediaDialogWin.$ && multiMediaDialogWin.$('#agentusers').length > 0){ + multiMediaDialogWin.Proxy.newAgentUserMessage(data,"agent"); if(data.type == 'message'){ WebIM.audioplayer('audioplane', newmessage, false); // 播放 } }else{ //来电弹屏 - $('#customerchatsaudit').click(); + $('#agentdesktop').attr('data-href' , '/agent/index.html?userid='+data.userid).click(); + } + }).on('workorder', function(data) { + + }).on('transout', function(data){ + // TODO 坐席会话被转接出去 + if($('#multiMediaDialogWin').length > 0){ + if(multiMediaDialogWin.document.getElementById('agentusers') != null){ + multiMediaDialogWin.Proxy.transoutAgentUserService(data); + } + } + layer.msg("您与"+data.username+"的会话已被转接给"+data.agentname,{time:1500}) + + }).on('audit_message', function(data){ + // 会话监控:消息 + if($('#customerChatAudit').length > 0 && customerChatAudit != null && customerChatAudit.$ && customerChatAudit.$('#agentuserscca').length > 0){ + customerChatAudit.Proxy.newAgentUserMessage(data,"cca"); + if(data.type == 'message'){ + WebIM.audioplayer('audioplane', newmessage, false); // 播放 + } } }).on('audit_new', function(data){ // 会话监控:新建 - $('#customerchatsaudit').click(); - WebIM.audioplayer('audioplane', newuser, false); // 播放 + if($('#customerChatAudit').length > 0 && customerChatAudit != null && customerChatAudit.$ && customerChatAudit.$('#agentuserscca').length > 0){ + customerChatAudit.Proxy.newAgentUserService(data,"cca"); + if(data.type == 'message'){ + WebIM.audioplayer('audioplane', newmessage, false); // 播放 + } + } }).on('audit_end', function(data){ // 会话监控:结束 if($('#customerChatAudit').length > 0){ - if(customerChatAudit.document.getElementById('agentusers') != null){ + if(customerChatAudit.document.getElementById('agentuserscca') != null){ customerChatAudit.Proxy.endAgentUserService(data); } - }else{ - //来电弹屏 - $('#customerchatsaudit').click(); } }).on('end', function(data) { if($('#multiMediaDialogWin').length > 0){ @@ -79,7 +84,6 @@ $(document).ready(function(){ $('#agentdesktop').attr('data-href', '/agent/index.html?userid='+data.userid).click(); } }).on('leave', function(data){ - console.log("[leave]", data); // 执行登出 window.location.href = "/logout.html?code=2"; }); diff --git a/contact-center/app/src/main/resources/static/js/CSKeFu_Rest_Request.v1.js b/contact-center/app/src/main/resources/static/js/CSKeFu_Rest_Request.v1.js index 9b0136f3..589b9eb7 100644 --- a/contact-center/app/src/main/resources/static/js/CSKeFu_Rest_Request.v1.js +++ b/contact-center/app/src/main/resources/static/js/CSKeFu_Rest_Request.v1.js @@ -28,7 +28,6 @@ function restApiRequest(opts) { authorization: getCookie('authorization').trim() }; payload.dataType = 'json'; - payload.data = JSON.stringify(opts.data); var popup = null; diff --git a/contact-center/app/src/main/resources/static/js/cskefu.js b/contact-center/app/src/main/resources/static/js/cskefu.js index 78dea32c..8ecd1ff5 100644 --- a/contact-center/app/src/main/resources/static/js/cskefu.js +++ b/contact-center/app/src/main/resources/static/js/cskefu.js @@ -292,8 +292,7 @@ function formatDate(value) { } var Proxy = { - newAgentUserService:function(data){ - console.log("newAgentUserService data", data); + newAgentUserService:function(data,type){ if($('#tip_message_'+data.userid).length >0){ if(data.channel){ var channel = data.channel; @@ -313,18 +312,17 @@ var Proxy = { }else{ if($('.chat-list-item.active').length > 0){ var id = $('.chat-list-item.active').data('id') ; - loadURL('/agent/agentusers.html?newuser=true&userid='+id , '#agentusers'); + type == "agent" ? loadURL('/agent/agentusers.html?newuser=true&userid='+id , '#agentusers') : loadURL('/apps/cca/agentusers.html?newuser=true&userid='+id , '#agentuserscca'); }else{ - location.href = "/agent/index.html?newuser=true" ; + type == "agent" ? location.href = "/agent/index.html?newuser=true" : location.href = "/apps/cca/index.html?newuser=true"; } } if(data.userid == cursession){ $('#agentuser-curstatus').remove(); - $("#chat_msg_list").append(template($('#begin_tpl').html(), {data: data})); + type == "agent" ? $("#chat_msg_list").append(template($('#begin_tpl').html(), {data: data})) : $("#chat_msg_list_cca").append(template($('#begin_tpl').html(), {data: data})); } }, - - newAgentUserMessage:function(data){ + newAgentUserMessage:function(data,type){ if(data.usession == cursession){ if(data.type == 'writing' && $('#writing').length > 0){ $('#writing').remove(); @@ -353,58 +351,21 @@ var Proxy = { } }); }); - $("#chat_msg_list").append(nodeMeassage); - document.getElementById('chat_msg_list').scrollTop = document.getElementById('chat_msg_list').scrollHeight ; + type == "agent" ? $("#chat_msg_list").append(nodeMeassage) : $("#chat_msg_list_cca").append(nodeMeassage); + type == "agent" ? + document.getElementById('chat_msg_list').scrollTop = document.getElementById('chat_msg_list').scrollHeight + : document.getElementById('chat_msg_list_cca').scrollTop = document.getElementById('chat_msg_list_cca').scrollHeight; } loadURL("/agent/readmsg.html?userid="+data.agentuser); //更新数据状态,将当前对话的新消息数量清空 }else{ if(data.type == 'message'){ $('#last_msg_'+data.userid).text(data.tokenum).show(); - Proxy.addTopMsgTip(1) ; + if(type == "agent"){ + Proxy.addTopMsgTip(1) ; + } } } }, - newAgentUserMessagecca:function(data){ - if(data.usession == cursession) { - if (data.type == 'writing' && $('#writing').length > 0) { - $('#writing').remove(); - } - var id = $('.chat-list-item.active').data('id'); - if (data.message != "") { - data.createtime = formatDate(data.createtime); - var newlist = template($('#message_tpl').html(), {data: data}) - var nodeMeassage = $(newlist); - nodeMeassage.find(".iconclick").click(function () { - console.log("点击标注") - if ($(this).attr('name') == 'nolabe') { - $(this).html('') - $(this).css('color', '#46cad4') - $(this).attr('name', 'yeslabe') - } else { - $(this).html('စ') - $(this).css('color', '#aaaaaa') - $(this).attr('name', 'nolabe') - } - $.ajax({ - url: '/agent/agentuserLabel.html', - data: {'iconid': $(this).attr('id')}, - type: "get", - success: function () { - } - }); - }); - $("#chat_msg_list_cca").append(nodeMeassage); - document.getElementById('chat_msg_list_cca').scrollTop = document.getElementById('chat_msg_list_cca').scrollHeight; - } - loadURL("/agent/readmsg.html?userid=" + data.agentuser); //更新数据状态,将当前对话的新消息数量清空 - }else{ - if(data.type == 'message'){ - $('#last_msg_'+data.userid).text(data.tokenum).show(); - Proxy.addTopMsgTip(1) ; - } - } - }, - endAgentUserService:function(data){ if($('#tip_message_'+data.userid).length >0){ if(data.channel){ @@ -428,6 +389,14 @@ var Proxy = { $("#chat_msg_list").append(template($('#end_tpl').html(), {data: data})); } }, + transoutAgentUserService:function(data){ + if($("#chat_users li").length>1){ + $('#agentuser_' + data.userid).remove(); + $("#chat_users li:first-child a").click(); + }else{ + parent.$('#agentdesktop').click(); + } + }, tipMsgForm : function(href){ top.layer.prompt({formType: 2,title: '请输入拉黑原因',area: ['300px', '50px']} , function(value, index, elem){ location.href = href+"&description="+encodeURIComponent(value); diff --git a/contact-center/app/src/main/resources/static/js/UKeFu_Util.js b/contact-center/app/src/main/resources/static/js/utils.js similarity index 91% rename from contact-center/app/src/main/resources/static/js/UKeFu_Util.js rename to contact-center/app/src/main/resources/static/js/utils.js index bbd3ec78..445c477e 100644 --- a/contact-center/app/src/main/resources/static/js/UKeFu_Util.js +++ b/contact-center/app/src/main/resources/static/js/utils.js @@ -1,3 +1,18 @@ +/** + * JavaScript String Formatting + * https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format + * 'The {0} is dead. Don\'t code {0}. Code {1} that is open source!'.format('ASP', 'PHP'); + * @returns {String|string} + */ +String.prototype.format = function() { + var formatted = this; + for (var i = 0; i < arguments.length; i++) { + var regexp = new RegExp('\\{'+i+'\\}', 'gi'); + formatted = formatted.replace(regexp, arguments[i]); + } + return formatted; +}; + /* * MAP对象,实现MAP功能 * diff --git a/contact-center/app/src/main/resources/templates/admin/include/left.html b/contact-center/app/src/main/resources/templates/admin/include/left.html index d2bf32b5..8e0a8e74 100644 --- a/contact-center/app/src/main/resources/templates/admin/include/left.html +++ b/contact-center/app/src/main/resources/templates/admin/include/left.html @@ -30,7 +30,7 @@ - <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")>
class="layui-this"> 语音渠道
@@ -112,4 +112,4 @@ - \ No newline at end of file + diff --git a/contact-center/app/src/main/resources/templates/admin/user/add.html b/contact-center/app/src/main/resources/templates/admin/user/add.html index 03bbb4cc..96fa6000 100644 --- a/contact-center/app/src/main/resources/templates/admin/user/add.html +++ b/contact-center/app/src/main/resources/templates/admin/user/add.html @@ -47,7 +47,7 @@ - <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")>
@@ -122,4 +122,4 @@ layui.use('form', function(){ } }); }); - \ No newline at end of file + diff --git a/contact-center/app/src/main/resources/templates/admin/user/edit.html b/contact-center/app/src/main/resources/templates/admin/user/edit.html index 490e965b..8d4346f8 100644 --- a/contact-center/app/src/main/resources/templates/admin/user/edit.html +++ b/contact-center/app/src/main/resources/templates/admin/user/edit.html @@ -50,7 +50,7 @@
- <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")>
@@ -125,4 +125,4 @@ layui.use('form', function(){ } }); }); - \ No newline at end of file + diff --git a/contact-center/app/src/main/resources/templates/admin/user/index.html b/contact-center/app/src/main/resources/templates/admin/user/index.html index 51b1b2ee..8b4d4011 100644 --- a/contact-center/app/src/main/resources/templates/admin/user/index.html +++ b/contact-center/app/src/main/resources/templates/admin/user/index.html @@ -18,7 +18,7 @@ - <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")> @@ -33,7 +33,7 @@ 电子邮件 手机 多媒体 - <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")> 呼叫中心 管理员 @@ -62,7 +62,7 @@ - <#if models?seq_contains("sales")> + <#if models?seq_contains("callout")> <#if user.callcenter> @@ -133,4 +133,4 @@ } }); }); - \ No newline at end of file + diff --git a/contact-center/app/src/main/resources/templates/admin/webim/invote.html b/contact-center/app/src/main/resources/templates/admin/webim/invote.html index 1da73114..5e7900d3 100644 --- a/contact-center/app/src/main/resources/templates/admin/webim/invote.html +++ b/contact-center/app/src/main/resources/templates/admin/webim/invote.html @@ -148,7 +148,7 @@

延时弹出访客邀请框

-

默认演示:5秒

+

默认延时:5秒

- <#if skillGroups??> - <#list skillGroups as skill> - - + <#if skillGroups?? && skillGroups?size gt 0 > + <#list skillGroups as skill> + + + <#else> +
diff --git a/contact-center/app/src/main/resources/templates/apps/agent/agentusers.html b/contact-center/app/src/main/resources/templates/apps/agent/agentusers.html index 278f59ee..0732cb6c 100644 --- a/contact-center/app/src/main/resources/templates/apps/agent/agentusers.html +++ b/contact-center/app/src/main/resources/templates/apps/agent/agentusers.html @@ -32,7 +32,7 @@ <#if agentUserList??> <#list agentUserList as agentuser>
  • + id="agentuser_${agentuser.userid!''}" remove-id="${agentuser.id!''}" data-id="${agentuser.userid!''}"> <#if agentuser.status?? && agentuser.status == 'end'> diff --git a/contact-center/app/src/main/resources/templates/apps/agent/index.html b/contact-center/app/src/main/resources/templates/apps/agent/index.html index 2e8e117b..8d9e77c9 100644 --- a/contact-center/app/src/main/resources/templates/apps/agent/index.html +++ b/contact-center/app/src/main/resources/templates/apps/agent/index.html @@ -1,5 +1,7 @@ + + diff --git a/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser.html b/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser.html index 1f3613ab..df3ff705 100644 --- a/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser.html +++ b/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser.html @@ -11,7 +11,7 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura <#else> @@ -26,7 +26,13 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura <#if (chatmessage.islabel == true??)><#else>စ - <#if chatmessage?? && chatmessage.calltype?? && chatmessage.calltype == '呼出'>${curagentuser.agentname}<#else>${curagentuser.username!''} + + <#if chatmessage?? && chatmessage.calltype?? && chatmessage.calltype == '呼出'> + ${chatmessage.intervented?string(chatmessage.supervisorname,curagentuser.agentname)} + <#else> + ${curagentuser.username!''} + + ${chatmessage.createtime?string('yyyy-MM-dd HH:mm:ss')} <#if (chatmessage.islabel == true??)><#else>စ @@ -510,15 +516,11 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura }); function sendMessage(){ - var skypeid = window.location.search.split("=")[1]; - // alert(skypeid) editor.sync(); var count = editor.count("text"); if(count>0){ var message = document.getElementById('message').value; top.WebIM.sendMessage(message , '${user.id!''}' , "${curagentuser.appid!''}" , "${user.sessionid!''}" , "${orgi!''}" , "<#if curagentuser??>${curagentuser.userid!''}" , "${user.username!''}"); - - console.log( editor,count ) } editor.html(''); }; diff --git a/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser_callout.html b/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser_callout.html index 51e0df6c..85678a26 100644 --- a/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser_callout.html +++ b/contact-center/app/src/main/resources/templates/apps/agent/mainagentuser_callout.html @@ -63,7 +63,6 @@ word-break: break-all; } - + + +
    @@ -87,4 +90,74 @@ $(this).parent().find("input").prop("checked" , true); } }); + + /** + * 转接访客坐席 + * @param agentUserId + * @param targetAgentno + * @param agentUserServiceId + * @param memo + */ + function submitTransAgentUserOut(agentUserId, targetAgentno, agentUserServiceId, memo) { + console.log("[submitTransAgentUser] ", agentUserId, targetAgentno, agentUserServiceId, memo); + restApiRequest({ + silent: true, + path: 'agentuser', + data: { + ops: 'transout', + agentno: targetAgentno, + agentUserId: agentUserId, + agentServiceId: agentUserServiceId, + memo: memo + } + }).then(function(result){ + if(result.status){ + // Token过期 + handleRestApiFail(result.status); + } else if(result.rc === 0){ + // 转接成功 + top.layer.msg('转接已完成',{icon: 1, time: 1000}) + // 进行显示调整! + if(multiMediaDialogWin.$("#chat_users li").length>1){ + multiMediaDialogWin.$("li[remove-id="+agentUserId+"]").remove(); + multiMediaDialogWin.$("#chat_users li:first-child a").click(); + }else{ + $('#agentdesktop').click(); + } + } else if(result.rc === 1){ + top.layer.msg('不合法的请求参数',{icon: 2, offset: 'b', time: 3000}) + } else if(result.rc === 2){ + top.layer.msg('不合法的操作',{icon: 2, offset: 'b', time: 3000}) + } else if(result.rc === 3){ + top.layer.msg('您没有权限执行该操作',{icon: 2, offset: 'b', time: 3000}) + } else if(result.rc === 4){ + top.layer.msg('该访客会话不存在',{icon: 2, offset: 'b', time: 3000}) + } else if(result.rc === 5){ + top.layer.msg('参数不合法',{icon: 2, offset: 'b', time: 3000}) + } + }, function(error){ + console.log("error", error); + // 服务器异常 + top.layer.msg('服务器抽风,请稍后再试!', {icon: 2, offset: 'b', time: 3000}) + }) + } + + $(function(){ + $('#selfTransAgentUserForm').on('submit', function(e){ + e.preventDefault(); //prevent form from submitting + var data = $("#selfTransAgentUserForm :input").serializeArray(); + var params = {}; + for(var index = 0; index < data.length; index++){ + params[data[index]['name']] = data[index]["value"]; + } + // 验证数据的完整,以下为必填 + if(params["userid"] && params["agentuserid"] && params["agentserviceid"] && params["agentno"]){ + submitTransAgentUserOut(params["agentuserid"], params["agentno"], params["agentserviceid"], params["memo"]); + } else { + top.layer.msg('未选择合理的转接信息!',{icon: 2, offset: 'b', time: 3000}); + } + }); + }); + + diff --git a/contact-center/app/src/main/resources/templates/apps/business/callcenter/extention/detail.html b/contact-center/app/src/main/resources/templates/apps/business/callcenter/extention/detail.html index 556bfcbe..0314f9e3 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/callcenter/extention/detail.html +++ b/contact-center/app/src/main/resources/templates/apps/business/callcenter/extention/detail.html @@ -2,11 +2,11 @@ "id":"${extention.id!''}", "extention":"${extention.extention!''}", "hostid":"${extention.hostid!''}", - "callout":"<#if models?seq_contains("sales")>${extention.callout!''}", + "callout":"<#if models?seq_contains("callout")>${extention.callout!''}", "webrtc":"<#if extention.enablewebrtc?? && extention.enablewebrtc == true && pbxhost?? && pbxhost.enablewebrtc?? && pbxhost.enablewebrtc == true>true<#else>false", "webrtchost":"<#if pbxhost??>${pbxhost.webrtcaddress!''}", "webrtcport":"<#if pbxhost??>${pbxhost.webrtcport!''}", "webrtcssl":"<#if pbxhost?? && pbxhost.webrtcssl == true>true<#else>false", "orgi":"${extention.orgi!''}", "userid":"${user.id!''}" -} \ No newline at end of file +} diff --git a/contact-center/app/src/main/resources/templates/apps/business/contacts/index.html b/contact-center/app/src/main/resources/templates/apps/business/contacts/index.html index 74d1e07c..e084c502 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/contacts/index.html +++ b/contact-center/app/src/main/resources/templates/apps/business/contacts/index.html @@ -283,7 +283,7 @@ }); function unreachableDialogWinByContactid(id){ - layer.msg('该联系人正在被其它访客服务或没有可触达的联系方式!',{icon: 2, offset: 'b', time: 3000}) + layer.msg('该联系人正在被其它客服服务或没有可触达的联系方式!',{icon: 2, offset: 'b', time: 3000}) } function openDialogWinByContactid(id){ diff --git a/contact-center/app/src/main/resources/templates/apps/business/report/design/index.html b/contact-center/app/src/main/resources/templates/apps/business/report/design/index.html index af0e9e5d..1589a722 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/report/design/index.html +++ b/contact-center/app/src/main/resources/templates/apps/business/report/design/index.html @@ -33,7 +33,7 @@ - + diff --git a/contact-center/app/src/main/resources/templates/apps/business/report/design/modeldesign.html b/contact-center/app/src/main/resources/templates/apps/business/report/design/modeldesign.html index c3f70bef..6e7433d1 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/report/design/modeldesign.html +++ b/contact-center/app/src/main/resources/templates/apps/business/report/design/modeldesign.html @@ -33,7 +33,7 @@ - + diff --git a/contact-center/app/src/main/resources/templates/apps/business/report/view.html b/contact-center/app/src/main/resources/templates/apps/business/report/view.html index e5de8076..acce37c0 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/report/view.html +++ b/contact-center/app/src/main/resources/templates/apps/business/report/view.html @@ -17,19 +17,15 @@ - - - - + - diff --git a/contact-center/app/src/main/resources/templates/apps/business/view/index.html b/contact-center/app/src/main/resources/templates/apps/business/view/index.html index bdc7d684..c6604b52 100644 --- a/contact-center/app/src/main/resources/templates/apps/business/view/index.html +++ b/contact-center/app/src/main/resources/templates/apps/business/view/index.html @@ -29,7 +29,7 @@ - + diff --git a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/add.html b/contact-center/app/src/main/resources/templates/apps/callout/dialplan/add.html deleted file mode 100644 index 60c4d31f..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/add.html +++ /dev/null @@ -1,160 +0,0 @@ -
    - -
    - 基本信息设置 -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    -
    - - - - - - - - - -
    - -
    - -
    -
    -
    - -
    - -
    -
    - - - - - - - - - -
    - -
    - -
    -
    - - - - - - - - - - - - -
    - 电销号码设置 -
    -
    - -
    -
    - - 上传文件 -
    -
    - - 上传后缀为.xlsx文件 - - - - 下载模板 - -
    -
    -
    -
    - -
    - -
    - -
    - 已经存在的客户电话号码会被过滤 -
    -
    -
    -
    - - -
    -
    - -
    \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/archive.html b/contact-center/app/src/main/resources/templates/apps/callout/dialplan/archive.html deleted file mode 100644 index d4f5dd47..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/archive.html +++ /dev/null @@ -1,73 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    -
    -

    - 已经删除的呼叫任务列表 -

    -
    -
    - - - - - - - - - - - - - - - <#if vm?? && vm.content??> - <#list vm.content as dialplan> - - - - - - - - - - - - - -
    任务名称部门创建人状态执行次数目标客户总数创建时间操作
    ${dialplan.name}${dialplan.organ.name}${dialplan.creater.uname}<#if dialplan.status == '已停止'> 已删除 ${dialplan.executed}${dialplan.targetnum}${dialplan.createtime} - - - 监控 - -
    -
    -
    -
    -
    -
    - -
    diff --git a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/edit.html b/contact-center/app/src/main/resources/templates/apps/callout/dialplan/edit.html deleted file mode 100644 index 0b99840b..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/edit.html +++ /dev/null @@ -1,28 +0,0 @@ -
    -
    - -
    - 基本信息设置 -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/index.html b/contact-center/app/src/main/resources/templates/apps/callout/dialplan/index.html deleted file mode 100644 index 6d4c6d86..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/dialplan/index.html +++ /dev/null @@ -1,407 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - - - - - -
    -
    -
    -

    - 呼叫任务列表 - - - -

    -
    -
    - - - - - - - - - - - - - - - <#if vm?? && vm.content??> - <#list vm.content as dialplan> - - - - - - - - - - - - - -
    任务名称部门创建人状态执行次数目标客户总数创建时间操作
    ${dialplan.name}${dialplan.organ.name}${dialplan.creater.uname}${dialplan.status}${dialplan.executed}${dialplan.targetnum}${dialplan.createtime} - - - 开始 - - - - 停止 - - - - 监控 - - - - 编辑 - - - - 删除 - -
    -
    -
    -
    -
    -
    - -
    - diff --git a/contact-center/app/src/main/resources/templates/apps/callout/include/left.html b/contact-center/app/src/main/resources/templates/apps/callout/include/left.html deleted file mode 100644 index b9bc89fb..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/include/left.html +++ /dev/null @@ -1,88 +0,0 @@ - - -
      -
    • - 外呼系统 -
    • -
    • - 资源管理 -
      - <#if user?? && (user.roleAuthMap["A11_A01_A03"]?? || user.usertype == "0") > -
      class="layui-this"> - 坐席监控 -
      - - - - - - - - - - - - - - - - -
      -
    • -
    • - 拨号计划 -
      - <#if user?? && (user.roleAuthMap["A11_A02_A01"]?? || user.usertype == "0") > -
      class="layui-this"> - 任务列表 -
      - - <#if user?? && (user.roleAuthMap["A11_A02_A02"]?? || user.usertype == "0") > -
      class="layui-this"> - 已删除任务 -
      - -
      -
    • -
    • - 数据查询 -
      - <#if user?? && (user.roleAuthMap["A11_A03_A01"]?? || user.usertype == "0") > -
      class="layui-this"> - 坐席报表 -
      - - <#if user?? && (user.roleAuthMap["A11_A03_A02"]?? || user.usertype == "0") > -
      class="layui-this"> - 外呼日报 -
      - - - - - - - - - - - - <#if user?? && (user.roleAuthMap["A11_A03_A05"]?? || user.usertype == "0") > -
      class="layui-this"> - 通话记录 -
      - - - - - - - <#if user?? && (user.roleAuthMap["A11_A03_A07"]?? || user.usertype == "0") > - - - - -
      -
    • - -
    \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/index.html b/contact-center/app/src/main/resources/templates/apps/callout/index.html deleted file mode 100644 index 7ba05a09..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/index.html +++ /dev/null @@ -1,87 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    -
    -
    -
    -
    -

    - 业务概况 -

    -
    -
    -
    -
    - 营销任务 - 总数 -
    -
    - -
    - 正在进行 - - - 0 - - -
    -
    -
    -
    -
    -
    -
    - 电话呼出统计 - 正在呼出 -
    -
    - -
    - 今日已呼出 - - - 0 - - -
    -
    -
    -
    -
    -
    -
    - 短信发送统计 - 正在发送 -
    -
    - -
    - 今日已发送 - - - 0 - - -
    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/agent-monitor.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/agent-monitor.html deleted file mode 100644 index 0cc00913..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/agent-monitor.html +++ /dev/null @@ -1,321 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    -
    -

    - 坐席监控 -

    -
    -

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    -
    -

    -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    坐席状态电话操作
    SIP地址部门姓名坐席SIP呼叫号码呼叫类型开始时间呼叫时长监听
    暂无数据
    -
    -
    -
    -
    -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/agents.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/agents.html deleted file mode 100644 index a89e737c..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/agents.html +++ /dev/null @@ -1,311 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    -
    -

    - 坐席报表 -

    -
    -

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    -
    - - -
    -
    -
    -

    -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    排名坐席合计呼入统计呼出统计
    部门姓名总次数总接听接听率总长均长最长一分钟以上呼入次数接听次数接听率通话总长通话均长最长通话一分钟以上呼出次数接听次数接听率通话总长通话均长最长通话一分钟以上
    暂无数据
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/communicate.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/communicate.html deleted file mode 100644 index b4f79d14..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/communicate.html +++ /dev/null @@ -1,325 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    -
    -
    -
    -

    - 通话记录 -

    -
    -
    -

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    - - - - - - -
    - -
    - -
    -
    -
    - - -
    -
    -
    -

    -
    -
    - - - - - - - - - - - - - - - - - - -
    部门坐席时间被叫号码被叫归属地通话时长呼叫类型通话状态挂断原因录音
    -
    -
    -
    -
    -
    -
    - - - - - - - - diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/daily-summary.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/daily-summary.html deleted file mode 100644 index 7691d8b9..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/daily-summary.html +++ /dev/null @@ -1,197 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    -
    -
    -

    - 外呼日报 -

    -
    -
    -
    -

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    -
    -

    -
    -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    自动外呼0失败数0成功数0呼通率0%分钟数0
    手动外呼0失败数0成功数0呼通率0%分钟数0
    所有外呼0失败数0成功数0呼通率0%分钟数0
    -

    -
    -
    -
    - - - \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/dialplan.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/dialplan.html deleted file mode 100644 index 659b38b4..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/dialplan.html +++ /dev/null @@ -1,87 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    -
    -
    -
    -

    - 拨号计划记录列表 -

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <#if dialPlanList?? && dialPlanList.content??> - <#list dialPlanList.content as dp> - - - - - - - - - - - - - - - -
    编号经办人操作时间模块子项操作状态细节客户IPURL
    ${dp.id}${dp.operator.uname}${dp.createtime}${dp.module}${dp.subitem}${dp.operation}${dp.status}${dp.detail}${dp.ipaddr}:${dp.port}${dp.url}
    -
    -
    -
    -
    -
    -
    -
    -
    - - diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/recording.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/recording.html deleted file mode 100644 index b49f1e7d..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/recording.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    - 录音记录 -
    -
    diff --git a/contact-center/app/src/main/resources/templates/apps/callout/reports/system.html b/contact-center/app/src/main/resources/templates/apps/callout/reports/system.html deleted file mode 100644 index e3dfbaa6..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/reports/system.html +++ /dev/null @@ -1,272 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    -
    -
    -

    - 系统状态 -

    -
    -
    -
    -
    -
    - - - - - - -
    分 机 状 态
    - - - - - - - - - - - - - - - - - - - - - - - - -
    分机总数60离线数28注册数32离席数23
    空闲数18工作数1通话数1振铃数0
    -
    -
    -
    - -
    -
    -
    - - - - - - -
    外 呼 任 务
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    任务总数47完成数46暂停数1运行数0
    线程限制0线程活动0已呼数0失败数0
    呼通数0接听数0意向数0呼损数0
    -
    -
    -
    - -
    -
    -
    - - - - - - -
    本 日 呼 叫
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    呼叫总数111025呼叫失败数93177呼叫成功数17848呼通率16.08%
    手拨总数763手拨失败数138手拨成功数625呼通率81.91%
    回拨总数110262回拨失败数93039回拨成功数17223呼通率15.62%
    -
    -
    -
    - -
    -
    -
    - - - - -
    - - - - 在 7 后更新 脚本运行时间 1.344763 秒
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/contact-center/app/src/main/resources/templates/apps/callout/resources/agents.html b/contact-center/app/src/main/resources/templates/apps/callout/resources/agents.html deleted file mode 100644 index a073a729..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/resources/agents.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    - 我的坐席 -
    -
    - diff --git a/contact-center/app/src/main/resources/templates/apps/callout/resources/skillgroups.html b/contact-center/app/src/main/resources/templates/apps/callout/resources/skillgroups.html deleted file mode 100644 index 7f08b436..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/resources/skillgroups.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    - 技能组 -
    -
    - diff --git a/contact-center/app/src/main/resources/templates/apps/callout/resources/switchboard.html b/contact-center/app/src/main/resources/templates/apps/callout/resources/switchboard.html deleted file mode 100644 index d4bdda3c..00000000 --- a/contact-center/app/src/main/resources/templates/apps/callout/resources/switchboard.html +++ /dev/null @@ -1,13 +0,0 @@ -
    -
    - <#include "/apps/callout/include/left.html"> -
    -
    - -
    -
    - 我的总机 -
    -
    - - diff --git a/contact-center/app/src/main/resources/templates/apps/cca/agentusers.html b/contact-center/app/src/main/resources/templates/apps/cca/agentusers.html index c21fd9b7..bf4223e7 100644 --- a/contact-center/app/src/main/resources/templates/apps/cca/agentusers.html +++ b/contact-center/app/src/main/resources/templates/apps/cca/agentusers.html @@ -27,26 +27,29 @@ <#if agentUserList??> <#list agentUserList as agentuser>
  • + id="agentuser_${agentuser.userid!''}" remove-id="${agentuser.id!''}" data-id="${agentuser.userid!''}"> - - <#if agentuser.status?? && agentuser.status == 'end'> - <#if agentuser.channel?? && agentuser.channel == "weixin"> - - <#elseif agentuser.channel?? && agentuser.channel == "webim"> - - <#elseif agentuser.channel?? && agentuser.channel == "phone"> - - - <#else> - <#if agentuser.channel?? && agentuser.channel == "weixin"> - - <#elseif agentuser.channel?? && agentuser.channel == "webim"> - - <#elseif agentuser.channel?? && agentuser.channel == "phone"> - - - + <#if agentuser.status?? && agentuser.status == 'end'> + <#if agentuser.channel?? && agentuser.channel == "weixin"> + + <#elseif agentuser.channel?? && agentuser.channel == "webim"> + + <#elseif agentuser.channel?? && agentuser.channel == "skype"> + + <#elseif agentuser.channel?? && agentuser.channel == "phone"> + + + <#else> + <#if agentuser.channel?? && agentuser.channel == "weixin"> + + <#elseif agentuser.channel?? && agentuser.channel == "webim"> + + <#elseif agentuser.channel?? && agentuser.channel == "skype"> + + <#elseif agentuser.channel?? && agentuser.channel == "phone"> + + +
    rateleft<%}else{%>rateright<%}%>"> name="nolabe" style="cursor:pointer;font-size: 30px; color: #aaaaaa;">စ <% }else{%> name="nolabe" style="cursor:pointer;font-size: 30px; color: #aaaaaa;">စ - <%=data.username%> + <% if(data.intervented && data.supervisorname){%><%=data.supervisorname%><%}else{%><%=data.username%><%}%> <%=data.createtime%> name="nolabe" style="cursor:pointer;font-size: 30px; color: #aaaaaa;">စ <%}%> @@ -94,7 +94,7 @@ <#include "/apps/cca/searchbox.html">
    -
    +
    <#include "/apps/cca/agentusers.html"/>
    diff --git a/contact-center/app/src/main/resources/templates/apps/cca/mainagentuser.html b/contact-center/app/src/main/resources/templates/apps/cca/mainagentuser.html index 5f935c3d..6656cb3c 100644 --- a/contact-center/app/src/main/resources/templates/apps/cca/mainagentuser.html +++ b/contact-center/app/src/main/resources/templates/apps/cca/mainagentuser.html @@ -24,7 +24,12 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura <#if (chatmessage.islabel == true??)><#else>စ - <#if chatmessage?? && chatmessage.chatype?? && chatmessage.chatype == 'aireply' && inviteData?? && inviteData.ainame??>${inviteData.ainame!'小E'}<#else>${chatmessage.username!''} + + <#if chatmessage?? && chatmessage.calltype?? && chatmessage.calltype == '呼出'> + ${chatmessage.intervented?string(chatmessage.supervisorname,curagentuser.agentname)} + <#else> + ${curagentuser.username!''} + ${chatmessage.createtime?string('yyyy-MM-dd HH:mm:ss')} <#if (chatmessage.islabel == true??)><#else>စ @@ -71,7 +76,7 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura height:"160px", themeType : 'simple', width:"100%", - items:['undo', 'redo' , 'emoticons', 'image','insertfile'], + items:['emoticons', 'image','insertfile'], resizeType:0, uploadJson : "/agent/image/upload.html?id=${curagentuser.id!''}", allowFileManager : false, @@ -172,10 +177,12 @@ word-break: break-all;"><#if curagentuser??>${curagentuser.username!''}<#if cura
    - <#if curagentuser.channel?? && curagentuser.channel == "webim"> + <#if curagentuser.channel?? && curagentuser.channel == "webim"> <#include "/apps/agent/channel/webim.html"> <#elseif curagentuser.channel?? && curagentuser.channel == "weixin"> <#include "/apps/agent/channel/weixin.html"> + <#elseif curagentuser.channel?? && curagentuser.channel == "skype"> + <#include "/apps/agent/channel/skype.html"> <#if curagentuser.name??>