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
1
Merge Requests
1
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
0aff4774
Commit
0aff4774
authored
Dec 18, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:加好友增加判断
parent
c5e81803
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
39 deletions
+59
-39
WxEnterpriseApiService.java
...gic/haoban/manage/api/service/WxEnterpriseApiService.java
+13
-2
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+17
-13
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+14
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+14
-23
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseApiService.java
View file @
0aff4774
...
...
@@ -148,13 +148,24 @@ public interface WxEnterpriseApiService {
/**
* 企微回调-同意授权转换external_userid
*
* @param corpId 公司标识
* @param serviceCorpId 服务公司id
* @param corpId 公司标识
(同意授权的企业ID)
* @param serviceCorpId 服务公司id
(服务商企业ID)
* @author mozhu
* @date 2021-11-30 19:14:08
*/
void
agreeExternalUseridCallBack
(
String
corpId
,
String
serviceCorpId
);
/**
* 同意外部标识标志
*
* @param wxEnterpriseId 公司标识
* @param openFlag 开放的标志
* @author mozhu
* @date 2021-12-18 11:55:51
*/
void
agreeExternalUseridFlag
(
String
wxEnterpriseId
,
Integer
openFlag
);
/**
* 好办登录
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
0aff4774
...
...
@@ -397,28 +397,32 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log
.
info
(
"未查询到企业:wxEnterpriseId:{}"
,
wxEnterpriseId
);
return
;
}
// TODO: 2021/12/18 先注释,后面打开
//String corpid = wxEnterpriseDTO.getCorpid();
//if (corpid.startsWith("ww")) {
// log.info("加好友ww开头的,走原来的逻辑(根据同一开平不同开平走):{}", corpid);
// addExternalClerkRelated(dto, staffId, staffClerkRelationDTO, wxEnterpriseRelated);
//} else {
// //发送欢迎语
// log.info("加好友wp开头的,走欢迎语:{}", corpid);
// addFriendByWelcome(dto, staffClerkRelationDTO);
//}
addFriendByWelcome
(
dto
,
staffClerkRelationDTO
);
String
corpid
=
wxEnterpriseDTO
.
getCorpid
();
if
(
corpid
.
startsWith
(
"ww"
))
{
Integer
agreeExternalUseridFlag
=
wxEnterpriseDTO
.
getAgreeExternalUseridFlag
();
log
.
info
(
"加好友ww开头的,并且是agreeExternalUseridFlag:{}走原来的逻辑(根据同一开平不同开平走):{}"
,
agreeExternalUseridFlag
,
corpid
);
if
(
agreeExternalUseridFlag
==
1
)
{
log
.
info
(
"同意直接走,发送欢迎语逻辑:wxEnterpriseId:{}"
,
wxEnterpriseId
);
addFriendByWelcome
(
dto
,
staffClerkRelationDTO
);
}
else
{
log
.
info
(
"未同意直接走原来同一开平逻辑:wxEnterpriseId:{}"
,
wxEnterpriseId
);
addExternalClerkRelated
(
dto
,
staffId
,
staffClerkRelationDTO
,
wxEnterpriseRelated
);
}
}
else
{
//发送欢迎语
log
.
info
(
"加好友wp开头的,走欢迎语:{}"
,
corpid
);
addFriendByWelcome
(
dto
,
staffClerkRelationDTO
);
}
}
/**
* 根据统一开平和不同开平 处理不同的添加好友关系
(新逻辑已废弃)
* 根据统一开平和不同开平 处理不同的添加好友关系
*
* @param dto
* @param staffId
* @param staffClerkRelationDTO
* @param wxEnterpriseRelated
*/
@Deprecated
private
void
addExternalClerkRelated
(
MemberUnionidRelatedDTO
dto
,
String
staffId
,
StaffClerkRelationDTO
staffClerkRelationDTO
,
TabHaobanWxEnterpriseRelated
wxEnterpriseRelated
)
{
String
wxUserId
=
dto
.
getWxUserId
();
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
0aff4774
...
...
@@ -289,14 +289,27 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
if
(
tabHaobanWxEnterprise
==
null
)
{
return
;
}
WxEnterpriseDTO
wxEnterpriseDTO
=
new
WxEnterpriseDTO
();
wxEnterpriseDTO
.
setWxEnterpriseId
(
tabHaobanWxEnterprise
.
getWxEnterpriseId
());
wxEnterpriseDTO
.
setAgreeExternalUseridFlag
(
1
);
wxEnterpriseDTO
.
setAgreeExternalUseridTime
(
new
Date
());
wxEnterpriseDTO
.
setUpdateTime
(
new
Date
());
wxEnterpriseService
.
update
(
wxEnterpriseDTO
);
}
@Override
public
void
agreeExternalUseridFlag
(
String
wxEnterpriseId
,
Integer
openFlag
)
{
log
.
info
(
"是否同意授权转换external_userid,运维操作:wxEnterpriseId:{}"
,
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO1
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO1
==
null
)
{
return
;
}
WxEnterpriseDTO
wxEnterpriseDTO
=
new
WxEnterpriseDTO
();
wxEnterpriseDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
wxEnterpriseDTO
.
setAgreeExternalUseridFlag
(
openFlag
);
wxEnterpriseDTO
.
setAgreeExternalUseridTime
(
new
Date
());
wxEnterpriseDTO
.
setUpdateTime
(
new
Date
());
wxEnterpriseService
.
update
(
wxEnterpriseDTO
);
}
@Override
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
0aff4774
...
...
@@ -76,7 +76,6 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
@IgnoreLogin
@RequestMapping
(
"wxa-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -105,7 +104,6 @@ public class WxEnterpriseController extends WebBaseController {
//授权企业列表
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxaEnterpriseList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -195,7 +193,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业绑定接口
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-bind"
)
public
HaobanResponse
wxEnterpriseBind
(
WxEnterpriseBindQo
bindQo
)
{
if
(
StringUtils
.
isAnyBlank
(
bindQo
.
getEnterpriseId
(),
bindQo
.
getVersion
()))
{
...
...
@@ -227,7 +224,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//溢出门店列表
@IgnoreLogin
@RequestMapping
(
"store-full-list"
)
public
HaobanResponse
storeFullList
(
BasePageInfo
basePageInfo
,
String
keyWord
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -280,7 +276,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业是否设置key
@IgnoreLogin
@RequestMapping
(
"is-wx-enterprise-secret-set"
)
public
HaobanResponse
isWxEnterpriseSecretSet
()
{
String
wxEnterpriseId
=
""
;
...
...
@@ -303,7 +298,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业绑定接口绑定通讯录key
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-contact-secret-set"
)
public
HaobanResponse
wxEnterpriseSecretSet
(
String
contactSecret
)
{
if
(
StringUtils
.
isBlank
(
contactSecret
))
{
...
...
@@ -341,7 +335,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业绑定接口绑定通讯录key
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-wx-secret-set"
)
public
HaobanResponse
wxEnterpriseWxSecretSet
(
String
wxSecretKey
)
{
if
(
StringUtils
.
isAnyBlank
(
wxSecretKey
))
{
...
...
@@ -379,7 +372,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业会员小程序
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-member-secret-set"
)
public
HaobanResponse
wxEnterpriseMemberSecretSet
(
String
memberSecret
,
String
enterpriseId
,
String
secretName
)
{
if
(
StringUtils
.
isAnyBlank
(
memberSecret
))
{
...
...
@@ -430,7 +422,6 @@ public class WxEnterpriseController extends WebBaseController {
}
//微信企业绑定接口绑定通讯录key(好办助手)
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-haoban-secret-set"
)
public
HaobanResponse
wxEnterpriseHaobanSecretSet
(
String
contactSecret
,
String
memberSecret
)
{
if
(
StringUtils
.
isNotBlank
(
memberSecret
))
{
...
...
@@ -473,10 +464,8 @@ public class WxEnterpriseController extends WebBaseController {
//微信企业会员小程序
@IgnoreLogin
@RequestMapping
(
"secret-list"
)
public
HaobanResponse
secretList
()
{
String
wxEnterpriseId
=
""
;
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
...
...
@@ -500,7 +489,6 @@ public class WxEnterpriseController extends WebBaseController {
//微信企业会员小程序
@IgnoreLogin
@RequestMapping
(
"member-secret-del"
)
public
HaobanResponse
delMemberSecret
(
String
secretId
)
{
if
(
StringUtils
.
isAnyBlank
(
secretId
))
{
...
...
@@ -587,7 +575,6 @@ public class WxEnterpriseController extends WebBaseController {
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-bind-detail"
)
public
HaobanResponse
wxEnterpriseBindDetail
(
String
enterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
...
...
@@ -607,7 +594,6 @@ public class WxEnterpriseController extends WebBaseController {
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"bind-store-list"
)
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -622,7 +608,6 @@ public class WxEnterpriseController extends WebBaseController {
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"flush-bind-store-list"
)
public
HaobanResponse
flushBindStoreList
(
String
enterpriseId
)
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -641,7 +626,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"list-miniprogram-setting"
)
public
HaobanResponse
miniprogramList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
...
...
@@ -655,7 +639,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"save-miniprogram-setting"
)
public
HaobanResponse
saveMiniprogram
(
MiniprogramSettingQo
settingDTO
)
{
if
(
StringUtils
.
isAnyBlank
(
settingDTO
.
getAppId
(),
...
...
@@ -679,7 +662,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"get-miniprogram-setting"
)
public
HaobanResponse
getMiniprogram
(
String
enterpriseId
)
{
if
(
StringUtils
.
isEmpty
(
enterpriseId
))
{
...
...
@@ -696,7 +678,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"del-miniprogram-setting"
)
public
HaobanResponse
delMiniprogram
(
String
id
)
{
if
(
StringUtils
.
isEmpty
(
id
))
{
...
...
@@ -749,7 +730,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"save-welcome"
)
public
HaobanResponse
savewelcome
(
String
title
,
String
welcomeContent
,
String
welcomeImg
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
...
...
@@ -771,7 +751,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"get-welcome"
)
public
HaobanResponse
getWelcome
()
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
...
...
@@ -785,7 +764,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"del-welcome"
)
public
HaobanResponse
delWelcome
()
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
...
...
@@ -799,7 +777,6 @@ public class WxEnterpriseController extends WebBaseController {
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"set-welcome"
)
public
HaobanResponse
setWelcome
(
int
openFlag
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
...
...
@@ -828,4 +805,18 @@ public class WxEnterpriseController extends WebBaseController {
}
}
/**
* 是否同意授权
*
* @param openFlag
* @return
*/
@RequestMapping
(
"agree_external_userid_flag"
)
public
HaobanResponse
agreeExternalUseridFlag
(
Integer
openFlag
)
{
LoginDTO
loginUser
=
this
.
getLoginUser
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
wxEnterpriseApiService
.
agreeExternalUseridFlag
(
wxEnterpriseId
,
openFlag
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
0aff4774
...
...
@@ -454,6 +454,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
if
(
StringUtils
.
isAnyBlank
(
memberId
,
enterpriseId
,
relationKey
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
logger
.
info
(
"会员绑定好友,memberId:{},enterpriseId:{},unionid:{},relationKey:{}"
,
enterpriseId
,
memberId
,
unionid
,
relationKey
);
memberOpenCardBusinessService
.
memberClerkProcessByQywxFriend
(
enterpriseId
,
memberId
,
unionid
,
relationKey
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
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