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
fccbf11e
Commit
fccbf11e
authored
Oct 20, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:审核权限
parent
721dcfb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
41 deletions
+19
-41
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+19
-41
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
fccbf11e
...
...
@@ -7,21 +7,18 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDetailDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
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.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.*
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.SyncHaobanToGicApiService
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper
;
...
...
@@ -68,14 +65,18 @@ public class AuditApiServiceImpl implements AuditApiService {
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
PowerService
powerService
;
@Autowired
private
StoreWidgetService
storeWidgetService
;
private
StaffApiService
staffApiService
;
@Override
public
Page
<
AuditDTO
>
page
(
Integer
auditType
,
String
search
,
String
wxEnterpriseId
,
String
enterpriseId
,
Integer
auditStatus
,
Integer
auditFlag
,
BasePageInfo
pageInfo
,
String
clerkId
)
{
List
<
String
>
storeIdList
=
this
.
getStoreIdList
(
enterpriseId
,
clerkId
);
List
<
String
>
storeIdList
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
return
PageUtil
.
emptyPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
}
if
(
storeIdList
.
contains
(
"-1"
))
{
storeIdList
=
null
;
}
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanAudit
>
page
=
auditMapper
.
page
(
wxEnterpriseId
,
auditType
,
storeIdList
,
search
,
enterpriseId
,
auditStatus
,
auditFlag
);
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getResult
()))
{
...
...
@@ -472,7 +473,13 @@ public class AuditApiServiceImpl implements AuditApiService {
String
storeId
=
clerkDTO
.
getStoreId
();
if
(
clerkType
==
2
)
{
// 如果null,说明是所有门店
storeIdList
=
this
.
getStoreIdList
(
enterpriseId
,
clerkId
);
storeIdList
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
return
0
;
}
if
(
storeIdList
.
contains
(
"-1"
))
{
storeIdList
=
null
;
}
clerkId
=
null
;
}
else
{
storeIdList
.
add
(
storeId
);
...
...
@@ -484,33 +491,4 @@ public class AuditApiServiceImpl implements AuditApiService {
return
this
.
auditMapper
.
getAuditCount
(
wxEnterpriseId
,
enterpriseId
,
clerkId
,
storeIdList
);
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
String
>
getStoreIdList
(
String
enterpriseId
,
String
clerkId
)
{
EnterpriseSettingDTO
enterpriseSetting
=
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
);
logger
.
info
(
"门店权限,getEnableAccessControl={},{}"
,
enterpriseSetting
.
getEnableAccessControl
(),
enterpriseId
);
if
(
enterpriseSetting
.
getEnableAccessControl
()
!=
null
&&
enterpriseSetting
.
getEnableAccessControl
()
==
1
)
{
String
storeWidgetKey
=
this
.
powerService
.
getStoreWidgetId
(
new
Date
(),
clerkId
);
logger
.
info
(
"权限控制-启用,创建人管辖门店的组件={}"
,
storeWidgetKey
);
StoreWidgetDTO
widget
=
this
.
storeWidgetService
.
getStoreWidgetBykey
(
storeWidgetKey
);
if
(
null
==
widget
||
widget
.
getSelectType
()
==
0
)
{
logger
.
info
(
"权限控制-启用,超管={}"
,
clerkId
);
return
null
;
}
List
<
String
>
storeIdList
=
new
ArrayList
<>();
storeIdList
.
add
(
"-1-1"
);
Page
<
StoreDTO
>
page
=
new
Page
<
StoreDTO
>(
1
,
Integer
.
MAX_VALUE
);
page
=
storeWidgetService
.
getStoreWidgetStore
(
storeWidgetKey
,
null
,
enterpriseId
,
page
);
if
(
page
!=
null
&&
CollectionUtils
.
isNotEmpty
(
page
.
getResult
()))
{
List
<
StoreDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
StoreDTO
dto
:
list
)
{
storeIdList
.
add
(
dto
.
getStoreId
());
}
}
}
return
storeIdList
;
}
return
null
;
}
}
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