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
755cba93
Commit
755cba93
authored
Oct 11, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未配置查询pendingid的不创建会员
parent
67f503bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
18 deletions
+42
-18
WxEnterpriseRelatedServiceImpl.java
.../service/service/impl/WxEnterpriseRelatedServiceImpl.java
+19
-2
QwFriendApiServiceImpl.java
...nage/service/service/out/impl/QwFriendApiServiceImpl.java
+23
-16
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseRelatedServiceImpl.java
View file @
755cba93
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -32,6 +36,8 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
@Autowired
private
WxEnterpriseMapper
wxEnterpriseMapper
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Override
public
TabHaobanWxEnterpriseRelated
getByGicEnterpriseIdByEnterpriseRelatedId
(
String
wxEnterpriseRelatedId
)
{
...
...
@@ -100,9 +106,20 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
if
(
StringUtils
.
isNotBlank
(
unionid
)
&&
openCardFlag
==
0
)
{
return
false
;
}
if
(
openCardFlag
!=
0
||
wxEnterpriseType
!=
0
)
{
String
enterpriseId
=
wxEnterpriseRelated
.
getEnterpriseId
()
;
EnterpriseSettingDTO
setting
=
this
.
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
String
customSetting
=
setting
.
getCustomSetting
()
;
boolean
settFlag
=
true
;
if
(
StringUtils
.
isNotBlank
(
customSetting
))
{
JSONObject
json
=
JSON
.
parseObject
(
customSetting
)
;
String
pendingidFlag
=
json
.
getString
(
"qwPendingidFlag"
)
;
if
(
StringUtils
.
isBlank
(
pendingidFlag
)
||
"0"
.
equals
(
pendingidFlag
))
{
settFlag
=
false
;
}
}
if
(
openCardFlag
==
0
&&
wxEnterpriseType
==
0
&&
settFlag
)
{
return
true
;
}
return
fals
e
;
return
tru
e
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QwFriendApiServiceImpl.java
View file @
755cba93
...
...
@@ -68,13 +68,12 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
String
openid
=
dto
.
getOpenId
()
;
String
wxaUnionid
=
dto
.
getUnionId
()
;
String
wxaOpenid
=
dto
.
getWxaOpenId
()
;
return
this
.
pendingIdCheck
(
enterpriseId
,
unionid
,
openid
,
wxaUnionid
,
wxaOpenid
);
return
this
.
pendingIdCheck
(
enterpriseId
,
unionid
,
openid
,
wxaUnionid
,
wxaOpenid
,
false
);
}
@Override
public
ServiceResponse
<
Map
<
String
,
String
>>
pendingIdCheck
(
String
enterpriseId
,
String
unionid
,
String
openid
,
String
wxaUnionid
,
String
wxaOpenid
)
{
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
);
String
wxaUnionid
,
String
wxaOpenid
,
boolean
setCheckFlag
)
{
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
,
setCheckFlag
);
if
(!
corpidResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
corpidResp
.
getCode
(),
corpidResp
.
getMessage
());
}
...
...
@@ -116,10 +115,16 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
retMap
.
put
(
"wxaCode"
,
wxaCode
);
return
ServiceResponse
.
success
(
retMap
);
}
@Override
public
ServiceResponse
<
Map
<
String
,
String
>>
pendingIdCheck
(
String
enterpriseId
,
String
unionid
,
String
openid
,
String
wxaUnionid
,
String
wxaOpenid
)
{
return
this
.
pendingIdCheck
(
enterpriseId
,
unionid
,
openid
,
wxaUnionid
,
wxaOpenid
,
true
)
;
}
@Override
public
ServiceResponse
<
QwPendingIdDTO
>
getPendingIdByUnionid
(
String
enterpriseId
,
String
unionid
,
String
openid
)
{
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
);
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
,
true
);
if
(!
corpidResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
corpidResp
.
getCode
(),
corpidResp
.
getMessage
());
}
...
...
@@ -148,7 +153,7 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
@Override
public
ServiceResponse
<
QwPendingIdDTO
>
getPendingIdByExternalid
(
String
enterpriseId
,
String
externalUserId
)
{
String
suiteid
=
config
.
getWxSuiteid
();
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
);
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
,
true
);
if
(!
corpidResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
corpidResp
.
getCode
(),
corpidResp
.
getMessage
());
}
...
...
@@ -177,7 +182,7 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
return
ServiceResponse
.
failure
(
"9999"
,
"外部联系人不能为空且每次最多1000条"
);
}
String
suiteid
=
config
.
getWxSuiteid
();
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
);
ServiceResponse
<
WxEnterpriseQwDTO
>
corpidResp
=
this
.
checkAndGetCorpid
(
enterpriseId
,
true
);
if
(!
corpidResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
corpidResp
.
getCode
(),
corpidResp
.
getMessage
());
}
...
...
@@ -205,20 +210,22 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
// 2010 不需要处理的
// 判断企业是否能用企微
private
ServiceResponse
<
WxEnterpriseQwDTO
>
checkAndGetCorpid
(
String
enterpriseId
)
{
private
ServiceResponse
<
WxEnterpriseQwDTO
>
checkAndGetCorpid
(
String
enterpriseId
,
boolean
setCheckFlag
)
{
WxEnterpriseRelationBO
enterpriseRelation
=
this
.
wxEnterpriseRelatedService
.
getHeadEnterprise
(
enterpriseId
);
if
(
null
==
enterpriseRelation
)
{
// 非总部或不存在
return
ServiceResponse
.
failure
(
HaoBanErrCode
.
ERR_2010
.
getCode
(),
"请确认商户是否有效且是总部"
);
}
EnterpriseSettingDTO
setting
=
this
.
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
String
customSetting
=
setting
.
getCustomSetting
()
;
if
(
StringUtils
.
isNotBlank
(
customSetting
))
{
JSONObject
json
=
JSON
.
parseObject
(
customSetting
)
;
String
pendingidFlag
=
json
.
getString
(
"qwPendingidFlag"
)
;
if
(
StringUtils
.
isBlank
(
pendingidFlag
)
||
"0"
.
equals
(
pendingidFlag
))
{
log
.
info
(
"未配置unionid查询企微外部联系人接口调用"
);
return
ServiceResponse
.
failure
(
HaoBanErrCode
.
ERR_2010
.
getCode
(),
"未配置unionid查询企微外部联系人接口调用"
);
if
(
setCheckFlag
)
{
EnterpriseSettingDTO
setting
=
this
.
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
String
customSetting
=
setting
.
getCustomSetting
()
;
if
(
StringUtils
.
isNotBlank
(
customSetting
))
{
JSONObject
json
=
JSON
.
parseObject
(
customSetting
)
;
String
pendingidFlag
=
json
.
getString
(
"qwPendingidFlag"
)
;
if
(
StringUtils
.
isBlank
(
pendingidFlag
)
||
"0"
.
equals
(
pendingidFlag
))
{
log
.
info
(
"未配置unionid查询企微外部联系人接口调用"
);
return
ServiceResponse
.
failure
(
HaoBanErrCode
.
ERR_2010
.
getCode
(),
"未配置unionid查询企微外部联系人接口调用"
);
}
}
}
Integer
code
=
this
.
enterpriseUseForbidService
.
selectPermissionStatus
(
enterpriseId
,
...
...
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