Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李丛阳
education
Commits
f3168d9f
Commit
f3168d9f
authored
Nov 28, 2019
by
王淑君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
733bc154
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
MTNotificationApiRequestClient.java
...common/util/outClient/MTNotificationApiRequestClient.java
+32
-30
No files found.
src/main/java/org/rcisoft/common/util/outClient/MTNotificationApiRequestClient.java
View file @
f3168d9f
...
...
@@ -27,6 +27,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 消息通知接口调用
...
...
@@ -61,24 +62,27 @@ public class MTNotificationApiRequestClient {
if
(
"dev"
.
equalsIgnoreCase
(
serverType
))
{
return
true
;
}
Ret
ret
=
new
Ret
();
List
<
String
>
receiIdListtake
=
new
ArrayList
<>();
String
receive
=
""
;
String
corpId
=
""
;
List
<
SysUser
>
personnelsList
=
sysUserMapper
.
selectByIds
(
Arrays
.
asList
(
new
String
[]{
message
.
getRecipientId
()}));
List
<
SysUser
>
personnelsList
=
sysUserMapper
.
selectByIds
(
Arrays
.
asList
(
message
.
getRecipientId
().
split
(
","
))
.
stream
()
.
map
(
s
->
s
.
trim
())
.
collect
(
Collectors
.
toList
()));
if
(
null
!=
personnelsList
&&
personnelsList
.
size
()
>
0
)
{
SysUser
personnels
=
personnelsList
.
get
(
0
);
for
(
SysUser
personnels:
personnelsList
){
if
(
null
!=
personnels
&&
null
!=
personnels
.
getAccountId
())
{
receiIdListtake
.
add
(
personnels
.
getAccountId
());
receive
=
personnels
.
getAccountId
();
corpId
=
personnels
.
getCorpId
();
}
}
MTNotificationSendReqDTO
mtNotificationSendReqDTO
=
MTNotificationSendReqDTO
.
builder
().
title
(
noticeTitle
).
content
(
message
.
getInfoText
())
.
channels
(
"ALL"
).
targetId
(
message
.
getBusinessId
()).
receiverIds
(
receiIdListtake
).
build
();
mtNotificationSendReqDTO
.
setSenderName
(
"排班
"
);
mtNotificationSendReqDTO
.
setSenderName
(
"智学
"
);
mtNotificationSendReqDTO
.
setChannels
(
"ALL"
);
mtNotificationSendReqDTO
.
setCategoryCodes
(
Arrays
.
asList
(
new
String
[]{
"SHIFTS
"
}));
mtNotificationSendReqDTO
.
setCategoryCodes
(
Arrays
.
asList
(
new
String
[]{
"EDUCATION
"
}));
if
(
StrUtil
.
isNotEmpty
(
corpId
))
mtNotificationSendReqDTO
.
setCorpId
(
corpId
);
else
...
...
@@ -87,23 +91,21 @@ public class MTNotificationApiRequestClient {
String
url
=
this
.
noticePropertiesUrl
+
"noticeType="
+
dealWithTitle
(
noticeTitle
)+
"&id="
+
receive
+
"&infoText="
+
UrlUtil
.
Utf8URLencode
(
message
.
getInfoText
())
+
"&messageId="
+
message
.
getBusinessId
()
+
"&createDate="
+
UrlUtil
.
Utf8URLencodeTime
(
df
.
format
(
message
.
getCreateDate
()))+
"&from=zx"
;
mtNotificationSendReqDTO
.
setProperties
(
new
HashMap
<
String
,
String
>(){{
put
(
"url"
,
url
);
}});
Ret
ret
=
new
Ret
();
mtNotificationSendReqDTO
.
setProperties
(
new
HashMap
<
String
,
String
>(){{
put
(
"url"
,
url
);
}});
try
{
ret
=
notificationFeignClient
.
sendMessage
(
mtNotificationSendReqDTO
,
"app"
,
(
long
)
1
);
}
catch
(
Exception
ex
){
log
.
error
(
"----------------------------------------------------调用智信通知失败!----------------------------------------------------------"
);
// throw new BizCommonException("调用智信通知失败");
}
}
}
if
(
ret
!=
null
&&
"M0000"
.
equals
(
ret
.
getCode
())){
return
true
;
}
return
false
;
}
private
String
dealWithTitle
(
String
title
){
// (GO_WORK_INFO:上班提醒";HAND_WORK_INFO:交班提醒;TAKE_WORK_INFO:接班提醒;FEEDBACK_WORK_INFO:反馈提醒;CHANGE_WORK_INFO","调班通知)
String
result
=
""
;
switch
(
title
){
case
"回复提醒"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment