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
56fcc9a2
Commit
56fcc9a2
authored
Jul 19, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/xgh/7月零散' into 'developer'
Feature/xgh/7月零散 See merge request
!2039
parents
34e403f1
8b099e01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
9 deletions
+54
-9
WelcomeUserInfoBO.java
...com/gic/haoban/manage/service/pojo/WelcomeUserInfoBO.java
+31
-0
WelcomeSendServiceImpl.java
...n/manage/service/service/impl/WelcomeSendServiceImpl.java
+23
-9
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/WelcomeUserInfoBO.java
0 → 100644
View file @
56fcc9a2
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
;
import
java.io.Serializable
;
public
class
WelcomeUserInfoBO
implements
Serializable
{
private
String
name
;
private
int
addWay
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getAddWay
()
{
return
addWay
;
}
public
void
setAddWay
(
int
addWay
)
{
this
.
addWay
=
addWay
;
}
public
WelcomeUserInfoBO
(
String
name
,
int
addWay
)
{
this
.
name
=
name
;
this
.
addWay
=
addWay
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WelcomeSendServiceImpl.java
View file @
56fcc9a2
...
@@ -5,8 +5,10 @@ import java.util.Date;
...
@@ -5,8 +5,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMediaMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMediaMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.pojo.WelcomeUserInfoBO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
...
@@ -112,10 +114,6 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -112,10 +114,6 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
/**
/**
* 发送欢迎语
* 发送欢迎语
*
*
* @param dto
* @param wxEnterpriseDTO
* @param enterpriseId
* @param staffId
* {"data":{"welcomeCode":"J0GjdrsF-nZNac3Xc6V2K2p8OokQZcY4g0jxljdHc7A","wxUserId":"016903","suiteid":"selfSuiteId","corpid":"wxbde984c3488b837e","externalUserid":"wmSe9FEAAAy39F1NI6Z-THUUd9mkqOIw","changeType":"add_external_contact"},"type":1,"mqTraceId":"278473818-1-1679557069.126"}
* {"data":{"welcomeCode":"J0GjdrsF-nZNac3Xc6V2K2p8OokQZcY4g0jxljdHc7A","wxUserId":"016903","suiteid":"selfSuiteId","corpid":"wxbde984c3488b837e","externalUserid":"wmSe9FEAAAy39F1NI6Z-THUUd9mkqOIw","changeType":"add_external_contact"},"type":1,"mqTraceId":"278473818-1-1679557069.126"}
*/
*/
@Override
@Override
...
@@ -144,6 +142,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -144,6 +142,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
log
.
info
(
"发送欢迎语,state={}"
,
state
);
log
.
info
(
"发送欢迎语,state={}"
,
state
);
String
relationKey
=
SecureUtil
.
md5
(
staffId
+
externalUserId
);
String
relationKey
=
SecureUtil
.
md5
(
staffId
+
externalUserId
);
WelcomeDetailBO
welcomeBO
=
null
;
WelcomeDetailBO
welcomeBO
=
null
;
WelcomeUserInfoBO
userBO
=
this
.
getExternalUserName
(
qwDTO
,
externalUserId
,
wxUserId
);
if
(
StringUtils
.
isNotBlank
(
state
)
if
(
StringUtils
.
isNotBlank
(
state
)
&&
(
state
.
startsWith
(
Manage3Constants
.
HM
)
||
state
.
startsWith
(
Manage3Constants
.
DT
)))
{
&&
(
state
.
startsWith
(
Manage3Constants
.
HM
)
||
state
.
startsWith
(
Manage3Constants
.
DT
)))
{
WelcomeReferBO
welcomeReferBo
=
getWelcomeReferBo
(
state
);
WelcomeReferBO
welcomeReferBo
=
getWelcomeReferBo
(
state
);
...
@@ -163,7 +162,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -163,7 +162,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
log
.
info
(
"欢迎语发送{}={}"
,
welcomeBO
.
getWelcomeId
(),
JSON
.
toJSONString
(
welcomeBO
));
log
.
info
(
"欢迎语发送{}={}"
,
welcomeBO
.
getWelcomeId
(),
JSON
.
toJSONString
(
welcomeBO
));
String
content
=
welcomeBO
.
getWelcomeContent
();
String
content
=
welcomeBO
.
getWelcomeContent
();
if
(
content
.
contains
(
"<微信昵称>"
))
{
if
(
content
.
contains
(
"<微信昵称>"
))
{
String
nickName
=
this
.
getExternalUserName
(
qwDTO
,
externalUserId
)
;
String
nickName
=
userBO
.
getName
()
;
//这里对“$”符号和”\\“符号进行转义处理
//这里对“$”符号和”\\“符号进行转义处理
nickName
=
java
.
util
.
regex
.
Matcher
.
quoteReplacement
(
nickName
);
nickName
=
java
.
util
.
regex
.
Matcher
.
quoteReplacement
(
nickName
);
content
=
content
.
replaceAll
(
"<微信昵称>"
,
nickName
);
content
=
content
.
replaceAll
(
"<微信昵称>"
,
nickName
);
...
@@ -403,7 +402,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -403,7 +402,7 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
}
}
}
}
private
String
getExternalUserName
(
WxEnterpriseQwDTO
qwDTO
,
String
external
UserId
)
{
private
WelcomeUserInfoBO
getExternalUserName
(
WxEnterpriseQwDTO
qwDTO
,
String
externalUserId
,
String
add
UserId
)
{
log
.
info
(
"查询好友详情,externalUserId={},{}"
,
externalUserId
,
qwDTO
.
getWxSecurityType
());
log
.
info
(
"查询好友详情,externalUserId={},{}"
,
externalUserId
,
qwDTO
.
getWxSecurityType
());
String
userInfo
=
null
;
String
userInfo
=
null
;
if
(
qwDTO
.
isSelf
())
{
if
(
qwDTO
.
isSelf
())
{
...
@@ -412,13 +411,14 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -412,13 +411,14 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
userInfo
=
qywxUserApiService
.
getExternalUseridInfo
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
externalUserId
);
userInfo
=
qywxUserApiService
.
getExternalUseridInfo
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
externalUserId
);
}
}
String
name
=
""
;
String
name
=
""
;
Integer
addWay
=
0
;
if
(
StringUtils
.
isBlank
(
userInfo
))
{
if
(
StringUtils
.
isBlank
(
userInfo
))
{
log
.
info
(
"好友不存在"
);
log
.
info
(
"好友不存在"
);
return
n
ame
;
return
n
ew
WelcomeUserInfoBO
(
name
,
0
)
;
}
}
if
(
"1"
.
equals
(
userInfo
))
{
if
(
"1"
.
equals
(
userInfo
))
{
log
.
info
(
"限制次数"
);
log
.
info
(
"限制次数"
);
return
n
ame
;
return
n
ew
WelcomeUserInfoBO
(
name
,
0
)
;
}
}
if
(
StringUtils
.
isNotBlank
(
userInfo
))
{
if
(
StringUtils
.
isNotBlank
(
userInfo
))
{
JSONObject
userJson
=
JSON
.
parseObject
(
userInfo
);
JSONObject
userJson
=
JSON
.
parseObject
(
userInfo
);
...
@@ -428,8 +428,22 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
...
@@ -428,8 +428,22 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
jt
=
JSON
.
parseObject
(
external_contact
);
jt
=
JSON
.
parseObject
(
external_contact
);
name
=
EmojiFilterUtil
.
filterEmojiLast
(
jt
.
getString
(
"name"
),
true
);
name
=
EmojiFilterUtil
.
filterEmojiLast
(
jt
.
getString
(
"name"
),
true
);
}
}
String
follow_user
=
""
;
follow_user
=
userJson
.
getString
(
"follow_user"
);
if
(
StringUtils
.
isNotBlank
(
follow_user
))
{
JSONArray
j
=
JSON
.
parseArray
(
follow_user
);
for
(
Object
object
:
j
)
{
String
followJson
=
JSON
.
toJSONString
(
object
);
JSONObject
follow
=
JSON
.
parseObject
(
followJson
);
String
userId
=
follow
.
getString
(
"userid"
);
if
(
userId
.
equals
(
addUserId
))
{
addWay
=
follow
.
getIntValue
(
"add_way"
)
;
}
}
}
}
}
return
name
;
log
.
info
(
"addWay={}"
,
addWay
);
return
new
WelcomeUserInfoBO
(
name
,
addWay
);
}
}
private
String
getClerkId
(
String
wxEnterpriseId
,
String
staffId
,
String
state
)
{
private
String
getClerkId
(
String
wxEnterpriseId
,
String
staffId
,
String
state
)
{
...
...
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