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
0ae6653a
Commit
0ae6653a
authored
Nov 02, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店查询
parent
779c4d91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
18 deletions
+41
-18
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+33
-4
WxStaffController.java
...m/gic/haoban/manage/web/controller/WxStaffController.java
+8
-14
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
0ae6653a
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
...
...
@@ -28,17 +27,28 @@ import com.gic.commons.util.GlobalInfo;
import
com.gic.commons.util.GlobalVar
;
import
com.gic.commons.util.ImageUtil
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreGroupDTO
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.RolesListUtils
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffPrivacyUseLogDTO
;
import
com.gic.haoban.manage.api.dto.StaffQrCodeDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
...
...
@@ -69,6 +79,8 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
cn.hutool.core.collection.CollectionUtil
;
@Service
public
class
StaffApiServiceImpl
implements
StaffApiService
{
...
...
@@ -113,6 +125,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private
EnterpriseService
enterpriseService
;
@Autowired
private
Config
config
;
@Autowired
private
StoreService
storeService
;
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
...
...
@@ -892,8 +906,23 @@ public class StaffApiServiceImpl implements StaffApiService {
}
if
(
storeIds
.
contains
(
"-1"
))
{
logger
.
info
(
"该导购为超管,clerkId={}"
,
clerkId
);
int
gicStoreCount
=
storeWidgetService
.
getClerkWidgetStore
(
clerkId
);
storeRoleDTO
.
setStoreCount
(
gicStoreCount
);
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
(),
clerkId
);
int
storeCount
=
0
;
String
storeId
=
null
;
if
(
null
!=
storeWidgetId
)
{
Page
<
Object
>
pageParam
=
new
Page
<
Object
>();
pageParam
.
setCurrentPage
(
1
);
pageParam
.
setPageSize
(
1
);
Page
<
StoreDTO
>
page
=
storeWidgetService
.
getStoreWidgetStore
(
storeWidgetId
,
null
,
clerkDTO
.
getEnterpriseId
(),
pageParam
,
clerkId
,
null
);
storeId
=
page
.
getResult
().
get
(
0
).
getStoreId
();
storeCount
=
page
.
getTotalCount
();
}
else
{
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
List
<
String
>>
storeResp
=
this
.
storeService
.
queryStoreIdByEnterprise
(
clerkDTO
.
getEnterpriseId
(),
null
)
;
storeCount
=
storeResp
.
getResult
().
size
();
storeId
=
storeResp
.
getResult
().
get
(
0
);
}
storeRoleDTO
.
setStoreId
(
storeId
);
storeRoleDTO
.
setStoreCount
(
storeCount
);
return
storeRoleDTO
;
}
int
size
=
storeIds
.
size
();
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
View file @
0ae6653a
...
...
@@ -1624,8 +1624,8 @@ public class WxStaffController extends WebBaseController {
List
<
StoreListVO
>
voList
=
new
ArrayList
<>();
int
totalCount
=
0
;
List
<
StoreDTO
>
storeDTOList
=
null
;
if
(
storeIdList
.
get
(
0
).
contains
(
"-1"
))
{
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
(),
clerkId
);
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
(),
clerkId
);
if
(
storeIdList
.
get
(
0
).
contains
(
"-1"
)
&&
StringUtils
.
isNotBlank
(
storeWidgetId
))
{
logger
.
info
(
"权限-所有门店storeWidgetId={}"
,
storeWidgetId
);
Page
<
Object
>
pageParam
=
new
Page
<
Object
>();
pageParam
.
setCurrentPage
(
currentPage
);
...
...
@@ -1635,6 +1635,12 @@ public class WxStaffController extends WebBaseController {
storeDTOList
=
page
.
getResult
();
totalCount
=
page
.
getTotalCount
();
}
}
if
(
storeIdList
.
get
(
0
).
contains
(
"-1"
)
&&
StringUtils
.
isBlank
(
storeWidgetId
))
{
// 未开启分权的商户
ServiceResponse
<
List
<
String
>>
storeResp
=
this
.
storeService
.
queryStoreIdByEnterprise
(
enterpriseId
,
null
)
;
if
(
storeResp
.
isSuccess
())
{
storeIdList
=
storeResp
.
getResult
()
;
}
}
else
{
totalCount
=
storeIdList
.
size
();
int
start
=
pageSize
*
(
currentPage
-
1
)
;
...
...
@@ -1708,16 +1714,4 @@ public class WxStaffController extends WebBaseController {
}
return
RestResponse
.
successResult
(
retList
);
}
private
List
<
String
>
getStoreIdList
(
ClerkDTO
clerkDTO
)
{
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
()
;
String
clerkId
=
clerkDTO
.
getClerkId
();
String
storeWidgetId
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
(),
clerkId
);
// 门店id列表
List
<
String
>
storeIdList
=
storeWidgetService
.
getStoreWidgetStore
(
storeWidgetId
,
enterpriseId
,
null
,
null
,
0
);
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
return
Collections
.
emptyList
();
}
return
storeIdList
;
}
}
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