Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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
base_platform_enterprise
gic-store
Commits
bf2aee61
Commit
bf2aee61
authored
Jul 06, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
共享门店的导购不能编辑,不能转移店长&去掉批量修改状态功能
parent
9cc173e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+17
-11
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
bf2aee61
...
...
@@ -98,9 +98,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
if
(!
paramResult
.
isSuccess
())
{
return
paramResult
;
}
if
(
validStoreIsOther
(
clerkDTO
.
getEnterpriseId
(),
clerkDTO
.
getStoreInfoId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"权限不足"
);
}
validStoreIsOther
(
clerkDTO
.
getEnterpriseId
(),
clerkDTO
.
getStoreInfoId
());
// 校验参数
if
(
StringUtils
.
isBlank
(
clerkDTO
.
getClerkCode
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"导购代码不可为空"
);
...
...
@@ -199,9 +197,8 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public
ServiceResponse
<
Void
>
verifyParam
(
ClerkDTO
clerkDTO
)
{
if
(
validStoreIsOther
(
clerkDTO
.
getEnterpriseId
(),
clerkDTO
.
getStoreInfoId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"权限不足"
);
}
validStoreIsOther
(
clerkDTO
.
getEnterpriseId
(),
clerkDTO
.
getStoreInfoId
());
// 校验参数
if
(
StringUtils
.
isBlank
(
clerkDTO
.
getClerkCode
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"导购代码不可为空"
);
...
...
@@ -425,12 +422,11 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
}
private
boolean
validStoreIsOther
(
Integer
enterpriseId
,
Integer
storeInfoId
)
{
private
void
validStoreIsOther
(
Integer
enterpriseId
,
Integer
storeInfoId
)
{
Integer
owner
=
storeService
.
getStoreOwnerByStoreInfoId
(
enterpriseId
,
storeInfoId
);
if
(
owner
==
null
)
{
return
false
;
if
(
owner
!=
null
&&
owner
==
StoreOwnTypeEnum
.
OTHER
.
getCode
()
)
{
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"共享数据不能编辑"
)
;
}
return
owner
==
StoreOwnTypeEnum
.
OTHER
.
getCode
();
}
@Override
...
...
@@ -582,12 +578,19 @@ public class ClerkApiServiceImpl implements ClerkApiService {
List
<
Integer
>
clerkIdList
;
if
(
StringUtils
.
isNotBlank
(
clerkIds
))
{
if
(
StringUtils
.
equals
(
com
.
gic
.
store
.
constant
.
Constants
.
ALL
,
clerkIds
))
{
clerkIdList
=
clerkService
.
listAllClerkId
(
enterpriseId
);
// 废弃 :clerkIdList = clerkService.listAllClerkId(enterpriseId);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"批量修改状态功能已废弃"
);
}
else
{
String
[]
split
=
clerkIds
.
split
(
GlobalInfo
.
FLAG_COMMA
);
clerkIdList
=
Stream
.
of
(
split
).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
if
(
clerkIdList
.
size
()
>
1
)
{
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"批量修改状态功能已废弃"
);
}
}
List
<
TabClerk
>
clerkList
=
this
.
clerkService
.
listClerkByIds
(
clerkIdList
);
//编辑权限验证
validStoreIsOther
(
clerkList
.
get
(
0
).
getEnterpriseId
(),
clerkList
.
get
(
0
).
getStoreInfoId
());
Map
<
Integer
,
TabClerk
>
clerkIdMap
=
clerkList
.
stream
().
collect
(
Collectors
.
toMap
(
TabClerk:
:
getClerkId
,
TabClerk
->
TabClerk
));
//过滤掉默认导购
if
(
StoreStatusEnum
.
INONLINE
.
getCode
()
==
status
){
...
...
@@ -894,6 +897,9 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override
public
ServiceResponse
updateClerkLeader
(
Integer
clerkId
)
{
TabClerk
clerk
=
this
.
clerkService
.
getById
(
clerkId
);
validStoreIsOther
(
clerk
.
getEnterpriseId
(),
clerk
.
getStoreInfoId
());
clerk
.
setPositionId
(
com
.
gic
.
store
.
constant
.
Constants
.
CLERK_LEADER_POSITION_ID
);
String
positionName
=
this
.
clerkPositionService
.
getByClerkPositionId
(
clerk
.
getPositionId
()).
getPositionName
();
clerk
.
setPositionName
(
positionName
);
...
...
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