1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-06-25 02:47:10 +08:00
This commit is contained in:
Hai Liang Wang 2019-12-24 13:36:56 +08:00
parent ac7a346bf6
commit a5e475fe35
9 changed files with 87 additions and 26 deletions

View File

@ -161,6 +161,13 @@ public class EntIMController extends Handler {
return view;
}
@RequestMapping("/expand")
@Menu(type = "im", subtype = "entim", access = false)
public ModelAndView expand(HttpServletRequest request, HttpServletResponse response) {
ModelAndView view = request(super.createEntIMTempletResponse("/apps/entim/expand"));
return view;
}
@RequestMapping("/chat")
@Menu(type = "im", subtype = "entim", access = false)
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {

View File

@ -49,7 +49,7 @@ public class BlackEntity implements java.io.Serializable{
private String agentserviceid ; //agent service id
private String description ; //备注黑名单原因
private int times ; //对话次数
private int chattime ; //最后一次对话时长
private int chattime ; //最后一次对话时长
@Id
@Column(length = 32)

View File

@ -53,5 +53,4 @@ public interface AgentServiceRepository
Page<AgentService> findAll(Specification<AgentService> spec, Pageable pageable); //分页按条件查询
}

View File

@ -17,15 +17,18 @@
package com.chatopera.cc.proxy;
import com.chatopera.cc.cache.Cache;
import com.chatopera.cc.model.AgentService;
import com.chatopera.cc.model.AgentUser;
import com.chatopera.cc.model.BlackEntity;
import com.chatopera.cc.model.User;
import com.chatopera.cc.persistence.repository.AgentServiceRepository;
import com.chatopera.cc.persistence.repository.AgentUserRepository;
import com.chatopera.cc.persistence.repository.BlackListRepository;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
@Component
@ -40,6 +43,10 @@ public class BlackEntityProxy {
@Autowired
private AgentUserRepository agentUserRepository;
@Autowired
private AgentServiceRepository agentServiceRes;
/**
* 更新或创建黑名单记录
*
@ -89,7 +96,11 @@ public class BlackEntityProxy {
blackEntityUpdated.setAgentuser(agentUser.getUsername());
}
blackEntityUpdated.setAgentserviceid(agentserviceid);
AgentService agentService = agentServiceRes.findByIdAndOrgi(agentserviceid, orgi);
if (agentService != null) {
blackEntityUpdated.setChattime((int) agentService.getSessiontimes());
}
blackListRes.save(blackEntityUpdated);
return blackEntityUpdated;

View File

@ -200,6 +200,7 @@ public class IMEventHandler {
p.setName(contacts.getName());
p.setPhone(contacts.getPhone());
p.setEmail(contacts.getEmail());
p.setResion(contacts.getMemo());
p.setChatbotops(false); // 非机器人客服
p.setOpttype(MainContext.OptType.HUMAN.toString());
getAgentUserProxy().save(p);
@ -210,6 +211,7 @@ public class IMEventHandler {
p.setName(contacts.getName());
p.setPhone(contacts.getPhone());
p.setEmail(contacts.getEmail());
p.setResion(contacts.getMemo());
agentServiceRepository.save(p);
});
}

View File

@ -0,0 +1,10 @@
<div class="ukefu-entim-point ukefu-entim-msgbox" style="cursor: pointer;" onclick="top.closeentim();" title="展开">
<div class=" expand" style="width: 100%;height: 100%;">
<i class="layui-icon" >&#xe603;</i>
</div>
</div>
<style>
.expand:hover{
background: rgba(0,0,0,0.2);
}
</style>

View File

@ -6,9 +6,17 @@
<#assign newmsg = recentUser.newmsg + newmsg>
</#list>
</#if>
<span class="layui-anim layer-anim-05 animated" id="msgbox" data-newmsg="${newmsg}" style="<#if newmsg == 0>display:none;</#if>top: 15px;background-color: red;left: 30px;">${newmsg}</span>
春松客服-企业聊天
<span class="layui-anim layer-anim-05 animated" id="msgbox" data-newmsg="${newmsg}" style="<#if newmsg == 0>display:none;</#if>top: 15px;background-color: red;left: 0px;">${newmsg}</span>
企业聊天
<div class="putAway" id="putAway" title="收起" style="width:30px; height: 100%;float: right">
<i class="layui-icon">&#xe602;</i>
</div>
</div>
<style>
.putAway:hover{
background: rgba(0,0,0,0.2);
}
</style>
<script>
var hostname = location.hostname ;
var socket = io.connect(location.protocol+"//"+top.hostname+":"+top.port+"/im/ent?userid=${user.id!''!''}&orgi=${user.orgi!''}");
@ -20,4 +28,10 @@
socket.on('disconnect',function() {
});
$("#putAway").click(function(e){
top.isImIndex = true;
top.closeentim();
e.stopPropagation();
})
</script>

View File

@ -57,9 +57,8 @@ arr.push(('randomNumber=' + Math.random()).replace('.'));
return arr.join('&');
}
var protocol = window.location.protocol.replace(/:/g,'');
<!--var protocol = "${schema!''}"-->
<!--console.log('protocol',protocol)-->
var protocol = "${schema!''}"
document.cookie=""
function chatoperaInit(info) {
@ -164,8 +163,6 @@ function closerefresh(){
location.reload();
}
var protocol = window.location.protocol.replace(/:/g,'');
<!--var protocol = "$!''}"-->
var cskefu = {
service: {agentno: null},
time : new Date().getTime(),

View File

@ -65,6 +65,8 @@
<script language="javascript">
var hostname = "${hostname!''}" , adminuser = "<#if user.admin?? && user.admin>true<#else>false</#if>" , schema = "${schema!'http'}", port = "${webimport!''}" , userid = "${user.id!''}" , session = "${sessionid!''}" , orgi = "${orgi!''}";
var layinx , layerhelper ;
var isImIndex = false;
$(document).ready(function(){
layui.use('layer', function(){
layerhelper = layer ;
@ -83,29 +85,48 @@
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ["200px", "50px"],
area: ["120px", "50px"],
offset: "rb", //右下角弹出
anim: 2,
shade: 0,
content: "/ent/im/point.html",
end:function(){
layinx = layer.open({
if(isImIndex == true){
layinx = layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ["260px", "520px"],
offset: "rb", //右下角弹出
anim: 2,
shade: 0,
content: ["/ent/im/index.html", "no"], //iframe的urlno代表不显示滚动条
end: function(){ //此处用于演示
imDialogHelper.open();
}
});
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ["30px", "50px"],
offset: "rb", //右下角弹出
anim: 2,
shade: 0,
content: "/ent/im/expand.html",
end: function(){ //此处用于演示
imDialogHelper.open();
isImIndex = false;
}
})
isImIndex = false;
}else{
layinx = layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ["260px", "520px"],
offset: "rb", //右下角弹出
anim: 2,
shade: 0,
content: ["/ent/im/index.html", "no"], //iframe的urlno代表不显示滚动条
end: function(){ //此处用于演示
imDialogHelper.open();
}
});
}
}
});
}
}
}
imDialogHelper.open();
</#if>
@ -121,6 +142,7 @@
layerhelper.close(layinx);
}
}
</script>
</head>
@ -169,7 +191,6 @@
</a>
</li>
</#if>
<li class="layui-nav-item"><a href="javascript:void(0)">
<i class="layui-icon" style="position: relative;float:left;">&#xe612;</i>
<span style="display: inline-block;max-width: 90px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float: left">