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
06a925ea
Commit
06a925ea
authored
Jul 14, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 发送特殊欢迎语
parent
8d70441f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
36 deletions
+30
-36
WelcomeRelationServiceImpl.java
...e/service/service/hm/impl/WelcomeRelationServiceImpl.java
+2
-34
WelcomeServiceImpl.java
...aoban/manage/service/service/impl/WelcomeServiceImpl.java
+28
-2
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/WelcomeRelationServiceImpl.java
View file @
06a925ea
...
...
@@ -3,22 +3,15 @@ package com.gic.haoban.manage.service.service.hm.impl;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.service.LinkService
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeTemplateRelationMapper
;
import
com.gic.haoban.manage.service.entity.hm.TabHaobanWelcomeTemplateRelation
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeReferBO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO
;
import
com.gic.haoban.manage.service.service.WelcomeService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -34,7 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -53,11 +45,6 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
@Autowired
private
WelcomeService
welcomeService
;
@Autowired
private
HmLinkService
linkService
;
@Autowired
private
HmQrcodeService
qrcodeService
;
private
static
final
String
WELCOME_RELATION_KEY
=
"HM:welcome:relation:"
;
private
static
final
Long
WELCOME_RELATION_CACHE_TIME
=
5
*
60L
;
...
...
@@ -65,30 +52,11 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
/**
* 查询欢迎语关联关系
*
* @retur
n
* @retur
*/
@Override
public
String
queryWelcomeRelation
(
WelcomeReferBO
welcomeReferBo
)
{
if
(
welcomeReferBo
==
null
||
welcomeReferBo
.
getType
()
==
null
||
StringUtils
.
isBlank
(
welcomeReferBo
.
getReferId
()))
{
return
null
;
}
try
{
if
(
HmWelcomeReferType
.
LINK
.
getCode
().
equals
(
welcomeReferBo
.
getType
()))
{
HmLinkBO
linkBo
=
linkService
.
getByLinkIdFormCache
(
null
,
null
,
Long
.
parseLong
(
welcomeReferBo
.
getReferId
()));
if
(
linkBo
==
null
||
StringUtils
.
isBlank
(
linkBo
.
getWelcomeId
())){
return
null
;
}
return
linkBo
.
getWelcomeId
();
}
else
if
(
HmWelcomeReferType
.
HM
.
getCode
().
equals
(
welcomeReferBo
.
getType
()))
{
HmQrcodeBO
qrcodeBo
=
qrcodeService
.
queryById
(
Long
.
parseLong
(
welcomeReferBo
.
getReferId
()));
if
(
qrcodeBo
==
null
||
StringUtils
.
isBlank
(
qrcodeBo
.
getWelcomeId
())){
return
null
;
}
return
qrcodeBo
.
getWelcomeId
();
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"queryWelcomeRelation err"
,
ex
);
}
return
null
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WelcomeServiceImpl.java
View file @
06a925ea
...
...
@@ -25,6 +25,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWelcomeMedia;
import
com.gic.haoban.manage.service.entity.TabHaobanWelcomeSuitRang
;
import
com.gic.haoban.manage.service.entity.TabMiniprogramSetting
;
import
com.gic.haoban.manage.service.entity.TabWelcome
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.FriendSettingDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.SaveFriendSettingBO
;
...
...
@@ -41,6 +43,8 @@ import com.gic.haoban.manage.service.pojo.qo.WelcomeRelationQO;
import
com.gic.haoban.manage.service.service.KeyDataService
;
import
com.gic.haoban.manage.service.service.WelcomeService
;
import
com.gic.haoban.manage.service.service.WelcomeSuitRangService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -89,7 +93,9 @@ public class WelcomeServiceImpl implements WelcomeService {
@Autowired
private
KeyDataService
keyDataService
;
@Autowired
private
LinkService
linkService
;
private
HmLinkService
linkService
;
@Autowired
private
HmQrcodeService
qrcodeService
;
private
static
final
int
WELCOME_LIMIT
=
50
;
private
static
final
int
DEPARTMENT_NUM_LIMIT
=
10000
;
private
static
final
int
STAFF_NUM_LIMIT
=
2000
;
...
...
@@ -669,7 +675,27 @@ public class WelcomeServiceImpl implements WelcomeService {
logger
.
info
(
"[getMatchWelcomeWithReferId] staffId:{}, wxEnterpriseId:{}, welcomeReferBo:{}"
,
staffId
,
wxEnterpriseId
,
JSON
.
toJSONString
(
welcomeReferBo
));
String
welcomeId
=
welcomeRelationService
.
queryWelcomeRelation
(
welcomeReferBo
);
if
(
welcomeReferBo
==
null
||
welcomeReferBo
.
getType
()
==
null
||
StringUtils
.
isBlank
(
welcomeReferBo
.
getReferId
()))
{
return
null
;
}
String
welcomeId
=
""
;
try
{
if
(
HmWelcomeReferType
.
LINK
.
getCode
().
equals
(
welcomeReferBo
.
getType
()))
{
HmLinkBO
linkBo
=
linkService
.
getByLinkIdFormCache
(
null
,
null
,
Long
.
parseLong
(
welcomeReferBo
.
getReferId
()));
if
(
linkBo
==
null
||
StringUtils
.
isBlank
(
linkBo
.
getWelcomeId
())){
return
null
;
}
welcomeId
=
linkBo
.
getWelcomeId
();
}
else
if
(
HmWelcomeReferType
.
HM
.
getCode
().
equals
(
welcomeReferBo
.
getType
()))
{
HmQrcodeBO
qrcodeBo
=
qrcodeService
.
queryById
(
Long
.
parseLong
(
welcomeReferBo
.
getReferId
()));
if
(
qrcodeBo
==
null
||
StringUtils
.
isBlank
(
qrcodeBo
.
getWelcomeId
())){
return
null
;
}
welcomeId
=
qrcodeBo
.
getWelcomeId
();
}
}
catch
(
Exception
ex
)
{
logger
.
error
(
"queryWelcomeRelation err"
,
ex
);
}
logger
.
info
(
"[getMatchWelcomeWithReferId] 获取欢迎语Id:{}, params:{}"
,
welcomeId
,
JSON
.
toJSONString
(
welcomeReferBo
));
if
(
StringUtils
.
isBlank
(
welcomeId
)){
return
null
;
...
...
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