1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-07-20 04:23:01 +08:00

#237 enable set thresholds for bot replies

This commit is contained in:
Hai Liang Wang 2019-11-24 11:32:22 +08:00
parent 9f7689cba3
commit 919146c3fb
21 changed files with 1142 additions and 812 deletions

View File

@ -351,7 +351,7 @@
<dependency>
<groupId>com.chatopera.bot</groupId>
<artifactId>sdk</artifactId>
<version>1.0.2</version>
<version>2.1.0</version>
</dependency>
</dependencies>

View File

@ -182,10 +182,17 @@ public class ACDAgentService {
}
// 获得所有待服务访客的列表
Map<String, AgentUser> pendingAgentUsers = cache.getAgentUsersInQueByOrgi(orgi);
final Map<String, AgentUser> pendingAgentUsers = cache.getAgentUsersInQueByOrgi(orgi);
final SessionConfig sessionConfig = acdPolicyService.initSessionConfig(orgi);
// 本次批量分配访客数目
int assigned = 0;
int currentAssigned = cache.getInservAgentUsersSizeByAgentnoAndOrgi(
agentStatus.getAgentno(), agentStatus.getOrgi());
logger.info(
"[assignVisitors] agentno {}, name {}, current assigned {}, batch size in queue {}",
agentStatus.getAgentno(),
agentStatus.getUsername(), currentAssigned, pendingAgentUsers.size());
for (Map.Entry<String, AgentUser> entry : pendingAgentUsers.entrySet()) {
AgentUser agentUser = entry.getValue();
@ -202,20 +209,16 @@ public class ACDAgentService {
StringUtils.isBlank(agentUser.getSkill()))) {
// 待服务的访客还没有指定坐席并且也没有绑定技能组
process = true;
} else {
if (StringUtils.isBlank(agentUser.getAgentno()) &&
agentStatus.getSkills().containsKey(agentUser.getSkill())) {
// 待服务的访客还没有指定坐席并且指定的技能组和该坐席的技能组一致
process = true;
}
}
} else {
// 目标坐席没有状态或该目标坐席有状态但是没有属于任何一个技能组
if (StringUtils.isBlank(agentUser.getAgentno()) &&
StringUtils.isBlank(agentUser.getSkill())) {
// 待服务访客没有指定坐席并且没有指定技能组
} else if (StringUtils.isBlank(agentUser.getAgentno()) &&
agentStatus.getSkills().containsKey(agentUser.getSkill())) {
// 待服务的访客还没有指定坐席并且指定的技能组和该坐席的技能组一致
process = true;
}
} else if (StringUtils.isBlank(agentUser.getAgentno()) &&
StringUtils.isBlank(agentUser.getSkill())) {
// 目标坐席没有状态或该目标坐席有状态但是没有属于任何一个技能组
// 待服务访客没有指定坐席并且没有指定技能组
process = true;
}
if (!process) {
@ -223,14 +226,14 @@ public class ACDAgentService {
}
// 坐席未达到最大咨询访客数量并且单次批量分配小于坐席就绪时分配最大访客数量(initMaxuser)
if (((agentStatus.getUsers() + assigned) < sessionConfig.getMaxuser()) && (assigned < sessionConfig.getInitmaxuser())) {
if (((currentAssigned + assigned) < sessionConfig.getMaxuser()) && (assigned < sessionConfig.getInitmaxuser())) {
assigned++;
pickupAgentUserInQueue(agentUser, agentStatus);
} else {
logger.info(
"[assignVisitors] agentno {} reach the max users limit {}/{} or batch assign limit {}/{}",
agentno,
(agentStatus.getUsers() + assigned),
(currentAssigned + assigned),
sessionConfig.getMaxuser(), assigned, sessionConfig.getInitmaxuser());
break;
}

View File

@ -222,6 +222,7 @@ public class WebIMController extends Handler {
tempInviteData.setMaxwordsnum(inviteData.getMaxwordsnum());
tempInviteData.setCtrlenter(inviteData.isCtrlenter());
tempInviteData.setWhitelist_mode(inviteData.isWhitelist_mode());
if (dialogad != null && StringUtils.isNotBlank(dialogad.getName()) && dialogad.getBytes() != null && dialogad.getBytes().length > 0) {
tempInviteData.setDialog_ad(super.saveImageFileWithMultipart(dialogad));

View File

@ -48,6 +48,7 @@ import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
@ -325,9 +326,10 @@ public class IMController extends Handler {
}
}
@RequestMapping("/userinformation")
@Menu(type = "im", subtype = "userinformation")
public ModelAndView userinformation(
@ResponseBody
@RequestMapping("/chatoperainit")
@Menu(type = "im", subtype = "chatoperainit")
public String chatoperaInit(
ModelMap map,
HttpServletRequest request,
HttpServletResponse response,
@ -338,6 +340,7 @@ public class IMController extends Handler {
String company_name,
String sid,
String system_name,
Boolean whitelist_mode,
@RequestParam String sessionid) throws IOException, TemplateException {
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/im/point"));
final User logined = super.getUser(request);
@ -364,11 +367,19 @@ public class IMController extends Handler {
onlineUserRes.save(onlineUser);
}
createContacts(userid,
request,
logined.getId(),
uid, cid, sid, username, company_name, system_name);
return view;
Contacts usc = contactsRes.findOneByWluidAndWlsidAndWlcid(uid, sid, cid);
if (usc != null) {
return "usc";
} else {
if (!whitelist_mode) {
createContacts(userid,
request,
logined.getId(),
uid, cid, sid, username, company_name, system_name);
}
}
return "ok";
}

View File

@ -158,6 +158,16 @@
<i class="layui-icon">&#xe605;</i>
</div>
</div>
<div class="ukefu-im-point <#if inviteData?? && inviteData.consult_vsitorbtn_model?? && inviteData.consult_vsitorbtn_model == '9'>ukefu-point-checked</#if>" data-class="ukefu-point-theme9" data-value="9">
<div class="ukefu-point-theme9">
<div class="ukefu-im-point-text">
<br>
</div>
</div>
<div class="ok">
<i class="layui-icon">&#xe605;</i>
</div>
</div>
</div>
<div class="ukefu-webim-tl" style="clear:both;">2、选择入口颜色</div>
<div class="box-item">
@ -474,7 +484,7 @@
function() {
$("#ukefu-point-theme")
.removeClass(
"ukefu-point-theme1 ukefu-point-theme2 ukefu-point-theme3")
"ukefu-point-theme1 ukefu-point-theme2 ukefu-point-theme3 ukefu-point-theme9")
.addClass(
$(this)
.attr(

View File

@ -505,6 +505,19 @@
</div>
</div>
</div>
<div class="ukefu-webim-prop">
<div class="ukefu-webim-tl" style="clear:both;">15、白名单模式 </div>
<div class="box-item">
<div class="row">
<div class="col-lg-8">
<p>联系人访问才显示在线客服按钮</p>
</div>
<div class="col-lg-4" style="text-align:right;">
<input type="checkbox" title="启用" name="whitelist_mode" id="whitelist_mode" <#if inviteData?? && inviteData.whitelist_mode == true>checked="checked"</#if>>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="ukefu-im-preview ukefu-im-preview-dialog" id="pv" style="width:380px;position: fixed;">

View File

@ -33,7 +33,7 @@
<#list agentUserList as agentuser>
<li class="clearfix chat-list-item <#if curagentuser?? && curagentuser.id?? && agentuser.id?? && curagentuser.id == agentuser.id>active</#if>"
id="agentuser_${agentuser.userid!''}" remove-id="${agentuser.id!''}" data-id="${agentuser.userid!''}">
<a href="/agent/agentuser.html?id=${agentuser.id!''}&channel=${agentuser.channel!''}" data-toggle="load" data-target="#ukefu-chat-agent" onclick="$('.chat-list-item.active').removeClass('active');$(this).closest('li.chat-list-item').addClass('active');Proxy.cleanTopMsgTip(1) ;$('#last_msg_${agentuser.userid!''}').text(0).hide();">
<a href="/agent/agentuser.html?id=${agentuser.id!''}&channel=${agentuser.channel!''}" data-toggle="load" data-target="#ukefu-chat-agent" onclick="$('.chat-list-item.active').removeClass('active');$(this).closest('li.chat-list-item').addClass('active');cleanTopMsgTip(this) ;$('#last_msg_${agentuser.userid!''}').text(0).hide();">
<img src="<#if agentuser.headimgurl?? && agentuser.headimgurl != ''>${agentuser.headimgurl}<#else>/images/im/user.png</#if>" style="width:45px;height:45px;">
<#if agentuser.status?? && agentuser.status == 'end'>
<#if agentuser.channel?? && agentuser.channel == "weixin">

View File

@ -153,6 +153,14 @@
}
}
function cleanTopMsgTip(tip){
var lastMsgNum = $(tip).find('.last-msg').text();
if(lastMsgNum){
var num = Number.parseInt(lastMsgNum);
Proxy.cleanTopMsgTip(num)
}
}
/**
* 结束会话RestAPI请求
* @param agentUserId

View File

@ -31,7 +31,7 @@
<#list agentUserList as agentuser>
<li class="clearfix chat-list-item <#if curagentuser?? && curagentuser.id?? && agentuser.id?? && curagentuser.id == agentuser.id>active</#if>"
id="agentuser_${agentuser.userid!''}" remove-id="${agentuser.id!''}" data-id="${agentuser.userid!''}">
<a href="/apps/cca/agentuser.html?id=${agentuser.id!''}&channel=${agentuser.channel!''}" data-toggle="load" data-target="#ukefu-chat-agent" onclick="$('.chat-list-item.active').removeClass('active');$(this).closest('li.chat-list-item').addClass('active');Proxy.cleanTopMsgTip(1) ;$('#last_msg_${agentuser.userid!''}').text(0).hide();">
<a href="/apps/cca/agentuser.html?id=${agentuser.id!''}&channel=${agentuser.channel!''}" data-toggle="load" data-target="#ukefu-chat-agent" onclick="$('.chat-list-item.active').removeClass('active');$(this).closest('li.chat-list-item').addClass('active');cleanTopMsgTip(this) ;$('#last_msg_${agentuser.userid!''}').text(0).hide();">
<img src="<#if agentuser.headimgurl?? && agentuser.headimgurl != ''>${agentuser.headimgurl}<#else>/images/im/user.png</#if>" style="width:45px;height:45px;">
<#if agentuser.status?? && agentuser.status == 'end'>
<#if agentuser.channel?? && agentuser.channel == "weixin">

View File

@ -134,5 +134,13 @@
otherTopicSearch();
}
}
function cleanTopMsgTip(tip){
var lastMsgNum = $(tip).find('.last-msg').text();
if(lastMsgNum){
var num = Number.parseInt(lastMsgNum);
Proxy.cleanTopMsgTip(num)
}
}
</script>
</#if>

View File

@ -9,7 +9,10 @@
<div class="layui-body">
<div class="layui-side-scroll">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-12" style="position: relative;">
<div style="position: absolute; right: 0; z-index: 10; padding: 7px;">
<i class="layui-icon" style="font-size: 20px; cursor:pointer;" onclick="location.reload()">&#x1002;</i>
</div>
<h1 class="site-h1">
在线客服业务概况
</h1>

View File

@ -61,18 +61,39 @@ var protocol = window.location.protocol.replace(/:/g,'');
<!--var protocol = "${schema!''}"-->
<!--console.log('protocol',protocol)-->
document.cookie=""
function chatoperaInit(list){
ajax({
url: protocol + "://${hostname!''}<#if port?? && port != 80>:${port!''}</#if>/im/userinformation.html?sessionid=${sessionid!''}",
type:'POST',
data:{"userid":cskefuOnlineUserId,'uid':list.uid,'username':list.username,'cid':list.cid,'company_name':list.company_name,'sid':list.sid,'system_name':list.system_name},
dataType:"json",
contentType: "application/json",
async:false,
success:function(res){
}
});
}
function chatoperaInit(info) {
ajax({
url:
protocol + "://${hostname!''}<#if port?? && port != 80>:${port!''}</#if>/im/chatoperainit.html?sessionid=${sessionid!''}",
type: "POST",
data: {
<#if inviteData.whitelist_mode == true >
whitelist_mode: ${inviteData.whitelist_mode},
<#else>
whitelist_mode: false,
</#if>
userid: cskefuOnlineUserId,
uid: info.uid,
username: info.username,
cid: info.cid,
company_name: info.company_name,
sid: info.sid,
system_name: info.system_name
},
dataType: "json",
contentType: "application/json",
async: false,
success: function(res) {
<#if inviteData.whitelist_mode == true >
if(res == 'usc'){
document.getElementById("ukefu-point").style.display = "block" ;
}
</#if>
}
});
}
<#assign style = 'text-align:center;height: 150px;border-radius: 30px;width: 40px;margin: 0px 5px 0 0; float:left ; word-wrap: break-word;overflow: hidden;font-size:15px;color:#FFFFFF;text-align: center;padding-top: 15px;border: 1px solid #DCDCDC;background-color:#008df3;'>
<#if inviteData.consult_vsitorbtn_model?? && inviteData.consult_vsitorbtn_model == "2">
@ -282,10 +303,10 @@ var cskefu = {
"<div class='ichat-title ichat-cursor' style='color: #FFFFFF;font-weight:400;font-size: 14px;font-weight: 400;height: 28px;line-height: 28px;overflow: hidden;padding: 0 5px;background-repeat: repeat-x;text-align:right;'><#if inviteData.consult_skill_bottomtitle??>${inviteData.consult_skill_bottomtitle!''}</#if></div>"+
"</div></div></#if>" ;
<#if webimexist == true >
append(document.body, '<div class="ukefu-im-point" id="ukefu-point" style="display:none;z-index:100000;font-family:14px \5FAE\8F6F\96C5\9ED1,Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;position: fixed;${position};<#if inviteData?? && inviteData.skill == true && inviteData.consult_skill_fixed == false>cursor:default;<#else>cursor: pointer;</#if>"> <div class="ukefu-point-theme${inviteData.consult_vsitorbtn_model!'1'} ukefu-theme-color theme1" style="${style}${theme}" id="ukefu-point-theme"><div class="ukefu-im-point-text" id="ukefu-im-point-text" style="cursor: pointer;${text};line-height: 23px;font-size: 15px;text-align: center;margin: 0 auto;"><i style="width:24px;height:24px;display: inline-block;font: normal normal normal 14px/1 FontAwesome;font-size: inherit;text-rendering: auto;-webkit-font-smoothing: antialiased;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAB60lEQVRIS7WV4TVsQRCEqyJABkSACBABLwJE8IjAigARIAMieCsCREAGjwja+eb03TO7O9ddrPm1Z29PV3dXdY31y8eL5I+ILUmbktYz/lXSs+2nofu9ABFBsjNJB5JWJT3MJNuR9CbpTtK5bUDnThMgIkaZnKSXtkkydyIC8BNJgI1sn88GzQFExI2kXUlHtsdDI+B7RBDPvUfbf+o7UwCZnHnv2qb9hU9EMEYKAuS4uzgByHapYqtvnkNoyRvE030Zaw0AScz7cijRZ9+Tv33b2xOAlOGjpLWvjmYWLEf1X9I2Mi4dRMRRtgVZ5WTgtaRX26cVmUj3lMtVzEPdeUTARVFfB4AsIbYG4Pe/0qbdxXERSaL7UapnKiYLIW5MTG8HGYjG6aAQlqNE+1RXVBYRUzH5H0SzF5MO2NqXJXHQ5dpAjbWKQL2jrSWo6MA2+zQlU2bOKOBi0MRaRVRq3OtcYHaT2YFDSQR8CSSTQ/itbXgpp+VFgCDbi5Z59ej+L6RKuqqTNwEqvWMbK2li97XxpSXwPhRTlPSOq7Zc99MHJxeQdt+6HcklYhdICmfonWKaZwgAh8RC8HmSXUjCjtcXtZQhAKrHGqiQUTynpTRfr1YLQwBomcq7HekdxbdG9JOF65XpMpLWOT4AygTtGd0Q7EsAAAAASUVORK5CYII=);"></i><br>${(inviteData.consult_vsitorbtn_content!'在线客服')?no_esc}</div></div><#if inviteData?? && inviteData.skill == true && inviteData.consult_skill_fixed == false>'+skillHtml+'</#if></div>');
append(document.body, "<div class='ukefu-im-preview' id='ukefu-invite-dialog' style='z-index: 2147483648;display:none;height:177px;position: fixed;z-index:10000;<#if phone?? && phone == true>bottom:0px;width:100%;<#else>top:"+top+";width: 420px;left:"+left+";</#if>border-radius: 2px;padding: 0px;overflow: hidden;margin: 0px;${invitetheme!''}'> <div id='ukefu-cousult-invite-dialog' class='ukefu-im-preview-bar ukefu-cousult-invite-dialog ukefu-theme-color theme1' style='padding:0px;height:100%;width:100%;background-size: cover;background:url(${schema!'http'}://${hostname!''}<#if port?? && port != 80>:${port!''}</#if>/res/image.html?id=${inviteData.consult_invite_bg}) no-repeat'><a href='javascript:void(0)' onclick='cskefu.refuseInvite();'><span style='float: right;width: 20px;height: 20px;color: #ffffff;font-size: 20px;' >×</span></a><div class='ukefu-consult-body' id='ukefu_consult_body' style='width:100%;height:100%;'><div class='ukefu-cousult-invite-content' id='ukefu-cousult-invite-content' style='color: #FFFFFF;width: 70%;height: 70px;line-height: 35px;font-size: 13pt;font-weight: 200;word-wrap: break-word;word-break: break-all;position: absolute;top: 30px;left: 25%;'>${inviteData.consult_invite_content!'欢迎来到本网站,请问有什么可以帮您?'}</div></div><div class='ukefu-cousult-invite-btn' style='position: absolute;bottom: 0px;right: 0px;margin: 0px 10px 10px 0px;'><button class='theme1' id='invite-btn' style='border-color:#FFFFFF !important;color:#FFFFFF;display: inline-block;height: 38px;line-height: 38px;padding: 0 18px;background-color: #009688;color: #fff;white-space: nowrap;text-align: center;font-size: 14px;margin-right:10px;border: none;border-radius: 2px;cursor: pointer;opacity: .9;filter: alpha(opacity=90);${invitetheme!''}border:1px solid #FFFFFF;' onclick='cskefu.refuseInvite();' ><#if inviteData.consult_invite_later?? && inviteData.consult_invite_later != ''>${inviteData.consult_invite_later}<#else>稍后再说</#if></button><button class='' style='display: inline-block;height: 38px;line-height: 38px;padding: 0 18px;background-color: #009688;color: #fff;white-space: nowrap;text-align: center;font-size: 14px;border: none;border-radius: 2px;cursor: pointer;opacity: .9;filter: alpha(opacity=90);background-color:#FFFFFF;color:#333333;' onclick='openInviteChatDialog();'><#if inviteData.consult_invite_accept?? && inviteData.consult_invite_accept!=''>${inviteData.consult_invite_accept}<#else>现在咨询</#if></button></div></div></div>");
</#if>
<#if inviteData?? && inviteData.skill == true && inviteData.consult_skill_fixed == false>
document.getElementById("ukefu-im-point-text").onclick=function(){
if(document.getElementById("ichatContent").style.display == "none"){
@ -295,11 +316,9 @@ var cskefu = {
}
}
<#else>
<#if webimexist == true >
document.getElementById("ukefu-point").onclick=function(){
cskefu.openChatDialog();
}
</#if>
</#if>
var inviteDialog = document.getElementById('ukefu-invite-dialog');
<#if phone?? && mobile == true>
@ -309,10 +328,9 @@ var cskefu = {
var width = document.documentElement.clientWidth ;
var top = (50 - 92*100/height)+"%";
var left = (50 - 210*100/width)+"%" ;
<#if webimexist == true >
inviteDialog.style.top = top ;
inviteDialog.style.left = left ;
</#if>
</#if>
<#if inviteAd??>
var inviteAdHtml =
@ -365,9 +383,11 @@ var cskefu = {
display:function(){
cskefu.writepoint();
<#if !(inviteData.consult_vsitorbtn_display??) || (inviteData.consult_vsitorbtn_display?? && inviteData.consult_vsitorbtn_display == 0)>
<#if webimexist == true >
document.getElementById("ukefu-point").style.display = "block" ;
</#if>
<#if inviteData?? && inviteData.consult_vsitorbtn_model != '9' && inviteData.whitelist_mode == false>
document.getElementById("ukefu-point").style.display = "block" ;
</#if>
<#if inviteData.consult_invite_enable>
<#if inviteData.consult_invite_delay?? && inviteData.consult_invite_delay == 0>
cskefu.writeinvite() ;
@ -433,17 +453,19 @@ function openAgentChatDialog(url){
return cskefu.openChatDialogWithURL(url);
}
Fingerprint2.get({}, function(components){
var glue = components.map(function (component) { return component.value })
cskefuOnlineUserId = Fingerprint2.x64hash128(glue.join(''), 31)
cskefu.ajax(cskefu.in+"&userid="+cskefuOnlineUserId+"&t="+new Date().getTime() , function(data){
if(data == "in"){}else{
cskefu.display();
cskefu.ping();
cskefu.check();
}
<#if webimexist == true >
Fingerprint2.get({}, function(components){
var glue = components.map(function (component) { return component.value })
cskefuOnlineUserId = Fingerprint2.x64hash128(glue.join(''), 31)
cskefu.ajax(cskefu.in+"&userid="+cskefuOnlineUserId+"&t="+new Date().getTime() , function(data){
if(data == "in"){}else{
cskefu.display();
cskefu.ping();
cskefu.check();
}
});
});
});
</#if>
var onlineAddress = protocol + "://${hostname!''}<#if port?? && port != 80 && port != 443>:${port!''}</#if>";
var newscript = document.createElement('script');

View File

@ -837,6 +837,11 @@ body .site-ukefu-nav .layui-nav-item{line-height: 40px}
border: 1px solid #DCDCDC;
background-color:#dddddd;
}
#ukefu-point .ukefu-point-theme9 {
display:none !important;
}
.ukefu-im-point .ukefu-point-theme3{
height: 70px;
border-radius: 70px;

View File

@ -1537,6 +1537,7 @@ CREATE TABLE `uk_consult_invite` (
`usershortcutkey` varchar(32) DEFAULT NULL COMMENT '访客默认回复消息快捷键',
`agentctrlenter` tinyint(4) DEFAULT '0' COMMENT '启用坐席端CTRL+Enter发送消息',
`ctrlenter` tinyint(4) DEFAULT '0' COMMENT '启用访客端CTRL+Enter发送消息',
`whitelist_mode` tinyint(4) DEFAULT '0' COMMENT '启用白名单',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='访客网站配置表';
@ -7941,6 +7942,29 @@ CREATE TABLE `uk_tableproperties` (
INSERT INTO `uk_tableproperties` (`ID`, `NAME`, `CODE`, `GROUPID`, `USERID`, `FIELDNAME`, `DATATYPECODE`, `DATATYPENAME`, `DBTABLEID`, `INDEXDATATYPE`, `PK`, `MODITS`, `INDEXFIELD`, `PLUGIN`, `ORGI`, `FKTABLE`, `FKPROPERTY`, `TABLENAME`, `viewtype`, `SORTINDEX`, `SYSTEMFIELD`, `INX`, `TOKEN`, `LENGTH`, `FIELDSTATUS`, `SELDATA`, `SELDATACODE`, `SELDATAKEY`, `SELDATAVALUE`, `SELDATATYPE`, `REFTBID`, `REFTPID`, `REFTYPE`, `REFTBNAME`, `REFTPNAME`, `REFTPTITLEFIELD`, `REFFK`, `DEFAULTSORT`, `DEFAULTVALUE`, `DEFAULTVALUETITLE`, `DEFAULTFIELDVALUE`, `MULTPARTFILE`, `UPLOADTYPE`, `cascadetype`, `title`, `DESCORDER`, `impfield`, `tokentype`, `phonenumber`, `phonetype`, `phonememo`, `secfield`, `secdistype`, `styletype`, `sysfield`)
VALUES
('2c9480886e91d9e5016e91f528ac018f', '性别', NULL, NULL, NULL, 'gender', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.contacts.sex', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528ac0190', '出生日期', NULL, NULL, NULL, 'cusbirthday', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 50, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528ac0192', '联系人类别', NULL, NULL, NULL, 'ckind', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.contacts.ckind', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528af019e', '电子邮件', NULL, NULL, NULL, 'email', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 128, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b001a0', '手机号码', NULL, NULL, NULL, 'mobileno', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 40, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b101a2', '办公电话', NULL, NULL, NULL, 'phone', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 40, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b301ab', '', NULL, NULL, NULL, 'province', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.address.area', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b401ac', '市(区)县', NULL, NULL, NULL, 'city', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.address.area', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b401ad', '地址', NULL, NULL, NULL, 'address', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 65535, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b801bb', '最后联系时间', NULL, NULL, NULL, 'touchtime', 0, 'datetime', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b901be', '创建人', NULL, NULL, NULL, 'creater', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 0, '', NULL, NULL, '', 'userdata', NULL, NULL, NULL, NULL, NULL, 1, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b901c1', '联系人备注', NULL, NULL, NULL, 'memo', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528b901c3', '修改时间', NULL, NULL, NULL, 'updatetime', 0, 'datetime', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528ba01c6', '创建时间', NULL, NULL, NULL, 'createtime', 0, 'datetime', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528ba01c7', '联系人姓名', NULL, NULL, NULL, 'name', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, '', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528ba01ca', '分享给', NULL, NULL, NULL, 'shares', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bb01d0', 'skypeid', NULL, NULL, NULL, 'skypeid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bb01d1', '人员id', NULL, NULL, NULL, 'wluid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bc01d2', '人员名称', NULL, NULL, NULL, 'wlusername', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bc01d3', '公司id', NULL, NULL, NULL, 'wlcid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bc01d4', '公司名称', NULL, NULL, NULL, 'wlcompany_name', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bc01d5', '子系统id', NULL, NULL, NULL, 'wlsid', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('2c9480886e91d9e5016e91f528bc01d6', '子系统名称', NULL, NULL, NULL, 'wlsystem_name', 0, 'text', '2c9480886e91d9e5016e91f528ab018d', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95575801c2', '企(事)业单位名称', NULL, NULL, NULL, 'name', 0, 'text', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95575801c3', '单位性质', NULL, NULL, NULL, 'etype', 0, 'text', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.customer.etype', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95575b01c4', '客户类别', NULL, NULL, NULL, 'ekind', 0, 'text', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.contacts.entype', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
@ -7958,23 +7982,6 @@ VALUES
('402870876e5d9773016e5e95576401f4', '修改时间', NULL, NULL, NULL, 'updatetime', 0, 'datetime', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95576401f6', '创建时间', NULL, NULL, NULL, 'createtime', 0, 'datetime', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95576401f9', '分享给', NULL, NULL, NULL, 'shares', 0, 'text', '402870876e5d9773016e5e95575601c0', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_entcustomer', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6350206', '联系人性别', NULL, NULL, NULL, 'gender', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.contacts.sex', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6350207', '出生日期', NULL, NULL, NULL, 'cusbirthday', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 50, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6360209', '联系人类别', NULL, NULL, NULL, 'ckind', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.contacts.ckind', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6370215', '电子邮件', NULL, NULL, NULL, 'email', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 128, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6370217', '手机号码', NULL, NULL, NULL, 'mobileno', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 40, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6370219', '办公电话', NULL, NULL, NULL, 'phone', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 40, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6380222', '', NULL, NULL, NULL, 'province', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.address.area', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6380223', '市(区)县', NULL, NULL, NULL, 'city', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 1, 'com.dic.address.area', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d6380224', '地址', NULL, NULL, NULL, 'address', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 65535, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63a0232', '最后联系时间', NULL, NULL, NULL, 'touchtime', 0, 'datetime', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63a0235', '创建人', NULL, NULL, NULL, 'creater', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 60, 1, 0, '', NULL, NULL, '', 'userdata', NULL, NULL, NULL, NULL, NULL, 1, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63b0238', '联系人备注', NULL, NULL, NULL, 'memo', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63b023a', '修改时间', NULL, NULL, NULL, 'updatetime', 0, 'datetime', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63b023d', '创建时间', NULL, NULL, NULL, 'createtime', 0, 'datetime', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 19, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63b023e', '联系人名称', NULL, NULL, NULL, 'name', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, '', NULL, NULL, '', '', NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63c0241', '分享给', NULL, NULL, NULL, 'shares', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 255, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e95d63c0247', 'skypeid', NULL, NULL, NULL, 'skypeid', 0, 'text', '402870876e5d9773016e5e95d6350204', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_contacts', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e9cc6380272', '坐席用户名', NULL, NULL, NULL, 'agentusername', 0, 'text', '402870876e5d9773016e5e9cc6370270', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_servicesummary', NULL, 100, 0, 1, 0, 100, 1, 0, '', NULL, NULL, '', 'userdata', NULL, NULL, NULL, NULL, NULL, 1, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e9cc6380275', '服务次数', NULL, NULL, NULL, 'times', 0, 'number', '402870876e5d9773016e5e9cc6370270', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_servicesummary', NULL, 100, 0, 1, 0, 10, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
('402870876e5d9773016e5e9cc6390278', '用户名', NULL, NULL, NULL, 'username', 0, 'text', '402870876e5d9773016e5e9cc6370270', NULL, 0, 0, NULL, NULL, 'cskefu', NULL, NULL, 'uk_servicesummary', NULL, 100, 0, 1, 0, 100, 1, 0, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, 1, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, 0, NULL, NULL, 0),
@ -8043,8 +8050,8 @@ CREATE TABLE `uk_tabletask` (
INSERT INTO `uk_tabletask` (`ID`, `NAME`, `SECURE`, `TASKSTATUS`, `TABLEDIRID`, `DBID`, `CODE`, `GROUPID`, `CREATER`, `CREATERNAME`, `TASKTYPE`, `TASKNAME`, `TASKPLAN`, `CONFIGURE`, `SECURECONF`, `USERID`, `PREVIEWTEMPLET`, `LISTBLOCKTEMPLET`, `TABLENAME`, `TABLETYPE`, `STARTINDEX`, `UPDATETIME`, `UPDATETIMENUMBER`, `DATASQL`, `DATABASETASK`, `DRIVERPLUGIN`, `ORGI`, `WORKFLOW`, `FROMDB`, `tabtype`, `pid`, `secmenuid`, `reportid`, `eventname`, `tltemplet`, `timeline`, `tbversion`, `LASTUPDATE`, `CREATETIME`)
VALUES
('2c9480886e91d9e5016e91f528ab018d', 'uk_contacts', NULL, NULL, '0', NULL, NULL, NULL, '2c9480886e91d9e5016e91db8df10017', 'xianli', NULL, 'uk_contacts', NULL, NULL, NULL, NULL, NULL, NULL, 'uk_contacts', '1', 0, '2019-11-22 15:13:13', 0, NULL, NULL, NULL, 'cskefu', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2019-11-22 15:13:13'),
('402870876e5d9773016e5e95575601c0', 'uk_entcustomer', NULL, NULL, '0', NULL, NULL, NULL, '402870876e4f5bdd016e4f77eb6f0075', 'xiaoxiao', NULL, 'uk_entcustomer', NULL, NULL, NULL, NULL, NULL, NULL, 'uk_entcustomer', '1', 0, '2019-11-12 15:47:53', 0, NULL, NULL, NULL, 'cskefu', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2019-11-12 15:47:53'),
('402870876e5d9773016e5e95d6350204', 'uk_contacts', NULL, NULL, '0', NULL, NULL, NULL, '402870876e4f5bdd016e4f77eb6f0075', 'xiaoxiao', NULL, 'uk_contacts', NULL, NULL, NULL, NULL, NULL, NULL, 'uk_contacts', '1', 0, '2019-11-12 15:48:28', 0, NULL, NULL, NULL, 'cskefu', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2019-11-12 15:48:28'),
('402870876e5d9773016e5e9cc6370270', 'uk_servicesummary', NULL, NULL, '0', NULL, NULL, NULL, '402870876e4f5bdd016e4f77eb6f0075', 'xiaoxiao', NULL, 'uk_servicesummary', NULL, NULL, NULL, NULL, NULL, NULL, 'uk_servicesummary', '1', 0, '2019-11-12 15:56:02', 0, NULL, NULL, NULL, 'cskefu', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2019-11-12 15:56:02');
-- ----------------------------

View File

@ -48,6 +48,8 @@ services:
- CSKEFU_MODULE_CONTACTS=true
- CSKEFU_MODULE_CHATBOT=true
- SKYPE_CHANNEL_CRM=${SKYPE_CHANNEL_CRM:-placeholder}
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.8}
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.6}
depends_on:
- mysql
- redis

View File

@ -17,5 +17,7 @@ package com.chatopera.cc.plugins.chatbot;
public class ChatbotConstants {
public static final String BOT_PROVIDER = "BOT_PROVIDER";
public static final String THRESHOLD_FAQ_BEST_REPLY = "BOT_THRESHOLD_FAQ_BEST_REPLY";
public static final String THRESHOLD_FAQ_SUGG_REPLY = "BOT_THRESHOLD_FAQ_SUGG_REPLY";
public static final String DEFAULT_BOT_PROVIDER = "https://bot.chatopera.com";
}

View File

@ -27,6 +27,7 @@ import com.chatopera.cc.persistence.repository.ChatbotRepository;
import com.chatopera.cc.socketio.message.ChatMessage;
import com.chatopera.cc.util.SerializeUtil;
import com.chatopera.cc.util.SystemEnvHelper;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -53,9 +54,17 @@ public class ChatbotEventSubscription {
@Autowired
private ChatbotRepository chatbotRes;
// 机器人服务提供地址
private final static String botServiecProvider = SystemEnvHelper.getenv(
ChatbotConstants.BOT_PROVIDER, ChatbotConstants.DEFAULT_BOT_PROVIDER);
// FAQ最佳回复阀值
private final static double thresholdFaqBestReply = Double.parseDouble(SystemEnvHelper.getenv(
ChatbotConstants.THRESHOLD_FAQ_BEST_REPLY, "0.8"));
// FAQ建议回复阀值
private final static double thresholdFaqSuggReply = Double.parseDouble(SystemEnvHelper.getenv(
ChatbotConstants.THRESHOLD_FAQ_SUGG_REPLY, "0.6"));
@Autowired
private ChatbotProxy chatbotProxy;
@ -82,12 +91,14 @@ public class ChatbotEventSubscription {
.findOne(request.getAiid());
logger.info(
"[chat] chat request baseUrl {}, chatbot {}, fromUserId {}, textMessage {}", botServiecProvider, c.getName(),
"[chat] chat request baseUrl {}, chatbot {}, fromUserId {}, textMessage {}", botServiecProvider,
c.getName(),
request.getUserid(), request.getMessage());
// Get response from Conversational Engine.
com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot(
c.getClientId(), c.getSecret(), botServiecProvider);
JSONObject result = bot.conversation(request.getUserid(), request.getMessage());
JSONObject result = bot.conversation(
request.getUserid(), request.getMessage(), thresholdFaqBestReply, thresholdFaqSuggReply);
// parse response
if (result != null) {
@ -95,31 +106,53 @@ public class ChatbotEventSubscription {
if (result.getInt(RestUtils.RESP_KEY_RC) == 0) {
// reply
JSONObject data = result.getJSONObject("data");
ChatMessage resp = new ChatMessage();
resp.setCalltype(MainContext.CallType.OUT.toString());
resp.setAppid(resp.getAppid());
resp.setOrgi(request.getOrgi());
resp.setAiid(request.getAiid());
resp.setMessage(data.getString("string"));
resp.setTouser(request.getUserid());
resp.setAgentserviceid(request.getAgentserviceid());
resp.setMsgtype(request.getMsgtype());
resp.setUserid(request.getUserid());
resp.setType(request.getType());
resp.setChannel(request.getChannel());
if (data.has("params")) {
resp.setExpmsg(data.get("params").toString());
}
resp.setContextid(request.getContextid());
resp.setSessionid(request.getSessionid());
resp.setUsession(request.getUsession());
resp.setUsername(c.getName());
resp.setUpdatetime(System.currentTimeMillis());
if (data.has("logic_is_fallback")) {
ChatMessage resp = new ChatMessage();
resp.setCalltype(MainContext.CallType.OUT.toString());
resp.setAppid(resp.getAppid());
resp.setOrgi(request.getOrgi());
resp.setAiid(request.getAiid());
resp.setMessage(data.getString("string"));
// 更新聊天机器人累计值
updateAgentUserWithRespData(request.getUserid(), request.getOrgi(), data);
// 保存并发送
chatbotProxy.saveAndPublish(resp);
if (data.getBoolean("logic_is_fallback")) {
// 兜底回复检查FAQ
JSONArray faqReplies = data.getJSONArray("faq");
JSONArray suggs = new JSONArray();
for (int i = 0; i < faqReplies.length(); i++) {
JSONObject sugg = new JSONObject();
JSONObject faqReply = faqReplies.getJSONObject(i);
sugg.put("label", Integer.toString(i + 1) + ". " + faqReply.getString("post"));
sugg.put("text", faqReply.getString("post"));
sugg.put("type", "qlist");
suggs.put(sugg);
}
if (suggs.length() > 0) {
// TODO set help message on View Page
resp.setMessage("为您找到如下信息:");
resp.setExpmsg(suggs.toString());
}
} else if (data.has("params")) {
resp.setExpmsg(data.get("params").toString());
}
resp.setTouser(request.getUserid());
resp.setAgentserviceid(request.getAgentserviceid());
resp.setMsgtype(request.getMsgtype());
resp.setUserid(request.getUserid());
resp.setType(request.getType());
resp.setChannel(request.getChannel());
resp.setContextid(request.getContextid());
resp.setSessionid(request.getSessionid());
resp.setUsession(request.getUsession());
resp.setUsername(c.getName());
resp.setUpdatetime(System.currentTimeMillis());
// 更新聊天机器人累计值
updateAgentUserWithRespData(request.getUserid(), request.getOrgi(), data);
// 保存并发送
chatbotProxy.saveAndPublish(resp);
}
} else {
logger.warn("[chat] can not get expected response {}", result.toString());
}

View File

@ -51,6 +51,8 @@ public class PluginDescriptor implements IPluginDescriptor {
public Map<String, String> getEnvironmentVariables() {
Map<String, String> env = new HashMap<>();
env.put(ChatbotConstants.BOT_PROVIDER, "https://bot.chatopera.com");
env.put(ChatbotConstants.THRESHOLD_FAQ_BEST_REPLY, "0.8");
env.put(ChatbotConstants.THRESHOLD_FAQ_SUGG_REPLY, "0.6");
return env;
}
}

View File

@ -10,4 +10,6 @@ ACTIVEMQ_PORT1=8051
ACTIVEMQ_PORT2=8052
ACTIVEMQ_PORT3=8053
DB_PASSWD=123456
LOG_LEVEL=INFO
LOG_LEVEL=INFO
BOT_THRESHOLD_FAQ_BEST_REPLY=0.8
BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6