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
3bc0bb50
Commit
3bc0bb50
authored
Dec 09, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店查询接口
parent
5ff11c4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
11 deletions
+58
-11
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+2
-1
StoreWidgetApiService.java
...ain/java/com/gic/store/service/StoreWidgetApiService.java
+5
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+26
-10
StoreWidgetApiServiceImpl.java
...c/store/service/outer/impl/StoreWidgetApiServiceImpl.java
+25
-0
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
3bc0bb50
...
...
@@ -222,5 +222,6 @@ public interface StoreApiService {
* @return
*/
ServiceResponse
<
Page
<
StoreDTO
>>
pageNearbyStore
(
Integer
enterpriseId
,
String
cityId
,
String
longitude
,
String
latitude
,
Integer
brandId
,
Integer
pageNum
,
Integer
pageSize
);
String
latitude
,
Integer
brandId
,
String
appid
,
Integer
pageNum
,
Integer
pageSize
);
}
gic-store-api/src/main/java/com/gic/store/service/StoreWidgetApiService.java
View file @
3bc0bb50
...
...
@@ -4,6 +4,9 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreWidgetDTO
;
import
com.sun.imageio.plugins.common.I18N
;
import
java.util.List
;
public
interface
StoreWidgetApiService
{
...
...
@@ -49,4 +52,6 @@ public interface StoreWidgetApiService {
* @return
*/
ServiceResponse
<
Page
<
StoreDTO
>>
listStoreByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
int
pageSize
);
ServiceResponse
<
List
<
Integer
>>
listStoreIdByStoreWidgetId
(
Integer
enterpriseId
,
Integer
storeWidgetId
);
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
3bc0bb50
...
...
@@ -9,9 +9,11 @@ import com.gic.commons.util.DateUtil;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.dto.CustomStoreDTO
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.enterprise.service.CustomStoreApiService
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.search.business.api.constant.enums.OperateEnum
;
...
...
@@ -83,6 +85,10 @@ public class StoreApiServiceImpl implements StoreApiService {
private
StoreLogService
storeLogService
;
@Autowired
private
StoreDictApiService
storeDictApiService
;
@Autowired
private
CustomStoreApiService
customStoreApiService
;
@Autowired
private
StoreWidgetApiService
storeWidgetApiService
;
static
{
storeStrtegyMap
.
put
(
1
,
new
StoreStatusStrategyImpl
());
...
...
@@ -492,16 +498,26 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public
ServiceResponse
<
Page
<
StoreDTO
>>
pageNearbyStore
(
Integer
enterpriseId
,
String
cityId
,
String
longitude
,
String
latitude
,
Integer
brandId
,
Integer
pageNum
,
Integer
pageSize
)
{
StoreSearchDBDTO
searchDBDTO
=
new
StoreSearchDBDTO
();
searchDBDTO
.
setEnterpriseId
(
enterpriseId
);
searchDBDTO
.
setStoreBrandId
(
brandId
);
searchDBDTO
.
setLongitude
(
longitude
);
searchDBDTO
.
setLatitude
(
latitude
);
searchDBDTO
.
setCityId
(
cityId
);
com
.
github
.
pagehelper
.
Page
<
StoreDTO
>
page
=
this
.
storeService
.
listStore
(
searchDBDTO
,
pageNum
,
pageSize
);
Page
<
StoreDTO
>
storeDTOPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
);
return
ServiceResponse
.
success
(
storeDTOPage
);
String
latitude
,
Integer
brandId
,
String
appid
,
Integer
pageNum
,
Integer
pageSize
)
{
ServiceResponse
<
CustomStoreDTO
>
customStore
=
this
.
customStoreApiService
.
getCustomStore
(
enterpriseId
,
appid
);
if
(
customStore
.
isSuccess
()
&&
customStore
.
getResult
()
!=
null
){
Integer
storeWidgetId
=
customStore
.
getResult
().
getStoreWidgetId
();
ServiceResponse
<
List
<
Integer
>>
response
=
this
.
storeWidgetApiService
.
listStoreIdByStoreWidgetId
(
enterpriseId
,
storeWidgetId
);
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
StoreSearchDBDTO
searchDBDTO
=
new
StoreSearchDBDTO
();
searchDBDTO
.
setEnterpriseId
(
enterpriseId
);
searchDBDTO
.
setStoreBrandId
(
brandId
);
searchDBDTO
.
setLongitude
(
longitude
);
searchDBDTO
.
setLatitude
(
latitude
);
searchDBDTO
.
setCityId
(
cityId
);
searchDBDTO
.
setStoreIdList
(
response
.
getResult
());
com
.
github
.
pagehelper
.
Page
<
StoreDTO
>
page
=
this
.
storeService
.
listStore
(
searchDBDTO
,
pageNum
,
pageSize
);
Page
<
StoreDTO
>
storeDTOPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
);
return
ServiceResponse
.
success
(
storeDTOPage
);
}
}
return
ServiceResponse
.
success
();
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreWidgetApiServiceImpl.java
View file @
3bc0bb50
...
...
@@ -13,6 +13,9 @@ import com.gic.store.service.StoreWidgetService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
(
"storeWidgetApiService"
)
public
class
StoreWidgetApiServiceImpl
implements
StoreWidgetApiService
{
@Autowired
...
...
@@ -80,4 +83,26 @@ public class StoreWidgetApiServiceImpl implements StoreWidgetApiService {
}
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
);
return
ServiceResponse
.
success
(
list
);
}
private
void
getStoreId
(
Integer
enterpriseId
,
Integer
storeWidgetId
,
int
pageNum
,
List
<
Integer
>
list
){
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
this
.
listStoreByStoreWidgetId
(
enterpriseId
,
storeWidgetId
,
pageNum
,
10000
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
StoreDTO
>
page
=
response
.
getResult
();
for
(
StoreDTO
dto
:
page
.
getResult
()){
list
.
add
(
dto
.
getStoreId
());
}
if
(
pageNum
==
1
&&
page
.
getPages
()
>
1
){
for
(
int
i
=
2
;
i
<=
page
.
getPages
();
i
++){
this
.
getStoreId
(
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