Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
663ccc29
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
663ccc29
编写于
8月 03, 2020
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
im消息用户不在线发送app推送消息
上级
245291c1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
71 addition
and
5 deletion
+71
-5
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
...src/main/java/com/x/base/core/project/config/Collect.java
+1
-1
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/PmsConsumeQueue.java
...a/com/x/message/assemble/communicate/PmsConsumeQueue.java
+5
-1
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/PmsInnerConsumeQueue.java
.../x/message/assemble/communicate/PmsInnerConsumeQueue.java
+5
-0
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/im/ActionMsgCreate.java
...essage/assemble/communicate/jaxrs/im/ActionMsgCreate.java
+59
-2
o2web/source/o2_core/o2/xDesktop/WebSocket.js
o2web/source/o2_core/o2/xDesktop/WebSocket.js
+1
-1
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
浏览文件 @
663ccc29
...
...
@@ -28,7 +28,7 @@ public class Collect extends ConfigObject {
private
static
String
Default_title
=
"企业办公平台"
;
private
static
String
Default_footer
=
"www.o2oa.net"
;
private
static
String
Default_name
=
"www.o2oa.net"
;
private
static
String
Default_appUrl
=
"https://
sample.o2oa.net/app
/download.html"
;
private
static
String
Default_appUrl
=
"https://
app.o2oa.net/download
/download.html"
;
private
static
String
Default_server
=
"collect.o2oa.net"
;
private
static
Integer
Default_port
=
20080
;
public
static
String
ADDRESS_COLLECT_LOGIN
=
"/o2_collect_assemble/jaxrs/authentication/captcha/key/o2/answer/o2"
;
...
...
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/PmsConsumeQueue.java
浏览文件 @
663ccc29
...
...
@@ -26,7 +26,7 @@ public class PmsConsumeQueue extends AbstractQueue<Message> {
protected
void
execute
(
Message
message
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
logger
.
debug
(
"send pms message:{}."
,
message
);
logger
.
info
(
"send pms message:{}."
,
message
);
Boolean
result
=
false
;
JsonElement
jsonElement
=
XGsonBuilder
.
instance
().
fromJson
(
message
.
getBody
(),
JsonElement
.
class
);
/* 跳过第一条待办的提醒 */
...
...
@@ -47,6 +47,10 @@ public class PmsConsumeQueue extends AbstractQueue<Message> {
result
=
wrapBoolean
.
getValue
();
}
}
//单独发送推送消息用,没有存message对象 所以没有id,不需要更新
if
(
StringUtils
.
isEmpty
(
message
.
getId
()))
{
return
;
}
if
(
BooleanUtils
.
isTrue
(
result
))
{
Message
messageEntityObject
=
emc
.
find
(
message
.
getId
(),
Message
.
class
);
if
(
null
!=
messageEntityObject
)
{
...
...
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/PmsInnerConsumeQueue.java
浏览文件 @
663ccc29
...
...
@@ -9,6 +9,7 @@ import com.x.base.core.project.queue.AbstractQueue;
import
com.x.base.core.project.x_jpush_assemble_control
;
import
com.x.message.core.entity.Message
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
public
class
PmsInnerConsumeQueue
extends
AbstractQueue
<
Message
>
{
...
...
@@ -21,6 +22,10 @@ public class PmsInnerConsumeQueue extends AbstractQueue<Message> {
innerMessage
.
setMessage
(
message
.
getTitle
());
WrapBoolean
wrapBoolean
=
ThisApplication
.
context
().
applications
().
postQuery
(
false
,
app
,
"message/send"
,
innerMessage
)
.
getData
(
WrapBoolean
.
class
);
//单独发送推送消息用,没有存message对象 所以没有id,不需要更新
if
(
StringUtils
.
isEmpty
(
message
.
getId
()))
{
return
;
}
if
(
BooleanUtils
.
isTrue
(
wrapBoolean
.
getValue
()))
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Message
messageEntityObject
=
emc
.
find
(
message
.
getId
(),
Message
.
class
);
...
...
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/im/ActionMsgCreate.java
浏览文件 @
663ccc29
...
...
@@ -7,13 +7,17 @@ import com.x.base.core.entity.JpaObject;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.message.MessageConnector
;
import
com.x.message.assemble.communicate.ThisApplication
;
import
com.x.message.assemble.communicate.ws.collaboration.ActionCollaboration
;
import
com.x.message.core.entity.IMConversation
;
import
com.x.message.core.entity.IMMsg
;
import
com.x.message.core.entity.Message
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -62,8 +66,30 @@ public class ActionMsgCreate extends BaseAction {
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
logger
.
info
(
"发送im消息, person: "
+
persons
.
get
(
i
));
MessageConnector
.
send
(
MessageConnector
.
TYPE_IM_CREATE
,
"来自 "
+
name
+
" 的消息"
,
persons
.
get
(
i
),
msg
);
String
person
=
persons
.
get
(
i
);
logger
.
info
(
"发送im消息, person: "
+
person
);
String
title
=
"来自 "
+
name
+
" 的消息"
;
MessageConnector
.
send
(
MessageConnector
.
TYPE_IM_CREATE
,
title
,
person
,
msg
);
//如果消息接收者没有在线 连接ws 就发送一个推送消息
try
{
if
(!
ActionCollaboration
.
clients
.
values
().
contains
(
person
))
{
logger
.
info
(
"向app 推送im消息, person: "
+
person
);
Message
message
=
new
Message
();
String
body
=
imMessageBody
(
msg
);
message
.
setTitle
(
title
+
": "
+
body
);
message
.
setPerson
(
person
);
message
.
setType
(
MessageConnector
.
TYPE_IM_CREATE
);
message
.
setId
(
""
);
if
(
Config
.
communicate
().
pmsEnable
())
{
ThisApplication
.
pmsConsumeQueue
.
send
(
message
);
}
if
(
Config
.
pushConfig
().
getEnable
())
{
ThisApplication
.
pmsInnerConsumeQueue
.
send
(
message
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
...
@@ -73,6 +99,16 @@ public class ActionMsgCreate extends BaseAction {
}
}
private
String
imMessageBody
(
IMMsg
msg
)
{
String
json
=
msg
.
getBody
();
IMMessageBody
body
=
gson
.
fromJson
(
json
,
IMMessageBody
.
class
);
if
(
"emoji"
.
equals
(
body
.
getType
()))
{
return
"[表情]"
;
}
else
{
return
body
.
getBody
();
}
}
public
static
class
Wo
extends
IMMsg
{
...
...
@@ -82,5 +118,26 @@ public class ActionMsgCreate extends BaseAction {
JpaObject
.
FieldsInvisible
);
}
public
static
class
IMMessageBody
{
private
String
type
;
private
String
body
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getBody
()
{
return
body
;
}
public
void
setBody
(
String
body
)
{
this
.
body
=
body
;
}
}
}
o2web/source/o2_core/o2/xDesktop/WebSocket.js
浏览文件 @
663ccc29
...
...
@@ -350,7 +350,7 @@ MWF.xDesktop.WebSocket = new Class({
if
(
body
.
type
&&
body
.
type
==
"
emoji
"
)
{
//表情 消息
msgBody
=
"
[表情]
"
;
}
var
content
=
"
<font style='color: #333; font-weight: bold'>
"
+
data
.
title
+
"
</font>
"
+
msgBody
;
var
content
=
"
<font style='color: #333; font-weight: bold'>
"
+
data
.
title
+
"
</font>
:
"
+
msgBody
;
var
msg
=
{
"
subject
"
:
MWF
.
LP
.
desktop
.
messsage
.
customMessageTitle
,
"
content
"
:
content
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录