Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
07b46f32
Commit
07b46f32
authored
Aug 29, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wx_user_id调整
parent
92daf5dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
NoticeMessageApiServiceImpl.java
...rvice/service/notify/out/NoticeMessageApiServiceImpl.java
+9
-11
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/out/NoticeMessageApiServiceImpl.java
View file @
07b46f32
...
...
@@ -93,22 +93,22 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger
.
info
(
"没有模板,无法发送消息:{}"
,
messageQDTO
.
getTemplateCode
());
return
;
}
String
wxUser
Id
=
null
;
String
staff
Id
=
null
;
String
wxEnterpriseId
=
null
;
StaffClerkRelationDTO
clerkRelationDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
messageQDTO
.
getStaffId
()))
{
TabHaobanStaff
haobanStaff
=
staffService
.
selectById
(
messageQDTO
.
getStaffId
());
wxUserId
=
haobanStaff
!=
null
?
haobanStaff
.
getWxUser
Id
()
:
null
;
staffId
=
haobanStaff
!=
null
?
haobanStaff
.
getStaff
Id
()
:
null
;
wxEnterpriseId
=
haobanStaff
!=
null
?
haobanStaff
.
getWxEnterpriseId
()
:
null
;
}
if
(
StringUtils
.
isNotEmpty
(
messageQDTO
.
getClerkId
()))
{
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkIdForWxUserId
(
messageQDTO
.
getClerkId
());
}
if
(
wxUser
Id
==
null
&&
clerkRelationDTO
==
null
)
{
if
(
staff
Id
==
null
&&
clerkRelationDTO
==
null
)
{
logger
.
info
(
"没有导购:{}"
,
messageQDTO
.
getClerkId
());
return
;
}
wxUserId
=
(
wxUserId
==
null
?
clerkRelationDTO
.
getQwUserId
()
:
wxUser
Id
);
staffId
=
(
staffId
==
null
?
clerkRelationDTO
.
getStaffId
()
:
staff
Id
);
wxEnterpriseId
=
(
wxEnterpriseId
==
null
?
clerkRelationDTO
.
getWxEnterpriseId
()
:
wxEnterpriseId
);
//消息组装 新增消息
...
...
@@ -124,9 +124,8 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
noticeMessageBO
.
setRelationId
(
messageQDTO
.
getOptTargetId
());
noticeMessageBO
.
setMessageContent
(
messageQDTO
.
getExtendContent
()
!=
null
?
JSONObject
.
toJSONString
(
messageQDTO
.
getExtendContent
())
:
null
);
noticeMessageService
.
addOrCreateNoticeMessage
(
noticeMessageBO
);
//发送企业微信
sendMessage
(
contentList
,
wxEnterpriseId
,
wxUser
Id
,
messageTypeEnum
,
noticeMessageBO
.
getMessageContent
());
sendMessage
(
contentList
,
wxEnterpriseId
,
staff
Id
,
messageTypeEnum
,
noticeMessageBO
.
getMessageContent
());
}
@Override
...
...
@@ -231,19 +230,18 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
* @param wxUserId
* @param messageTypeEnum
*/
private
void
sendMessage
(
List
<
TemplateContentBO
>
contentList
,
String
wxEnterpriseId
,
String
wxUser
Id
,
NoticeMessageTypeEnum
messageTypeEnum
,
String
data
)
{
private
void
sendMessage
(
List
<
TemplateContentBO
>
contentList
,
String
wxEnterpriseId
,
String
staff
Id
,
NoticeMessageTypeEnum
messageTypeEnum
,
String
data
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
String
corpid
=
qwDTO
.
getThirdCorpid
()
;
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectBy
UserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
)
;
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectBy
Id
(
staffId
)
;
if
(
tabHaobanStaff
==
null
)
{
logger
.
error
(
"未查询到员工:
wxUserId:{}"
,
wxUser
Id
);
logger
.
error
(
"未查询到员工:
staffId:{}"
,
staff
Id
);
return
;
}
String
wxUserId
=
tabHaobanStaff
.
getWxUserId
();
if
(
qwDTO
.
needOpenUserId3th
())
{
wxUserId
=
tabHaobanStaff
.
getWxOpenUseId
();
}
else
{
wxUserId
=
tabHaobanStaff
.
getWxUserId
();
}
List
<
ItemDTO
>
items
=
contentList
.
stream
().
map
(
bo
->
{
ItemDTO
item
=
new
ItemDTO
();
...
...
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