master
kira 6 years ago
parent 4948539479
commit 016f5f94b1

@ -124,7 +124,7 @@ public class OpenimClient {
list2.add(obj3);
obj3.setNick("king");
obj3.setIconUrl("https://ss0.baidu.com/73t1bjeh1BF3odCf/it/u=1948403834,955109320&fm=85&s=0D06E5134AD145F30C8D6D680300303A");
obj3.setUserid("kira2");
obj3.setUserid("kira3_PINE");
obj3.setPassword("xxxxxx");
req.setUserinfos(list2);
OpenimUsersAddResponse rsp = null;

@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.BoundListOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -118,7 +119,11 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
queryParams.put("clientId", client.getIntValue("client_id"));
}
if (StringUtils.isNotEmpty(userNames)) {
queryParams.put("userNames", Arrays.asList(userNames.split(",")));
List<String> userNams = Arrays.asList(userNames.split(","));
if(CollectionUtils.isEmpty(userNams)){
return Collections.EMPTY_LIST;
}
queryParams.put("userNames",userNams );
}
if (queryParams.size() < 1) {
return Collections.emptyList();

@ -99,7 +99,7 @@
<![CDATA[
SELECT display_name
FROM sys_managers
WHERE role & #{mask} >0 AND org_id IS NULL AND is_valid = 1
WHERE role & #{mask} >0 AND (org_id IS NULL or org_id=1) AND is_valid = 1
]]>
</select>

@ -62,8 +62,8 @@
var cnts = data.data.cnts;
for (var i = cnts.length - 1; i >= 0; i--) {
var unreadmapEle = {msgCount: 0};
window.sdk.unreadMap[WKIT.Conn.sdk.Base.getNick(
cnts[i].from)] = unreadmapEle;
window.sdk.unreadMap[getName(WKIT.Conn.sdk.Base.getNick(
cnts[i].from))] = unreadmapEle;
}
getUnreadMsgCount();
},
@ -78,18 +78,20 @@
WKIT.Conn.sdk.Base.getUnreadMsgCount({
count: 40,
success: function (data) {
console.log(data);
var unreads = data.data;
var uids = "";
for (var i = unreads.length - 1; i >= 0; i--) {
if(window.sdk.unreadMap[WKIT.Conn.sdk.Base.getNick(unreads[i].contact)]){
window.sdk.unreadMap[getName(WKIT.Conn.sdk.Base.getNick(unreads[i].contact))].msgCount =
unreads[i].msgCount;
var nick = getName(WKIT.Conn.sdk.Base.getNick(unreads[i].contact));
if(nick.length<=6){
uids += nick+",";
}else {
uids += nick.substring(0,uid.length-5) + ",";
}
window.sdk.unreadMap[WKIT.Conn.sdk.Base.getNick(unreads[i].contact)].msgCount =
unreads[i].msgCount;
var nick = WKIT.Conn.sdk.Base.getNick(unreads[i].contact)
uids += nick.substr(0,nick.length-6) + ",";
}
console.log("unreadMap",window.sdk.unreadMap);
window.sdk.loadContactList(uids);
},
error: function (error) {
@ -100,7 +102,9 @@
function updateContractList(data) {
var msg = data.msgs[0];
var msg_uid = WKIT.Conn.sdk.Base.getNick(msg.from);
var msg_uid = getName(WKIT.Conn.sdk.Base.getNick(msg.from))
if (window.sdk.unreadMap[msg_uid]) {
window.sdk.unreadMap[msg_uid].msgCount = window.sdk.unreadMap[msg_uid].msgCount + 1;
} else {
@ -116,6 +120,14 @@
$("#J_wkitPluginFrameWrap").css("margin", "0 0 0 0");
}
function getName(uid) {
if(uid.substring(uid.length-5,uid.length-4)=='_'){
var prefix = uid.substring(0,uid.length-5);
var suffix =uid.substring(uid.length-5,uid.length).toUpperCase();
return prefix+suffix;
}
return uid;
}
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);

@ -123,11 +123,13 @@
function updateContractList(data) {
var msg = data.msgs[0];
var msg_uid = WKIT.Conn.sdk.Base.getNick(msg.from);
var msg_uid = WKIT.Conn.sdk.Base.getNick(msg.from).toUpperCase();
if (window.sdk.unreadMap[msg_uid]) {
window.sdk.unreadMap[msg_uid].msgCount = window.sdk.unreadMap[msg_uid].msgCount + 1;
window.sdk.unreadMap[msg_uid].lastMsg =msg.msg ;
} else {
var unreadMapEle = {msgCount: 1}
var unreadMapEle = {msgCount: 1,msg:msg.msg}
window.sdk.unreadMap[msg_uid] = unreadMapEle;
}
window.sdk.loadContactList(msg_uid.substr(0, msg_uid - 6));

@ -15,6 +15,7 @@
transition: background-color .1s;
margin-bottom: 13px;
width: 100%;
height: 2rem;
}
ul {
@ -65,22 +66,26 @@
}
.avatar {
margin-top: 8px;
padding-left: 27px;
margin-top: 11px;
padding-left: 42px;
}
.msg {
margin-top: 11px;
padding-left: 42px;
}
.notice {
width: 15px;
height: 15px;
line-height: 15px;
width: 1.2rem;
height: 1.2rem;
line-height: 1.2rem;
font-size: 10px;
color: #fff;
text-align: center;
background-color: #f00;
border-radius: 50%;
position: relative;
right: -16px;
top: -7px;
right: -23px;
top: -8px;
}
.frm_search {
@ -166,31 +171,28 @@
function showContactList(map) {
var contact_list = '';
for (var key in map) {
var css = 'hover';
if (key == parent.window.uid) {
css = 'active';
}
var ele= map[key];
var headImUrl = '';
if (map[key].headimg) {
headImUrl = map[key].headimg;
if (ele.headimg) {
headImUrl = ele.headimg;
} else {
headImUrl = "/static/images/act/encourage_money/default_headimg.png";
}
contact_list +=
"<li " + " class=\"" + css + "\" onclick=switchToUser('" + key
"<li onclick=switchToUser('" + key
+ "')>"
+ "<div class=\"headimg\" style='background-image:url(" + headImUrl
+ "')>"
+ "<div class=\"notice\">" + map[key].msgCount + "</div>"
+ "<div class=\"notice\">" + ele.msgCount + "</div>"
+ "</div>"
+ "<div class=\"avatar\">" + key + "</div>"
+ "</li>"
+ "<div class=\"avatar\">" + key + "</div>";
if(ele.lastMsg){
contact_list +="<div class=\"msg\">" + ele.lastMsg + "</div>";
}
contact_list+= "</li>";
}
$("#contact_list").html(contact_list);
}
function switchToUser(touid) {
parent.document.getElementById("subPage").contentWindow.switchTouid(touid);
parent.hideList();

@ -12,10 +12,10 @@
container: document.getElementById('J_demo'),
width: 700,
height: 500,
uid: 'kira2',
uid: 'kira3_PINE',
appkey: 24980715,
credential: 'xxxxxx',
touid: 'kira',
touid: 'kira7',
logo: 'http://img.alicdn.com/tps/i3/TB12LD9IFXXXXb3XpXXSyFWJXXX-82-82.png',
});
}

Loading…
Cancel
Save