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
22ce39e1
Commit
22ce39e1
authored
May 31, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店交集
parent
f7df5e6a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+22
-20
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
22ce39e1
...
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.PowerClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
...
@@ -83,16 +82,12 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -83,16 +82,12 @@ public class StaffApiServiceImpl implements StaffApiService {
private
StoreGroupService
storeGroupService
;
private
StoreGroupService
storeGroupService
;
@Autowired
@Autowired
private
UserLoginLogService
userLoginLogService
;
private
UserLoginLogService
userLoginLogService
;
@Autowired
@Autowired
private
SyncErrorLogService
syncErrorLogService
;
private
SyncErrorLogService
syncErrorLogService
;
@Autowired
@Autowired
private
QQCloudPicService
qqCloudPicService
;
private
QQCloudPicService
qqCloudPicService
;
@Autowired
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
private
StaffClerkRelationService
staffClerkRelationService
;
@Autowired
@Autowired
private
SecretSettingService
secretSettingService
;
private
SecretSettingService
secretSettingService
;
@Autowired
@Autowired
...
@@ -106,8 +101,6 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -106,8 +101,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired
@Autowired
private
StoreRangeService
storeRangeService
;
private
StoreRangeService
storeRangeService
;
@Autowired
@Autowired
private
WxEnterpriseRelatedMapper
wxEnterpriseRelatedMapper
;
@Autowired
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
@Override
@Override
...
@@ -1304,22 +1297,35 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1304,22 +1297,35 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
@Override
public
List
<
String
>
getHaoBanStoreRolesByClerkId
(
String
clerkId
,
String
wxEnterpriseId
)
{
public
List
<
String
>
getHaoBanStoreRolesByClerkId
(
String
clerkId
,
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
clerkId
)
||
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
logger
.
info
(
"参数为空clerkId={},wxEid={}"
,
clerkId
,
wxEnterpriseId
);
return
Collections
.
emptyList
();
}
String
cacheKey
=
"hb:clerk:store:"
+
clerkId
+
wxEnterpriseId
;
Object
cache
=
RedisUtil
.
getCache
(
cacheKey
)
;
if
(
cache
!=
null
)
{
logger
.
info
(
"从缓存中获取通道={},{}"
,
cacheKey
,
JSON
.
toJSONString
(
cache
));
return
(
List
<
String
>)
cache
;
}
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
if
(
clerkDTO
==
null
)
{
if
(
clerkDTO
==
null
)
{
logger
.
info
(
"导购不存在:clerkId:{}"
,
clerkId
);
logger
.
info
(
"导购不存在:clerkId:{}"
,
clerkId
);
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
clerkDTO
.
getEnterpriseId
());
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
clerkDTO
.
getEnterpriseId
());
if
(
CollectionUtils
.
isNotEmpty
(
enterpriseIdStoreIds
))
{
if
(
CollectionUtils
.
isEmpty
(
enterpriseIdStoreIds
))
{
logger
.
info
(
"好办门店id数量:{}"
,
enterpriseIdStoreIds
.
size
());
logger
.
info
(
"好办门店空,eid={}"
,
clerkDTO
.
getEnterpriseId
());
return
Collections
.
emptyList
();
}
}
List
<
String
>
gicStoreIds
=
getStoreIdList
(
clerkId
);
logger
.
info
(
"好办门店id数量:{}"
,
enterpriseIdStoreIds
.
size
());
List
<
String
>
gicStoreIds
=
getStoreIdList
(
clerkDTO
);
if
(
CollectionUtils
.
isEmpty
(
gicStoreIds
))
{
if
(
CollectionUtils
.
isEmpty
(
gicStoreIds
))
{
logger
.
info
(
"gic门店为空"
);
logger
.
info
(
"gic门店为空"
);
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
if
(
gicStoreIds
.
contains
(
"-1"
))
{
if
(
gicStoreIds
.
contains
(
"-1"
))
{
//gic管理员返回好办企业
//gic管理员返回好办企业
RedisUtil
.
setCache
(
cacheKey
,
enterpriseIdStoreIds
,
10L
,
TimeUnit
.
MINUTES
);
return
enterpriseIdStoreIds
;
return
enterpriseIdStoreIds
;
}
}
logger
.
info
(
"gic门店数量:{}"
,
gicStoreIds
.
size
());
logger
.
info
(
"gic门店数量:{}"
,
gicStoreIds
.
size
());
...
@@ -1327,6 +1333,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1327,6 +1333,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Sets
.
SetView
<
String
>
intersection
=
Sets
.
intersection
(
Sets
.
newHashSet
(
enterpriseIdStoreIds
),
Sets
.
newHashSet
(
gicStoreIds
));
Sets
.
SetView
<
String
>
intersection
=
Sets
.
intersection
(
Sets
.
newHashSet
(
enterpriseIdStoreIds
),
Sets
.
newHashSet
(
gicStoreIds
));
List
<
String
>
storeList
=
intersection
.
stream
().
collect
(
Collectors
.
toList
());
List
<
String
>
storeList
=
intersection
.
stream
().
collect
(
Collectors
.
toList
());
logger
.
info
(
"该导购权限:clerkId:{},门店数量:{}"
,
clerkId
,
storeList
.
size
());
logger
.
info
(
"该导购权限:clerkId:{},门店数量:{}"
,
clerkId
,
storeList
.
size
());
RedisUtil
.
setCache
(
cacheKey
,
storeList
,
10L
,
TimeUnit
.
MINUTES
);
return
storeList
;
return
storeList
;
}
}
...
@@ -1367,12 +1374,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1367,12 +1374,8 @@ public class StaffApiServiceImpl implements StaffApiService {
* @author mozhu
* @author mozhu
* @date 2022-05-06 16:00:05
* @date 2022-05-06 16:00:05
*/
*/
private
List
<
String
>
getStoreIdList
(
String
clerkId
)
{
private
List
<
String
>
getStoreIdList
(
ClerkDTO
clerkDTO
)
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
String
clerkId
=
clerkDTO
.
getClerkId
()
;
if
(
clerkDTO
==
null
)
{
logger
.
info
(
"导购不存在"
);
return
Collections
.
emptyList
();
}
Integer
superAdmin
=
clerkDTO
.
getSuperAdmin
();
Integer
superAdmin
=
clerkDTO
.
getSuperAdmin
();
if
(
superAdmin
!=
null
&&
superAdmin
==
1
)
{
if
(
superAdmin
!=
null
&&
superAdmin
==
1
)
{
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
...
@@ -1382,12 +1385,11 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1382,12 +1385,11 @@ public class StaffApiServiceImpl implements StaffApiService {
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
);
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
);
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
PowerClerkDTO
clerkDetail
=
powerService
.
getClerkDetail
(
clerkId
)
;
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
()
,
clerkId
)
;
if
(
clerkDetail
==
null
)
{
if
(
StringUtils
.
isBlank
(
storeWidgetId
)
)
{
logger
.
info
(
"导购不存在"
);
logger
.
info
(
"导购
权限
不存在"
);
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
String
storeWidgetId
=
clerkDetail
.
getStoreWidgetId
();
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidgetBykey
(
storeWidgetId
);
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidgetBykey
(
storeWidgetId
);
if
(
storeWidgetDTO
==
null
)
{
if
(
storeWidgetDTO
==
null
)
{
logger
.
info
(
"导购权限不存在"
);
logger
.
info
(
"导购权限不存在"
);
...
...
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