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
3a4871e4
Commit
3a4871e4
authored
Apr 30, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店控件增加接口
parent
8ea88068
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
5 deletions
+86
-5
StoreWidgetApiService.java
...ain/java/com/gic/store/service/StoreWidgetApiService.java
+6
-0
StoreWidgetApiServiceImpl.java
...c/store/service/outer/impl/StoreWidgetApiServiceImpl.java
+80
-5
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreWidgetApiService.java
View file @
3a4871e4
...
...
@@ -53,8 +53,14 @@ public interface StoreWidgetApiService {
*/
ServiceResponse
<
Page
<
StoreDTO
>>
listStoreByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
);
ServiceResponse
<
Page
<
Integer
>>
listStoreIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
);
ServiceResponse
<
Page
<
Integer
>>
listStoreInfoIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
);
ServiceResponse
<
List
<
Integer
>>
listStoreIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
);
ServiceResponse
<
List
<
Integer
>>
listStoreInfoIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
);
/** @Description: 判断门店是否在门店控件里
* @author taogs
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreWidgetApiServiceImpl.java
View file @
3a4871e4
...
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreSearchDTO
;
import
com.gic.store.dto.StoreWidgetDTO
;
...
...
@@ -88,6 +89,62 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
@Override
public
ServiceResponse
<
Page
<
Integer
>>
listStoreIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
)
{
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidget
(
storeWidgetId
);
if
(
storeWidgetDTO
!=
null
){
String
authSearchParam
=
storeWidgetDTO
.
getAuthSearchParam
();
String
searchParam
=
storeWidgetDTO
.
getSearchParam
();
StoreSearchDTO
dto
=
new
StoreSearchDTO
();
dto
.
setEnterpriseId
(
enterpriseId
);
if
(
StringUtils
.
isNotBlank
(
authSearchParam
)
&&
!
"{}"
.
equals
(
authSearchParam
)){
dto
.
setAuthSearchJson
(
authSearchParam
);
}
dto
.
setSearchJson
(
searchParam
);
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
storeApiService
.
listStore
(
dto
,
pageNum
,
pageSize
,
StoreESFieldsEnum
.
STOREID
.
getField
()
+
""
);
Page
<
Integer
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
response
.
getResult
()
!=
null
){
page
.
setTotalCount
(
response
.
getResult
().
getTotalCount
());
for
(
StoreDTO
storeDTO
:
response
.
getResult
().
getResult
()){
list
.
add
(
storeDTO
.
getStoreId
());
}
}
page
.
setResult
(
list
);
return
ServiceResponse
.
success
(
page
);
}
return
ServiceResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"门店控件id不存在"
);
}
@Override
public
ServiceResponse
<
Page
<
Integer
>>
listStoreInfoIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
)
{
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidget
(
storeWidgetId
);
if
(
storeWidgetDTO
!=
null
){
String
authSearchParam
=
storeWidgetDTO
.
getAuthSearchParam
();
String
searchParam
=
storeWidgetDTO
.
getSearchParam
();
StoreSearchDTO
dto
=
new
StoreSearchDTO
();
dto
.
setEnterpriseId
(
enterpriseId
);
if
(
StringUtils
.
isNotBlank
(
authSearchParam
)
&&
!
"{}"
.
equals
(
authSearchParam
)){
dto
.
setAuthSearchJson
(
authSearchParam
);
}
dto
.
setSearchJson
(
searchParam
);
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
storeApiService
.
listStore
(
dto
,
pageNum
,
pageSize
,
StoreESFieldsEnum
.
STOREINFOID
.
getField
()
+
""
);
Page
<
Integer
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
response
.
getResult
()
!=
null
){
page
.
setTotalCount
(
response
.
getResult
().
getTotalCount
());
for
(
StoreDTO
storeDTO
:
response
.
getResult
().
getResult
()){
list
.
add
(
storeDTO
.
getStoreInfoId
());
}
}
page
.
setResult
(
list
);
return
ServiceResponse
.
success
(
page
);
}
return
ServiceResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"门店控件id不存在"
);
}
@Override
public
ServiceResponse
<
List
<
Integer
>>
listStoreIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
)
{
List
<
Integer
>
list
=
new
ArrayList
<>();
this
.
getStoreId
(
enterpriseId
,
storeWidgetId
,
1
,
list
);
...
...
@@ -95,6 +152,13 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
@Override
public
ServiceResponse
<
List
<
Integer
>>
listStoreInfoIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
)
{
List
<
Integer
>
list
=
new
ArrayList
<>();
this
.
getStoreInfoId
(
enterpriseId
,
storeWidgetId
,
1
,
list
);
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
exist
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
Integer
storeId
)
{
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidget
(
storeWidgetId
);
if
(
storeWidgetDTO
!=
null
){
...
...
@@ -121,12 +185,10 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
private
void
getStoreId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
List
<
Integer
>
list
){
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
listStore
ByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
ServiceResponse
<
Page
<
Integer
>>
response
=
this
.
listStoreId
ByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
StoreDTO
>
page
=
response
.
getResult
();
for
(
StoreDTO
dto
:
page
.
getResult
()){
list
.
add
(
dto
.
getStoreId
());
}
Page
<
Integer
>
page
=
response
.
getResult
();
list
.
addAll
(
page
.
getResult
());
if
(
pageNum
==
1
&&
page
.
getPages
()
>
1
){
for
(
int
i
=
2
;
i
<=
page
.
getPages
();
i
++){
this
.
getStoreId
(
enterpriseId
,
storeWidgetId
,
i
,
list
);
...
...
@@ -134,4 +196,17 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
}
}
private
void
getStoreInfoId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
List
<
Integer
>
list
){
ServiceResponse
<
Page
<
Integer
>>
response
=
this
.
listStoreInfoIdByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
Integer
>
page
=
response
.
getResult
();
list
.
addAll
(
page
.
getResult
());
if
(
pageNum
==
1
&&
page
.
getPages
()
>
1
){
for
(
int
i
=
2
;
i
<=
page
.
getPages
();
i
++){
this
.
getStoreInfoId
(
enterpriseId
,
storeWidgetId
,
i
,
list
);
}
}
}
}
}
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