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
3ca96bd1
Commit
3ca96bd1
authored
May 08, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试群发带活动id
parent
0e8b4e6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
QywxSendService.java
...om/gic/haoban/manage/service/service/QywxSendService.java
+1
-1
QywxSendServiceImpl.java
...oban/manage/service/service/impl/QywxSendServiceImpl.java
+21
-11
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/QywxSendService.java
View file @
3ca96bd1
...
@@ -11,7 +11,7 @@ public interface QywxSendService {
...
@@ -11,7 +11,7 @@ public interface QywxSendService {
* 企微群发-传入素材(ecm、群发助手)
* 企微群发-传入素材(ecm、群发助手)
*/
*/
public
ServiceResponse
<
String
>
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
public
ServiceResponse
<
String
>
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
);
List
<
String
>
materialIdList
,
String
planId
);
/**
/**
* 素材-分享
* 素材-分享
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/QywxSendServiceImpl.java
View file @
3ca96bd1
...
@@ -73,27 +73,27 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -73,27 +73,27 @@ public class QywxSendServiceImpl implements QywxSendService {
@Override
@Override
public
ServiceResponse
<
String
>
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
public
ServiceResponse
<
String
>
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
)
{
List
<
String
>
materialIdList
,
String
planId
)
{
return
this
.
send
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
,
null
,
1
,
single
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
,
null
,
1
,
single
,
planId
,
1
);
}
}
@Override
@Override
public
ServiceResponse
<
String
>
sendMessageShare
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
public
ServiceResponse
<
String
>
sendMessageShare
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
ContentMaterialDTO
>
imageList
,
String
message
)
{
List
<
ContentMaterialDTO
>
imageList
,
String
message
)
{
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
1
);
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
1
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
,
message
,
2
,
null
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
,
message
,
2
,
null
,
null
,
null
);
}
}
// 群发发送
// 群发发送
private
ServiceResponse
<
String
>
send
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
private
ServiceResponse
<
String
>
send
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
,
String
message
,
int
from
,
String
chatType
)
{
List
<
String
>
materialIdList
,
String
message
,
int
from
,
String
chatType
,
String
planId
,
Integer
planType
)
{
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
staffId
);
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
staffId
);
if
(
null
==
tabHaobanStaff
)
{
if
(
null
==
tabHaobanStaff
)
{
log
.
info
(
"staff不存在,staffId={}"
,
staffId
);
log
.
info
(
"staff不存在,staffId={}"
,
staffId
);
return
ServiceResponse
.
failure
(
"9999"
,
"群发失败,成员不存在"
);
return
ServiceResponse
.
failure
(
"9999"
,
"群发失败,成员不存在"
);
}
}
// 群发请求参数
// 群发请求参数
QywxExternalMessageDTO
messageDTO
=
this
.
getMessage
(
from
,
message
,
materialIdList
,
chatType
);
QywxExternalMessageDTO
messageDTO
=
this
.
getMessage
(
from
,
message
,
materialIdList
,
chatType
,
planId
,
planType
);
log
.
info
(
"群发信息={}"
,
JSON
.
toJSONString
(
messageDTO
));
log
.
info
(
"群发信息={}"
,
JSON
.
toJSONString
(
messageDTO
));
if
(
messageDTO
.
getAttachments
().
isEmpty
()
&&
StringUtils
.
isBlank
(
messageDTO
.
getContent
()))
{
if
(
messageDTO
.
getAttachments
().
isEmpty
()
&&
StringUtils
.
isBlank
(
messageDTO
.
getContent
()))
{
log
.
info
(
"群发素材不存在, 群发创建失败"
);
log
.
info
(
"群发素材不存在, 群发创建失败"
);
...
@@ -132,7 +132,7 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -132,7 +132,7 @@ public class QywxSendServiceImpl implements QywxSendService {
List
<
ContentMaterialDTO
>
imageList
)
{
List
<
ContentMaterialDTO
>
imageList
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
2
);
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
2
);
QywxExternalMessageDTO
dto
=
this
.
getMessage
(
2
,
message
,
materialIdList
,
null
);
QywxExternalMessageDTO
dto
=
this
.
getMessage
(
2
,
message
,
materialIdList
,
null
,
null
,
null
);
MomentTaskDTO
moment
=
EntityUtil
.
changeEntity
(
MomentTaskDTO
.
class
,
dto
);
MomentTaskDTO
moment
=
EntityUtil
.
changeEntity
(
MomentTaskDTO
.
class
,
dto
);
Text
text
=
new
Text
();
Text
text
=
new
Text
();
text
.
setContent
(
dto
.
getContent
());
text
.
setContent
(
dto
.
getContent
());
...
@@ -166,7 +166,7 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -166,7 +166,7 @@ public class QywxSendServiceImpl implements QywxSendService {
}
}
// from 1好办素材 2内容中台
// from 1好办素材 2内容中台
private
QywxExternalMessageDTO
getMessage
(
int
from
,
String
message
,
List
<
String
>
materialIdList
,
String
chatType
)
{
private
QywxExternalMessageDTO
getMessage
(
int
from
,
String
message
,
List
<
String
>
materialIdList
,
String
chatType
,
String
planId
,
Integer
planType
)
{
QywxExternalMessageDTO
messageDTO
=
new
QywxExternalMessageDTO
();
QywxExternalMessageDTO
messageDTO
=
new
QywxExternalMessageDTO
();
messageDTO
.
setChatType
(
chatType
);
messageDTO
.
setChatType
(
chatType
);
List
<
QywxMessageMaterialDTO
>
attachList
=
new
ArrayList
<>();
List
<
QywxMessageMaterialDTO
>
attachList
=
new
ArrayList
<>();
...
@@ -185,7 +185,7 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -185,7 +185,7 @@ public class QywxSendServiceImpl implements QywxSendService {
if
(
material
.
getMaterialType
()
==
1
)
{
if
(
material
.
getMaterialType
()
==
1
)
{
messageDTO
.
setContent
(
material
.
getMaterialContent
());
messageDTO
.
setContent
(
material
.
getMaterialContent
());
}
else
{
}
else
{
attachList
.
add
(
this
.
getMessageMaterial
(
material
));
attachList
.
add
(
this
.
getMessageMaterial
(
material
,
planId
,
planType
));
}
}
});
});
}
}
...
@@ -196,7 +196,7 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -196,7 +196,7 @@ public class QywxSendServiceImpl implements QywxSendService {
/**
/**
* 素材发送对象构造
* 素材发送对象构造
*/
*/
private
QywxMessageMaterialDTO
getMessageMaterial
(
MaterialDTO
material
)
{
private
QywxMessageMaterialDTO
getMessageMaterial
(
MaterialDTO
material
,
String
planId
,
Integer
planType
)
{
// 素材类型
// 素材类型
Integer
materialType
=
material
.
getMaterialType
();
Integer
materialType
=
material
.
getMaterialType
();
// 企微对应的id
// 企微对应的id
...
@@ -227,6 +227,16 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -227,6 +227,16 @@ public class QywxSendServiceImpl implements QywxSendService {
miniprogramMaterialDTO
.
setPicMediaId
(
maerialId
);
miniprogramMaterialDTO
.
setPicMediaId
(
maerialId
);
miniprogramMaterialDTO
.
setAppid
(
material
.
getAppId
());
miniprogramMaterialDTO
.
setAppid
(
material
.
getAppId
());
miniprogramMaterialDTO
.
setPage
(
material
.
getLink
());
miniprogramMaterialDTO
.
setPage
(
material
.
getLink
());
if
(
null
!=
planType
&&
StringUtils
.
isNotBlank
(
planId
))
{
String
url
=
"qtActivityType="
+
planType
+
"&qtActivityId="
+
planId
;
if
(
material
.
getLink
().
contains
(
"?"
))
{
url
=
"&"
+
url
;
}
else
{
url
=
"?"
+
url
;
}
miniprogramMaterialDTO
.
setPage
(
material
.
getLink
()+
url
);
log
.
info
(
"群发链接={}"
,
material
.
getLink
(),
miniprogramMaterialDTO
.
getPage
());
}
dto
.
setMsgType
(
QywxMediaTypeEnum
.
MINIPROGRAM
.
getName
());
dto
.
setMsgType
(
QywxMediaTypeEnum
.
MINIPROGRAM
.
getName
());
dto
.
setMiniprogram
(
miniprogramMaterialDTO
);
dto
.
setMiniprogram
(
miniprogramMaterialDTO
);
}
}
...
@@ -235,12 +245,12 @@ public class QywxSendServiceImpl implements QywxSendService {
...
@@ -235,12 +245,12 @@ public class QywxSendServiceImpl implements QywxSendService {
@Override
@Override
public
ServiceResponse
<
String
>
sendChatMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
materialIdList
)
{
public
ServiceResponse
<
String
>
sendChatMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
materialIdList
)
{
return
this
.
send
(
wxEnterpriseId
,
staffId
,
null
,
materialIdList
,
null
,
1
,
group
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
null
,
materialIdList
,
null
,
1
,
group
,
null
,
null
);
}
}
@Override
@Override
public
ServiceResponse
<
String
>
sendChatMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
ContentMaterialDTO
>
imageList
,
String
message
)
{
public
ServiceResponse
<
String
>
sendChatMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
ContentMaterialDTO
>
imageList
,
String
message
)
{
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
1
);
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
1
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
null
,
materialIdList
,
message
,
2
,
group
);
return
this
.
send
(
wxEnterpriseId
,
staffId
,
null
,
materialIdList
,
message
,
2
,
group
,
null
,
null
);
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
3ca96bd1
...
@@ -1178,7 +1178,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -1178,7 +1178,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
*/
*/
@Override
@Override
public
JSONResponse
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
,
String
planId
)
{
public
JSONResponse
sendMessage
(
String
wxEnterpriseId
,
String
staffId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
,
String
planId
)
{
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
resp
=
this
.
qywxSendService
.
sendMessage
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
)
;
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
resp
=
this
.
qywxSendService
.
sendMessage
(
wxEnterpriseId
,
staffId
,
extendUserList
,
materialIdList
,
planId
)
;
return
this
.
retJson
(
resp
)
;
return
this
.
retJson
(
resp
)
;
}
}
...
...
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