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
f099dd00
Commit
f099dd00
authored
May 21, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断导购在不在某个门店下
parent
1580a9fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
ClerkApiService.java
.../src/main/java/com/gic/store/service/ClerkApiService.java
+14
-2
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+23
-3
No files found.
gic-store-api/src/main/java/com/gic/store/service/ClerkApiService.java
View file @
f099dd00
...
...
@@ -153,12 +153,24 @@ public interface ClerkApiService {
* 如果存在返回 门店下 同导购code 的 clerkId ,如果不存在,新建导购,返回新建的导购i
* @author zhiwj
* @param clerkId
* @param storeId
* @param storeInfoId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Integer
>
addClerkToOtherStore
(
Integer
clerkId
,
Integer
storeInfoId
,
Integer
enterpriseId
);
/**
* @Title: ensureClerkInStore
* @Description:
* @author zhiwj
* @param clerkId
* @param storeInfoId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Integer
>
addClerkToOtherStore
(
Integer
clerkId
,
Integer
store
Id
,
Integer
enterpriseId
);
ServiceResponse
<
Boolean
>
ensureClerkInStore
(
Integer
clerkId
,
Integer
storeInfo
Id
,
Integer
enterpriseId
);
/**
* @Title: listClerkByStoreBrand
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
f099dd00
...
...
@@ -576,13 +576,13 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public
ServiceResponse
<
Integer
>
addClerkToOtherStore
(
Integer
clerkId
,
Integer
storeId
,
Integer
enterpriseId
)
{
logger
.
info
(
"clerkId:{}, storeI
d:{}, enterpriseId:{}"
,
clerkId
,
store
Id
,
enterpriseId
);
public
ServiceResponse
<
Integer
>
addClerkToOtherStore
(
Integer
clerkId
,
Integer
storeI
nfoI
d
,
Integer
enterpriseId
)
{
logger
.
info
(
"clerkId:{}, storeI
nfoId:{}, enterpriseId:{}"
,
clerkId
,
storeInfo
Id
,
enterpriseId
);
TabClerk
clerk
=
this
.
clerkService
.
getById
(
clerkId
);
if
(
clerk
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"导购不存在"
);
}
StoreDTO
store
=
this
.
storeApiService
.
getStoreBy
Id
(
enterpriseId
,
store
Id
).
getResult
();
StoreDTO
store
=
this
.
storeApiService
.
getStoreBy
StoreInfoId
(
enterpriseId
,
storeInfo
Id
).
getResult
();
if
(
store
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"门店不存在"
);
}
...
...
@@ -604,6 +604,26 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public
ServiceResponse
<
Boolean
>
ensureClerkInStore
(
Integer
clerkId
,
Integer
storeInfoId
,
Integer
enterpriseId
)
{
logger
.
info
(
"clerkId:{}, storeInfoId:{}, enterpriseId:{}"
,
clerkId
,
storeInfoId
,
enterpriseId
);
TabClerk
clerk
=
this
.
clerkService
.
getById
(
clerkId
);
if
(
clerk
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"导购不存在"
,
Boolean
.
FALSE
);
}
StoreDTO
store
=
this
.
storeApiService
.
getStoreById
(
enterpriseId
,
storeInfoId
).
getResult
();
if
(
store
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"门店不存在"
,
Boolean
.
FALSE
);
}
if
(
clerk
.
getStoreInfoId
().
equals
(
store
.
getStoreInfoId
()))
{
logger
.
info
(
"导购[clerkId:{}]已存在门店[storeId:{}, storeInfoId:{}]下"
,
clerkId
,
store
.
getStoreId
(),
store
.
getStoreInfoId
());
return
EnterpriseServiceResponse
.
success
(
Boolean
.
TRUE
);
}
else
{
logger
.
info
(
"导购[clerkId:{}]不存在门店[storeId:{}, storeInfoId:{}]下"
,
clerkId
,
store
.
getStoreId
(),
store
.
getStoreInfoId
());
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"导购不存在该门店下"
,
Boolean
.
FALSE
);
}
}
@Override
public
ServiceResponse
<
List
<
ClerkDTO
>>
listClerkByStoreBrand
(
Integer
enterpriseId
,
Integer
storeBrandId
,
String
clerkName
)
{
StoreSearchDBDTO
storeSearchDBDTO
=
new
StoreSearchDBDTO
();
storeSearchDBDTO
.
setEnterpriseId
(
enterpriseId
);
...
...
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