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
e758fda8
Commit
e758fda8
authored
Jun 25, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
63883fff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+5
-2
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+1
-1
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+14
-8
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
e758fda8
...
...
@@ -243,7 +243,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
//保存门店范围
storeRangeService
.
saveStoreRange
(
detailDTO
.
getRelations
(),
detailDTO
.
getEnterpriseId
(),
detailDTO
.
getWxEnterpriseId
());
//超级管理员新增
/
*/
/超级管理员新增
TabHaobanStaff sStaff = staffMapper.selectSuperByWxEnterpriseId(detailDTO.getWxEnterpriseId());
if (sStaff == null) {
TabHaobanStaff staff = new TabHaobanStaff();
...
...
@@ -251,14 +251,16 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
staff.setWxEnterpriseId(detailDTO.getWxEnterpriseId());
staff.setSuperManagerFlag(1);
staffService.add(staff);
}
}
*/
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
detailDTO
.
getEnterpriseId
());
List
<
EnterpriseWxaRelationDTO
>
relationDTOList
=
authorizeService
.
queryList
(
detailDTO
.
getEnterpriseId
());
if
(
CollectionUtils
.
isEmpty
(
relationDTOList
))
{
logger
.
info
(
"relationDTOList is null"
);
return
resp
;
}
EnterpriseWxaRelationDTO
relationDTO
=
relationDTOList
.
stream
().
filter
(
dto
->
dto
.
getWxaAppkey
().
equals
(
enterpriseDTO
.
getMallMiniprogramAppid
())).
findFirst
().
orElse
(
null
);
if
(
null
==
relationDTO
)
{
logger
.
info
(
"relationDTO is null"
);
return
resp
;
}
TabMiniprogramSetting
miniprogramSetting
=
miniprogramSettingService
.
getMiniprogramSettingNoMedia
(
detailDTO
.
getWxEnterpriseId
(),
detailDTO
.
getEnterpriseId
());
...
...
@@ -420,6 +422,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
// 获取所有门店信息
List
<
StoreSimpleDTO
>
storeDtos
=
storeService
.
listSimpleStore
(
enterpriseId
,
null
,
null
);
logger
.
info
(
"所有门店数={},{}"
,
enterpriseId
,
storeDtos
.
size
());
Map
<
String
,
List
<
String
>>
storeMapByGroupId
=
storeDtos
.
stream
().
filter
(
dto
->
StringUtils
.
isNotBlank
(
dto
.
getStoreGroupId
())).
collect
(
Collectors
.
groupingBy
(
dto
->
dto
.
getStoreGroupId
(),
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toList
())));
Map
<
String
,
StoreSimpleDTO
>
storeIdMap
=
storeDtos
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreId
(),
dto
->
dto
));
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
e758fda8
...
...
@@ -228,7 +228,7 @@ public class ApplicationController extends WebBaseController {
@RequestMapping
(
"get-auth-url"
)
public
HaobanResponse
getAuthUrl
()
{
String
suiteId
=
config
.
getSuiteId
();
log
.
info
(
"应用ID:{}"
,
suiteId
);
log
.
info
(
"
通讯录
应用ID:{}"
,
suiteId
);
String
redictUrl
=
config
.
getHost
()
+
"callback"
;
String
authorizationUrl
=
this
.
qywxSuiteApiService
.
getGrantAuthorizationUrl
(
suiteId
,
redictUrl
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
authorizationUrl
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
e758fda8
...
...
@@ -323,39 +323,45 @@ public class WxEnterpriseInfoController extends WebBaseController {
@IgnoreLogin
@RequestMapping
(
"get-user-by-member-code"
)
public
HaobanResponse
getInfoByMemberCode
(
GetUserByMemberCodeQo
qo
)
{
logger
.
info
(
"会员小程序={}"
,
JSON
.
toJSONString
(
qo
));
String
gicEnterpriseId
=
qo
.
getGicEnterpriseId
()
;
WxEnterpriseDTO
enterpriseDetailDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
qo
.
getCorpId
()))
{
enterpriseDetailDTO
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
qo
.
getCorpId
());
if
(
null
==
enterpriseDetailDTO
)
{
logger
.
info
(
"
改企业没有关系好办1:{}"
,
qo
.
getGicEnterprise
Id
());
logger
.
info
(
"
企微查不到,corpid={}"
,
qo
.
getCorp
Id
());
return
resultResponse
(
HaoBanErrCode
.
ERR_500001
);
}
}
else
{
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
qo
.
getGicEnterpriseId
()
);
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
wxEnterpriseDTOS
))
{
logger
.
info
(
"
改企业没有关系好办:{}"
,
qo
.
getGicEnterpriseId
()
);
logger
.
info
(
"
商户没有关联企微,eid={}"
,
gicEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_500001
);
}
enterpriseDetailDTO
=
wxEnterpriseDTOS
.
get
(
0
);
}
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
enterpriseDetailDTO
.
getWxEnterpriseId
());
String
wxEnterpriseId
=
enterpriseDetailDTO
.
getWxEnterpriseId
()
;
logger
.
info
(
"查询到的企微ID={}"
,
wxEnterpriseId
);
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
==
null
)
{
logger
.
info
(
"该企业不存在
:{}"
,
qo
.
getGicEnterpriseId
()
);
logger
.
info
(
"该企业不存在
wxEnterpriseId={}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
MemberLoginQo
user
=
new
MemberLoginQo
();
if
(
StringUtils
.
isBlank
(
qo
.
getUserId
()))
{
user
=
getUserByCode
(
enterpriseDTO
,
qo
.
getCode
(),
qo
.
getGicEnterpriseId
());
if
(
user
==
null
)
{
logger
.
info
(
"登录失败,从微信获取用户信息失败"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
WxApplicationDTO
wxApplicationDTO
=
wxApplicationApiService
.
selectByCorpid
(
user
.
getCorpId
());
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxApplicationDTO
.
getWxEnterpriseId
());
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
info
(
"该企业不存在
:{}"
,
qo
.
getGic
EnterpriseId
());
logger
.
info
(
"该企业不存在
corpid={},{}"
,
user
.
getCorpId
(),
wxApplicationDTO
.
getWx
EnterpriseId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
if
(!
wxEnterpriseDTO
.
getCorpid
().
equals
(
enterpriseDTO
.
getCorpid
()))
{
logger
.
info
(
"{},{}"
,
wxEnterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getCorpid
());
return
resultResponse
(
HaoBanErrCode
.
ERR_500003
,
wxEnterpriseDTO
.
getCorpid
());
}
}
else
{
...
...
@@ -364,7 +370,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
StaffDTO
staffDTO
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
user
.
getUserId
(),
enterpriseDTO
.
getWxEnterpriseId
());
if
(
staffDTO
==
null
)
{
logger
.
info
(
"成员不存在
"
);
logger
.
info
(
"成员不存在
,userId={}"
,
user
.
getUserId
()
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
//保存关联关系
...
...
@@ -418,7 +424,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
private
MemberLoginQo
getUserByCode
(
WxEnterpriseDTO
enterpriseDTO
,
String
code
,
String
enterpriseId
)
{
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
enterpriseDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
(),
enterpriseId
);
if
(
null
==
secretSetting
||
StringUtils
.
isBlank
(
secretSetting
.
getSecretVal
()))
{
logger
.
info
(
"MEMBER_WAPPsecret
配置没1ss有配置"
);
logger
.
info
(
"MEMBER_WAPPsecret
没有配置{},{}"
,
enterpriseDTO
.
getWxEnterpriseId
(),
enterpriseId
);
return
null
;
}
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
code
);
...
...
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