1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-06-29 07:11:38 +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; 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") @RequestMapping("/chat")
@Menu(type = "im", subtype = "entim", access = false) @Menu(type = "im", subtype = "entim", access = false)
public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) { public ModelAndView chat(HttpServletRequest request, HttpServletResponse response, @Valid String userid) {

View File

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

View File

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

View File

@ -200,6 +200,7 @@ public class IMEventHandler {
p.setName(contacts.getName()); p.setName(contacts.getName());
p.setPhone(contacts.getPhone()); p.setPhone(contacts.getPhone());
p.setEmail(contacts.getEmail()); p.setEmail(contacts.getEmail());
p.setResion(contacts.getMemo());
p.setChatbotops(false); // 非机器人客服 p.setChatbotops(false); // 非机器人客服
p.setOpttype(MainContext.OptType.HUMAN.toString()); p.setOpttype(MainContext.OptType.HUMAN.toString());
getAgentUserProxy().save(p); getAgentUserProxy().save(p);
@ -210,6 +211,7 @@ public class IMEventHandler {
p.setName(contacts.getName()); p.setName(contacts.getName());
p.setPhone(contacts.getPhone()); p.setPhone(contacts.getPhone());
p.setEmail(contacts.getEmail()); p.setEmail(contacts.getEmail());
p.setResion(contacts.getMemo());
agentServiceRepository.save(p); 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> <#assign newmsg = recentUser.newmsg + newmsg>
</#list> </#list>
</#if> </#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>
</div>
<style>
.putAway:hover{
background: rgba(0,0,0,0.2);
}
</style>
<script> <script>
var hostname = location.hostname ; var hostname = location.hostname ;
var socket = io.connect(location.protocol+"//"+top.hostname+":"+top.port+"/im/ent?userid=${user.id!''!''}&orgi=${user.orgi!''}"); 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() { socket.on('disconnect',function() {
}); });
$("#putAway").click(function(e){
top.isImIndex = true;
top.closeentim();
e.stopPropagation();
})
</script> </script>

View File

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

View File

@ -65,6 +65,8 @@
<script language="javascript"> <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 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 layinx , layerhelper ;
var isImIndex = false;
$(document).ready(function(){ $(document).ready(function(){
layui.use('layer', function(){ layui.use('layer', function(){
layerhelper = layer ; layerhelper = layer ;
@ -83,12 +85,30 @@
title: false, title: false,
closeBtn: 0, //不显示关闭按钮 closeBtn: 0, //不显示关闭按钮
shade: [0], shade: [0],
area: ["200px", "50px"], area: ["120px", "50px"],
offset: "rb", //右下角弹出 offset: "rb", //右下角弹出
anim: 2, anim: 2,
shade: 0, shade: 0,
content: "/ent/im/point.html", content: "/ent/im/point.html",
end:function(){ end:function(){
if(isImIndex == true){
layinx = layer.open({
type: 2,
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({ layinx = layer.open({
type: 2, type: 2,
title: false, title: false,
@ -104,6 +124,7 @@
} }
}); });
} }
}
}); });
} }
} }
@ -121,6 +142,7 @@
layerhelper.close(layinx); layerhelper.close(layinx);
} }
} }
</script> </script>
</head> </head>
@ -169,7 +191,6 @@
</a> </a>
</li> </li>
</#if> </#if>
<li class="layui-nav-item"><a href="javascript:void(0)"> <li class="layui-nav-item"><a href="javascript:void(0)">
<i class="layui-icon" style="position: relative;float:left;">&#xe612;</i> <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"> <span style="display: inline-block;max-width: 90px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float: left">