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
8d70441f
Commit
8d70441f
authored
Jul 14, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 发送特殊欢迎语
parent
dcf9ca26
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
31 deletions
+104
-31
WelcomeReferBO.java
...haoban/manage/service/pojo/bo/welcome/WelcomeReferBO.java
+36
-0
WelcomeService.java
...com/gic/haoban/manage/service/service/WelcomeService.java
+1
-1
WelcomeRelationService.java
...ban/manage/service/service/hm/WelcomeRelationService.java
+3
-4
WelcomeRelationServiceImpl.java
...e/service/service/hm/impl/WelcomeRelationServiceImpl.java
+31
-13
WelcomeServiceImpl.java
...aoban/manage/service/service/impl/WelcomeServiceImpl.java
+12
-11
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+21
-2
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/welcome/WelcomeReferBO.java
0 → 100644
View file @
8d70441f
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
.
bo
.
welcome
;
import
java.io.Serializable
;
/**
* @Author MUSI
* @Date 2022/7/14 3:26 PM
* @Description
* @Version
**/
public
class
WelcomeReferBO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6490051043315353967L
;
/**
* @see com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
*/
private
Integer
type
;
private
String
referId
;
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getReferId
()
{
return
referId
;
}
public
void
setReferId
(
String
referId
)
{
this
.
referId
=
referId
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WelcomeService.java
View file @
8d70441f
...
...
@@ -135,7 +135,7 @@ public interface WelcomeService {
* @param referId 活码 / 链接id
* @return
*/
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
referId
);
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
WelcomeReferBO
welcomeReferBo
);
/**
* 删除欢迎语
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/WelcomeRelationService.java
View file @
8d70441f
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.hm;
import
com.gic.api.base.commons.Page
;
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
java.util.List
;
...
...
@@ -16,12 +17,10 @@ import java.util.List;
public
interface
WelcomeRelationService
{
/**
* 查询欢迎语关联关系
* @param referId
* @param status
* 查询关联的欢迎语
* @return
*/
HmWelcomeRelationBO
queryWelcomeRelation
(
String
referId
,
Integer
status
);
String
queryWelcomeRelation
(
WelcomeReferBO
welcomeReferBo
);
/**
* 条件查询 欢迎语引用列表
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/WelcomeRelationServiceImpl.java
View file @
8d70441f
...
...
@@ -3,15 +3,22 @@ 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
;
...
...
@@ -46,7 +53,11 @@ 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
;
...
...
@@ -54,24 +65,31 @@ public class WelcomeRelationServiceImpl implements WelcomeRelationService {
/**
* 查询欢迎语关联关系
*
* @param referId
* @param status
* @return
*/
@Override
public
HmWelcomeRelationBO
queryWelcomeRelation
(
String
referId
,
Integer
status
)
{
String
welcomeRelationCacheKey
=
WELCOME_RELATION_KEY
+
referId
;
HmWelcomeRelationBO
cache
=
RedisUtil
.
getCache
(
welcomeRelationCacheKey
,
HmWelcomeRelationBO
.
class
);
if
(
cache
!=
null
)
{
return
cache
;
}
List
<
TabHaobanWelcomeTemplateRelation
>
welcomeTemplateRelations
=
welcomeTemplateRelationMapper
.
queryWelTemplateRelation
(
null
,
referId
,
status
);
if
(
CollectionUtils
.
isEmpty
(
welcomeTemplateRelations
))
{
public
String
queryWelcomeRelation
(
WelcomeReferBO
welcomeReferBo
)
{
if
(
welcomeReferBo
==
null
||
welcomeReferBo
.
getType
()
==
null
||
StringUtils
.
isBlank
(
welcomeReferBo
.
getReferId
()))
{
return
null
;
}
HmWelcomeRelationBO
welcomeRelationBO
=
EntityUtil
.
changeEntityByOrika
(
HmWelcomeRelationBO
.
class
,
welcomeTemplateRelations
.
get
(
0
));
RedisUtil
.
setCache
(
welcomeRelationCacheKey
,
welcomeRelationBO
,
WELCOME_RELATION_CACHE_TIME
,
TimeUnit
.
SECONDS
);
return
welcomeRelationBO
;
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 @
8d70441f
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
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.StringUtil
;
import
com.gic.haoban.manage.api.dto.welcome.dto.WelcomeRemoveCheckDTO
;
import
com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeQDTO
;
...
...
@@ -31,6 +33,7 @@ import com.gic.haoban.manage.service.pojo.bo.welcome.SaveWelcomeMediaBO;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeListBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeMediaBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeReferBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitDepartmentBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeSuitStaffBO
;
import
com.gic.haoban.manage.service.pojo.qo.WelcomeInfoQO
;
...
...
@@ -85,7 +88,8 @@ public class WelcomeServiceImpl implements WelcomeService {
private
WelcomeRelationService
welcomeRelationService
;
@Autowired
private
KeyDataService
keyDataService
;
@Autowired
private
LinkService
linkService
;
private
static
final
int
WELCOME_LIMIT
=
50
;
private
static
final
int
DEPARTMENT_NUM_LIMIT
=
10000
;
private
static
final
int
STAFF_NUM_LIMIT
=
2000
;
...
...
@@ -661,19 +665,16 @@ public class WelcomeServiceImpl implements WelcomeService {
}
@Override
public
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
String
referId
)
{
logger
.
info
(
"[getMatchWelcomeWithReferId] staffId:{}, wxEnterpriseId:{},
referId
:{}"
,
staffId
,
wxEnterpriseId
,
referId
);
public
WelcomeDetailBO
getMatchWelcomeWithReferId
(
String
staffId
,
String
wxEnterpriseId
,
WelcomeReferBO
welcomeReferBo
)
{
logger
.
info
(
"[getMatchWelcomeWithReferId] staffId:{}, wxEnterpriseId:{},
welcomeReferBo
:{}"
,
staffId
,
wxEnterpriseId
,
JSON
.
toJSONString
(
welcomeReferBo
)
);
if
(
StringUtils
.
isBlank
(
referId
)){
String
welcomeId
=
welcomeRelationService
.
queryWelcomeRelation
(
welcomeReferBo
);
logger
.
info
(
"[getMatchWelcomeWithReferId] 获取欢迎语Id:{}, params:{}"
,
welcomeId
,
JSON
.
toJSONString
(
welcomeReferBo
));
if
(
StringUtils
.
isBlank
(
welcomeId
)){
return
null
;
}
HmWelcomeRelationBO
welcomeRelationBO
=
welcomeRelationService
.
queryWelcomeRelation
(
referId
,
WelcomeRelationStatusEnum
.
ENABLE
.
getCode
());
if
(
welcomeRelationBO
==
null
){
// 不存在
return
null
;
}
TabWelcome
tabWelcome
=
welcomeMapper
.
selectByPrimaryKey
(
welcomeRelationBO
.
getWelcomeId
());
TabWelcome
tabWelcome
=
welcomeMapper
.
selectByPrimaryKey
(
welcomeId
);
return
convertWelcomeToBo
(
tabWelcome
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
8d70441f
...
...
@@ -35,6 +35,7 @@ import com.gic.haoban.manage.api.dto.*;
import
com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogQDTO
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.service.CheckQywxSettingApiService
;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
...
...
@@ -52,6 +53,7 @@ import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import
com.gic.haoban.manage.service.pojo.bo.hm.KeyDataLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeMediaBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeReferBO
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.hm.WxUserAddLogService
;
import
com.gic.haoban.manage.service.util.CommonUtil
;
...
...
@@ -577,8 +579,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
StringUtils
.
isNotBlank
(
state
))
{
//"HM+id" "DT+key"
log
.
info
(
"特殊欢迎语 state:{}"
,
state
);
String
refId
=
getRefId
(
state
);
welcomeDetailBO
=
welcomeService
.
getMatchWelcomeWithReferId
(
staffId
,
wxEnterpriseId
,
refId
);
WelcomeReferBO
welcomeReferBo
=
getWelcomeReferBo
(
state
);
welcomeDetailBO
=
welcomeService
.
getMatchWelcomeWithReferId
(
staffId
,
wxEnterpriseId
,
welcomeReferBo
);
}
else
{
welcomeDetailBO
=
welcomeService
.
getMatchWelcome
(
staffId
,
wxEnterpriseId
);
}
...
...
@@ -658,6 +660,23 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return
refId
;
}
private
WelcomeReferBO
getWelcomeReferBo
(
String
state
){
WelcomeReferBO
welcomeReferBo
=
new
WelcomeReferBO
();
String
id
=
state
.
substring
(
2
);
if
(
state
.
contains
(
"HM"
))
{
welcomeReferBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
welcomeReferBo
.
setReferId
(
id
);
}
else
if
(
state
.
contains
(
"DT"
))
{
KeyDataLinkBO
dataForHmLink
=
keyDataService
.
getDataForHmLink
(
id
);
if
(
dataForHmLink
!=
null
)
{
welcomeReferBo
.
setType
(
HmWelcomeReferType
.
LINK
.
getCode
());
welcomeReferBo
.
setReferId
(
Convert
.
toStr
(
dataForHmLink
.
getLinkId
()));
}
}
return
welcomeReferBo
;
}
private
void
attachmentAddImage
(
List
<
QywxExternalMessageBaseDTO
>
attachments
,
WelcomeMediaBO
media
,
WxEnterpriseDTO
wxEnterpriseDTO
)
{
String
mediaUrl
=
media
.
getMediaUrl
();
String
[]
arr
=
mediaUrl
.
split
(
"/"
);
...
...
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