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
98b05dfe
Commit
98b05dfe
authored
Jul 05, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限导购分野接口&导购是否有权限
parent
36df4b98
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
315 additions
and
6 deletions
+315
-6
ClerkAuthDTO.java
...i/src/main/java/com/gic/store/dto/clerk/ClerkAuthDTO.java
+136
-0
ClerkAuthValidDTO.java
.../main/java/com/gic/store/dto/clerk/ClerkAuthValidDTO.java
+49
-0
ClerkApiService.java
.../src/main/java/com/gic/store/service/ClerkApiService.java
+22
-3
ClerkService.java
...ice/src/main/java/com/gic/store/service/ClerkService.java
+12
-0
ClerkServiceImpl.java
...ain/java/com/gic/store/service/impl/ClerkServiceImpl.java
+22
-0
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+74
-3
No files found.
gic-store-api/src/main/java/com/gic/store/dto/clerk/ClerkAuthDTO.java
0 → 100644
View file @
98b05dfe
package
com
.
gic
.
store
.
dto
.
clerk
;
import
java.io.Serializable
;
/**
* 管理员权限导购
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/7/5 9:53 AM
*/
public
class
ClerkAuthDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8008850748120884541L
;
/**
* 店员id
*/
private
Integer
clerkId
;
/**
*
*/
private
String
clerkName
;
/**
* 门店id
*/
private
Integer
storeInfoId
;
private
Integer
positionId
;
/**
* 职位名称(仅作展现)
*/
private
String
positionName
;
/**
* 性别 1:男 2:女
*/
private
Integer
clerkGender
;
/**
* 国际码
*/
private
String
nationcode
;
/**
* 电话号码
*/
private
String
phoneNumber
;
public
Integer
getClerkId
()
{
return
clerkId
;
}
public
ClerkAuthDTO
setClerkId
(
Integer
clerkId
)
{
this
.
clerkId
=
clerkId
;
return
this
;
}
public
String
getClerkName
()
{
return
clerkName
;
}
public
ClerkAuthDTO
setClerkName
(
String
clerkName
)
{
this
.
clerkName
=
clerkName
;
return
this
;
}
public
Integer
getStoreInfoId
()
{
return
storeInfoId
;
}
public
ClerkAuthDTO
setStoreInfoId
(
Integer
storeInfoId
)
{
this
.
storeInfoId
=
storeInfoId
;
return
this
;
}
public
Integer
getPositionId
()
{
return
positionId
;
}
public
ClerkAuthDTO
setPositionId
(
Integer
positionId
)
{
this
.
positionId
=
positionId
;
return
this
;
}
public
String
getPositionName
()
{
return
positionName
;
}
public
ClerkAuthDTO
setPositionName
(
String
positionName
)
{
this
.
positionName
=
positionName
;
return
this
;
}
public
Integer
getClerkGender
()
{
return
clerkGender
;
}
public
ClerkAuthDTO
setClerkGender
(
Integer
clerkGender
)
{
this
.
clerkGender
=
clerkGender
;
return
this
;
}
public
String
getNationcode
()
{
return
nationcode
;
}
public
ClerkAuthDTO
setNationcode
(
String
nationcode
)
{
this
.
nationcode
=
nationcode
;
return
this
;
}
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
ClerkAuthDTO
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
return
this
;
}
@Override
public
String
toString
()
{
return
"ClerkAuthDTO{"
+
"clerkId="
+
clerkId
+
", clerkName='"
+
clerkName
+
'\''
+
", storeInfoId="
+
storeInfoId
+
", positionId="
+
positionId
+
", positionName='"
+
positionName
+
'\''
+
", clerkGender="
+
clerkGender
+
", nationcode='"
+
nationcode
+
'\''
+
", phoneNumber='"
+
phoneNumber
+
'\''
+
'}'
;
}
}
gic-store-api/src/main/java/com/gic/store/dto/clerk/ClerkAuthValidDTO.java
0 → 100644
View file @
98b05dfe
package
com
.
gic
.
store
.
dto
.
clerk
;
import
java.io.Serializable
;
/**
* 导购是否有权限
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/7/5 10:29 AM
*/
public
class
ClerkAuthValidDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
259533237449387754L
;
/**
* 店员id
*/
private
Integer
clerkId
;
/**
* 该导购是否有权限
*/
private
boolean
hasAuth
;
public
Integer
getClerkId
()
{
return
clerkId
;
}
public
ClerkAuthValidDTO
setClerkId
(
Integer
clerkId
)
{
this
.
clerkId
=
clerkId
;
return
this
;
}
public
boolean
isHasAuth
()
{
return
hasAuth
;
}
public
ClerkAuthValidDTO
setHasAuth
(
boolean
hasAuth
)
{
this
.
hasAuth
=
hasAuth
;
return
this
;
}
@Override
public
String
toString
()
{
return
"ClerkAuthValidDTO{"
+
"clerkId="
+
clerkId
+
", hasAuth="
+
hasAuth
+
'}'
;
}
}
gic-store-api/src/main/java/com/gic/store/service/ClerkApiService.java
View file @
98b05dfe
...
...
@@ -5,9 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.store.dto.ClerkDTO
;
import
com.gic.store.dto.ClerkSearchDTO
;
import
com.gic.store.dto.ClerkStoreListDTO
;
import
com.gic.store.dto.clerk.OrderAddClerkDTO
;
import
com.gic.store.dto.clerk.PosAddClerkDTO
;
import
com.gic.store.dto.clerk.ProcessBatchClerkDTO
;
import
com.gic.store.dto.clerk.*
;
import
java.util.List
;
...
...
@@ -143,6 +141,27 @@ public interface ClerkApiService {
* @throws
*/
ServiceResponse
<
ClerkDTO
>
getClerkByCodeAndStoreInfoId
(
Integer
enterpriseId
,
String
clerkCode
,
Integer
storeInfoId
);
/**
* 查询有权限的导购
* @param enterpriseId
* @param userId
* @param clerkSearch
* @param pageNum
* @param pageSize
* @return
*/
ServiceResponse
<
Page
<
ClerkAuthDTO
>>
listAuthClerk
(
Integer
enterpriseId
,
Integer
userId
,
String
clerkSearch
,
Integer
pageNum
,
Integer
pageSize
);
/**
* 导购是否有权限
* @param enterpriseId
* @param userId
* @param clerkIdList
* @return
*/
ServiceResponse
<
List
<
ClerkAuthValidDTO
>>
listAuthClerk
(
Integer
enterpriseId
,
Integer
userId
,
List
<
Integer
>
clerkIdList
);
/**
* 导购列表
* @Title: listClerk
...
...
gic-store-service/src/main/java/com/gic/store/service/ClerkService.java
View file @
98b05dfe
...
...
@@ -3,6 +3,7 @@ package com.gic.store.service;
import
com.gic.store.dto.ClerkDTO
;
import
com.gic.store.dto.ClerkSearchDTO
;
import
com.gic.store.entity.TabClerk
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -135,6 +136,17 @@ public interface ClerkService {
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
ClerkSearchDTO
search
);
/**
* 分页查询
* @param storeInfoIds
* @param clerkSearch
* @param clerkIdList
* @param pageNum
* @param pageSize
* @return
*/
Page
<
TabClerk
>
pageClerk
(
List
<
Integer
>
storeInfoIds
,
String
clerkSearch
,
List
<
Integer
>
clerkIdList
,
Integer
pageNum
,
Integer
pageSize
);
/**
* listClerkByStoreInfoId
* @Title: listClerkByStoreInfoId
* @Description:
...
...
gic-store-service/src/main/java/com/gic/store/service/impl/ClerkServiceImpl.java
View file @
98b05dfe
...
...
@@ -8,6 +8,8 @@ import com.gic.store.dto.ClerkSearchDTO;
import
com.gic.store.entity.TabClerk
;
import
com.gic.store.service.ClerkService
;
import
com.gic.store.service.StoreService
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.dubbo.common.utils.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -137,6 +139,26 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public
Page
<
TabClerk
>
pageClerk
(
List
<
Integer
>
storeInfoIdList
,
String
clerkSearch
,
List
<
Integer
>
clerkIdList
,
Integer
pageNum
,
Integer
pageSize
)
{
// list 如果太大, 让 mybatis 解析 会打满内存
String
storeInfoIds
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
storeInfoIdList
))
{
storeInfoIds
=
"("
+
storeInfoIdList
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
))
+
")"
;
}
if
(
pageNum
==
null
)
{
pageNum
=
1
;
}
if
(
pageSize
==
null
)
{
pageSize
=
20
;
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
TabClerk
>
list
=
tabClerkMapper
.
listClerkByStoreInfoIdAndClerkId
(
null
,
storeInfoIds
,
clerkSearch
,
null
,
null
,
clerkIdList
);
return
(
Page
<
TabClerk
>)
list
;
}
@Override
public
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
Integer
status
,
String
search
)
{
return
tabClerkMapper
.
listClerkByStoreInfoId
(
storeInfoIds
,
null
,
search
,
null
,
status
);
}
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
98b05dfe
...
...
@@ -4,10 +4,15 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.StoreResourceDTO
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.service.ResourceGroupApiService
;
import
com.gic.auth.service.UserApiService
;
import
com.gic.commons.util.*
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.dto.wm.WmStoreSyncLogDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.exception.CommonException
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.enterprise.service.WmStoreSyncLogApiService
;
...
...
@@ -23,9 +28,7 @@ import com.gic.redis.data.util.RedisUtil;
import
com.gic.spark.api.service.SparkJobApiService
;
import
com.gic.store.constant.*
;
import
com.gic.store.dto.*
;
import
com.gic.store.dto.clerk.OrderAddClerkDTO
;
import
com.gic.store.dto.clerk.PosAddClerkDTO
;
import
com.gic.store.dto.clerk.ProcessBatchClerkDTO
;
import
com.gic.store.dto.clerk.*
;
import
com.gic.store.entity.TabClerk
;
import
com.gic.store.service.*
;
import
com.gic.store.utils.valid.ValidUtil
;
...
...
@@ -84,6 +87,10 @@ public class ClerkApiServiceImpl implements ClerkApiService {
private
CardAscriptionConfigService
cardAscriptionConfigService
;
@Autowired
private
StoreUpdateApiService
storeUpdateApiService
;
@Autowired
private
UserApiService
userApiService
;
@Autowired
private
ResourceGroupApiService
resourceGroupApiService
;
@Override
public
ServiceResponse
saveOrUpdate
(
ClerkDTO
clerkDTO
)
{
...
...
@@ -334,6 +341,70 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
}
@Override
public
ServiceResponse
<
Page
<
ClerkAuthDTO
>>
listAuthClerk
(
Integer
enterpriseId
,
Integer
userId
,
String
clerkSearch
,
Integer
pageNum
,
Integer
pageSize
)
{
return
ServiceResponse
.
success
(
listAuthClerkCommon
(
enterpriseId
,
userId
,
clerkSearch
,
null
,
pageNum
,
pageSize
));
}
@Override
public
ServiceResponse
<
List
<
ClerkAuthValidDTO
>>
listAuthClerk
(
Integer
enterpriseId
,
Integer
userId
,
List
<
Integer
>
clerkIdList
)
{
Page
<
ClerkAuthDTO
>
page
=
listAuthClerkCommon
(
enterpriseId
,
userId
,
null
,
clerkIdList
,
1
,
1000
);
if
(
page
!=
null
)
{
List
<
ClerkAuthDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
ServiceResponse
.
success
(
clerkIdList
.
stream
()
.
map
(
e
->
new
ClerkAuthValidDTO
().
setClerkId
(
e
).
setHasAuth
(
false
))
.
collect
(
Collectors
.
toList
()));
}
else
{
Set
<
Integer
>
clerkIdSet
=
list
.
stream
().
map
(
e
->
e
.
getClerkId
()).
collect
(
Collectors
.
toSet
());
return
ServiceResponse
.
success
(
clerkIdList
.
stream
().
map
(
e
->
{
ClerkAuthValidDTO
temp
=
new
ClerkAuthValidDTO
();
temp
.
setClerkId
(
e
);
if
(
clerkIdSet
.
contains
(
e
))
{
temp
.
setHasAuth
(
true
);
}
else
{
temp
.
setHasAuth
(
false
);
}
return
temp
;
}).
collect
(
Collectors
.
toList
()));
}
}
return
ServiceResponse
.
success
();
}
private
Page
<
ClerkAuthDTO
>
listAuthClerkCommon
(
Integer
enterpriseId
,
Integer
userId
,
String
clerkSearch
,
List
<
Integer
>
clerkIdList
,
Integer
pageNum
,
Integer
pageSize
)
{
ServiceResponse
<
UserDTO
>
userResponse
=
userApiService
.
getUserInfoById
(
userId
);
if
(
userResponse
.
isSuccess
())
{
UserDTO
userDTO
=
userResponse
.
getResult
();
ClerkSearchDTO
clerkSearchDTO
=
new
ClerkSearchDTO
();
clerkSearchDTO
.
setEnterpriseId
(
enterpriseId
);
boolean
isAdmin
=
userDTO
.
getSuperAdmin
()
==
1
;
if
(!
isAdmin
)
{
ServiceResponse
<
StoreResourceDTO
>
storeResourceRes
=
resourceGroupApiService
.
getStoreResourceByUserId
(
userId
);
if
(
storeResourceRes
.
isSuccess
())
{
clerkSearchDTO
.
setStoreResource
(
storeResourceRes
.
getResult
().
getStoreResourceId
().
longValue
());
}
}
ServiceResponse
<
Page
<
StoreDTO
>>
serviceResponse
=
listStoreIds
(
clerkSearchDTO
,
pageNum
,
pageSize
);
if
(!
serviceResponse
.
isSuccess
())
{
throw
new
CommonException
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
Page
<
StoreDTO
>
page
=
serviceResponse
.
getResult
();
if
(
page
==
null
)
{
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"ES门店数据为空"
);
}
com
.
github
.
pagehelper
.
Page
<
TabClerk
>
clerkPage
=
clerkService
.
pageClerk
(
page
.
getResult
()
.
stream
().
map
(
e
->
e
.
getStoreInfoId
()).
collect
(
Collectors
.
toList
()),
clerkSearch
,
clerkIdList
,
pageNum
,
pageSize
);
return
PageHelperUtils
.
changePageHelperToCurrentPage
(
clerkPage
,
ClerkAuthDTO
.
class
);
}
else
{
throw
new
CommonException
(
userResponse
.
getCode
(),
userResponse
.
getMessage
());
}
}
private
void
storeLogByAddClerk
(
ClerkDTO
clerkDTO
)
{
try
{
StoreLogDTO
storeLogDTO
=
new
StoreLogDTO
();
...
...
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