mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
Close #77 重组织核心类
This commit is contained in:
parent
d6444fcc1a
commit
eea1da55a5
@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chatopera.cc.util;
|
||||
package com.chatopera.cc.app;
|
||||
|
||||
import java.beans.BeanInfo;
|
||||
import java.beans.Introspector;
|
||||
@ -49,11 +49,11 @@ import java.util.regex.Pattern;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.*;
|
||||
import com.chatopera.cc.util.asr.AsrResult;
|
||||
import com.chatopera.cc.event.ChatbotEvent;
|
||||
import com.chatopera.cc.event.MultiUpdateEvent;
|
||||
import com.chatopera.cc.event.UserDataEvent;
|
||||
import com.chatopera.cc.disruptor.chatbot.ChatbotEvent;
|
||||
import com.chatopera.cc.disruptor.multiupdate.MultiUpdateEvent;
|
||||
import com.chatopera.cc.disruptor.user.UserDataEvent;
|
||||
import com.chatopera.cc.event.UserEvent;
|
||||
import com.chatopera.cc.util.mail.MailSender;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
@ -118,7 +118,7 @@ import io.netty.handler.codec.http.HttpHeaders;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
|
||||
|
||||
public class UKTools {
|
||||
public class MainUtils {
|
||||
private static MD5 md5 = new MD5();
|
||||
|
||||
public static SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") ;
|
||||
@ -275,10 +275,10 @@ public class UKTools {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked"})
|
||||
public static void chatbot(UserEvent event){
|
||||
Disruptor<ChatbotEvent> disruptor = (Disruptor<ChatbotEvent>) MainContext.getContext().getBean("chatbot") ;
|
||||
public static void chatbot(ChatbotEvent event){
|
||||
Disruptor<UserDataEvent> disruptor = (Disruptor<UserDataEvent>) MainContext.getContext().getBean("chatbot") ;
|
||||
long seq = disruptor.getRingBuffer().next();
|
||||
disruptor.getRingBuffer().get(seq).setEvent(event); ;
|
||||
disruptor.getRingBuffer().get(seq).setEvent(event);
|
||||
disruptor.getRingBuffer().publish(seq);
|
||||
}
|
||||
|
||||
@ -881,7 +881,7 @@ public class UKTools {
|
||||
if(!StringUtils.isBlank(confirm)){
|
||||
if(secretConfig!=null && secretConfig.size() > 0){
|
||||
Secret secret = secretConfig.get( 0) ;
|
||||
if(UKTools.md5(confirm).equals(secret.getPassword())){
|
||||
if(MainUtils.md5(confirm).equals(secret.getPassword())){
|
||||
execute = true ;
|
||||
}
|
||||
}
|
||||
@ -897,7 +897,7 @@ public class UKTools {
|
||||
//保存附件
|
||||
for(MultipartFile file : files){
|
||||
if(file.getSize() > 0){ //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = UKTools.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
String fileid = MainUtils.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if(!StringUtils.isBlank(fileid)){
|
||||
AttachmentFile attachmentFile = new AttachmentFile() ;
|
||||
attachmentFile.setCreater(user.getId());
|
||||
@ -1040,8 +1040,7 @@ public class UKTools {
|
||||
/**
|
||||
* 16进制字符串转换为字符串
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public static String string2HexString(String strPart) {
|
||||
StringBuffer hexString = new StringBuffer();
|
||||
@ -1055,8 +1054,7 @@ public class UKTools {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param templetid
|
||||
* @throws IOException
|
||||
* @throws IOException
|
||||
* @throws TemplateException
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@ -1086,7 +1084,7 @@ public class UKTools {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void sendMail(String email , String cc , String subject , String content ,List<String> filenames) throws Exception{
|
||||
SystemConfig config = UKTools.getSystemConfig() ;
|
||||
SystemConfig config = MainUtils.getSystemConfig() ;
|
||||
if(config!=null && config.isEnablemail() && config.getEmailid()!=null) {
|
||||
SystemMessage systemMessage = MainContext.getContext().getBean(SystemMessageRepository.class).findByIdAndOrgi(config.getEmailid(),config.getOrgi()) ;
|
||||
MailSender sender = new MailSender(systemMessage.getSmtpserver(),systemMessage.getMailfrom(),systemMessage.getSmtpuser(), decryption(systemMessage.getSmtppassword()),systemMessage.getSeclev(),systemMessage.getSslport());
|
||||
@ -1099,7 +1097,7 @@ public class UKTools {
|
||||
public static String encode(Object obj) {
|
||||
Base64 base64 = new Base64();
|
||||
try {
|
||||
return base64.encodeToString(UKTools.toBytes(obj)) ;
|
||||
return base64.encodeToString(MainUtils.toBytes(obj)) ;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1109,7 +1107,7 @@ public class UKTools {
|
||||
public static <T> T decode(String str,Class<T> clazz) {
|
||||
Base64 base64 = new Base64();
|
||||
try {
|
||||
return (T)UKTools.toObject(base64.decode(str)) ;
|
||||
return (T) MainUtils.toObject(base64.decode(str)) ;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1167,7 +1165,6 @@ public class UKTools {
|
||||
/***
|
||||
* 计算T+1
|
||||
* @param text
|
||||
* @param format
|
||||
* @return
|
||||
*/
|
||||
public static Object getDaysParam(String text){
|
||||
@ -1183,7 +1180,6 @@ public class UKTools {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param defaultParam
|
||||
* @param value
|
||||
* @return
|
||||
* @throws ParseException
|
||||
@ -1197,7 +1193,6 @@ public class UKTools {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param defaultParam
|
||||
* @param value
|
||||
* @return
|
||||
* @throws ParseException
|
||||
@ -1284,26 +1279,28 @@ public class UKTools {
|
||||
}
|
||||
return asrResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
* @param email
|
||||
* @param cc
|
||||
* @param subject
|
||||
* @param content
|
||||
* @throws Exception
|
||||
*/
|
||||
* 发送短信
|
||||
* @param phone
|
||||
* @param id
|
||||
* @param tpId
|
||||
* @param tplValuesMap
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean sendSms(String phone,String id ,String tpId, Map<String,Object> tplValuesMap) throws Exception{
|
||||
SystemConfig config = UKTools.getSystemConfig() ;
|
||||
SystemConfig config = MainUtils.getSystemConfig() ;
|
||||
if(config!=null) {
|
||||
SystemMessage systemMessage = MainContext.getContext().getBean(SystemMessageRepository.class).findByIdAndOrgi(id,config.getOrgi()) ;
|
||||
if(systemMessage==null) {
|
||||
return false;
|
||||
}
|
||||
Template tp = UKTools.getTemplate(tpId) ;
|
||||
Template tp = MainUtils.getTemplate(tpId) ;
|
||||
if(tp==null) {
|
||||
return false;
|
||||
}
|
||||
String params = UKTools.getTemplet(tp.getTemplettext(),tplValuesMap) ;
|
||||
String params = MainUtils.getTemplet(tp.getTemplettext(),tplValuesMap) ;
|
||||
|
||||
SysDic sysDic= UKeFuDic.getInstance().getDicItem(systemMessage.getSmstype());
|
||||
//阿里大于
|
||||
@ -1385,7 +1382,7 @@ public class UKTools {
|
||||
workSession.setSessionid(session);
|
||||
workSession.setOrgi(orgi);
|
||||
|
||||
workSession.setDatestr(UKTools.simpleDateFormat.format(new Date()));
|
||||
workSession.setDatestr(MainUtils.simpleDateFormat.format(new Date()));
|
||||
|
||||
return workSession ;
|
||||
}
|
@ -14,18 +14,18 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chatopera.cc.util;
|
||||
package com.chatopera.cc.app;
|
||||
|
||||
public class UKView {
|
||||
public class Viewport {
|
||||
private String page ;
|
||||
private String templet;
|
||||
|
||||
public UKView(String templet , String page){
|
||||
public Viewport(String templet , String page){
|
||||
this.templet = templet ;
|
||||
this.page = page ;
|
||||
}
|
||||
|
||||
public UKView(String page){
|
||||
public Viewport(String page){
|
||||
this.page = page ;
|
||||
}
|
||||
|
@ -19,8 +19,9 @@ package com.chatopera.cc.app.aop;
|
||||
import java.util.List;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.UKeFuList;
|
||||
import com.chatopera.cc.event.MultiUpdateEvent;
|
||||
import com.chatopera.cc.disruptor.multiupdate.MultiUpdateEvent;
|
||||
import com.chatopera.cc.app.service.hibernate.BaseService;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
@ -29,7 +30,6 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.model.ESBean;
|
||||
|
||||
@Aspect
|
||||
@ -62,10 +62,10 @@ public class SyncDatabaseExt {
|
||||
}else if(data instanceof List){
|
||||
List<Object> dataList = (List<Object>)data ;
|
||||
for(Object dbData : dataList){
|
||||
UKTools.multiupdate(new MultiUpdateEvent<Object>(dbData , dbDataRes, MainContext.MultiUpdateType.SAVE.toString()));
|
||||
MainUtils.multiupdate(new MultiUpdateEvent<Object>(dbData , dbDataRes, MainContext.MultiUpdateType.SAVE.toString()));
|
||||
}
|
||||
}else{
|
||||
UKTools.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.SAVE.toString()));
|
||||
MainUtils.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.SAVE.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -81,13 +81,13 @@ public class SyncDatabaseExt {
|
||||
if(data instanceof List){
|
||||
List<Object> dataList = (List<Object>)data ;
|
||||
for(Object dbData : dataList){
|
||||
UKTools.multiupdate(new MultiUpdateEvent<Object>(dbData , dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
MainUtils.multiupdate(new MultiUpdateEvent<Object>(dbData , dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
}
|
||||
}else{
|
||||
if(data instanceof ESBean){
|
||||
UKTools.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
MainUtils.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
}else{
|
||||
UKTools.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
MainUtils.multiupdate(new MultiUpdateEvent<Object>(data, dbDataRes, MainContext.MultiUpdateType.DELETE.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ import org.springframework.stereotype.Component;
|
||||
import com.lmax.disruptor.SleepingWaitStrategy;
|
||||
import com.lmax.disruptor.dsl.Disruptor;
|
||||
import com.lmax.disruptor.dsl.ProducerType;
|
||||
import com.chatopera.cc.event.UserDataEvent;
|
||||
import com.chatopera.cc.disruptor.UserDataEventFactory;
|
||||
import com.chatopera.cc.disruptor.UserEventHandler;
|
||||
import com.chatopera.cc.disruptor.user.UserDataEvent;
|
||||
import com.chatopera.cc.disruptor.user.UserDataEventFactory;
|
||||
import com.chatopera.cc.disruptor.user.UserEventHandler;
|
||||
|
||||
@Component
|
||||
public class DisruptorConfigure {
|
||||
|
@ -35,7 +35,7 @@ import com.corundumstudio.socketio.Configuration;
|
||||
import com.corundumstudio.socketio.HandshakeData;
|
||||
import com.corundumstudio.socketio.SocketIOServer;
|
||||
import com.corundumstudio.socketio.annotation.SpringAnnotationScanner;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.exception.UCKeFuExceptionListener;
|
||||
|
||||
@org.springframework.context.annotation.Configuration
|
||||
@ -88,7 +88,7 @@ public class IMServerConfiguration
|
||||
sslProperties.load(in);
|
||||
in.close();
|
||||
if(!StringUtils.isBlank(sslProperties.getProperty("key-store")) && !StringUtils.isBlank(sslProperties.getProperty("key-store-password"))){
|
||||
config.setKeyStorePassword(UKTools.decryption(sslProperties.getProperty("key-store-password")));
|
||||
config.setKeyStorePassword(MainUtils.decryption(sslProperties.getProperty("key-store-password")));
|
||||
InputStream stream = new FileInputStream(new File(path , "ssl/"+sslProperties.getProperty("key-store")));
|
||||
config.setKeyStore(stream);
|
||||
}
|
||||
|
@ -28,13 +28,13 @@ import com.chatopera.cc.app.service.repository.SystemConfigRepository;
|
||||
import com.chatopera.cc.app.service.repository.TablePropertiesRepository;
|
||||
import com.chatopera.cc.app.model.Generation;
|
||||
import com.chatopera.cc.app.model.SysDic;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.BlackListRepository;
|
||||
import com.chatopera.cc.app.model.BlackEntity;
|
||||
import com.chatopera.cc.app.model.SystemConfig;
|
||||
@ -91,9 +91,9 @@ public class StartedEventListener implements ApplicationListener<ContextRefreshe
|
||||
CacheHelper.getSystemCacheBean().setAtomicLong(MainContext.ModelType.WORKORDERS.toString(), generation.getStartinx());
|
||||
}
|
||||
|
||||
UKTools.initSystemArea();
|
||||
MainUtils.initSystemArea();
|
||||
|
||||
UKTools.initSystemSecField(event.getApplicationContext().getBean(TablePropertiesRepository.class));
|
||||
//UKTools.initAdv();//初始化广告位
|
||||
MainUtils.initSystemSecField(event.getApplicationContext().getBean(TablePropertiesRepository.class));
|
||||
//MainUtils.initAdv();//初始化广告位
|
||||
}
|
||||
}
|
@ -22,6 +22,7 @@ import java.io.IOException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.coyote.http11.Http11NioProtocol;
|
||||
@ -33,8 +34,6 @@ import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletCon
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Configuration
|
||||
public class WebServerConfiguration
|
||||
{
|
||||
@ -59,7 +58,7 @@ public class WebServerConfiguration
|
||||
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(UKTools.decryption(sslProperties.getProperty("key-store-password")));
|
||||
ssl.setKeyStorePassword(MainUtils.decryption(sslProperties.getProperty("key-store-password")));
|
||||
tomcatFactory.setSsl(ssl);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,8 @@ import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKView;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.Viewport;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.repository.TenantRepository;
|
||||
@ -46,7 +47,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.model.SystemConfig;
|
||||
|
||||
|
||||
@ -81,8 +81,8 @@ public class Handler {
|
||||
}
|
||||
if(user==null){
|
||||
user = new User();
|
||||
user.setId(UKTools.getContextID(request.getSession().getId())) ;
|
||||
user.setUsername(MainContext.GUEST_USER+"_"+UKTools.genIDByKey(user.getId())) ;
|
||||
user.setId(MainUtils.getContextID(request.getSession().getId())) ;
|
||||
user.setUsername(MainContext.GUEST_USER+"_"+ MainUtils.genIDByKey(user.getId())) ;
|
||||
user.setOrgi(MainContext.SYSTEM_ORGI);
|
||||
user.setSessionid(user.getId()) ;
|
||||
}
|
||||
@ -179,7 +179,7 @@ public class Handler {
|
||||
if(!StringUtils.isBlank(request.getParameter("callbegin"))) {
|
||||
try {
|
||||
|
||||
rangeQuery = QueryBuilders.rangeQuery("calltime").from(UKTools.dateFormate.parse(request.getParameter("callbegin")).getTime()) ;
|
||||
rangeQuery = QueryBuilders.rangeQuery("calltime").from(MainUtils.dateFormate.parse(request.getParameter("callbegin")).getTime()) ;
|
||||
} catch (ParseException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
@ -190,9 +190,9 @@ public class Handler {
|
||||
try {
|
||||
|
||||
if(rangeQuery == null) {
|
||||
rangeQuery = QueryBuilders.rangeQuery("calltime").to(UKTools.dateFormate.parse(request.getParameter("callend")).getTime()) ;
|
||||
rangeQuery = QueryBuilders.rangeQuery("calltime").to(MainUtils.dateFormate.parse(request.getParameter("callend")).getTime()) ;
|
||||
}else {
|
||||
rangeQuery.to(UKTools.dateFormate.parse(request.getParameter("callend")).getTime()) ;
|
||||
rangeQuery.to(MainUtils.dateFormate.parse(request.getParameter("callend")).getTime()) ;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
|
||||
@ -209,7 +209,7 @@ public class Handler {
|
||||
if(!StringUtils.isBlank(request.getParameter("apbegin"))) {
|
||||
try {
|
||||
|
||||
rangeQuery = QueryBuilders.rangeQuery("aptime").from(UKTools.dateFormate.parse(request.getParameter("apbegin")).getTime()) ;
|
||||
rangeQuery = QueryBuilders.rangeQuery("aptime").from(MainUtils.dateFormate.parse(request.getParameter("apbegin")).getTime()) ;
|
||||
} catch (ParseException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
@ -220,9 +220,9 @@ public class Handler {
|
||||
try {
|
||||
|
||||
if(rangeQuery == null) {
|
||||
rangeQuery = QueryBuilders.rangeQuery("aptime").to(UKTools.dateFormate.parse(request.getParameter("apend")).getTime()) ;
|
||||
rangeQuery = QueryBuilders.rangeQuery("aptime").to(MainUtils.dateFormate.parse(request.getParameter("apend")).getTime()) ;
|
||||
}else {
|
||||
rangeQuery.to(UKTools.dateFormate.parse(request.getParameter("apend")).getTime()) ;
|
||||
rangeQuery.to(MainUtils.dateFormate.parse(request.getParameter("apend")).getTime()) ;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
|
||||
@ -271,16 +271,16 @@ public class Handler {
|
||||
if(!StringUtils.isBlank(userid)){
|
||||
user.setId(userid) ;
|
||||
}else{
|
||||
user.setId(UKTools.getContextID(request.getSession().getId())) ;
|
||||
user.setId(MainUtils.getContextID(request.getSession().getId())) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(nickname)){
|
||||
user.setUsername(nickname);
|
||||
}else{
|
||||
user.setUsername(MainContext.GUEST_USER+"_"+UKTools.genIDByKey(user.getId())) ;
|
||||
user.setUsername(MainContext.GUEST_USER+"_"+ MainUtils.genIDByKey(user.getId())) ;
|
||||
}
|
||||
user.setSessionid(user.getId()) ;
|
||||
}else{
|
||||
user.setSessionid(UKTools.getContextID(request.getSession().getId())) ;
|
||||
user.setSessionid(MainUtils.getContextID(request.getSession().getId())) ;
|
||||
}
|
||||
return user ;
|
||||
}
|
||||
@ -296,16 +296,16 @@ public class Handler {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public UKView createAdminTempletResponse(String page) {
|
||||
return new UKView("/admin/include/tpl" , page);
|
||||
public Viewport createAdminTempletResponse(String page) {
|
||||
return new Viewport("/admin/include/tpl" , page);
|
||||
}
|
||||
/**
|
||||
* 创建系统监控的 模板页面
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public UKView createAppsTempletResponse(String page) {
|
||||
return new UKView("/apps/include/tpl" , page);
|
||||
public Viewport createAppsTempletResponse(String page) {
|
||||
return new Viewport("/apps/include/tpl" , page);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -313,12 +313,12 @@ public class Handler {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public UKView createEntIMTempletResponse(String page) {
|
||||
return new UKView("/apps/entim/include/tpl" , page);
|
||||
public Viewport createEntIMTempletResponse(String page) {
|
||||
return new Viewport("/apps/entim/include/tpl" , page);
|
||||
}
|
||||
|
||||
public UKView createRequestPageTempletResponse(String page) {
|
||||
return new UKView(page);
|
||||
public Viewport createRequestPageTempletResponse(String page) {
|
||||
return new Viewport(page);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -326,7 +326,7 @@ public class Handler {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public ModelAndView request(UKView data) {
|
||||
public ModelAndView request(Viewport data) {
|
||||
return new ModelAndView(data.getTemplet()!=null ? data.getTemplet(): data.getPage() , "data", data) ;
|
||||
}
|
||||
|
||||
@ -402,7 +402,7 @@ public class Handler {
|
||||
* @return
|
||||
*/
|
||||
public String getOrgiByTenantshare(HttpServletRequest request){
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if(systemConfig!=null&&systemConfig.isEnabletneant()&&systemConfig.isTenantshare()) {
|
||||
User user = this.getUser(request) ;
|
||||
return user.getOrgid();
|
||||
@ -415,7 +415,7 @@ public class Handler {
|
||||
* @return
|
||||
*/
|
||||
public boolean isTenantshare(){
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if(systemConfig!=null&&systemConfig.isEnabletneant()&&systemConfig.isTenantshare()) {
|
||||
return true;
|
||||
}
|
||||
@ -427,7 +427,7 @@ public class Handler {
|
||||
* @return
|
||||
*/
|
||||
public boolean isEnabletneant(){
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if(systemConfig!=null&&systemConfig.isEnabletneant()) {
|
||||
return true;
|
||||
}
|
||||
@ -438,7 +438,7 @@ public class Handler {
|
||||
* @return
|
||||
*/
|
||||
public boolean isTenantconsole(){
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if(systemConfig!=null&&systemConfig.isEnabletneant()&&systemConfig.isTenantconsole()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
package com.chatopera.cc.app.handler;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.model.*;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.repository.OrganRepository;
|
||||
@ -102,7 +102,7 @@ public class LoginController extends Handler {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (cookie != null && !StringUtils.isBlank(cookie.getName()) && !StringUtils.isBlank(cookie.getValue())) {
|
||||
if (cookie.getName().equals(MainContext.UKEFU_SYSTEM_COOKIES_FLAG)) {
|
||||
String flagid = UKTools.decryption(cookie.getValue());
|
||||
String flagid = MainUtils.decryption(cookie.getValue());
|
||||
if (!StringUtils.isBlank(flagid)) {
|
||||
User user = userRepository.findById(flagid);
|
||||
if (user != null) {
|
||||
@ -117,7 +117,7 @@ public class LoginController extends Handler {
|
||||
if (!StringUtils.isBlank(msg)) {
|
||||
view.addObject("msg", msg);
|
||||
}
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if (systemConfig != null && systemConfig.isEnableregorgi()) {
|
||||
view.addObject("show", true);
|
||||
}
|
||||
@ -133,15 +133,15 @@ public class LoginController extends Handler {
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/"));
|
||||
if (request.getSession(true).getAttribute(MainContext.USER_SESSION_NAME) == null) {
|
||||
if (user != null && user.getUsername() != null) {
|
||||
final User loginUser = userRepository.findByUsernameAndPasswordAndDatastatus(user.getUsername(), UKTools.md5(user.getPassword()), false);
|
||||
final User loginUser = userRepository.findByUsernameAndPasswordAndDatastatus(user.getUsername(), MainUtils.md5(user.getPassword()), false);
|
||||
if (loginUser != null && !StringUtils.isBlank(loginUser.getId())) {
|
||||
view = this.processLogin(request, response, view, loginUser, referer);
|
||||
if (!StringUtils.isBlank(sla) && sla.equals("1")) {
|
||||
Cookie flagid = new Cookie(MainContext.UKEFU_SYSTEM_COOKIES_FLAG, UKTools.encryption(loginUser.getId()));
|
||||
Cookie flagid = new Cookie(MainContext.UKEFU_SYSTEM_COOKIES_FLAG, MainUtils.encryption(loginUser.getId()));
|
||||
flagid.setMaxAge(7 * 24 * 60 * 60);
|
||||
response.addCookie(flagid);
|
||||
// add authorization code for rest api
|
||||
String auth = UKTools.getUUID();
|
||||
String auth = MainUtils.getUUID();
|
||||
CacheHelper.getApiUserCacheBean().put(auth, loginUser, MainContext.SYSTEM_ORGI);
|
||||
response.addCookie((new Cookie("authorization", auth)));
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class LoginController extends Handler {
|
||||
}
|
||||
}
|
||||
}
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if (systemConfig != null && systemConfig.isEnableregorgi()) {
|
||||
view.addObject("show", true);
|
||||
}
|
||||
@ -173,7 +173,7 @@ public class LoginController extends Handler {
|
||||
view = request(super.createRequestPageTempletResponse("redirect:/"));
|
||||
}
|
||||
//登录成功 判断是否进入多租户页面
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if (systemConfig != null && systemConfig.isEnabletneant() && systemConfig.isTenantconsole() && !loginUser.isSuperuser()) {
|
||||
view = request(super.createRequestPageTempletResponse("redirect:/apps/tenant/index"));
|
||||
}
|
||||
@ -265,7 +265,7 @@ public class LoginController extends Handler {
|
||||
user.setUname(user.getUsername());
|
||||
user.setUsertype("0");
|
||||
if (!StringUtils.isBlank(user.getPassword())) {
|
||||
user.setPassword(UKTools.md5(user.getPassword()));
|
||||
user.setPassword(MainUtils.md5(user.getPassword()));
|
||||
}
|
||||
user.setOrgi(super.getOrgiByTenantshare(request));
|
||||
/*if(!StringUtils.isBlank(super.getUser(request).getOrgid())) {
|
||||
|
@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
@ -40,7 +41,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -78,27 +78,27 @@ public class AdminController extends Handler{
|
||||
map.put("systemCaches", CacheHelper.getSystemCacheBean().getSize()) ;
|
||||
|
||||
map.put("agentReport", ServiceQuene.getAgentReport(super.getOrgi(request))) ;
|
||||
map.put("webIMReport", UKTools.getWebIMReport(userEventRes.findByOrgiAndCreatetimeRange(super.getOrgi(request), UKTools.getStartTime() , UKTools.getEndTime()))) ;
|
||||
map.put("webIMReport", MainUtils.getWebIMReport(userEventRes.findByOrgiAndCreatetimeRange(super.getOrgi(request), MainUtils.getStartTime() , MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("agents",getAgent(request).size()) ;
|
||||
|
||||
map.put("webIMInvite", UKTools.getWebIMInviteStatus(onlineUserRes.findByOrgiAndStatus(super.getOrgi(request), MainContext.OnlineUserOperatorStatus.ONLINE.toString()))) ;
|
||||
map.put("webIMInvite", MainUtils.getWebIMInviteStatus(onlineUserRes.findByOrgiAndStatus(super.getOrgi(request), MainContext.OnlineUserOperatorStatus.ONLINE.toString()))) ;
|
||||
|
||||
map.put("inviteResult", UKTools.getWebIMInviteResult(onlineUserRes.findByOrgiAndAgentnoAndCreatetimeRange(super.getOrgi(request), super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime()))) ;
|
||||
map.put("inviteResult", MainUtils.getWebIMInviteResult(onlineUserRes.findByOrgiAndAgentnoAndCreatetimeRange(super.getOrgi(request), super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("agentUserCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.INSERVICE.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentUserCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.INSERVICE.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
map.put("agentServicesCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentServicesCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
map.put("agentServicesAvg", onlineUserRes.countByAgentForAvagTime(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentServicesAvg", onlineUserRes.countByAgentForAvagTime(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
map.put("webInviteReport", UKTools.getWebIMInviteAgg(onlineUserRes.findByOrgiAndCreatetimeRange(super.getOrgi(request) , MainContext.ChannelTypeEnum.WEBIM.toString(),UKTools.getLast30Day(), UKTools.getEndTime()))) ;
|
||||
map.put("webInviteReport", MainUtils.getWebIMInviteAgg(onlineUserRes.findByOrgiAndCreatetimeRange(super.getOrgi(request) , MainContext.ChannelTypeEnum.WEBIM.toString(), MainUtils.getLast30Day(), MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("agentConsultReport", UKTools.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForAgent(super.getOrgi(request), UKTools.getLast30Day(), UKTools.getEndTime()))) ;
|
||||
map.put("agentConsultReport", MainUtils.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForAgent(super.getOrgi(request), MainUtils.getLast30Day(), MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("clentConsultReport", UKTools.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForClient(super.getOrgi(request), UKTools.getLast30Day(), UKTools.getEndTime() , MainContext.ChannelTypeEnum.WEBIM.toString()))) ;
|
||||
map.put("clentConsultReport", MainUtils.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForClient(super.getOrgi(request), MainUtils.getLast30Day(), MainUtils.getEndTime() , MainContext.ChannelTypeEnum.WEBIM.toString()))) ;
|
||||
|
||||
map.put("browserConsultReport", UKTools.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForBrowser(super.getOrgi(request), UKTools.getLast30Day(), UKTools.getEndTime(), MainContext.ChannelTypeEnum.WEBIM.toString()))) ;
|
||||
map.put("browserConsultReport", MainUtils.getWebIMDataAgg(onlineUserRes.findByOrgiAndCreatetimeRangeForBrowser(super.getOrgi(request), MainUtils.getLast30Day(), MainUtils.getEndTime(), MainContext.ChannelTypeEnum.WEBIM.toString()))) ;
|
||||
}
|
||||
private List<User> getAgent(HttpServletRequest request){
|
||||
//获取当前产品or租户坐席数
|
||||
@ -142,7 +142,7 @@ public class AdminController extends Handler{
|
||||
map.addAttribute("title", title) ;
|
||||
map.addAttribute("url", url) ;
|
||||
if(!StringUtils.isBlank(iconstr) && !StringUtils.isBlank(icontext)){
|
||||
map.addAttribute("iconstr", iconstr.replaceAll(icontext, "&#x"+UKTools.string2HexString(icontext)+";")) ;
|
||||
map.addAttribute("iconstr", iconstr.replaceAll(icontext, "&#x"+ MainUtils.string2HexString(icontext)+";")) ;
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("/admin/system/auth/event"));
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import java.util.Date;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@ -31,7 +32,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.AreaTypeRepository;
|
||||
import com.chatopera.cc.app.service.repository.SysDicRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -84,7 +84,7 @@ public class AreaController extends Handler{
|
||||
area.setCreatetime(new Date());
|
||||
area.setCreater(super.getUser(request).getId());
|
||||
areaRepository.save(area) ;
|
||||
UKTools.initSystemArea();
|
||||
MainUtils.initSystemArea();
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/admin/area/index.html"));
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class AreaController extends Handler{
|
||||
area.setOrgi(super.getOrgi(request));
|
||||
area.setCreater(areaType.getCreater());
|
||||
areaRepository.save(area) ;
|
||||
UKTools.initSystemArea();
|
||||
MainUtils.initSystemArea();
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/admin/area/index.html"));
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class AreaController extends Handler{
|
||||
AreaType areaType = areaRepository.findByIdAndOrgi(area.getId(), super.getOrgi(request)) ;
|
||||
if(areaType!=null){
|
||||
areaRepository.delete(areaType);
|
||||
UKTools.initSystemArea();
|
||||
MainUtils.initSystemArea();
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/admin/area/index.html"));
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.MediaRepository;
|
||||
import com.chatopera.cc.app.service.repository.PbxHostRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -79,7 +79,7 @@ public class CallCenterMediaController extends Handler{
|
||||
if(!StringUtils.isBlank(media.getName())){
|
||||
int count = mediaRes.countByNameAndOrgi(media.getName(), super.getOrgi(request)) ;
|
||||
if(count == 0){
|
||||
String fileName = "media/"+UKTools.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "media/"+ MainUtils.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
|
||||
media.setOrgi(super.getOrgi(request));
|
||||
media.setCreater(super.getUser(request).getId());
|
||||
@ -125,7 +125,7 @@ public class CallCenterMediaController extends Handler{
|
||||
wavFile.deleteOnExit();
|
||||
}
|
||||
|
||||
String fileName = "media/"+UKTools.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "media/"+ MainUtils.getUUID()+mediafile.getOriginalFilename().substring(mediafile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
oldMedia.setFilename(fileName);
|
||||
|
||||
if(mediafile!=null && mediafile.getOriginalFilename().lastIndexOf(".") > 0){
|
||||
|
@ -17,7 +17,7 @@ package com.chatopera.cc.app.handler.admin.channel;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
import com.chatopera.cc.app.service.repository.ConsultInviteRepository;
|
||||
import com.chatopera.cc.app.service.repository.SNSAccountRepository;
|
||||
@ -107,7 +107,7 @@ public class CalloutChannelController extends Handler {
|
||||
@Menu(type = "callout" , subtype = "delete")
|
||||
public ModelAndView delete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String confirm) {
|
||||
boolean execute = false ;
|
||||
if(execute = UKTools.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
if(execute = MainUtils.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
SNSAccount snsAccount = snsAccountRes.findByIdAndOrgi(id , super.getOrgi(request)) ;
|
||||
if(snsAccountRes!=null){
|
||||
snsAccountRes.delete(snsAccount);
|
||||
|
@ -19,7 +19,7 @@ package com.chatopera.cc.app.handler.admin.channel;
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Base62;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.ConsultInviteRepository;
|
||||
import com.chatopera.cc.app.service.repository.OrganRepository;
|
||||
import com.chatopera.cc.app.service.repository.SNSAccountRepository;
|
||||
@ -123,7 +123,7 @@ public class SNSAccountIMController extends Handler {
|
||||
@Menu(type = "weixin", subtype = "delete")
|
||||
public ModelAndView delete(ModelMap map, HttpServletRequest request, @Valid String id, @Valid String confirm) {
|
||||
boolean execute = false;
|
||||
if (execute = UKTools.secConfirm(secRes, super.getOrgi(request), confirm)) {
|
||||
if (execute = MainUtils.secConfirm(secRes, super.getOrgi(request), confirm)) {
|
||||
SNSAccount snsAccount = snsAccountRes.findByIdAndOrgi(id, super.getOrgi(request));
|
||||
if (snsAccountRes != null) {
|
||||
snsAccountRes.delete(snsAccount);
|
||||
|
@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.repository.SecretRepository;
|
||||
@ -50,7 +51,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.corundumstudio.socketio.SocketIOServer;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
import com.chatopera.cc.app.model.SystemConfig;
|
||||
import com.chatopera.cc.app.model.UKeFuDic;
|
||||
@ -135,7 +135,7 @@ public class SystemConfigController extends Handler{
|
||||
@Menu(type = "admin" , subtype = "stopimserver" , access = false , admin = true)
|
||||
public ModelAndView stopimserver(ModelMap map , HttpServletRequest request , @Valid String confirm) throws SQLException {
|
||||
boolean execute = false ;
|
||||
if(execute = UKTools.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
if(execute = MainUtils.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
server.stop();
|
||||
MainContext.setIMServerStatus(false);
|
||||
}
|
||||
@ -167,7 +167,7 @@ public class SystemConfigController extends Handler{
|
||||
@Menu(type = "admin" , subtype = "stop" , access = false , admin = true)
|
||||
public ModelAndView stop(ModelMap map , HttpServletRequest request , @Valid String confirm) throws SQLException {
|
||||
boolean execute = false ;
|
||||
if(execute = UKTools.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
if(execute = MainUtils.secConfirm(secRes, super.getOrgi(request), confirm)){
|
||||
server.stop();
|
||||
MainContext.setIMServerStatus(false);
|
||||
System.exit(0);
|
||||
@ -192,7 +192,7 @@ public class SystemConfigController extends Handler{
|
||||
config.setCreatetime(new Date());
|
||||
systemConfig = config ;
|
||||
}else{
|
||||
UKTools.copyProperties(config,systemConfig);
|
||||
MainUtils.copyProperties(config,systemConfig);
|
||||
}
|
||||
if(config.isEnablessl()){
|
||||
if(keyfile!=null && keyfile.getBytes()!=null && keyfile.getBytes().length > 0 && keyfile.getOriginalFilename()!=null && keyfile.getOriginalFilename().length() > 0){
|
||||
@ -204,7 +204,7 @@ public class SystemConfigController extends Handler{
|
||||
}
|
||||
Properties prop = new Properties();
|
||||
FileOutputStream oFile = new FileOutputStream(sslFilePath);//true表示追加打开
|
||||
prop.setProperty("key-store-password", UKTools.encryption(systemConfig.getJkspassword())) ;
|
||||
prop.setProperty("key-store-password", MainUtils.encryption(systemConfig.getJkspassword())) ;
|
||||
prop.setProperty("key-store",systemConfig.getJksfile()) ;
|
||||
prop.store(oFile , "SSL Properties File");
|
||||
oFile.close();
|
||||
@ -217,17 +217,17 @@ public class SystemConfigController extends Handler{
|
||||
}
|
||||
|
||||
if(loginlogo!=null && !StringUtils.isBlank(loginlogo.getOriginalFilename()) && loginlogo.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||
String logoFileName = "logo/"+UKTools.md5(loginlogo.getOriginalFilename())+loginlogo.getOriginalFilename().substring(loginlogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String logoFileName = "logo/"+ MainUtils.md5(loginlogo.getOriginalFilename())+loginlogo.getOriginalFilename().substring(loginlogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
FileUtils.writeByteArrayToFile(new File(path ,logoFileName), loginlogo.getBytes());
|
||||
systemConfig.setLoginlogo(logoFileName);
|
||||
}
|
||||
if(consolelogo!=null && !StringUtils.isBlank(consolelogo.getOriginalFilename()) && consolelogo.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||
String consoleLogoFileName = "logo/"+UKTools.md5(consolelogo.getOriginalFilename())+consolelogo.getOriginalFilename().substring(consolelogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String consoleLogoFileName = "logo/"+ MainUtils.md5(consolelogo.getOriginalFilename())+consolelogo.getOriginalFilename().substring(consolelogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
FileUtils.writeByteArrayToFile(new File(path ,consoleLogoFileName), consolelogo.getBytes());
|
||||
systemConfig.setConsolelogo(consoleLogoFileName);
|
||||
}
|
||||
if(favlogo!=null && !StringUtils.isBlank(favlogo.getOriginalFilename()) && consolelogo.getOriginalFilename().lastIndexOf(".") > 0) {
|
||||
String favLogoFileName = "logo/"+UKTools.md5(favlogo.getOriginalFilename())+favlogo.getOriginalFilename().substring(favlogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String favLogoFileName = "logo/"+ MainUtils.md5(favlogo.getOriginalFilename())+favlogo.getOriginalFilename().substring(favlogo.getOriginalFilename().lastIndexOf(".")) ;
|
||||
FileUtils.writeByteArrayToFile(new File(path ,favLogoFileName), favlogo.getBytes());
|
||||
systemConfig.setFavlogo(favLogoFileName);
|
||||
}
|
||||
@ -239,8 +239,8 @@ public class SystemConfigController extends Handler{
|
||||
if(secretConfig!=null && secretConfig.size() > 0){
|
||||
Secret tempSecret = secretConfig.get(0) ;
|
||||
String oldpass = request.getParameter("oldpass") ;
|
||||
if(!StringUtils.isBlank(oldpass) && UKTools.md5(oldpass).equals(tempSecret.getPassword())){
|
||||
tempSecret.setPassword(UKTools.md5(secret.getPassword()));
|
||||
if(!StringUtils.isBlank(oldpass) && MainUtils.md5(oldpass).equals(tempSecret.getPassword())){
|
||||
tempSecret.setPassword(MainUtils.md5(secret.getPassword()));
|
||||
msg = "1" ;
|
||||
tempSecret.setEnable(true);
|
||||
secRes.save(tempSecret) ;
|
||||
@ -251,7 +251,7 @@ public class SystemConfigController extends Handler{
|
||||
secret.setOrgi(super.getOrgi(request));
|
||||
secret.setCreater(super.getUser(request).getId());
|
||||
secret.setCreatetime(new Date());
|
||||
secret.setPassword(UKTools.md5(secret.getPassword()));
|
||||
secret.setPassword(MainUtils.md5(secret.getPassword()));
|
||||
secret.setEnable(true);
|
||||
msg = "1" ;
|
||||
secRes.save(secret) ;
|
||||
|
@ -37,7 +37,7 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/admin")
|
||||
@ -65,7 +65,7 @@ public class SystemMessageController extends Handler {
|
||||
email.setOrgi(super.getOrgi(request));
|
||||
email.setMsgtype(MainContext.SystemMessageType.EMAIL.toString());
|
||||
if(!StringUtils.isBlank(email.getSmtppassword())) {
|
||||
email.setSmtppassword(UKTools.encryption(email.getSmtppassword()));
|
||||
email.setSmtppassword(MainUtils.encryption(email.getSmtppassword()));
|
||||
}
|
||||
systemMessageRepository.save(email) ;
|
||||
return request(super.createRequestPageTempletResponse("redirect:/admin/email/index.html"));
|
||||
@ -87,7 +87,7 @@ public class SystemMessageController extends Handler {
|
||||
email.setOrgi(temp.getOrgi());
|
||||
email.setMsgtype(MainContext.SystemMessageType.EMAIL.toString());
|
||||
if(!StringUtils.isBlank(email.getSmtppassword())) {
|
||||
email.setSmtppassword(UKTools.encryption(email.getSmtppassword()));
|
||||
email.setSmtppassword(MainUtils.encryption(email.getSmtppassword()));
|
||||
}else {
|
||||
email.setSmtppassword(temp.getSmtppassword());
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class SystemMessageController extends Handler {
|
||||
sms.setOrgi(super.getOrgi(request));
|
||||
sms.setMsgtype(MainContext.SystemMessageType.SMS.toString());
|
||||
if(!StringUtils.isBlank(sms.getSmtppassword())) {
|
||||
sms.setSmtppassword(UKTools.encryption(sms.getSmtppassword()));
|
||||
sms.setSmtppassword(MainUtils.encryption(sms.getSmtppassword()));
|
||||
}
|
||||
systemMessageRepository.save(sms) ;
|
||||
return request(super.createRequestPageTempletResponse("redirect:/admin/sms/index.html"));
|
||||
@ -151,7 +151,7 @@ public class SystemMessageController extends Handler {
|
||||
sms.setOrgi(temp.getOrgi());
|
||||
sms.setMsgtype(MainContext.SystemMessageType.SMS.toString());
|
||||
if(!StringUtils.isBlank(sms.getSmtppassword())) {
|
||||
sms.setSmtppassword(UKTools.encryption(sms.getSmtppassword()));
|
||||
sms.setSmtppassword(MainUtils.encryption(sms.getSmtppassword()));
|
||||
}else {
|
||||
sms.setSmtppassword(temp.getSmtppassword());
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.UKeFuList;
|
||||
import com.chatopera.cc.app.service.repository.MetadataRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -222,7 +222,7 @@ public class MetadataController extends Handler{
|
||||
//当前记录没有被添加过,进行正常添加
|
||||
metaDataTable.setTablename(table);
|
||||
metaDataTable.setOrgi(user.getOrgi());
|
||||
metaDataTable.setId(UKTools.md5(metaDataTable.getTablename()));
|
||||
metaDataTable.setId(MainUtils.md5(metaDataTable.getTablename()));
|
||||
metaDataTable.setTabledirid("0");
|
||||
metaDataTable.setCreater(user.getId());
|
||||
metaDataTable.setCreatername(user.getUsername());
|
||||
|
@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.repository.SysDicRepository;
|
||||
import com.chatopera.cc.app.service.repository.TemplateRepository;
|
||||
@ -67,7 +67,7 @@ public class TemplateController extends Handler{
|
||||
public void expall(ModelMap map , HttpServletRequest request , HttpServletResponse response) throws Exception {
|
||||
List<Template> templateList = templateRes.findByOrgi(super.getOrgi(request)) ;
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Template-Export-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".data");
|
||||
response.getOutputStream().write(UKTools.toBytes(templateList));
|
||||
response.getOutputStream().write(MainUtils.toBytes(templateList));
|
||||
return ;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class TemplateController extends Handler{
|
||||
@Menu(type = "admin" , subtype = "template" , access = false , admin = true)
|
||||
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "dataFile", required = false) MultipartFile dataFile) throws Exception {
|
||||
if(dataFile!=null && dataFile.getSize() > 0){
|
||||
List<Template> templateList = (List<Template>) UKTools.toObject(dataFile.getBytes()) ;
|
||||
List<Template> templateList = (List<Template>) MainUtils.toObject(dataFile.getBytes()) ;
|
||||
if(templateList!=null && templateList.size() >0){
|
||||
templateRes.deleteInBatch(templateList);
|
||||
for(Template template : templateList){
|
||||
|
@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
import com.chatopera.cc.util.OnlineUserUtils;
|
||||
@ -103,7 +103,7 @@ public class UsersController extends Handler{
|
||||
user.setUsertype(null);
|
||||
}
|
||||
if(!StringUtils.isBlank(user.getPassword())){
|
||||
user.setPassword(UKTools.md5(user.getPassword()));
|
||||
user.setPassword(MainUtils.md5(user.getPassword()));
|
||||
}
|
||||
|
||||
user.setOrgi(super.getOrgiByTenantshare(request));
|
||||
@ -184,7 +184,7 @@ public class UsersController extends Handler{
|
||||
|
||||
tempUser.setCallcenter(user.isCallcenter());
|
||||
if(!StringUtils.isBlank(user.getPassword())){
|
||||
tempUser.setPassword(UKTools.md5(user.getPassword()));
|
||||
tempUser.setPassword(MainUtils.md5(user.getPassword()));
|
||||
}
|
||||
|
||||
if(request.getParameter("admin")!=null){
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.handler.api;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.repository.UserRoleRepository;
|
||||
@ -42,7 +43,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
|
||||
@ -61,7 +61,7 @@ public class ApiLoginController extends Handler{
|
||||
@Menu(type = "apps" , subtype = "token" , access = true)
|
||||
@ApiOperation("登录服务,传入登录账号和密码")
|
||||
public ResponseEntity login(HttpServletRequest request , HttpServletResponse response , @Valid String username, @Valid String password) {
|
||||
User loginUser = userRepository.findByUsernameAndPassword(username , UKTools.md5(password)) ;
|
||||
User loginUser = userRepository.findByUsernameAndPassword(username , MainUtils.md5(password)) ;
|
||||
ResponseEntity entity = null ;
|
||||
if(loginUser!=null && !StringUtils.isBlank(loginUser.getId())){
|
||||
loginUser.setLogin(true);
|
||||
@ -75,7 +75,7 @@ public class ApiLoginController extends Handler{
|
||||
if(!StringUtils.isBlank(loginUser.getId())){
|
||||
userRepository.save(loginUser) ;
|
||||
}
|
||||
String auth = UKTools.getUUID();
|
||||
String auth = MainUtils.getUUID();
|
||||
CacheHelper.getApiUserCacheBean().put(auth, loginUser, MainContext.SYSTEM_ORGI);
|
||||
entity = new ResponseEntity<>(auth, HttpStatus.OK) ;
|
||||
response.addCookie(new Cookie("authorization",auth));
|
||||
|
@ -16,7 +16,7 @@
|
||||
package com.chatopera.cc.app.handler.api.rest;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.exception.CallOutRecordException;
|
||||
import com.chatopera.cc.app.model.*;
|
||||
import com.chatopera.cc.app.service.repository.*;
|
||||
@ -526,7 +526,7 @@ public class ApiChatbotController extends Handler {
|
||||
if (result.getInt("rc") == 0) {
|
||||
// 创建成功
|
||||
Chatbot c = new Chatbot();
|
||||
c.setId(UKTools.getUUID());
|
||||
c.setId(MainUtils.getUUID());
|
||||
c.setBaseUrl(capi.getBaseUrl());
|
||||
c.setChatbotID(chatbotID);
|
||||
c.setDescription(description);
|
||||
|
@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
import com.chatopera.cc.util.RestResultType;
|
||||
|
||||
@ -83,7 +83,7 @@ public class ApiUserController extends Handler {
|
||||
public ResponseEntity<RestResult> put(HttpServletRequest request , @Valid User user) {
|
||||
if(user != null && !StringUtils.isBlank(user.getUsername())){
|
||||
if(!StringUtils.isBlank(user.getPassword())){
|
||||
user.setPassword(UKTools.md5(user.getPassword()));
|
||||
user.setPassword(MainUtils.md5(user.getPassword()));
|
||||
userRepository.save(user) ;
|
||||
}else if(!StringUtils.isBlank(user.getId())){
|
||||
User old = userRepository.findByIdAndOrgi(user.getId(), super.getOrgi(request)) ;
|
||||
|
@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
@ -40,7 +41,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.InviteRecordRepository;
|
||||
import com.chatopera.cc.app.service.repository.OnlineUserRepository;
|
||||
import com.chatopera.cc.app.service.repository.OrgiSkillRelRepository;
|
||||
@ -107,19 +107,19 @@ public class AppsController extends Handler {
|
||||
|
||||
private void aggValues(ModelMap map , HttpServletRequest request){
|
||||
map.put("agentReport", ServiceQuene.getAgentReport(super.getOrgi(request))) ;
|
||||
map.put("webIMReport", UKTools.getWebIMReport(userEventRes.findByOrgiAndCreatetimeRange(super.getOrgi(request), UKTools.getStartTime() , UKTools.getEndTime()))) ;
|
||||
map.put("webIMReport", MainUtils.getWebIMReport(userEventRes.findByOrgiAndCreatetimeRange(super.getOrgi(request), MainUtils.getStartTime() , MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("agents",getUsers(request).size()) ;
|
||||
|
||||
map.put("webIMInvite", UKTools.getWebIMInviteStatus(onlineUserRes.findByOrgiAndStatus(super.getOrgi(request), MainContext.OnlineUserOperatorStatus.ONLINE.toString()))) ;
|
||||
map.put("webIMInvite", MainUtils.getWebIMInviteStatus(onlineUserRes.findByOrgiAndStatus(super.getOrgi(request), MainContext.OnlineUserOperatorStatus.ONLINE.toString()))) ;
|
||||
|
||||
map.put("inviteResult", UKTools.getWebIMInviteResult(onlineUserRes.findByOrgiAndAgentnoAndCreatetimeRange(super.getOrgi(request), super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime()))) ;
|
||||
map.put("inviteResult", MainUtils.getWebIMInviteResult(onlineUserRes.findByOrgiAndAgentnoAndCreatetimeRange(super.getOrgi(request), super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime()))) ;
|
||||
|
||||
map.put("agentUserCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.INSERVICE.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentUserCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.INSERVICE.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
map.put("agentServicesCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentServicesCount", onlineUserRes.countByAgentForAgentUser(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
map.put("agentServicesAvg", onlineUserRes.countByAgentForAvagTime(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , UKTools.getStartTime() , UKTools.getEndTime())) ;
|
||||
map.put("agentServicesAvg", onlineUserRes.countByAgentForAvagTime(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),super.getUser(request).getId() , MainUtils.getStartTime() , MainUtils.getEndTime())) ;
|
||||
|
||||
}
|
||||
@RequestMapping({"/apps/onlineuser"})
|
||||
@ -207,7 +207,7 @@ public class AppsController extends Handler {
|
||||
tempUser.setAgent(user.isAgent());
|
||||
tempUser.setOrgi(super.getOrgiByTenantshare(request));
|
||||
if(!StringUtils.isBlank(user.getPassword())){
|
||||
tempUser.setPassword(UKTools.md5(user.getPassword()));
|
||||
tempUser.setPassword(MainUtils.md5(user.getPassword()));
|
||||
}
|
||||
if(tempUser.getCreatetime() == null){
|
||||
tempUser.setCreatetime(new Date());
|
||||
|
@ -29,8 +29,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.PinYinTools;
|
||||
import com.chatopera.cc.util.*;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
import com.chatopera.cc.util.extra.DataExchangeInterface;
|
||||
@ -42,8 +41,6 @@ import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.es.ContactsRepository;
|
||||
import com.chatopera.cc.app.service.es.QuickReplyRepository;
|
||||
import com.chatopera.cc.app.service.repository.*;
|
||||
import com.chatopera.cc.util.OnlineUserUtils;
|
||||
import com.chatopera.cc.util.PropertiesEventUtils;
|
||||
import com.chatopera.cc.app.im.router.OutMessageRouter;
|
||||
import com.chatopera.cc.app.im.message.ChatMessage;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@ -65,7 +62,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
|
||||
import freemarker.template.TemplateException;
|
||||
@ -690,14 +687,14 @@ public class AgentController extends Handler {
|
||||
if(!uploadDir.exists()){
|
||||
uploadDir.mkdirs() ;
|
||||
}
|
||||
String fileid = UKTools.md5(imgFile.getBytes()) , fileURL = null , targetFile = null;
|
||||
String fileid = MainUtils.md5(imgFile.getBytes()) , fileURL = null , targetFile = null;
|
||||
ChatMessage data = new ChatMessage() ;
|
||||
if(imgFile.getContentType()!=null && imgFile.getContentType().indexOf("image") >= 0){
|
||||
fileName = "upload/"+fileid+"_original" ;
|
||||
File imageFile = new File(path , fileName) ;
|
||||
FileCopyUtils.copy(imgFile.getBytes(), imageFile);
|
||||
targetFile = "upload/"+fileid ;
|
||||
UKTools.processImage(new File(path , targetFile), imageFile) ;
|
||||
MainUtils.processImage(new File(path , targetFile), imageFile) ;
|
||||
|
||||
|
||||
fileURL = "/res/image.html?id="+targetFile ;
|
||||
@ -747,7 +744,7 @@ public class AgentController extends Handler {
|
||||
}
|
||||
//同时发送消息给 坐席
|
||||
data.setMessage(fileURL);
|
||||
data.setId(UKTools.getUUID());
|
||||
data.setId(MainUtils.getUUID());
|
||||
data.setContextid(agentUser.getContextid());
|
||||
|
||||
data.setAgentserviceid(agentUser.getAgentserviceid());
|
||||
@ -808,7 +805,7 @@ public class AgentController extends Handler {
|
||||
chatMessage.setCooperation(true);
|
||||
chatMessageRepository.save(chatMessage) ;
|
||||
|
||||
UKTools.scaleImage(imageFile, tempFile , 0.1F) ;
|
||||
MainUtils.scaleImage(imageFile, tempFile , 0.1F) ;
|
||||
|
||||
|
||||
|
||||
@ -845,7 +842,7 @@ public class AgentController extends Handler {
|
||||
private String processAttachmentFile(MultipartFile file , HttpServletRequest request) throws IOException{
|
||||
String id = null ;
|
||||
if(file.getSize() > 0){ //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = UKTools.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
String fileid = MainUtils.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if(!StringUtils.isBlank(fileid)){
|
||||
AttachmentFile attachmentFile = new AttachmentFile() ;
|
||||
attachmentFile.setCreater(super.getUser(request).getId());
|
||||
@ -1244,7 +1241,7 @@ public class AgentController extends Handler {
|
||||
if(au == null)
|
||||
throw new CSKefuException("不存在该服务记录");
|
||||
|
||||
contacts.setId(UKTools.getUUID());
|
||||
contacts.setId(MainUtils.getUUID());
|
||||
contacts.setCreater(super.getUser(request).getId());
|
||||
contacts.setOrgi(super.getOrgi(request));
|
||||
contacts.setOrgan(super.getUser(request).getOrgan());
|
||||
@ -1255,7 +1252,7 @@ public class AgentController extends Handler {
|
||||
contactsRes.save(contacts) ;
|
||||
|
||||
AgentUserContacts auc = new AgentUserContacts();
|
||||
auc.setId(UKTools.getUUID());
|
||||
auc.setId(MainUtils.getUUID());
|
||||
auc.setUsername(au.getUsername());
|
||||
auc.setOrgi(MainContext.SYSTEM_ORGI);
|
||||
auc.setUserid(au.getUserid());
|
||||
@ -1275,7 +1272,7 @@ public class AgentController extends Handler {
|
||||
if(data!=null){
|
||||
List<PropertiesEvent> events = PropertiesEventUtils.processPropertiesModify(request, contacts , data , "id" , "orgi" , "creater" ,"createtime" , "updatetime") ; //记录 数据变更 历史
|
||||
if(events.size()>0){
|
||||
String modifyid = UKTools.getUUID() ;
|
||||
String modifyid = MainUtils.getUUID() ;
|
||||
Date modifytime = new Date();
|
||||
for(PropertiesEvent event : events){
|
||||
event.setDataid(contacts.getId());
|
||||
|
@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.AclRepository;
|
||||
import com.chatopera.cc.app.service.repository.ExtentionRepository;
|
||||
import com.chatopera.cc.app.service.repository.RouterRulesRepository;
|
||||
@ -77,7 +77,7 @@ public class ExtentionController extends Handler{
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/extention/index")) ;
|
||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
||||
PbxHost pbxHost = null ;
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig() ;
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
||||
pbxHost = pbxHostList.get(0) ;
|
||||
map.addAttribute("pbxHost" , pbxHost);
|
||||
@ -86,7 +86,7 @@ public class ExtentionController extends Handler{
|
||||
}
|
||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
||||
if(!StringUtils.isBlank(systemConfig.getCc_extention())){
|
||||
Template template = UKTools.getTemplate(systemConfig.getCc_extention()) ;
|
||||
Template template = MainUtils.getTemplate(systemConfig.getCc_extention()) ;
|
||||
if(template!=null){
|
||||
map.addAttribute("template" , template);
|
||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/template")) ;
|
||||
@ -102,7 +102,7 @@ public class ExtentionController extends Handler{
|
||||
|
||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
||||
PbxHost pbxHost = null ;
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig() ;
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
||||
pbxHost = pbxHostList.get(0) ;
|
||||
map.addAttribute("pbxHost" , pbxHost);
|
||||
@ -118,21 +118,21 @@ public class ExtentionController extends Handler{
|
||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/callcenter"));
|
||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
||||
if(!StringUtils.isBlank(systemConfig.getCc_quene())){
|
||||
template = UKTools.getTemplate(systemConfig.getCc_quene()) ;
|
||||
template = MainUtils.getTemplate(systemConfig.getCc_quene()) ;
|
||||
}
|
||||
}
|
||||
}else if(key_value!=null && key_value.equals("acl.conf")){
|
||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/acl"));
|
||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
||||
if(!StringUtils.isBlank(systemConfig.getCc_acl())){
|
||||
template = UKTools.getTemplate(systemConfig.getCc_acl()) ;
|
||||
template = MainUtils.getTemplate(systemConfig.getCc_acl()) ;
|
||||
}
|
||||
}
|
||||
}else if(key_value!=null && key_value.equals("ivr.conf")){
|
||||
view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/configure/ivr"));
|
||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
||||
if(!StringUtils.isBlank(systemConfig.getCc_ivr())){
|
||||
template = UKTools.getTemplate(systemConfig.getCc_ivr()) ;
|
||||
template = MainUtils.getTemplate(systemConfig.getCc_ivr()) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class ExtentionController extends Handler{
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/business/callcenter/dialplan/index"));
|
||||
List<PbxHost> pbxHostList = pbxHostRes.findByHostnameOrIpaddr(hostname, hostname) ;
|
||||
PbxHost pbxHost = null ;
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig() ;
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig() ;
|
||||
Template template = null ;
|
||||
if(pbxHostList!=null && pbxHostList.size() > 0){
|
||||
pbxHost = pbxHostList.get(0) ;
|
||||
@ -158,7 +158,7 @@ public class ExtentionController extends Handler{
|
||||
}
|
||||
if(systemConfig!=null && systemConfig.isCallcenter()){
|
||||
if(!StringUtils.isBlank(systemConfig.getCc_siptrunk())){
|
||||
template = UKTools.getTemplate(systemConfig.getCc_router()) ;
|
||||
template = MainUtils.getTemplate(systemConfig.getCc_router()) ;
|
||||
}
|
||||
if(template!=null){
|
||||
map.addAttribute("template" , template);
|
||||
|
@ -19,7 +19,7 @@ package com.chatopera.cc.app.handler.apps.contacts;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.PinYinTools;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
import com.chatopera.cc.util.task.DSData;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
@ -120,7 +120,7 @@ public class ContactsController extends Handler {
|
||||
boolQueryBuilder.must(termQuery("ckind", ckind));
|
||||
map.put("ckind", ckind);
|
||||
}
|
||||
map.addAttribute("contactsList", contactsRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(), super.getOrgi(request), UKTools.getStartTime(), null, false, boolQueryBuilder, q, new PageRequest(super.getP(request), super.getPs(request))));
|
||||
map.addAttribute("contactsList", contactsRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(), super.getOrgi(request), MainUtils.getStartTime(), null, false, boolQueryBuilder, q, new PageRequest(super.getP(request), super.getPs(request))));
|
||||
|
||||
return request(super.createAppsTempletResponse("/apps/business/contacts/index"));
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class ContactsController extends Handler {
|
||||
boolQueryBuilder.must(termQuery("ckind", ckind));
|
||||
map.put("ckind", ckind);
|
||||
}
|
||||
map.addAttribute("contactsList", contactsRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(), super.getOrgi(request), UKTools.getWeekStartTime(), null, false, boolQueryBuilder, q, new PageRequest(super.getP(request), super.getPs(request))));
|
||||
map.addAttribute("contactsList", contactsRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(), super.getOrgi(request), MainUtils.getWeekStartTime(), null, false, boolQueryBuilder, q, new PageRequest(super.getP(request), super.getPs(request))));
|
||||
|
||||
return request(super.createAppsTempletResponse("/apps/business/contacts/index"));
|
||||
}
|
||||
@ -221,7 +221,7 @@ public class ContactsController extends Handler {
|
||||
if (data != null) {
|
||||
List<PropertiesEvent> events = PropertiesEventUtils.processPropertiesModify(request, contacts, data, "id", "orgi", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
||||
if (events.size() > 0) {
|
||||
String modifyid = UKTools.getUUID();
|
||||
String modifyid = MainUtils.getUUID();
|
||||
Date modifytime = new Date();
|
||||
for (PropertiesEvent event : events) {
|
||||
event.setDataid(contacts.getId());
|
||||
@ -258,7 +258,7 @@ public class ContactsController extends Handler {
|
||||
@Menu(type = "contacts", subtype = "contacts")
|
||||
public ModelAndView impsave(ModelMap map, HttpServletRequest request, @RequestParam(value = "cusfile", required = false) MultipartFile cusfile, @Valid String ckind) throws IOException {
|
||||
DSDataEvent event = new DSDataEvent();
|
||||
String fileName = "contacts/" + UKTools.getUUID() + cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf("."));
|
||||
String fileName = "contacts/" + MainUtils.getUUID() + cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf("."));
|
||||
File excelFile = new File(path, fileName);
|
||||
if (!excelFile.getParentFile().exists()) {
|
||||
excelFile.getParentFile().mkdirs();
|
||||
@ -289,7 +289,7 @@ public class ContactsController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||
List<Map<String, Object>> values = new ArrayList<Map<String, Object>>();
|
||||
for (Contacts contacts : contactsList) {
|
||||
values.add(UKTools.transBean2Map(contacts));
|
||||
values.add(MainUtils.transBean2Map(contacts));
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Contacts-" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xls");
|
||||
@ -314,7 +314,7 @@ public class ContactsController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||
List<Map<String, Object>> values = new ArrayList<Map<String, Object>>();
|
||||
for (Contacts contacts : contactsList) {
|
||||
values.add(UKTools.transBean2Map(contacts));
|
||||
values.add(MainUtils.transBean2Map(contacts));
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Contacts-" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xls");
|
||||
@ -340,7 +340,7 @@ public class ContactsController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_contacts");
|
||||
List<Map<String, Object>> values = new ArrayList<Map<String, Object>>();
|
||||
for (Contacts contacts : contactsList) {
|
||||
values.add(UKTools.transBean2Map(contacts));
|
||||
values.add(MainUtils.transBean2Map(contacts));
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Contacts-" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xls");
|
||||
@ -405,7 +405,7 @@ public class ContactsController extends Handler {
|
||||
if (data != null) {
|
||||
List<PropertiesEvent> events = PropertiesEventUtils.processPropertiesModify(request, contacts, data, "id", "orgi", "creater", "createtime", "updatetime"); //记录 数据变更 历史
|
||||
if (events.size() > 0) {
|
||||
String modifyid = UKTools.getUUID();
|
||||
String modifyid = MainUtils.getUUID();
|
||||
Date modifytime = new Date();
|
||||
for (PropertiesEvent event : events) {
|
||||
event.setDataid(contacts.getId());
|
||||
|
@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.PinYinTools;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
@ -58,7 +59,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
import com.chatopera.cc.app.service.repository.MetadataRepository;
|
||||
import com.chatopera.cc.app.service.repository.ReporterRepository;
|
||||
@ -128,7 +128,7 @@ public class CustomerController extends Handler{
|
||||
boolQueryBuilder.must(termQuery("ekind" , ekind)) ;
|
||||
map.put("ekind", ekind) ;
|
||||
}
|
||||
map.addAttribute("entCustomerList", entCustomerRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(),super.getOrgi(request), UKTools.getStartTime() , null , false, boolQueryBuilder ,q , new PageRequest(super.getP(request) , super.getPs(request)))) ;
|
||||
map.addAttribute("entCustomerList", entCustomerRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(),super.getOrgi(request), MainUtils.getStartTime() , null , false, boolQueryBuilder ,q , new PageRequest(super.getP(request) , super.getPs(request)))) ;
|
||||
|
||||
return request(super.createAppsTempletResponse("/apps/business/customer/index"));
|
||||
}
|
||||
@ -148,7 +148,7 @@ public class CustomerController extends Handler{
|
||||
boolQueryBuilder.must(termQuery("ekind" , ekind)) ;
|
||||
map.put("ekind", ekind) ;
|
||||
}
|
||||
map.addAttribute("entCustomerList", entCustomerRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(),super.getOrgi(request), UKTools.getWeekStartTime() , null , false, boolQueryBuilder ,q , new PageRequest(super.getP(request) , super.getPs(request)))) ;
|
||||
map.addAttribute("entCustomerList", entCustomerRes.findByCreaterAndSharesAndOrgi(super.getUser(request).getId(), super.getUser(request).getId(),super.getOrgi(request), MainUtils.getWeekStartTime() , null , false, boolQueryBuilder ,q , new PageRequest(super.getP(request) , super.getPs(request)))) ;
|
||||
|
||||
return request(super.createAppsTempletResponse("/apps/business/customer/index"));
|
||||
}
|
||||
@ -272,7 +272,7 @@ public class CustomerController extends Handler{
|
||||
|
||||
List<PropertiesEvent> events = PropertiesEventUtils.processPropertiesModify(request, customerGroupForm.getEntcustomer() , customer , "id" , "orgi" , "creater" ,"createtime" , "updatetime") ; //记录 数据变更 历史
|
||||
if(events.size()>0){
|
||||
String modifyid = UKTools.getUUID() ;
|
||||
String modifyid = MainUtils.getUUID() ;
|
||||
Date modifytime = new Date();
|
||||
for(PropertiesEvent event : events){
|
||||
event.setDataid(customerGroupForm.getEntcustomer().getId());
|
||||
@ -305,7 +305,7 @@ public class CustomerController extends Handler{
|
||||
@Menu(type = "customer" , subtype = "customer")
|
||||
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "cusfile", required = false) MultipartFile cusfile,@Valid String ekind) throws IOException {
|
||||
DSDataEvent event = new DSDataEvent();
|
||||
String fileName = "customer/"+UKTools.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "customer/"+ MainUtils.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
File excelFile = new File(path , fileName) ;
|
||||
if(!excelFile.getParentFile().exists()){
|
||||
excelFile.getParentFile().mkdirs() ;
|
||||
@ -336,7 +336,7 @@ public class CustomerController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(EntCustomer customer : entCustomerList){
|
||||
values.add(UKTools.transBean2Map(customer)) ;
|
||||
values.add(MainUtils.transBean2Map(customer)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-EntCustomer-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -363,7 +363,7 @@ public class CustomerController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(EntCustomer customer : entCustomerList){
|
||||
values.add(UKTools.transBean2Map(customer)) ;
|
||||
values.add(MainUtils.transBean2Map(customer)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-EntCustomer-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -394,7 +394,7 @@ public class CustomerController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_entcustomer") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(EntCustomer customer : entCustomerList){
|
||||
values.add(UKTools.transBean2Map(customer)) ;
|
||||
values.add(MainUtils.transBean2Map(customer)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-EntCustomer-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.repository.IMGroupRepository;
|
||||
@ -38,7 +39,6 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.ChatMessageRepository;
|
||||
import com.chatopera.cc.app.service.repository.RecentUserRepository;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
@ -103,7 +103,7 @@ public class EntIMController extends Handler {
|
||||
public ModelAndView chat(HttpServletRequest request , HttpServletResponse response , @Valid String userid) {
|
||||
ModelAndView view = request(super.createEntIMTempletResponse("/apps/entim/chat")) ;
|
||||
view.addObject("entimuser", userRes.findByIdAndOrgi(userid, super.getOrgi(request))) ;
|
||||
view.addObject("contextid", UKTools.genNewID(super.getUser(request).getId(), userid)) ;
|
||||
view.addObject("contextid", MainUtils.genNewID(super.getUser(request).getId(), userid)) ;
|
||||
view.addObject("online", NettyClients.getInstance().getEntIMClientsNum(userid) > 0) ;
|
||||
view.addObject("chatMessageList", chatMessageRes.findByContextidAndUseridAndOrgi(userid , super.getUser(request).getId(), super.getOrgi(request), new PageRequest(0, 20, Sort.Direction.DESC, "createtime"))) ;
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
package com.chatopera.cc.app.handler.apps.internet;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.*;
|
||||
import com.chatopera.cc.util.WebIMClient;
|
||||
import com.chatopera.cc.app.model.*;
|
||||
@ -120,7 +121,7 @@ public class IMController extends Handler {
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
view.addObject("hostname", request.getServerName());
|
||||
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if (systemConfig != null && systemConfig.isEnablessl()) {
|
||||
view.addObject("schema", "https");
|
||||
if (request.getServerPort() == 80) {
|
||||
@ -135,10 +136,10 @@ public class IMController extends Handler {
|
||||
view.addObject("appid", id);
|
||||
|
||||
|
||||
view.addObject("client", UKTools.getUUID());
|
||||
view.addObject("client", MainUtils.getUUID());
|
||||
view.addObject("sessionid", sessionid);
|
||||
|
||||
view.addObject("ip", UKTools.md5(request.getRemoteAddr()));
|
||||
view.addObject("ip", MainUtils.md5(request.getRemoteAddr()));
|
||||
|
||||
view.addObject("mobile", CheckMobile.check(request.getHeader("User-Agent")));
|
||||
|
||||
@ -165,7 +166,7 @@ public class IMController extends Handler {
|
||||
}
|
||||
userHistory.setReferer(userHistory.getUrl());
|
||||
}
|
||||
userHistory.setParam(UKTools.getParameter(request));
|
||||
userHistory.setParam(MainUtils.getParameter(request));
|
||||
if (userHistory != null) {
|
||||
userHistory.setMaintype("im");
|
||||
userHistory.setSubtype("point");
|
||||
@ -190,7 +191,7 @@ public class IMController extends Handler {
|
||||
userHistory.setAppid(id);
|
||||
userHistory.setSessionid(sessionid);
|
||||
|
||||
String ip = UKTools.getIpAddr(request);
|
||||
String ip = MainUtils.getIpAddr(request);
|
||||
userHistory.setHostname(ip);
|
||||
userHistory.setIp(ip);
|
||||
IP ipdata = IPTools.getInstance().findGeography(ip);
|
||||
@ -199,7 +200,7 @@ public class IMController extends Handler {
|
||||
userHistory.setCity(ipdata.getCity());
|
||||
userHistory.setIsp(ipdata.getIsp());
|
||||
|
||||
BrowserClient client = UKTools.parseClient(request);
|
||||
BrowserClient client = MainUtils.parseClient(request);
|
||||
userHistory.setOstype(client.getOs());
|
||||
userHistory.setBrowser(client.getBrowser());
|
||||
userHistory.setMobile(CheckMobile.check(request.getHeader("User-Agent")) ? "1" : "0");
|
||||
@ -216,11 +217,11 @@ public class IMController extends Handler {
|
||||
}
|
||||
view.addObject("traceid", userHistory.getId());
|
||||
if (invite.isRecordhis()) {
|
||||
UKTools.published(userHistory);
|
||||
MainUtils.published(userHistory);
|
||||
}
|
||||
|
||||
view.addObject("pointAd", UKTools.getPointAdv(MainContext.AdPosEnum.POINT.toString(), orgi));
|
||||
view.addObject("inviteAd", UKTools.getPointAdv(MainContext.AdPosEnum.INVITE.toString(), orgi));
|
||||
view.addObject("pointAd", MainUtils.getPointAdv(MainContext.AdPosEnum.POINT.toString(), orgi));
|
||||
view.addObject("inviteAd", MainUtils.getPointAdv(MainContext.AdPosEnum.INVITE.toString(), orgi));
|
||||
}
|
||||
}
|
||||
|
||||
@ -349,9 +350,9 @@ public class IMController extends Handler {
|
||||
CousultInvite invite = OnlineUserUtils.cousult(appid, orgi, inviteRepository);
|
||||
String userID = null;
|
||||
if (StringUtils.isNotBlank(userid)) {
|
||||
userID = UKTools.genIDByKey(userid);
|
||||
userID = MainUtils.genIDByKey(userid);
|
||||
} else {
|
||||
userID = UKTools.genIDByKey(sessionid);
|
||||
userID = MainUtils.genIDByKey(sessionid);
|
||||
}
|
||||
String nickname = "Guest_" + userID;
|
||||
boolean consult = true; //是否已收集用户信息
|
||||
@ -377,7 +378,7 @@ public class IMController extends Handler {
|
||||
view.addObject("pid", pid);
|
||||
view.addObject("purl", purl);
|
||||
|
||||
map.addAttribute("ip", UKTools.md5(request.getRemoteAddr()));
|
||||
map.addAttribute("ip", MainUtils.md5(request.getRemoteAddr()));
|
||||
|
||||
if (StringUtils.isNotBlank(traceid)) {
|
||||
map.addAttribute("traceid", traceid);
|
||||
@ -408,7 +409,7 @@ public class IMController extends Handler {
|
||||
|
||||
AgentReport report = ServiceQuene.getAgentReport(invite.getOrgi());
|
||||
|
||||
if (report.getAgents() == 0 || (sessionConfig.isHourcheck() && !UKTools.isInWorkingHours(sessionConfig.getWorkinghours()) && invite.isLeavemessage())) {
|
||||
if (report.getAgents() == 0 || (sessionConfig.isHourcheck() && !MainUtils.isInWorkingHours(sessionConfig.getWorkinghours()) && invite.isLeavemessage())) {
|
||||
view = request(super.createRequestPageTempletResponse("/apps/im/leavemsg"));
|
||||
} else if (invite.isConsult_info()) { //启用了信息收集 , 从Request获取 , 或从 Cookies 里去
|
||||
//验证 OnlineUser 信息
|
||||
@ -416,21 +417,21 @@ public class IMController extends Handler {
|
||||
consult = true;
|
||||
//存入 Cookies
|
||||
if (invite.isConsult_info_cookies()) {
|
||||
Cookie name = new Cookie("name", UKTools.encryption(URLEncoder.encode(contacts.getName(), "UTF-8")));
|
||||
Cookie name = new Cookie("name", MainUtils.encryption(URLEncoder.encode(contacts.getName(), "UTF-8")));
|
||||
response.addCookie(name);
|
||||
name.setMaxAge(3600);
|
||||
if (StringUtils.isNotBlank(contacts.getPhone())) {
|
||||
Cookie phonecookie = new Cookie("phone", UKTools.encryption(URLEncoder.encode(contacts.getPhone(), "UTF-8")));
|
||||
Cookie phonecookie = new Cookie("phone", MainUtils.encryption(URLEncoder.encode(contacts.getPhone(), "UTF-8")));
|
||||
phonecookie.setMaxAge(3600);
|
||||
response.addCookie(phonecookie);
|
||||
}
|
||||
if (StringUtils.isNotBlank(contacts.getEmail())) {
|
||||
Cookie email = new Cookie("email", UKTools.encryption(URLEncoder.encode(contacts.getEmail(), "UTF-8")));
|
||||
Cookie email = new Cookie("email", MainUtils.encryption(URLEncoder.encode(contacts.getEmail(), "UTF-8")));
|
||||
email.setMaxAge(3600);
|
||||
response.addCookie(email);
|
||||
}
|
||||
if (StringUtils.isNotBlank(contacts.getMemo())) {
|
||||
Cookie memo = new Cookie("memo", UKTools.encryption(URLEncoder.encode(contacts.getName(), "UTF-8")));
|
||||
Cookie memo = new Cookie("memo", MainUtils.encryption(URLEncoder.encode(contacts.getName(), "UTF-8")));
|
||||
memo.setMaxAge(3600);
|
||||
response.addCookie(memo);
|
||||
}
|
||||
@ -444,16 +445,16 @@ public class IMController extends Handler {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (cookie != null && StringUtils.isNotBlank(cookie.getName()) && StringUtils.isNotBlank(cookie.getValue())) {
|
||||
if (cookie.getName().equals("name")) {
|
||||
contacts.setName(URLDecoder.decode(UKTools.decryption(cookie.getValue()), "UTF-8"));
|
||||
contacts.setName(URLDecoder.decode(MainUtils.decryption(cookie.getValue()), "UTF-8"));
|
||||
}
|
||||
if (cookie.getName().equals("phone")) {
|
||||
contacts.setPhone(URLDecoder.decode(UKTools.decryption(cookie.getValue()), "UTF-8"));
|
||||
contacts.setPhone(URLDecoder.decode(MainUtils.decryption(cookie.getValue()), "UTF-8"));
|
||||
}
|
||||
if (cookie.getName().equals("email")) {
|
||||
contacts.setEmail(URLDecoder.decode(UKTools.decryption(cookie.getValue()), "UTF-8"));
|
||||
contacts.setEmail(URLDecoder.decode(MainUtils.decryption(cookie.getValue()), "UTF-8"));
|
||||
}
|
||||
if (cookie.getName().equals("memo")) {
|
||||
contacts.setMemo(URLDecoder.decode(UKTools.decryption(cookie.getValue()), "UTF-8"));
|
||||
contacts.setMemo(URLDecoder.decode(MainUtils.decryption(cookie.getValue()), "UTF-8"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -483,7 +484,7 @@ public class IMController extends Handler {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
map.addAttribute("type", type);
|
||||
}
|
||||
IP ipdata = IPTools.getInstance().findGeography(UKTools.getIpAddr(request));
|
||||
IP ipdata = IPTools.getInstance().findGeography(MainUtils.getIpAddr(request));
|
||||
map.addAttribute("skillList", OnlineUserUtils.organ(invite.getOrgi(), ipdata, invite, true));
|
||||
|
||||
if (invite != null && consult) {
|
||||
@ -517,8 +518,8 @@ public class IMController extends Handler {
|
||||
}
|
||||
view.addObject("commentList", UKeFuDic.getInstance().getDic(MainContext.UKEFU_SYSTEM_COMMENT_DIC));
|
||||
view.addObject("commentItemList", UKeFuDic.getInstance().getDic(MainContext.UKEFU_SYSTEM_COMMENT_ITEM_DIC));
|
||||
view.addObject("welcomeAd", UKTools.getPointAdv(MainContext.AdPosEnum.WELCOME.toString(), orgi));
|
||||
view.addObject("imageAd", UKTools.getPointAdv(MainContext.AdPosEnum.IMAGE.toString(), orgi));
|
||||
view.addObject("welcomeAd", MainUtils.getPointAdv(MainContext.AdPosEnum.WELCOME.toString(), orgi));
|
||||
view.addObject("imageAd", MainUtils.getPointAdv(MainContext.AdPosEnum.IMAGE.toString(), orgi));
|
||||
// OnlineUserUtils.sendWebIMClients(userid , "accept");
|
||||
|
||||
if (invite.isTraceuser()) {
|
||||
@ -597,7 +598,7 @@ public class IMController extends Handler {
|
||||
view.addObject("appid", appid);
|
||||
|
||||
|
||||
view.addObject("ip", UKTools.md5(request.getRemoteAddr()));
|
||||
view.addObject("ip", MainUtils.md5(request.getRemoteAddr()));
|
||||
|
||||
if (StringUtils.isNotBlank(skill)) {
|
||||
view.addObject("skill", skill);
|
||||
@ -606,7 +607,7 @@ public class IMController extends Handler {
|
||||
view.addObject("agent", agent);
|
||||
}
|
||||
|
||||
view.addObject("client", UKTools.getUUID());
|
||||
view.addObject("client", MainUtils.getUUID());
|
||||
view.addObject("sessionid", request.getSession().getId());
|
||||
|
||||
view.addObject("id", id);
|
||||
@ -717,13 +718,13 @@ public class IMController extends Handler {
|
||||
if (!uploadDir.exists()) {
|
||||
uploadDir.mkdirs();
|
||||
}
|
||||
String fileid = UKTools.md5(imgFile.getBytes());
|
||||
String fileid = MainUtils.md5(imgFile.getBytes());
|
||||
if (imgFile.getContentType() != null && imgFile.getContentType().indexOf("image") >= 0) {
|
||||
fileName = "upload/" + fileid + "_original";
|
||||
File imageFile = new File(path, fileName);
|
||||
FileCopyUtils.copy(imgFile.getBytes(), imageFile);
|
||||
String thumbnailsFileName = "upload/" + fileid;
|
||||
UKTools.processImage(new File(path, thumbnailsFileName), imageFile);
|
||||
MainUtils.processImage(new File(path, thumbnailsFileName), imageFile);
|
||||
|
||||
|
||||
upload = new UploadStatus("0", "/res/image.html?id=" + thumbnailsFileName);
|
||||
@ -769,7 +770,7 @@ public class IMController extends Handler {
|
||||
private String processAttachmentFile(MultipartFile file, HttpServletRequest request) throws IOException {
|
||||
String id = null;
|
||||
if (file.getSize() > 0) { //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = UKTools.md5(file.getBytes()); //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
String fileid = MainUtils.md5(file.getBytes()); //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if (StringUtils.isNotBlank(fileid)) {
|
||||
AttachmentFile attachmentFile = new AttachmentFile();
|
||||
attachmentFile.setCreater(super.getUser(request).getId());
|
||||
|
@ -23,6 +23,7 @@ import java.util.Date;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.model.JobDetail;
|
||||
import com.chatopera.cc.app.model.JobTask;
|
||||
@ -33,7 +34,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.JobDetailRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
|
||||
@ -77,12 +77,12 @@ public class JobController extends Handler {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
detail.setTaskinfo(mapper.writeValueAsString(taskinfo));
|
||||
|
||||
detail.setCronexp(UKTools.convertCrond(taskinfo));
|
||||
detail.setCronexp(MainUtils.convertCrond(taskinfo));
|
||||
/**
|
||||
* 设定触发时间
|
||||
*/
|
||||
detail.setNextfiretime(new Date());
|
||||
detail.setNextfiretime(UKTools.updateTaskNextFireTime(detail));
|
||||
detail.setNextfiretime(MainUtils.updateTaskNextFireTime(detail));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Controller
|
||||
@RequestMapping({"/apps/kbs"})
|
||||
@ -150,7 +150,7 @@ public class KbsController extends Handler {
|
||||
//保存附件
|
||||
for(MultipartFile file : files){
|
||||
if(file.getSize() > 0){ //文件尺寸 限制 ?在 启动 配置中 设置 的最大值,其他地方不做限制
|
||||
String fileid = UKTools.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
String fileid = MainUtils.md5(file.getBytes()) ; //使用 文件的 MD5作为 ID,避免重复上传大文件
|
||||
if(!StringUtils.isBlank(fileid)){
|
||||
AttachmentFile attachmentFile = new AttachmentFile() ;
|
||||
attachmentFile.setCreater(super.getUser(request).getId());
|
||||
|
@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.extra.DataExchangeInterface;
|
||||
import com.chatopera.cc.util.task.DSData;
|
||||
@ -55,7 +56,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
import com.chatopera.cc.util.task.process.TopicProcess;
|
||||
import com.chatopera.cc.app.service.es.TopicRepository;
|
||||
@ -259,7 +259,7 @@ public class TopicController extends Handler{
|
||||
if(knowledgeType == null){
|
||||
type.setOrgi(super.getOrgi(request));
|
||||
type.setCreatetime(new Date());
|
||||
type.setId(UKTools.getUUID());
|
||||
type.setId(MainUtils.getUUID());
|
||||
type.setTypeid(type.getId());
|
||||
type.setUpdatetime(new Date());
|
||||
if(StringUtils.isBlank(type.getParentid())){
|
||||
@ -369,7 +369,7 @@ public class TopicController extends Handler{
|
||||
@Menu(type = "xiaoe" , subtype = "knowledge")
|
||||
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "cusfile", required = false) MultipartFile cusfile , @Valid String type, @Valid String aiid) throws IOException {
|
||||
DSDataEvent event = new DSDataEvent();
|
||||
String fileName = "xiaoe/"+UKTools.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "xiaoe/"+ MainUtils.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
File excelFile = new File(path , fileName) ;
|
||||
if(!excelFile.getParentFile().exists()){
|
||||
excelFile.getParentFile().mkdirs() ;
|
||||
@ -416,7 +416,7 @@ public class TopicController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_xiaoe_topic") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(Topic topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Contacts-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -437,7 +437,7 @@ public class TopicController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_xiaoe_topic") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(Topic topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-XiaoE-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -458,7 +458,7 @@ public class TopicController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_xiaoe_topic") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(Topic topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-XiaoE-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -23,6 +23,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.service.repository.OrganizationRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -35,7 +36,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.UserRepository;
|
||||
import com.chatopera.cc.app.model.SystemConfig;
|
||||
|
||||
@ -76,7 +76,7 @@ public class OrganizationController extends Handler {
|
||||
}
|
||||
ModelAndView view = request(super.createRequestPageTempletResponse("redirect:/"));
|
||||
//登录成功 判断是否进入多租户页面
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if(systemConfig!=null&&systemConfig.isEnabletneant()&&systemConfig.isTenantconsole()) {
|
||||
view = request(super.createRequestPageTempletResponse("redirect:/apps/tenant/index"));
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -32,7 +33,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.CubeLevelRepository;
|
||||
import com.chatopera.cc.app.service.repository.CubeMeasureRepository;
|
||||
import com.chatopera.cc.app.service.repository.CubeMetadataRepository;
|
||||
@ -427,10 +427,10 @@ public class CubeController extends Handler{
|
||||
User user = super.getUser(request);
|
||||
Cube cube =this.getCube(cubeid);
|
||||
PublishedCube publishCube = new PublishedCube();
|
||||
UKTools.copyProperties(cube, publishCube, "");
|
||||
MainUtils.copyProperties(cube, publishCube, "");
|
||||
publishCube.setId(null);
|
||||
Base64 base64 = new Base64();
|
||||
publishCube.setCubecontent(base64.encodeToString(UKTools.toBytes(cube))) ;
|
||||
publishCube.setCubecontent(base64.encodeToString(MainUtils.toBytes(cube))) ;
|
||||
publishCube.setDataid(cubeid);
|
||||
publishCube.setUserid(user.getId());
|
||||
publishCube.setUsername(user.getUsername());
|
||||
|
@ -33,6 +33,7 @@ import javax.validation.Valid;
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.service.repository.PublishedReportRepository;
|
||||
import com.chatopera.cc.app.model.ReportFilter;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -46,7 +47,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.DSData;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
import com.chatopera.cc.util.task.ExcelImportProecess;
|
||||
@ -119,7 +119,7 @@ public class ReportController extends Handler{
|
||||
report.setOrgi(super.getOrgi(request));
|
||||
report.setCreater(super.getUser(request).getId());
|
||||
report.setReporttype(MainContext.ReportType.REPORT.toString());
|
||||
report.setCode(UKTools.genID());
|
||||
report.setCode(MainUtils.genID());
|
||||
reportRes.save(report) ;
|
||||
}else {
|
||||
view = request(super.createRequestPageTempletResponse("redirect:/apps/report/index.html?msg=rt_name_exist&dicid="+report.getDicid()));
|
||||
@ -252,7 +252,7 @@ public class ReportController extends Handler{
|
||||
@Menu(type = "setting" , subtype = "reportimpsave")
|
||||
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "cusfile", required = false) MultipartFile cusfile , @Valid String type) throws IOException {
|
||||
DSDataEvent event = new DSDataEvent();
|
||||
String fileName = "quickreply/"+UKTools.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "quickreply/"+ MainUtils.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
File excelFile = new File(path , fileName) ;
|
||||
if(!excelFile.getParentFile().exists()){
|
||||
excelFile.getParentFile().mkdirs() ;
|
||||
@ -297,7 +297,7 @@ public class ReportController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_report") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(Report topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Report-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -318,7 +318,7 @@ public class ReportController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_report") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(Report report : reportList){
|
||||
values.add(UKTools.transBean2Map(report)) ;
|
||||
values.add(MainUtils.transBean2Map(report)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Report-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.bi.ReportData;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
@ -38,7 +39,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.ColumnPropertiesRepository;
|
||||
import com.chatopera.cc.app.service.repository.MetadataRepository;
|
||||
import com.chatopera.cc.app.service.repository.PublishedCubeRepository;
|
||||
@ -182,7 +182,7 @@ public class ReportDesignController extends Handler {
|
||||
ChartProperties chartProperties = new ChartProperties();
|
||||
chartProperties.setChartype(tp.getCharttype());
|
||||
Base64 base64 = new Base64();
|
||||
model.setChartcontent(base64.encodeToString(UKTools.toBytes(chartProperties))) ;
|
||||
model.setChartcontent(base64.encodeToString(MainUtils.toBytes(chartProperties))) ;
|
||||
model.setTempletid(template);
|
||||
model.setMid(mid);
|
||||
|
||||
@ -272,7 +272,7 @@ public class ReportDesignController extends Handler {
|
||||
map.addAttribute("eltemplet",t);
|
||||
if (!StringUtils.isBlank(parentid)) {
|
||||
ReportFilter filter = new ReportFilter();
|
||||
filter.setCode(UKTools.genID());
|
||||
filter.setCode(MainUtils.genID());
|
||||
filter.setReportid(id);
|
||||
filter.setOrgi(super.getOrgi(request));
|
||||
filter.setCreatetime(new Date());
|
||||
@ -478,7 +478,7 @@ public class ReportDesignController extends Handler {
|
||||
String modelId = "";
|
||||
if (f != null) {
|
||||
if(StringUtils.isBlank(f.getCode())) {
|
||||
f.setCode(UKTools.genID());
|
||||
f.setCode(MainUtils.genID());
|
||||
}
|
||||
f.setOrgi(super.getOrgi(request));
|
||||
f.setCreatetime(new Date());
|
||||
@ -545,7 +545,7 @@ public class ReportDesignController extends Handler {
|
||||
}else{
|
||||
col.setCur(dtype);
|
||||
}
|
||||
col.setId(UKTools.genID());
|
||||
col.setId(MainUtils.genID());
|
||||
CubeLevel cubeLevel = null;
|
||||
for (Dimension dim : cube.getCube().getDimension()) {
|
||||
for (CubeLevel level : dim.getCubeLevel()) {
|
||||
@ -586,7 +586,7 @@ public class ReportDesignController extends Handler {
|
||||
if (!inlist) {
|
||||
ColumnProperties col = new ColumnProperties();
|
||||
col.setCur("measure"); // 数据结构字段
|
||||
col.setId(UKTools.genID());
|
||||
col.setId(MainUtils.genID());
|
||||
CubeMeasure cubeMeasure = null;
|
||||
for (CubeMeasure measure : cube.getCube().getMeasure()) {
|
||||
if (measure.getId().equals(m)) {
|
||||
@ -619,7 +619,7 @@ public class ReportDesignController extends Handler {
|
||||
}
|
||||
if (!inlist) {
|
||||
ReportFilter filter = new ReportFilter();
|
||||
filter.setId(UKTools.genID());
|
||||
filter.setId(MainUtils.genID());
|
||||
CubeLevel cubeLevel = null;
|
||||
if (cube != null && cube.getCube() != null && cube.getCube().getDimension().size() > 0) {
|
||||
for (Dimension dim : cube.getCube().getDimension()) {
|
||||
@ -678,7 +678,7 @@ public class ReportDesignController extends Handler {
|
||||
if (!StringUtils.isBlank(id)) {
|
||||
ReportModel model = this.getModel(id, super.getOrgi(request),publishedid);
|
||||
if(model!=null) {
|
||||
map.addAttribute("eltemplet", UKTools.getTemplate(model.getTempletid()));
|
||||
map.addAttribute("eltemplet", MainUtils.getTemplate(model.getTempletid()));
|
||||
}
|
||||
map.addAttribute("element", model);
|
||||
map.addAttribute("reportModel", model);
|
||||
@ -1109,7 +1109,7 @@ public class ReportDesignController extends Handler {
|
||||
ChartProperties oldChartppy = model.getChartProperties();
|
||||
oldChartppy.setChartype(tp.getCharttype());
|
||||
Base64 base64 = new Base64();
|
||||
model.setChartcontent(base64.encodeToString(UKTools.toBytes(oldChartppy))) ;
|
||||
model.setChartcontent(base64.encodeToString(MainUtils.toBytes(oldChartppy))) ;
|
||||
reportModelRes.save(model);
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse(
|
||||
@ -1131,7 +1131,7 @@ public class ReportDesignController extends Handler {
|
||||
oldChartppy.setDataview(chartProperties.isDataview());
|
||||
oldChartppy.setFormat(StringUtils.isBlank(chartProperties.getFormat())?"val":chartProperties.getFormat());
|
||||
Base64 base64 = new Base64();
|
||||
model.setChartcontent(base64.encodeToString(UKTools.toBytes(oldChartppy))) ;
|
||||
model.setChartcontent(base64.encodeToString(MainUtils.toBytes(oldChartppy))) ;
|
||||
reportModelRes.save(model);
|
||||
}
|
||||
map.addAttribute("eltemplet", templateRes.findByIdAndOrgi(model.getTempletid(), super.getOrgi(request)));
|
||||
@ -1272,10 +1272,10 @@ public class ReportDesignController extends Handler {
|
||||
List<ReportFilter> reportFilters = reportCubeService.fillReportFilterData(reportFilterRepository.findByReportidAndFiltertypeAndOrgi(reportid, "report", super.getOrgi(request)),request);
|
||||
report.setReportFilters(reportFilters);
|
||||
PublishedReport publishedReport = new PublishedReport();
|
||||
UKTools.copyProperties(report, publishedReport, "");
|
||||
MainUtils.copyProperties(report, publishedReport, "");
|
||||
publishedReport.setId(null);
|
||||
Base64 base64 = new Base64();
|
||||
publishedReport.setReportcontent(base64.encodeToString(UKTools.toBytes(report))) ;
|
||||
publishedReport.setReportcontent(base64.encodeToString(MainUtils.toBytes(report))) ;
|
||||
publishedReport.setDataid(reportid);
|
||||
publishedReport.setCreatetime(new Date());
|
||||
publishedReport.setCreater(user.getId());
|
||||
|
@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.task.export.ExcelExporterProcess;
|
||||
import com.chatopera.cc.app.service.es.ContactsRepository;
|
||||
@ -52,7 +53,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.MetadataRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
import com.chatopera.cc.app.model.AgentService;
|
||||
@ -103,10 +103,10 @@ public class AgentSummaryController extends Handler{
|
||||
list.add(cb.notEqual(root.get("channel").as(String.class), MainContext.ChannelTypeEnum.PHONE.toString())) ;
|
||||
try {
|
||||
if(!StringUtils.isBlank(begin) && begin.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(begin))) ;
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(begin))) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(end) && end.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(end))) ;
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(end))) ;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
@ -164,7 +164,7 @@ public class AgentSummaryController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary event : statusEventList){
|
||||
values.add(UKTools.transBean2Map(event)) ;
|
||||
values.add(MainUtils.transBean2Map(event)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -184,7 +184,7 @@ public class AgentSummaryController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary statusEvent : statusEventList){
|
||||
values.add(UKTools.transBean2Map(statusEvent)) ;
|
||||
values.add(MainUtils.transBean2Map(statusEvent)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -208,10 +208,10 @@ public class AgentSummaryController extends Handler{
|
||||
list.add(cb.and(cb.notEqual(root.get("channel").as(String.class), MainContext.ChannelTypeEnum.PHONE.toString()))) ;
|
||||
try {
|
||||
if(!StringUtils.isBlank(begin) && begin.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.and(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(begin)))) ;
|
||||
list.add(cb.and(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(begin)))) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(end) && end.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.and(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(end)))) ;
|
||||
list.add(cb.and(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(end)))) ;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
@ -222,7 +222,7 @@ public class AgentSummaryController extends Handler{
|
||||
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary summary : page){
|
||||
values.add(UKTools.transBean2Map(summary)) ;
|
||||
values.add(MainUtils.transBean2Map(summary)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -30,6 +30,7 @@ import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.IP;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
@ -47,7 +48,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.AgentServiceRepository;
|
||||
import com.chatopera.cc.app.service.repository.AgentStatusRepository;
|
||||
import com.chatopera.cc.app.service.repository.AgentUserRepository;
|
||||
@ -116,10 +116,10 @@ public class ChatServiceController extends Handler {
|
||||
if(!StringUtils.isBlank(servicetimetype)) {
|
||||
try {
|
||||
if(!StringUtils.isBlank(begin) && begin.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.greaterThanOrEqualTo(root.get(servicetimetype).as(Date.class), UKTools.dateFormate.parse(begin))) ;
|
||||
list.add(cb.greaterThanOrEqualTo(root.get(servicetimetype).as(Date.class), MainUtils.dateFormate.parse(begin))) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(end) && end.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.lessThanOrEqualTo(root.get(servicetimetype).as(Date.class), UKTools.dateFormate.parse(end))) ;
|
||||
list.add(cb.lessThanOrEqualTo(root.get(servicetimetype).as(Date.class), MainUtils.dateFormate.parse(end))) ;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -39,7 +39,7 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.AgentServiceRepository;
|
||||
import com.chatopera.cc.app.service.repository.AgentUserContactsRepository;
|
||||
import com.chatopera.cc.app.service.repository.ChatMessageRepository;
|
||||
@ -97,7 +97,7 @@ public class OnlineUserController extends Handler {
|
||||
@Menu(type = "service" , subtype = "online" , admin= true)
|
||||
public ModelAndView index(ModelMap map , HttpServletRequest request , String userid , String agentservice , @Valid String channel) {
|
||||
if(!StringUtils.isBlank(userid)){
|
||||
map.put("inviteResult", UKTools.getWebIMInviteResult(onlineUserRes.findByOrgiAndUserid(super.getOrgi(request), userid))) ;
|
||||
map.put("inviteResult", MainUtils.getWebIMInviteResult(onlineUserRes.findByOrgiAndUserid(super.getOrgi(request), userid))) ;
|
||||
map.put("tagRelationList", tagRelationRes.findByUserid(userid)) ;
|
||||
map.put("onlineUserHistList", onlineUserHisRes.findByUseridAndOrgi(userid, super.getOrgi(request))) ;
|
||||
map.put("agentServicesAvg", onlineUserRes.countByUserForAvagTime(super.getOrgi(request), MainContext.AgentUserStatusEnum.END.toString(),userid)) ;
|
||||
|
@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
@ -45,7 +46,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.export.ExcelExporterProcess;
|
||||
import com.chatopera.cc.app.service.es.ContactsRepository;
|
||||
import com.chatopera.cc.app.service.repository.AgentServiceRepository;
|
||||
@ -108,10 +108,10 @@ public class ProcessedSummaryController extends Handler{
|
||||
}
|
||||
try {
|
||||
if(!StringUtils.isBlank(begin) && begin.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(begin))) ;
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(begin))) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(end) && end.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(end))) ;
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(end))) ;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -172,7 +172,7 @@ public class ProcessedSummaryController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary event : statusEventList){
|
||||
values.add(UKTools.transBean2Map(event)) ;
|
||||
values.add(MainUtils.transBean2Map(event)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -192,7 +192,7 @@ public class ProcessedSummaryController extends Handler{
|
||||
MetadataTable table = metadataRes.findByTablename("uk_servicesummary") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary statusEvent : statusEventList){
|
||||
values.add(UKTools.transBean2Map(statusEvent)) ;
|
||||
values.add(MainUtils.transBean2Map(statusEvent)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -221,10 +221,10 @@ public class ProcessedSummaryController extends Handler{
|
||||
}
|
||||
try {
|
||||
if(!StringUtils.isBlank(begin) && begin.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(begin))) ;
|
||||
list.add(cb.greaterThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(begin))) ;
|
||||
}
|
||||
if(!StringUtils.isBlank(end) && end.matches("[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}")){
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), UKTools.dateFormate.parse(end))) ;
|
||||
list.add(cb.lessThanOrEqualTo(root.get("createtime").as(Date.class), MainUtils.dateFormate.parse(end))) ;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -235,7 +235,7 @@ public class ProcessedSummaryController extends Handler{
|
||||
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(AgentServiceSummary summary : page){
|
||||
values.add(UKTools.transBean2Map(summary)) ;
|
||||
values.add(MainUtils.transBean2Map(summary)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Summary-History-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.bi.UKExcelUtil;
|
||||
import com.chatopera.cc.util.bi.model.Level;
|
||||
import com.chatopera.cc.app.service.repository.CubeService;
|
||||
@ -59,7 +59,7 @@ public class StatsController extends Handler{
|
||||
@RequestMapping("/stats/coment")
|
||||
@Menu(type = "service" , subtype = "statcoment" , admin= true)
|
||||
public ModelAndView statcoment(ModelMap map , HttpServletRequest request , @Valid String agent , @Valid String skill , @Valid String begin ,@Valid String end) throws Exception {
|
||||
Map<String,Object> mapR =UKTools.getRequestParam(request);
|
||||
Map<String,Object> mapR = MainUtils.getRequestParam(request);
|
||||
mapR.put("orgi",super.getOrgi(request));
|
||||
ReportData reportData = new CubeService("coment.xml", path, dataSource ,mapR ).execute("SELECT [comment].[满意度].members on columns , NonEmptyCrossJoin([time].[日期].members , NonEmptyCrossJoin([skill].[技能组].members,[agent].[坐席].members)) on rows FROM [满意度]") ;
|
||||
|
||||
@ -101,7 +101,7 @@ public class StatsController extends Handler{
|
||||
@RequestMapping("/stats/coment/exp")
|
||||
@Menu(type = "service" , subtype = "statcoment" , admin= true)
|
||||
public void statcomentexp(ModelMap map , HttpServletRequest request , HttpServletResponse response , @Valid String agent , @Valid String skill , @Valid String begin ,@Valid String end) throws Exception {
|
||||
Map<String,Object> mapR =UKTools.getRequestParam(request);
|
||||
Map<String,Object> mapR = MainUtils.getRequestParam(request);
|
||||
mapR.put("orgi",super.getOrgi(request));
|
||||
ReportData reportData = new CubeService("coment.xml", path, dataSource , mapR).execute("SELECT [comment].[满意度].members on columns , NonEmptyCrossJoin([time].[日期].members , NonEmptyCrossJoin([skill].[技能组].members,[agent].[坐席].members)) on rows FROM [满意度]") ;
|
||||
|
||||
@ -123,7 +123,7 @@ public class StatsController extends Handler{
|
||||
@RequestMapping("/stats/agent")
|
||||
@Menu(type = "service" , subtype = "statagent" , admin= true)
|
||||
public ModelAndView statagent(ModelMap map , HttpServletRequest request , @Valid String agent , @Valid String skill , @Valid String begin ,@Valid String end) throws Exception {
|
||||
Map<String,Object> mapR =UKTools.getRequestParam(request);
|
||||
Map<String,Object> mapR = MainUtils.getRequestParam(request);
|
||||
mapR.put("orgi",super.getOrgi(request));
|
||||
ReportData reportData = new CubeService("consult.xml", path, dataSource , mapR).execute("SELECT {[Measures].[咨询数量],[Measures].[平均等待时长(秒)],[Measures].[平均咨询时长(秒)]} on columns , NonEmptyCrossJoin([time].[日期].members , NonEmptyCrossJoin([skill].[技能组].members,[agent].[坐席].members)) on rows FROM [咨询]") ;
|
||||
map.addAttribute("reportData", reportData);
|
||||
@ -155,7 +155,7 @@ public class StatsController extends Handler{
|
||||
@RequestMapping("/stats/agent/exp")
|
||||
@Menu(type = "service" , subtype = "statagent" , admin= true)
|
||||
public void statagentexp(ModelMap map , HttpServletRequest request , HttpServletResponse response ,@Valid String agent , @Valid String skill , @Valid String begin ,@Valid String end) throws Exception {
|
||||
Map<String,Object> mapR =UKTools.getRequestParam(request);
|
||||
Map<String,Object> mapR = MainUtils.getRequestParam(request);
|
||||
mapR.put("orgi",super.getOrgi(request));
|
||||
ReportData reportData = new CubeService("consult.xml", path, dataSource , mapR).execute("SELECT {[Measures].[咨询数量],[Measures].[平均等待时长(秒)],[Measures].[平均咨询时长(秒)]} on columns , NonEmptyCrossJoin([time].[日期].members , NonEmptyCrossJoin([skill].[技能组].members,[agent].[坐席].members)) on rows FROM [咨询]") ;
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-Report-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
@ -48,7 +49,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.BlackListRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
import com.chatopera.cc.app.model.BlackEntity;
|
||||
@ -115,7 +115,7 @@ public class IMAgentController extends Handler{
|
||||
tempSessionConfig = sessionConfig;
|
||||
tempSessionConfig.setCreater(super.getUser(request).getId());
|
||||
}else{
|
||||
UKTools.copyProperties(sessionConfig, tempSessionConfig);
|
||||
MainUtils.copyProperties(sessionConfig, tempSessionConfig);
|
||||
}
|
||||
tempSessionConfig.setOrgi(super.getOrgi(request));
|
||||
sessionConfigRes.save(tempSessionConfig) ;
|
||||
@ -282,13 +282,13 @@ public class IMAgentController extends Handler{
|
||||
if(!adDir.exists()){
|
||||
adDir.mkdirs() ;
|
||||
}
|
||||
String fileName = "adv/"+UKTools.getUUID()+imgfile.getOriginalFilename().substring(imgfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "adv/"+ MainUtils.getUUID()+imgfile.getOriginalFilename().substring(imgfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
FileCopyUtils.copy(imgfile.getBytes(), new File(path , fileName));
|
||||
adv.setImgurl("/res/image.html?id="+java.net.URLEncoder.encode(fileName , "UTF-8"));
|
||||
}
|
||||
adTypeRes.save(adv) ;
|
||||
|
||||
UKTools.initAdv(super.getOrgi(request));
|
||||
MainUtils.initAdv(super.getOrgi(request));
|
||||
|
||||
return request(super.createRequestPageTempletResponse("redirect:/setting/adv.html?adpos="+adv.getAdpos()));
|
||||
}
|
||||
@ -317,14 +317,14 @@ public class IMAgentController extends Handler{
|
||||
if(!adDir.exists()){
|
||||
adDir.mkdirs() ;
|
||||
}
|
||||
String fileName = "adv/"+UKTools.getUUID()+imgfile.getOriginalFilename().substring(imgfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "adv/"+ MainUtils.getUUID()+imgfile.getOriginalFilename().substring(imgfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
FileCopyUtils.copy(imgfile.getBytes(), new File(path , fileName));
|
||||
ad.setImgurl("/res/image.html?id="+java.net.URLEncoder.encode(fileName , "UTF-8"));
|
||||
}else{
|
||||
ad.setImgurl(tempad.getImgurl());
|
||||
}
|
||||
adTypeRes.save(ad) ;
|
||||
UKTools.initAdv(super.getOrgi(request));
|
||||
MainUtils.initAdv(super.getOrgi(request));
|
||||
}
|
||||
return request(super.createRequestPageTempletResponse("redirect:/setting/adv.html?adpos="+adpos));
|
||||
}
|
||||
@ -333,7 +333,7 @@ public class IMAgentController extends Handler{
|
||||
@Menu(type = "setting" , subtype = "adv" , admin= false)
|
||||
public ModelAndView advdelete(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String adpos) {
|
||||
adTypeRes.delete(id);
|
||||
UKTools.initAdv(super.getOrgi(request));
|
||||
MainUtils.initAdv(super.getOrgi(request));
|
||||
return request(super.createRequestPageTempletResponse("redirect:/setting/adv.html?adpos="+adpos));
|
||||
}
|
||||
}
|
@ -30,8 +30,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.DSData;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
import com.chatopera.cc.util.task.ExcelImportProecess;
|
||||
@ -239,7 +239,7 @@ public class QuickReplyController extends Handler {
|
||||
@Menu(type = "setting" , subtype = "quickreplyimpsave")
|
||||
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "cusfile", required = false) MultipartFile cusfile , @Valid String type) throws IOException {
|
||||
DSDataEvent event = new DSDataEvent();
|
||||
String fileName = "quickreply/"+ UKTools.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
String fileName = "quickreply/"+ MainUtils.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
|
||||
File excelFile = new File(path , fileName) ;
|
||||
if(!excelFile.getParentFile().exists()){
|
||||
excelFile.getParentFile().mkdirs() ;
|
||||
@ -284,7 +284,7 @@ public class QuickReplyController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_quickreply") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(QuickReply topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-QuickReply-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -305,7 +305,7 @@ public class QuickReplyController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_quickreply") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(QuickReply topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-QuickReply-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
@ -326,7 +326,7 @@ public class QuickReplyController extends Handler {
|
||||
MetadataTable table = metadataRes.findByTablename("uk_quickreply") ;
|
||||
List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
||||
for(QuickReply topic : topicList){
|
||||
values.add(UKTools.transBean2Map(topic)) ;
|
||||
values.add(MainUtils.transBean2Map(topic)) ;
|
||||
}
|
||||
|
||||
response.setHeader("content-disposition", "attachment;filename=UCKeFu-QuickReply-"+new SimpleDateFormat("yyyy-MM-dd").format(new Date())+".xls");
|
||||
|
@ -19,6 +19,7 @@ package com.chatopera.cc.app.handler.apps.test;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.OnlineUserUtils;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
@ -27,8 +28,6 @@ import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Controller
|
||||
public class TestController extends Handler {
|
||||
|
||||
@ -37,7 +36,7 @@ public class TestController extends Handler {
|
||||
@Menu(type="apps", subtype="test" , access=false , admin = true)
|
||||
public ModelAndView content(ModelMap map , HttpServletRequest request){
|
||||
for(int i=0 ; i<500; i++){
|
||||
String user = UKTools.getUUID();
|
||||
String user = MainUtils.getUUID();
|
||||
try {
|
||||
OnlineUserUtils.newRequestMessage(user, "ukewo", "user", "system", "localhost" , "win10", "test" , MainContext.ChannelTypeEnum.WEBIM.toString() , null , null , "admin" , "标题" , "http://www.ukewo.cn" , "12434" , MainContext.ChatInitiatorType.USER.toString()) ;
|
||||
} catch (Exception e) {
|
||||
|
@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.repository.AttachmentRepository;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
import com.chatopera.cc.app.model.AttachmentFile;
|
||||
@ -65,17 +65,17 @@ public class MediaController extends Handler{
|
||||
if(id.endsWith("_original") && !file.exists()){
|
||||
File orgFile = new File(path , id.substring(0 , id.indexOf("_original"))) ;
|
||||
if(orgFile.exists()){
|
||||
UKTools.processImage(file = new File(path , id), orgFile) ;
|
||||
MainUtils.processImage(file = new File(path , id), orgFile) ;
|
||||
}
|
||||
}else if(!StringUtils.isBlank(id) && file.exists() && !id.endsWith("_original")){
|
||||
File originalFile = new File( path , id+"_original") ;
|
||||
if(!originalFile.exists()){
|
||||
UKTools.processImage(new File( path , id+"_original"), file) ;
|
||||
MainUtils.processImage(new File( path , id+"_original"), file) ;
|
||||
}
|
||||
}else if(!StringUtils.isBlank(id) && !file.exists() && !id.endsWith("_original")){
|
||||
File destFile = new File(path , id+"_original") ;
|
||||
if(destFile.exists()){
|
||||
UKTools.processImage(new File(path + id), destFile) ;
|
||||
MainUtils.processImage(new File(path + id), destFile) ;
|
||||
}
|
||||
file = new File(path , id) ;
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class MediaController extends Handler{
|
||||
if(!uploadDir.exists()){
|
||||
uploadDir.mkdirs() ;
|
||||
}
|
||||
fileName = "upload/"+UKTools.md5(imgFile.getBytes())+imgFile.getOriginalFilename().substring(imgFile.getOriginalFilename().lastIndexOf(".")).toLowerCase() ;
|
||||
fileName = "upload/"+ MainUtils.md5(imgFile.getBytes())+imgFile.getOriginalFilename().substring(imgFile.getOriginalFilename().lastIndexOf(".")).toLowerCase() ;
|
||||
FileCopyUtils.copy(imgFile.getBytes(), new File(path , fileName));
|
||||
|
||||
String fileURL = request.getScheme()+"://"+request.getServerName()+"/res/image.html?id="+fileName ;
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
public class NettyAgentClient implements NettyClient{
|
||||
|
||||
@ -37,7 +37,7 @@ public class NettyAgentClient implements NettyClient{
|
||||
public void removeClient(String key , String id){
|
||||
List<SocketIOClient> keyClients = this.getClients(key) ;
|
||||
for(SocketIOClient client : keyClients){
|
||||
if(UKTools.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
if(MainUtils.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
keyClients.remove(client) ;
|
||||
break ;
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ package com.chatopera.cc.app.im.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
/**
|
||||
* 呼叫中心登录坐席
|
||||
@ -42,7 +42,7 @@ public class NettyCallCenterClient implements NettyClient{
|
||||
public void removeClient(String key , String id){
|
||||
List<SocketIOClient> keyClients = this.getClients(key) ;
|
||||
for(SocketIOClient client : keyClients){
|
||||
if(UKTools.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
if(MainUtils.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
keyClients.remove(client) ;
|
||||
break ;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.client;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
||||
@ -41,7 +41,7 @@ public class NettyCalloutClient implements NettyClient{
|
||||
public void removeClient(String key , String id){
|
||||
List<SocketIOClient> keyClients = this.getClients(key) ;
|
||||
for(SocketIOClient client : keyClients){
|
||||
if(UKTools.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
if(MainUtils.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
keyClients.remove(client) ;
|
||||
break ;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.client;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
|
||||
@ -42,7 +42,7 @@ public class NettyChatbotClient implements NettyClient{
|
||||
public void removeClient(String key , String id){
|
||||
List<SocketIOClient> keyClients = this.getClients(key) ;
|
||||
for(SocketIOClient client : keyClients){
|
||||
if(UKTools.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
if(MainUtils.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
keyClients.remove(client) ;
|
||||
break ;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ package com.chatopera.cc.app.im.client;
|
||||
import java.util.List;
|
||||
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -58,7 +58,7 @@ public class NettyClients {
|
||||
public void closeIMEventClient(String id , String sessionid, String orgi){
|
||||
List<SocketIOClient> userClients = imClients.getClients(id) ;
|
||||
for(SocketIOClient userClient : userClients){
|
||||
if(UKTools.getContextID(userClient.getSessionId().toString()).equals(sessionid)){
|
||||
if(MainUtils.getContextID(userClient.getSessionId().toString()).equals(sessionid)){
|
||||
userClient.disconnect();
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
public class NettyIMClient implements NettyClient{
|
||||
|
||||
@ -41,7 +41,7 @@ public class NettyIMClient implements NettyClient{
|
||||
public void removeClient(String key , String id){
|
||||
List<SocketIOClient> keyClients = this.getClients(key) ;
|
||||
for(SocketIOClient client : keyClients){
|
||||
if(UKTools.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
if(MainUtils.getContextID(client.getSessionId().toString()).equals(id)){
|
||||
keyClients.remove(client) ;
|
||||
break ;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
@ -79,13 +79,13 @@ public class AgentEventHandler
|
||||
}
|
||||
}
|
||||
InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress() ;
|
||||
String ip = UKTools.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
|
||||
|
||||
WorkSessionRepository workSessionRepository = MainContext.getContext().getBean(WorkSessionRepository.class) ;
|
||||
int count = workSessionRepository.countByAgentAndDatestrAndOrgi(user, UKTools.simpleDateFormat.format(new Date()), orgi) ;
|
||||
int count = workSessionRepository.countByAgentAndDatestrAndOrgi(user, MainUtils.simpleDateFormat.format(new Date()), orgi) ;
|
||||
|
||||
workSessionRepository.save(UKTools.createWorkSession(user, UKTools.getContextID(client.getSessionId().toString()), session, orgi, ip, address.getHostName() , admin , count == 0)) ;
|
||||
workSessionRepository.save(MainUtils.createWorkSession(user, MainUtils.getContextID(client.getSessionId().toString()), session, orgi, ip, address.getHostName() , admin , count == 0)) ;
|
||||
|
||||
NettyClients.getInstance().putAgentEventClient(user, client);
|
||||
}
|
||||
@ -100,10 +100,10 @@ public class AgentEventHandler
|
||||
String admin = client.getHandshakeData().getSingleUrlParam("admin") ;
|
||||
if(!StringUtils.isBlank(user)){
|
||||
ServiceQuene.deleteAgentStatus(user, orgi, !StringUtils.isBlank(admin) && admin.equals("true"));
|
||||
NettyClients.getInstance().removeAgentEventClient(user , UKTools.getContextID(client.getSessionId().toString()));
|
||||
NettyClients.getInstance().removeAgentEventClient(user , MainUtils.getContextID(client.getSessionId().toString()));
|
||||
|
||||
WorkSessionRepository workSessionRepository = MainContext.getContext().getBean(WorkSessionRepository.class) ;
|
||||
List<WorkSession> workSessionList = workSessionRepository.findByOrgiAndClientid(orgi, UKTools.getContextID(client.getSessionId().toString())) ;
|
||||
List<WorkSession> workSessionList = workSessionRepository.findByOrgiAndClientid(orgi, MainUtils.getContextID(client.getSessionId().toString())) ;
|
||||
if(workSessionList.size() > 0) {
|
||||
WorkSession workSession = workSessionList.get(0) ;
|
||||
workSession.setEndtime(new Date());
|
||||
@ -165,7 +165,7 @@ public class AgentEventHandler
|
||||
}
|
||||
|
||||
if(agentUser!=null && user!=null && user.equals(agentUser.getAgentno())){
|
||||
data.setId(UKTools.getUUID());
|
||||
data.setId(MainUtils.getUUID());
|
||||
data.setContextid(agentUser.getContextid());
|
||||
|
||||
data.setAgentserviceid(agentUser.getAgentserviceid());
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package com.chatopera.cc.app.im.handler;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.corundumstudio.socketio.SocketIOClient;
|
||||
import com.corundumstudio.socketio.SocketIOServer;
|
||||
@ -54,7 +54,7 @@ public class CalloutEventHandler
|
||||
if(!StringUtils.isBlank(user) && !StringUtils.isBlank(user)){
|
||||
client.set("agentno", user);
|
||||
InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress() ;
|
||||
String ip = UKTools.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
|
||||
NettyClients.getInstance().putCalloutEventClient(user, client);
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class CalloutEventHandler
|
||||
String session = client.getHandshakeData().getSingleUrlParam("session") ;
|
||||
String admin = client.getHandshakeData().getSingleUrlParam("admin") ;
|
||||
logger.info("onDisconnect userid {}, orgi {}", user, orgi);
|
||||
NettyClients.getInstance().removeCalloutEventClient(user, UKTools.getContextID(client.getSessionId().toString()));
|
||||
NettyClients.getInstance().removeCalloutEventClient(user, MainUtils.getContextID(client.getSessionId().toString()));
|
||||
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ package com.chatopera.cc.app.im.handler;
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.IP;
|
||||
import com.chatopera.cc.util.IPTools;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.model.*;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
@ -88,12 +88,12 @@ public class ChatbotEventHandler {
|
||||
outMessage.setMessageType(MainContext.MessageTypeEnum.MESSAGE.toString());
|
||||
outMessage.setCalltype(MainContext.CallTypeEnum.IN.toString());
|
||||
outMessage.setNickName(invite.getAiname());
|
||||
outMessage.setCreatetime(UKTools.dateFormate.format(now));
|
||||
outMessage.setCreatetime(MainUtils.dateFormate.format(now));
|
||||
|
||||
client.sendEvent(MainContext.MessageTypeEnum.STATUS.toString(), outMessage);
|
||||
|
||||
InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress();
|
||||
String ip = UKTools.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString());
|
||||
String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString());
|
||||
OnlineUser onlineUser = getOnlineUserRes().findOne(user);
|
||||
|
||||
if (onlineUser == null) {
|
||||
@ -102,7 +102,7 @@ public class ChatbotEventHandler {
|
||||
if (StringUtils.isNotBlank(nickname)) {
|
||||
onlineUser.setUsername(nickname);
|
||||
} else {
|
||||
onlineUser.setUsername(MainContext.GUEST_USER + "_" + UKTools.genIDByKey(user));
|
||||
onlineUser.setUsername(MainContext.GUEST_USER + "_" + MainUtils.genIDByKey(user));
|
||||
}
|
||||
|
||||
onlineUser.setSessionid(session);
|
||||
@ -161,7 +161,7 @@ public class ChatbotEventHandler {
|
||||
String user = client.getHandshakeData().getSingleUrlParam("userid");
|
||||
String orgi = client.getHandshakeData().getSingleUrlParam("orgi");
|
||||
if (StringUtils.isNotBlank(user)) {
|
||||
NettyClients.getInstance().removeChatbotEventClient(user, UKTools.getContextID(client.getSessionId().toString()));
|
||||
NettyClients.getInstance().removeChatbotEventClient(user, MainUtils.getContextID(client.getSessionId().toString()));
|
||||
AgentUser agentUser = (AgentUser) CacheHelper.getAgentUserCacheBean().getCacheObject(user, orgi);
|
||||
OnlineUser onlineUser = (OnlineUser) CacheHelper.getOnlineUserCacheBean().getCacheObject(user, orgi);
|
||||
if (agentUser != null) {
|
||||
@ -209,11 +209,11 @@ public class ChatbotEventHandler {
|
||||
} else if (!StringUtils.isBlank(data.getMessage()) && data.getMessage().length() > 300) {
|
||||
data.setMessage(data.getMessage().substring(0, 300));
|
||||
}
|
||||
data.setSessionid(UKTools.getContextID(client.getSessionId().toString()));
|
||||
data.setSessionid(MainUtils.getContextID(client.getSessionId().toString()));
|
||||
/**
|
||||
* 处理表情
|
||||
*/
|
||||
data.setMessage(UKTools.processEmoti(data.getMessage()));
|
||||
data.setMessage(MainUtils.processEmoti(data.getMessage()));
|
||||
data.setTousername(invite.getAiname());
|
||||
|
||||
data.setAiid(aiid);
|
||||
|
@ -19,6 +19,7 @@ package com.chatopera.cc.app.im.handler;
|
||||
import java.util.List;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@ -28,7 +29,6 @@ import com.corundumstudio.socketio.SocketIOServer;
|
||||
import com.corundumstudio.socketio.annotation.OnConnect;
|
||||
import com.corundumstudio.socketio.annotation.OnDisconnect;
|
||||
import com.corundumstudio.socketio.annotation.OnEvent;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.repository.ChatMessageRepository;
|
||||
import com.chatopera.cc.app.service.repository.IMGroupUserRepository;
|
||||
@ -137,7 +137,7 @@ public class EntIMEventHandler
|
||||
|
||||
data.setUserid(user);
|
||||
// data.setUsername(name);
|
||||
data.setId(UKTools.getUUID());
|
||||
data.setId(MainUtils.getUUID());
|
||||
data.setUsession(user);
|
||||
data.setCalltype(MainContext.CallTypeEnum.OUT.toString());
|
||||
|
||||
|
@ -24,6 +24,7 @@ import java.util.List;
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.im.message.ChatMessage;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@ -33,7 +34,6 @@ import com.corundumstudio.socketio.SocketIOServer;
|
||||
import com.corundumstudio.socketio.annotation.OnConnect;
|
||||
import com.corundumstudio.socketio.annotation.OnDisconnect;
|
||||
import com.corundumstudio.socketio.annotation.OnEvent;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.service.impl.AgentUserService;
|
||||
@ -81,7 +81,7 @@ public class IMEventHandler
|
||||
* 用户进入到对话连接 , 排队用户请求 , 如果返回失败,表示当前坐席全忙,用户进入排队状态,当前提示信息 显示 当前排队的队列位置,不可进行对话,用户发送的消息作为留言处理
|
||||
*/
|
||||
InetSocketAddress address = (InetSocketAddress) client.getRemoteAddress() ;
|
||||
String ip = UKTools.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
String ip = MainUtils.getIpAddr(client.getHandshakeData().getHttpHeaders(), address.getHostString()) ;
|
||||
NewRequestMessage newRequestMessage = OnlineUserUtils.newRequestMessage(user, orgi , session , appid , ip , client.getHandshakeData().getSingleUrlParam("osname") , client.getHandshakeData().getSingleUrlParam("browser") , MainContext.ChannelTypeEnum.WEBIM.toString() , skill , agent , nickname , title , url , traceid , MainContext.ChatInitiatorType.USER.toString()) ;
|
||||
// /**
|
||||
// * 加入到 缓存列表
|
||||
@ -94,7 +94,7 @@ public class IMEventHandler
|
||||
outMessage.setMessageType(MainContext.MessageTypeEnum.MESSAGE.toString());
|
||||
outMessage.setCalltype(MainContext.CallTypeEnum.IN.toString());
|
||||
outMessage.setNickName(newRequestMessage.getUsername());
|
||||
outMessage.setCreatetime(UKTools.dateFormate.format(new Date()));
|
||||
outMessage.setCreatetime(MainUtils.dateFormate.format(new Date()));
|
||||
outMessage.setAgentserviceid(newRequestMessage.getAgentserviceid());
|
||||
|
||||
outMessage.setNoagent(newRequestMessage.isNoagent());
|
||||
@ -125,7 +125,7 @@ public class IMEventHandler
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
NettyClients.getInstance().removeIMEventClient(user ,UKTools.getContextID(client.getSessionId().toString()));
|
||||
NettyClients.getInstance().removeIMEventClient(user , MainUtils.getContextID(client.getSessionId().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ public class IMEventHandler
|
||||
/**
|
||||
* 处理表情
|
||||
*/
|
||||
data.setMessage(UKTools.processEmoti(data.getMessage()));
|
||||
data.setMessage(MainUtils.processEmoti(data.getMessage()));
|
||||
|
||||
MessageUtils.createMessage(data , MainContext.MediaTypeEnum.TEXT.toString(), data.getUserid());
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.message;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
public class AgentServiceMessage extends Message{
|
||||
/**
|
||||
@ -25,7 +25,7 @@ public class AgentServiceMessage extends Message{
|
||||
private static final long serialVersionUID = 3520656734252136303L;
|
||||
|
||||
private String type ;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.message;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
public class AgentStatusMessage extends Message{
|
||||
/**
|
||||
@ -25,7 +25,7 @@ public class AgentStatusMessage extends Message{
|
||||
private static final long serialVersionUID = 3520656734252136303L;
|
||||
|
||||
private String type ;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
|
@ -31,7 +31,7 @@ import javax.persistence.Transient;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.event.UserEvent;
|
||||
import com.chatopera.cc.util.OnlineUserUtils;
|
||||
|
||||
@ -44,7 +44,7 @@ public class ChatMessage implements java.io.Serializable ,UserEvent{
|
||||
*/
|
||||
private static final long serialVersionUID = 3520656734252136303L;
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String appid ;
|
||||
private String userid ;
|
||||
private String username ;
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.message;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
|
||||
public abstract class Message implements java.io.Serializable{
|
||||
@ -26,7 +25,7 @@ public abstract class Message implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1872188129813937898L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String appid ;
|
||||
private String userid ;
|
||||
private String username ;
|
||||
|
@ -16,14 +16,14 @@
|
||||
*/
|
||||
package com.chatopera.cc.app.im.message;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
public class NewRequestMessage extends Message{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 3520656734252136303L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String type ;
|
||||
private boolean noagent ;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.chatopera.cc.app.im.router;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.model.AgentService;
|
||||
@ -33,7 +33,7 @@ public class MessageRouter extends Router{
|
||||
outMessage.setOrgi(inMessage.getOrgi());
|
||||
outMessage.setFromUser(inMessage.getToUser());
|
||||
outMessage.setToUser(inMessage.getFromUser());
|
||||
outMessage.setId(UKTools.genID());
|
||||
outMessage.setId(MainUtils.genID());
|
||||
outMessage.setMessageType(inMessage.getMessageType());
|
||||
outMessage.setUser(inMessage.getUser());
|
||||
outMessage.setAgentUser(inMessage.getAgentUser());
|
||||
|
@ -22,6 +22,7 @@ import java.util.Enumeration;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.Menu;
|
||||
import com.chatopera.cc.app.model.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -30,7 +31,6 @@ import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.handler.Handler;
|
||||
import com.chatopera.cc.app.model.RequestLog;
|
||||
|
||||
@ -85,7 +85,7 @@ public class LogIntercreptorHandler implements org.springframework.web.servlet.H
|
||||
while(names.hasMoreElements()){
|
||||
String paraName=(String)names.nextElement();
|
||||
if(paraName.indexOf("password") >= 0) {
|
||||
str.append(paraName).append("=").append(UKTools.encryption(request.getParameter(paraName))).append(",");
|
||||
str.append(paraName).append("=").append(MainUtils.encryption(request.getParameter(paraName))).append(",");
|
||||
}else {
|
||||
str.append(paraName).append("=").append(request.getParameter(paraName)).append(",");
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class LogIntercreptorHandler implements org.springframework.web.servlet.H
|
||||
}
|
||||
|
||||
log.setParameters(str.toString());
|
||||
UKTools.published(log);
|
||||
MainUtils.published(log);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
import com.chatopera.cc.app.model.SystemConfig;
|
||||
import com.chatopera.cc.app.model.UKeFuDic;
|
||||
@ -62,7 +62,7 @@ public class UserInterceptorHandler extends HandlerInterceptorAdapter {
|
||||
ModelAndView view) throws Exception {
|
||||
User user = (User) arg0.getSession().getAttribute(MainContext.USER_SESSION_NAME) ;
|
||||
String infoace = (String) arg0.getSession().getAttribute(MainContext.UKEFU_SYSTEM_INFOACQ) ; //进入信息采集模式
|
||||
SystemConfig systemConfig = UKTools.getSystemConfig();
|
||||
SystemConfig systemConfig = MainUtils.getSystemConfig();
|
||||
if( view!=null){
|
||||
if(user!=null){
|
||||
view.addObject("user", user) ;
|
||||
@ -93,7 +93,7 @@ public class UserInterceptorHandler extends HandlerInterceptorAdapter {
|
||||
view.addObject("infoace", infoace) ; //进入信息采集模式
|
||||
}
|
||||
view.addObject("webimport", MainContext.getWebIMPort()) ;
|
||||
view.addObject("sessionid", UKTools.getContextID(arg0.getSession().getId())) ;
|
||||
view.addObject("sessionid", MainUtils.getContextID(arg0.getSession().getId())) ;
|
||||
|
||||
view.addObject("models", MainContext.model) ;
|
||||
|
||||
@ -107,7 +107,7 @@ public class UserInterceptorHandler extends HandlerInterceptorAdapter {
|
||||
if(imUser == null && view!=null){
|
||||
imUser = new User();
|
||||
imUser.setUsername(MainContext.GUEST_USER) ;
|
||||
imUser.setId(UKTools.getContextID(arg0.getSession(true).getId())) ;
|
||||
imUser.setId(MainUtils.getContextID(arg0.getSession(true).getId())) ;
|
||||
imUser.setSessionid(imUser.getId()) ;
|
||||
view.addObject("imuser", imUser) ;
|
||||
}
|
||||
|
@ -25,10 +25,9 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_webim_monitor")
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
@ -51,7 +50,7 @@ public class AgentReport implements java.io.Serializable{
|
||||
private String workresult ;
|
||||
private String dataid ;
|
||||
|
||||
private String datestr = UKTools.simpleDateFormat.format(new Date());
|
||||
private String datestr = MainUtils.simpleDateFormat.format(new Date());
|
||||
private String hourstr = new SimpleDateFormat("HH").format(new Date());
|
||||
private String datehourstr = new SimpleDateFormat("yyyy-MM-dd HH").format(new Date());
|
||||
public String getOrgi() {
|
||||
|
@ -31,7 +31,7 @@ import com.chatopera.cc.app.MainContext;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_agentservice")
|
||||
@ -44,7 +44,7 @@ public class AgentService implements Serializable {
|
||||
private long times;
|
||||
private Date servicetime;
|
||||
private String orgi;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String username;
|
||||
private String userid;
|
||||
private String channel;
|
||||
|
@ -29,7 +29,7 @@ import javax.persistence.Transient;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_agentuser")
|
||||
@ -69,7 +69,7 @@ public class AgentUser implements Serializable, Comparable<AgentUser> {
|
||||
private String status;
|
||||
private String appid;
|
||||
private String sessiontype;
|
||||
private String contextid = UKTools.getUUID();
|
||||
private String contextid = MainUtils.getUUID();
|
||||
private String agentserviceid;
|
||||
private String orgi;
|
||||
private long ordertime = System.currentTimeMillis();
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package com.chatopera.cc.app.model;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
@ -29,7 +29,7 @@ import java.util.Date;
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
public class ContactNotes {
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String contactid;
|
||||
private Date createtime;
|
||||
private Date updatetime;
|
||||
|
@ -24,11 +24,10 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Document(indexName = "cskefu", type = "contacts")
|
||||
@Entity
|
||||
@Table(name = "uk_contacts")
|
||||
@ -38,7 +37,7 @@ public class Contacts extends ESBean implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5781401948807231526L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String gender;
|
||||
private String cusbirthday;
|
||||
private String ctype;
|
||||
|
@ -29,7 +29,7 @@ import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
@Entity
|
||||
@Table(name = "uk_cube")
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
@ -223,6 +223,6 @@ public class Cube implements java.io.Serializable{
|
||||
}
|
||||
@Transient
|
||||
public String getTable(){
|
||||
return "c_d_"+UKTools.md5(this.getId());
|
||||
return "c_d_"+ MainUtils.md5(this.getId());
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ import javax.persistence.Table;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Document(indexName = "cskefu", type = "entcustomer")
|
||||
@Entity
|
||||
@ -41,7 +41,7 @@ public class EntCustomer extends ESBean implements java.io.Serializable{
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String name;
|
||||
private String etype;
|
||||
|
@ -32,7 +32,7 @@ import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
import org.springframework.data.elasticsearch.annotations.Parent;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Document(indexName = "cskefu", type = "favorites" , createIndex = false )
|
||||
@Entity
|
||||
@ -44,7 +44,7 @@ public class Favorites implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8667838872697390231L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String name ;
|
||||
private String code = "true";
|
||||
private String title ;
|
||||
|
@ -25,10 +25,9 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_act_formfilter_item")
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
@ -39,7 +38,7 @@ public class FormFilterItem implements java.io.Serializable{
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String formfilterid;
|
||||
|
||||
|
@ -26,11 +26,10 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@ -49,7 +48,7 @@ public class KbsTopic extends ESBean implements java.io.Serializable , UKAgg{
|
||||
*
|
||||
*/
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String sessionid ;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldIndex;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
@Document(indexName = "cskefu", type = "kbs_topiccomment")
|
||||
public class KbsTopicComment implements UKAgg{
|
||||
|
||||
@ -39,7 +39,7 @@ public class KbsTopicComment implements UKAgg{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -4911955236794918875L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String username;
|
||||
private String creater ;
|
||||
|
||||
|
@ -26,13 +26,13 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldIndex;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
@Document(indexName = "cskefu", type = "orderscomment")
|
||||
@Entity
|
||||
@Table(name = "uk_orderscomment")
|
||||
@ -43,7 +43,7 @@ public class OrdersComment implements UKAgg{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -4911955236794918875L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String username;
|
||||
private String creater ;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import javax.persistence.Transient;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
@Entity
|
||||
@Table(name = "uk_publishedcube")
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
@ -201,7 +201,7 @@ public class PublishedCube implements java.io.Serializable{
|
||||
public Cube getCube() {
|
||||
Base64 base64 = new Base64();
|
||||
try {
|
||||
return cube!=null ? cube : (cube = (this.cubecontent==null?null:(Cube)UKTools.toObject(base64.decode(this.cubecontent))));
|
||||
return cube!=null ? cube : (cube = (this.cubecontent==null?null:(Cube) MainUtils.toObject(base64.decode(this.cubecontent))));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ import org.apache.commons.codec.binary.Base64;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
@Document(indexName = "cskefu", type = "publishedreport")
|
||||
@Entity
|
||||
@Table(name = "uk_publishedreport")
|
||||
@ -146,7 +146,7 @@ public class PublishedReport implements java.io.Serializable{
|
||||
public Report getReport() {
|
||||
Base64 base64 = new Base64();
|
||||
try {
|
||||
return report!=null ? report : (report = (this.reportcontent==null?null:(Report)UKTools.toObject(base64.decode(this.reportcontent))));
|
||||
return report!=null ? report : (report = (this.reportcontent==null?null:(Report) MainUtils.toObject(base64.decode(this.reportcontent))));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import javax.persistence.Table;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Document(indexName = "cskefu", type = "quickreply")
|
||||
@Entity
|
||||
@ -35,7 +35,7 @@ import com.chatopera.cc.util.UKTools;
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
public class QuickReply {
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String title ; //标题
|
||||
private String content ; //内容
|
||||
|
@ -27,7 +27,7 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
@ -40,7 +40,7 @@ public class Report extends ESBean implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5781401948807231526L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String name ;
|
||||
private String reporttype ; //0 代表动态报表 1 代表自助查询报表
|
||||
private String viewtype;
|
||||
|
@ -34,7 +34,7 @@ import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_reportfilter")
|
||||
@ -425,7 +425,7 @@ public class ReportFilter implements java.io.Serializable{
|
||||
}
|
||||
@Transient
|
||||
public Template templet(){
|
||||
return UKTools.getTemplate(this.filtertemplet) ;
|
||||
return MainUtils.getTemplate(this.filtertemplet) ;
|
||||
}
|
||||
public String getFiltertemplet() {
|
||||
return filtertemplet;
|
||||
|
@ -29,12 +29,11 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.bi.ReportData;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_reportmodel")
|
||||
@ -44,7 +43,7 @@ public class ReportModel implements java.io.Serializable {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String posx ;
|
||||
private String posy ;
|
||||
private String poswidth;
|
||||
@ -688,7 +687,7 @@ public class ReportModel implements java.io.Serializable {
|
||||
this.colindex = colindex;
|
||||
}
|
||||
public Template templet() {
|
||||
return UKTools.getTemplate(this.templetid) ;
|
||||
return MainUtils.getTemplate(this.templetid) ;
|
||||
}
|
||||
@Transient
|
||||
public List<ColumnProperties> getProperties() {
|
||||
@ -738,7 +737,7 @@ public class ReportModel implements java.io.Serializable {
|
||||
public ChartProperties getChartProperties() {
|
||||
Base64 base64 = new Base64();
|
||||
try {
|
||||
return chartProperties!=null ? chartProperties : (chartProperties = (this.chartcontent==null?null:(ChartProperties)UKTools.toObject(base64.decode(this.chartcontent))));
|
||||
return chartProperties!=null ? chartProperties : (chartProperties = (this.chartcontent==null?null:(ChartProperties) MainUtils.toObject(base64.decode(this.chartcontent))));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -746,7 +745,7 @@ public class ReportModel implements java.io.Serializable {
|
||||
}
|
||||
@Transient
|
||||
public String getChartPropertiesJson() {
|
||||
return UKTools.toJson(getChartProperties());
|
||||
return MainUtils.toJson(getChartProperties());
|
||||
}
|
||||
public String getChartcontent() {
|
||||
return chartcontent;
|
||||
|
@ -27,7 +27,7 @@ import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
|
||||
/**
|
||||
@ -46,7 +46,7 @@ public class Scene implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String sessionid ;
|
||||
|
||||
|
@ -24,17 +24,16 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_ai")
|
||||
@org.hibernate.annotations.Proxy(lazy = false)
|
||||
public class ServiceAi implements java.io.Serializable{
|
||||
private static final long serialVersionUID = 1115593425069549681L;
|
||||
|
||||
private String id = UKTools.getUUID() ;
|
||||
private String id = MainUtils.getUUID() ;
|
||||
private String name ;
|
||||
private String code ;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_callcenter_event")
|
||||
@ -160,7 +160,7 @@ public class StatusEvent implements Serializable, Comparable<StatusEvent>{
|
||||
private String satisfaction ; //满意度评价
|
||||
private Date satisfdate ; //满意度调查提交时间
|
||||
|
||||
private String datestr = UKTools.simpleDateFormat.format(new Date());
|
||||
private String datestr = MainUtils.simpleDateFormat.format(new Date());
|
||||
private String hourstr = new SimpleDateFormat("HH").format(new Date());
|
||||
|
||||
|
||||
|
@ -27,11 +27,10 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
|
||||
/**
|
||||
* 表 uk_xiaoe_topic
|
||||
@ -50,7 +49,7 @@ public class Topic implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String sessionid ;
|
||||
|
||||
|
@ -27,7 +27,7 @@ import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "uk_act_callnames")
|
||||
@ -39,7 +39,7 @@ public class UKefuCallOutNames implements java.io.Serializable{
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String orgi ; //租户ID
|
||||
private String organ ; //创建部门
|
||||
private String creater ; //创建人
|
||||
|
@ -25,11 +25,10 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.chatopera.cc.event.UserEvent;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Proxy;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
@Entity
|
||||
@Table(name="uk_userevent")
|
||||
@Proxy(lazy=false)
|
||||
@ -38,7 +37,7 @@ public class UserHistory implements UserEvent {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -9167939944520945485L;
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
private String username;
|
||||
private String creater;
|
||||
private Date createtime = new Date();
|
||||
@ -66,7 +65,7 @@ public class UserHistory implements UserEvent {
|
||||
private String sessionid ;
|
||||
private String param ;
|
||||
private int times ;
|
||||
private String createdate = UKTools.simpleDateFormat.format(new Date());
|
||||
private String createdate = MainUtils.simpleDateFormat.format(new Date());
|
||||
private String model = "app";
|
||||
@Id
|
||||
@Column(length=32)
|
||||
|
@ -25,11 +25,10 @@ import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@ -48,7 +47,7 @@ public class WorkOrders extends ESBean implements UKAgg{
|
||||
*
|
||||
*/
|
||||
|
||||
private String id = UKTools.getUUID();
|
||||
private String id = MainUtils.getUUID();
|
||||
|
||||
private String orderno ; //工单编号
|
||||
private String sessionid ;
|
||||
|
@ -17,16 +17,16 @@
|
||||
package com.chatopera.cc.app.service.acd;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.WebIMReport;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.im.router.OutMessageRouter;
|
||||
import com.chatopera.cc.app.model.*;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.quene.AgentStatusBusyOrgiFilter;
|
||||
import com.chatopera.cc.app.service.quene.AgentStatusOrgiFilter;
|
||||
import com.chatopera.cc.app.service.quene.AgentUserOrgiFilter;
|
||||
import com.chatopera.cc.app.service.repository.*;
|
||||
import com.chatopera.cc.app.im.router.OutMessageRouter;
|
||||
import com.chatopera.cc.util.WebIMReport;
|
||||
import com.corundumstudio.socketio.SocketIONamespace;
|
||||
import com.hazelcast.core.IMap;
|
||||
import com.hazelcast.mapreduce.aggregation.Aggregations;
|
||||
@ -205,7 +205,7 @@ public class ServiceQuene {
|
||||
outMessage.setMessageType(MainContext.MediaTypeEnum.TEXT.toString());
|
||||
outMessage.setCalltype(MainContext.CallTypeEnum.IN.toString());
|
||||
outMessage.setNickName(agentStatus.getUsername());
|
||||
outMessage.setCreatetime(UKTools.dateFormate.format(new Date()));
|
||||
outMessage.setCreatetime(MainUtils.dateFormate.format(new Date()));
|
||||
|
||||
if (!StringUtils.isBlank(agentUser.getUserid())) {
|
||||
OutMessageRouter router = null;
|
||||
@ -324,7 +324,7 @@ public class ServiceQuene {
|
||||
} else {
|
||||
outMessage.setNickName(agentUser.getUsername());
|
||||
}
|
||||
outMessage.setCreatetime(UKTools.dateFormate.format(new Date()));
|
||||
outMessage.setCreatetime(MainUtils.dateFormate.format(new Date()));
|
||||
outMessage.setAgentserviceid(agentUser.getAgentserviceid());
|
||||
|
||||
router.handler(agentUser.getUserid(), MainContext.MessageTypeEnum.STATUS.toString(), agentUser.getAppid(), outMessage);
|
||||
@ -407,13 +407,13 @@ public class ServiceQuene {
|
||||
workMonitor.setBusy(true);
|
||||
}
|
||||
if (status.equals(MainContext.AgentStatusEnum.READY.toString())) {
|
||||
int count = workMonitorRes.countByAgentAndDatestrAndStatusAndOrgi(agent, UKTools.simpleDateFormat.format(new Date()), MainContext.AgentStatusEnum.READY.toString(), orgi);
|
||||
int count = workMonitorRes.countByAgentAndDatestrAndStatusAndOrgi(agent, MainUtils.simpleDateFormat.format(new Date()), MainContext.AgentStatusEnum.READY.toString(), orgi);
|
||||
if (count == 0) {
|
||||
workMonitor.setFirsttime(true);
|
||||
}
|
||||
}
|
||||
if (current.equals(MainContext.AgentStatusEnum.NOTREADY.toString())) {
|
||||
List<WorkMonitor> workMonitorList = workMonitorRes.findByOrgiAndAgentAndDatestrAndFirsttime(orgi, agent, UKTools.simpleDateFormat.format(new Date()), true);
|
||||
List<WorkMonitor> workMonitorList = workMonitorRes.findByOrgiAndAgentAndDatestrAndFirsttime(orgi, agent, MainUtils.simpleDateFormat.format(new Date()), true);
|
||||
if (workMonitorList.size() > 0) {
|
||||
WorkMonitor firstWorkMonitor = workMonitorList.get(0);
|
||||
if (firstWorkMonitor.getFirsttimes() == 0) {
|
||||
@ -423,7 +423,7 @@ public class ServiceQuene {
|
||||
}
|
||||
}
|
||||
workMonitor.setCreatetime(new Date());
|
||||
workMonitor.setDatestr(UKTools.simpleDateFormat.format(new Date()));
|
||||
workMonitor.setDatestr(MainUtils.simpleDateFormat.format(new Date()));
|
||||
|
||||
workMonitor.setName(agent);
|
||||
workMonitor.setOrgi(orgi);
|
||||
@ -584,7 +584,7 @@ public class ServiceQuene {
|
||||
}
|
||||
agentService.setOrgi(orgi);
|
||||
|
||||
UKTools.copyProperties(agentUser, agentService); //复制属性
|
||||
MainUtils.copyProperties(agentUser, agentService); //复制属性
|
||||
|
||||
agentService.setChannel(agentUser.getChannel());
|
||||
|
||||
@ -604,7 +604,7 @@ public class ServiceQuene {
|
||||
agentService.setSkill(agentUser.getSkill());
|
||||
|
||||
if (sessionConfig.isLastagent()) { //启用了历史坐席优先 , 查找 历史服务坐席
|
||||
List<WebIMReport> webIMaggList = UKTools.getWebIMDataAgg(onlineUserRes.findByOrgiForDistinctAgent(orgi, agentUser.getUserid()));
|
||||
List<WebIMReport> webIMaggList = MainUtils.getWebIMDataAgg(onlineUserRes.findByOrgiForDistinctAgent(orgi, agentUser.getUserid()));
|
||||
if (webIMaggList.size() > 0) {
|
||||
for (WebIMReport report : webIMaggList) {
|
||||
if (report.getData().equals(agentStatus.getAgentno())) {
|
||||
|
@ -31,7 +31,7 @@ import com.chatopera.cc.app.model.ColumnProperties;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.bi.CubeReportData;
|
||||
import com.chatopera.cc.util.bi.model.FirstTitle;
|
||||
import com.chatopera.cc.util.bi.model.Level;
|
||||
@ -60,10 +60,10 @@ public class CubeService {
|
||||
if(!mdxFileDir.exists()){
|
||||
mdxFileDir.mkdirs() ;
|
||||
}
|
||||
schemaFile = new File(mdxFileDir , UKTools.getUUID()+".xml") ;
|
||||
schemaFile = new File(mdxFileDir , MainUtils.getUUID()+".xml") ;
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(CubeService.class.getClassLoader().getResourceAsStream(SCHEMA_DATA_PATH+xml), writer, "UTF-8");
|
||||
FileUtils.write(schemaFile,UKTools.getTemplet(writer.toString(), requestValues) , "UTF-8"); //使用系统默认编码
|
||||
FileUtils.write(schemaFile, MainUtils.getTemplet(writer.toString(), requestValues) , "UTF-8"); //使用系统默认编码
|
||||
}
|
||||
|
||||
public CubeService(String xml , String path , DataSourceService dataSource , Map<String,Object> requestValues,boolean isContentStr) throws IOException, TemplateException {
|
||||
@ -72,13 +72,13 @@ public class CubeService {
|
||||
if(!mdxFileDir.exists()){
|
||||
mdxFileDir.mkdirs() ;
|
||||
}
|
||||
schemaFile = new File(mdxFileDir , UKTools.getUUID()+".xml") ;
|
||||
schemaFile = new File(mdxFileDir , MainUtils.getUUID()+".xml") ;
|
||||
if(isContentStr) {
|
||||
FileUtils.write(schemaFile,UKTools.getTemplet(xml, requestValues) , "UTF-8"); //使用系统默认编码
|
||||
FileUtils.write(schemaFile, MainUtils.getTemplet(xml, requestValues) , "UTF-8"); //使用系统默认编码
|
||||
}else {
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(CubeService.class.getClassLoader().getResourceAsStream(SCHEMA_DATA_PATH+xml), writer, "UTF-8");
|
||||
FileUtils.write(schemaFile,UKTools.getTemplet(writer.toString(), requestValues) , "UTF-8"); //使用系统默认编码
|
||||
FileUtils.write(schemaFile, MainUtils.getTemplet(writer.toString(), requestValues) , "UTF-8"); //使用系统默认编码
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,13 +24,13 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.bi.ReportData;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.model.ColumnProperties;
|
||||
import com.chatopera.cc.app.model.Cube;
|
||||
import com.chatopera.cc.app.model.CubeLevel;
|
||||
@ -435,7 +435,7 @@ public class ReportCubeService{
|
||||
public static String getDefaultValue(ReportFilter filter , HttpServletRequest request){
|
||||
String value = filter.getDefaultvalue();
|
||||
if(value!=null && value.matches("[ ]{0,}[TtMmYy]{1,}[ ]{0,}[+-]{0,1}([\\d]{0,})")){//处理动态参数的问题 , Y表示 年 , 如 Y+1 , M表示 月 , 如:M+1 , T表示 日 , 如 T+1 , 例如,Y-1 = 2013 , M-1 = 8
|
||||
value = UKTools.processParam(filter.getFormatstr() , value);
|
||||
value = MainUtils.processParam(filter.getFormatstr() , value);
|
||||
}
|
||||
value = StringUtils.isBlank(filter.getRequestvalue()) ? value : filter.getRequestvalue();
|
||||
return value;
|
||||
@ -449,7 +449,7 @@ public class ReportCubeService{
|
||||
public static String getStartValue(ReportFilter filter , HttpServletRequest request){
|
||||
String startValue = filter.getStartvalue();
|
||||
if(startValue!=null && startValue.matches("[ ]{0,}[TtMmYy]{1,}[ ]{0,}[+-]{0,1}([\\d]{0,})")){//处理动态参数的问题 , Y表示 年 , 如 Y+1 , M表示 月 , 如:M+1 , T表示 日 , 如 T+1 , 例如,Y-1 = 2013 , M-1 = 8
|
||||
startValue = UKTools.processParam(filter.getFormatstr() , startValue);
|
||||
startValue = MainUtils.processParam(filter.getFormatstr() , startValue);
|
||||
}
|
||||
return StringUtils.isBlank(filter.getRequeststartvalue()) ? startValue :filter.getRequeststartvalue() ;
|
||||
}
|
||||
@ -462,7 +462,7 @@ public class ReportCubeService{
|
||||
public static String getEndValue(ReportFilter filter , HttpServletRequest request){
|
||||
String endValue = filter.getEndvalue();
|
||||
if(endValue!=null && endValue.matches("[ ]{0,}[TtMmYy]{1,}[ ]{0,}[+-]{0,1}([\\d]{0,})")){//处理动态参数的问题 , Y表示 年 , 如 Y+1 , M表示 月 , 如:M+1 , T表示 日 , 如 T+1 , 例如,Y-1 = 2013 , M-1 = 8
|
||||
endValue =UKTools.processParam(filter.getFormatstr() , endValue);
|
||||
endValue = MainUtils.processParam(filter.getFormatstr() , endValue);
|
||||
}
|
||||
return StringUtils.isBlank(filter.getRequestendvalue())? endValue : filter.getRequestendvalue();
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.model.JobDetail;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.es.SearchTools;
|
||||
import com.chatopera.cc.es.UKDataBean;
|
||||
import com.chatopera.cc.app.service.impl.BatchDataProcess;
|
||||
@ -131,7 +131,7 @@ public class ActivityResource extends Resource{
|
||||
}
|
||||
}else {
|
||||
task = new UKefuCallOutTask() ;
|
||||
task.setName(this.jobDetail.getName() + "_" + UKTools.dateFormate.format(new Date()));
|
||||
task.setName(this.jobDetail.getName() + "_" + MainUtils.dateFormate.format(new Date()));
|
||||
task.setBatid(formFilter.getBatid());
|
||||
|
||||
task.setOrgi(this.jobDetail.getOrgi());
|
||||
@ -161,8 +161,8 @@ public class ActivityResource extends Resource{
|
||||
|
||||
formFilter.setExecnum(formFilter.getExecnum() + 1);
|
||||
|
||||
UKTools.copyProperties(task, filter);
|
||||
filter.setName(this.formFilter.getName() + "_" + UKTools.dateFormate.format(new Date()));
|
||||
MainUtils.copyProperties(task, filter);
|
||||
filter.setName(this.formFilter.getName() + "_" + MainUtils.dateFormate.format(new Date()));
|
||||
filter.setExecnum(formFilter.getExecnum());
|
||||
this.callOutFilterRes.save(filter) ;
|
||||
}
|
||||
|
@ -24,10 +24,10 @@ import java.util.HashMap;
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.service.impl.BatchDataProcess;
|
||||
import com.chatopera.cc.app.model.JobDetail;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.util.task.DSData;
|
||||
import com.chatopera.cc.util.task.DSDataEvent;
|
||||
import com.chatopera.cc.util.task.ExcelImportProecess;
|
||||
@ -64,13 +64,13 @@ public class BatchResource extends Resource{
|
||||
if(metadataTable!=null && !StringUtils.isBlank(this.jobDetail.getBatchtype()) && this.jobDetail.getBatchtype().equals("plan")) {
|
||||
if(!StringUtils.isBlank(this.jobDetail.getImptype())) {
|
||||
if(this.jobDetail.getImptype().equals("local")) {
|
||||
tempFile = new File(UKTools.getTemplet(this.jobDetail.getImpurl(), new HashMap<String,Object>()));
|
||||
tempFile = new File(MainUtils.getTemplet(this.jobDetail.getImpurl(), new HashMap<String,Object>()));
|
||||
}else if(this.jobDetail.getImptype().equals("remote")){
|
||||
FileUtils.copyURLToFile(new URL(UKTools.getTemplet(this.jobDetail.getImpurl(), new HashMap<String,Object>())), tempFile = File.createTempFile("UKeFu-CallOut-Temp", ".xls"));
|
||||
FileUtils.copyURLToFile(new URL(MainUtils.getTemplet(this.jobDetail.getImpurl(), new HashMap<String,Object>())), tempFile = File.createTempFile("UKeFu-CallOut-Temp", ".xls"));
|
||||
}
|
||||
}
|
||||
if(tempFile.exists()) {
|
||||
String fileName = "callout/batch/"+UKTools.getUUID() + tempFile.getName().substring(tempFile.getName().lastIndexOf(".")) ;
|
||||
String fileName = "callout/batch/"+ MainUtils.getUUID() + tempFile.getName().substring(tempFile.getName().lastIndexOf(".")) ;
|
||||
File excelFile = new File(path , fileName) ;
|
||||
if(!excelFile.getParentFile().exists()){
|
||||
excelFile.getParentFile().mkdirs() ;
|
||||
@ -91,7 +91,7 @@ public class BatchResource extends Resource{
|
||||
|
||||
event.getDSData().getReport().setOrgi(this.jobDetail.getOrgi());
|
||||
event.getDSData().getReport().setDataid(this.jobDetail.getId());
|
||||
event.getDSData().getReport().setTitle(this.jobDetail.getName() + "_" + UKTools.dateFormate.format(new Date()));
|
||||
event.getDSData().getReport().setTitle(this.jobDetail.getName() + "_" + MainUtils.dateFormate.format(new Date()));
|
||||
}else {
|
||||
event.getDSData().getReport().setError(true);
|
||||
if(tempFile!=null) {
|
||||
|
@ -17,7 +17,7 @@ package com.chatopera.cc.app.service.task;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.util.Constants;
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.event.CallOutWireEvent;
|
||||
import com.chatopera.cc.exception.CSKefuException;
|
||||
@ -122,8 +122,8 @@ public class CallOutWireTask implements MessageListener {
|
||||
final Date createtime,
|
||||
final String callid,
|
||||
final Contacts lxr) {
|
||||
final String statusEventId = UKTools.getUUID();
|
||||
final String serviceId = UKTools.getUUID();
|
||||
final String statusEventId = MainUtils.getUUID();
|
||||
final String serviceId = MainUtils.getUUID();
|
||||
|
||||
// 通话记录
|
||||
StatusEvent statusEvent = new StatusEvent();
|
||||
@ -180,7 +180,7 @@ public class CallOutWireTask implements MessageListener {
|
||||
AgentService as = new AgentService();
|
||||
as.setOrgi(orgi);
|
||||
as.setId(serviceId);
|
||||
UKTools.copyProperties(agentUser, as);
|
||||
MainUtils.copyProperties(agentUser, as);
|
||||
as.setAgentuserid(agentUser.getId());
|
||||
as.setAgentserviceid(serviceId);
|
||||
as.setQualitystatus(MainContext.QualityStatus.NO.toString()); // 不做质检
|
||||
@ -195,7 +195,7 @@ public class CallOutWireTask implements MessageListener {
|
||||
if(lxr != null){
|
||||
// 创建联系人,坐席服务关联
|
||||
AgentUserContacts auc = new AgentUserContacts();
|
||||
auc.setId(UKTools.getUUID());
|
||||
auc.setId(MainUtils.getUUID());
|
||||
auc.setContactsid(lxr.getId());
|
||||
auc.setAppid(channel);
|
||||
auc.setCreatetime(now);
|
||||
@ -240,10 +240,10 @@ public class CallOutWireTask implements MessageListener {
|
||||
OnlineUser onlineUser = onlineUserRes.findByPhoneAndOrgi(visitorPhoneNumber, MainContext.SYSTEM_ORGI);
|
||||
if (onlineUser == null) {
|
||||
onlineUser = new OnlineUser();
|
||||
onlineUser.setId(UKTools.getUUID());
|
||||
onlineUser.setId(MainUtils.getUUID());
|
||||
onlineUser.setUserid(onlineUser.getId());
|
||||
onlineUser.setUsertype(MainContext.OnlineUserTypeStatus.TELECOM.toString());
|
||||
onlineUser.setUsername(MainContext.GUEST_USER + "_" + UKTools.genIDByKey(onlineUser.getId()));
|
||||
onlineUser.setUsername(MainContext.GUEST_USER + "_" + MainUtils.genIDByKey(onlineUser.getId()));
|
||||
onlineUser.setOrgi(MainContext.SYSTEM_ORGI);
|
||||
onlineUser.setMobile("0"); // 不是 移动客户端
|
||||
onlineUser.setPhone(visitorPhoneNumber);
|
||||
@ -496,7 +496,7 @@ public class CallOutWireTask implements MessageListener {
|
||||
*/
|
||||
public void callOutFail(final CallOutWireEvent event) throws CallOutRuntimeException {
|
||||
StatusEvent se = new StatusEvent();
|
||||
se.setId(UKTools.getUUID());
|
||||
se.setId(MainUtils.getUUID());
|
||||
se.setStatus(event.getStatus());
|
||||
se.setDuration(0);
|
||||
se.setDirection(event.getDirection());
|
||||
|
@ -24,9 +24,9 @@ import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.service.cache.CacheHelper;
|
||||
import com.chatopera.cc.app.service.resource.Resource;
|
||||
import com.chatopera.cc.app.model.JobDetail;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.ReporterRepository;
|
||||
import com.chatopera.cc.app.service.resource.OutputTextFormat;
|
||||
|
||||
@ -118,7 +118,7 @@ public class Fetcher implements Runnable {
|
||||
}
|
||||
this.job.getReport().setOrgi(this.job.getOrgi());
|
||||
this.job.getReport().setDataid(this.job.getId());
|
||||
this.job.getReport().setTitle(this.job.getName() + "_" + UKTools.dateFormate.format(new Date()));
|
||||
this.job.getReport().setTitle(this.job.getName() + "_" + MainUtils.dateFormate.format(new Date()));
|
||||
|
||||
this.job.getReport().setUserid(this.job.getCreater());
|
||||
this.job.getReport().setUsername(this.job.getUsername());
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.app.im.client.NettyClients;
|
||||
import com.chatopera.cc.app.MainUtils;
|
||||
import com.chatopera.cc.util.extra.DataExchangeInterface;
|
||||
import com.chatopera.cc.util.freeswitch.model.CallCenterAgent;
|
||||
import com.chatopera.cc.app.service.acd.ServiceQuene;
|
||||
@ -42,7 +43,6 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import com.chatopera.cc.util.UKTools;
|
||||
import com.chatopera.cc.app.service.repository.ChatMessageRepository;
|
||||
import com.chatopera.cc.app.service.repository.ConsultInviteRepository;
|
||||
import com.chatopera.cc.app.model.AgentStatus;
|
||||
@ -78,7 +78,7 @@ public class WebIMTask {
|
||||
if (sessionConfigList != null && sessionConfigList.size() > 0 && MainContext.getContext() != null) {
|
||||
for (SessionConfig sessionConfig : sessionConfigList) {
|
||||
if (sessionConfig.isSessiontimeout()) { //设置了启用 超时提醒
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastmessageLessThanAndStatusAndOrgi(UKTools.getLastTime(sessionConfig.getTimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastmessageLessThanAndStatusAndOrgi(MainUtils.getLastTime(sessionConfig.getTimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
for (AgentUserTask task : agentUserTask) { // 超时未回复
|
||||
AgentUser agentUser = (AgentUser) CacheHelper.getAgentUserCacheBean().getCacheObject(task.getUserid(), MainContext.SYSTEM_ORGI);
|
||||
if (agentUser != null && agentUser.getAgentno() != null) {
|
||||
@ -91,7 +91,7 @@ public class WebIMTask {
|
||||
//发送提示消息
|
||||
processMessage(sessionConfig, sessionConfig.getTimeoutmsg(), agentStatus.getUsername(), agentUser, agentStatus, task);
|
||||
agentUserTaskRes.save(task);
|
||||
} else if (sessionConfig.isResessiontimeout() && agentStatus != null && task.getWarningtime() != null && UKTools.getLastTime(sessionConfig.getRetimeout()).after(task.getWarningtime())) { //再次超时未回复
|
||||
} else if (sessionConfig.isResessiontimeout() && agentStatus != null && task.getWarningtime() != null && MainUtils.getLastTime(sessionConfig.getRetimeout()).after(task.getWarningtime())) { //再次超时未回复
|
||||
/**
|
||||
* 设置了再次超时 断开
|
||||
*/
|
||||
@ -105,12 +105,12 @@ public class WebIMTask {
|
||||
}
|
||||
}
|
||||
} else if (sessionConfig.isResessiontimeout()) { //未启用超时提醒,只设置了超时断开
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastmessageLessThanAndStatusAndOrgi(UKTools.getLastTime(sessionConfig.getRetimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastmessageLessThanAndStatusAndOrgi(MainUtils.getLastTime(sessionConfig.getRetimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
for (AgentUserTask task : agentUserTask) { // 超时未回复
|
||||
AgentUser agentUser = (AgentUser) CacheHelper.getAgentUserCacheBean().getCacheObject(task.getUserid(), MainContext.SYSTEM_ORGI);
|
||||
if (agentUser != null) {
|
||||
AgentStatus agentStatus = (AgentStatus) CacheHelper.getAgentStatusCacheBean().getCacheObject(agentUser.getAgentno(), task.getOrgi());
|
||||
if (agentStatus != null && task.getWarningtime() != null && UKTools.getLastTime(sessionConfig.getRetimeout()).after(task.getWarningtime())) { //再次超时未回复
|
||||
if (agentStatus != null && task.getWarningtime() != null && MainUtils.getLastTime(sessionConfig.getRetimeout()).after(task.getWarningtime())) { //再次超时未回复
|
||||
/**
|
||||
* 设置了再次超时 断开
|
||||
*/
|
||||
@ -125,7 +125,7 @@ public class WebIMTask {
|
||||
}
|
||||
}
|
||||
if (sessionConfig.isQuene()) { //启用排队超时功能,超时断开
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLogindateLessThanAndStatusAndOrgi(UKTools.getLastTime(sessionConfig.getQuenetimeout()), MainContext.AgentUserStatusEnum.INQUENE.toString(), sessionConfig.getOrgi());
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLogindateLessThanAndStatusAndOrgi(MainUtils.getLastTime(sessionConfig.getQuenetimeout()), MainContext.AgentUserStatusEnum.INQUENE.toString(), sessionConfig.getOrgi());
|
||||
for (AgentUserTask task : agentUserTask) { // 超时未回复
|
||||
AgentUser agentUser = (AgentUser) CacheHelper.getAgentUserCacheBean().getCacheObject(task.getUserid(), MainContext.SYSTEM_ORGI);
|
||||
if (agentUser != null) {
|
||||
@ -152,7 +152,7 @@ public class WebIMTask {
|
||||
for (SessionConfig sessionConfig : sessionConfigList) {
|
||||
sessionConfig = ServiceQuene.initSessionConfig(sessionConfig.getOrgi());
|
||||
if (sessionConfig != null && MainContext.getContext() != null && sessionConfig.isAgentreplaytimeout()) {
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastgetmessageLessThanAndStatusAndOrgi(UKTools.getLastTime(sessionConfig.getAgenttimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
List<AgentUserTask> agentUserTask = agentUserTaskRes.findByLastgetmessageLessThanAndStatusAndOrgi(MainUtils.getLastTime(sessionConfig.getAgenttimeout()), MainContext.AgentUserStatusEnum.INSERVICE.toString(), sessionConfig.getOrgi());
|
||||
for (AgentUserTask task : agentUserTask) { // 超时未回复
|
||||
AgentUser agentUser = (AgentUser) CacheHelper.getAgentUserCacheBean().getCacheObject(task.getUserid(), MainContext.SYSTEM_ORGI);
|
||||
if (agentUser != null) {
|
||||
@ -174,7 +174,7 @@ public class WebIMTask {
|
||||
|
||||
@Scheduled(fixedDelay = 600000) // 每分钟执行一次
|
||||
public void onlineuser() {
|
||||
Page<OnlineUser> pages = onlineUserRes.findByStatusAndCreatetimeLessThan(MainContext.OnlineUserOperatorStatus.ONLINE.toString(), UKTools.getLastTime(60), new PageRequest(0, 100));
|
||||
Page<OnlineUser> pages = onlineUserRes.findByStatusAndCreatetimeLessThan(MainContext.OnlineUserOperatorStatus.ONLINE.toString(), MainUtils.getLastTime(60), new PageRequest(0, 100));
|
||||
if (pages.getContent().size() > 0) {
|
||||
for (OnlineUser onlineUser : pages.getContent()) {
|
||||
try {
|
||||
@ -273,7 +273,7 @@ public class WebIMTask {
|
||||
data.setUsername(agentUser.getUsername());
|
||||
data.setMessage(message);
|
||||
|
||||
data.setId(UKTools.getUUID());
|
||||
data.setId(MainUtils.getUUID());
|
||||
data.setContextid(agentUser.getContextid());
|
||||
|
||||
data.setAgentserviceid(agentUser.getAgentserviceid());
|
||||
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Chatopera Inc, <https://www.chatopera.com>
|
||||
*
|
||||
* 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.disruptor.chatbot;
|
||||
|
||||
import com.chatopera.cc.app.service.hibernate.BaseService;
|
||||
import com.chatopera.cc.event.UserEvent;
|
||||
|
||||
public class ChatbotEvent<S> implements UserEvent {
|
||||
|
||||
private S data;
|
||||
private BaseService<?> crudRes;
|
||||
private String eventype;
|
||||
|
||||
public ChatbotEvent(S data, BaseService<?> crudRes, String eventype) {
|
||||
this.data = data;
|
||||
this.crudRes = crudRes;
|
||||
this.eventype = eventype;
|
||||
}
|
||||
|
||||
public S getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(S data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public BaseService<?> getCrudRes() {
|
||||
return crudRes;
|
||||
}
|
||||
|
||||
public void setCrudRes(BaseService<?> crudRes) {
|
||||
this.crudRes = crudRes;
|
||||
}
|
||||
|
||||
public String getEventype() {
|
||||
return eventype;
|
||||
}
|
||||
|
||||
public void setEventype(String eventype) {
|
||||
this.eventype = eventype;
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.chatopera.cc.disruptor.chatbot;
|
||||
|
||||
import com.chatopera.cc.event.UserDataEvent;
|
||||
import com.chatopera.cc.disruptor.user.UserDataEvent;
|
||||
import com.lmax.disruptor.EventFactory;
|
||||
|
||||
public class ChatbotEventFactory implements EventFactory<UserDataEvent>{
|
||||
|
@ -16,8 +16,8 @@
|
||||
package com.chatopera.cc.disruptor.chatbot;
|
||||
|
||||
import com.chatopera.cc.app.MainContext;
|
||||
import com.chatopera.cc.event.MultiUpdateEvent;
|
||||
import com.chatopera.cc.event.UserDataEvent;
|
||||
import com.chatopera.cc.disruptor.multiupdate.MultiUpdateEvent;
|
||||
import com.chatopera.cc.disruptor.user.UserDataEvent;
|
||||
import com.chatopera.cc.util.task.ESData;
|
||||
import com.lmax.disruptor.EventHandler;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user