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
3701fcd6
Commit
3701fcd6
authored
Feb 27, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加日志
parent
1c6dc1e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
14 deletions
+30
-14
StoreOpenApiServiceImpl.java
...gic/store/service/outer/impl/StoreOpenApiServiceImpl.java
+29
-14
dubbo-gic-store-service.xml
...re-service/src/main/resources/dubbo-gic-store-service.xml
+1
-0
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreOpenApiServiceImpl.java
View file @
3701fcd6
...
...
@@ -6,6 +6,8 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.application.center.api.dto.ApplicationResourceDTO
;
import
com.gic.application.center.api.service.AuthorizeService
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.service.ResourceApiService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.constants.Constants
;
...
...
@@ -69,6 +71,8 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
private
AuthorizeService
authorizeService
;
@Autowired
private
StoreWidgetApiService
storeWidgetApiService
;
@Autowired
private
ResourceApiService
resourceApiService
;
@Override
public
ServiceResponse
<
String
>
getApiFieldJson
(
Integer
enterpriseId
,
Integer
regionId
)
{
...
...
@@ -576,24 +580,35 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
if
(
res
.
isSuccess
())
{
ApplicationResourceDTO
resourceDTO
=
res
.
getResult
();
if
(
resourceDTO
!=
null
)
{
Long
storeResourceId
=
resourceDTO
.
getStoreResource
();
//查询门店资源组所有的门店权限
ServiceResponse
<
Page
<
StoreDTO
>>
storeResult
=
storeWidgetApiService
.
listStoreByStoreWidgetId
(
enterpriseId
,
storeResourceId
.
intValue
(),
0
,
Integer
.
MAX_VALUE
);
if
(
storeResult
.
isSuccess
())
{
Page
<
StoreDTO
>
page
=
storeResult
.
getResult
();
List
<
StoreDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
StoreDTO
storeDTO
:
list
)
{
storeMap
.
put
(
storeDTO
.
getStoreCode
(),
1
);
regionMap
.
put
(
storeDTO
.
getRegionId
().
toString
(),
1
);
Integer
resourceId
=
resourceDTO
.
getResourceId
();
if
(
resourceId
==
null
)
{
return
false
;
}
ServiceResponse
<
ResourceDTO
>
resourceResult
=
resourceApiService
.
getResource
(
resourceId
);
if
(
resourceResult
.
isSuccess
())
{
LOGGER
.
info
(
"对外API权限校验结果-门店资源ID:{}"
,
JSON
.
toJSONString
(
resourceResult
));
Long
storeResourceId
=
resourceResult
.
getResult
().
getStoreResource
();
//查询门店资源组所有的门店权限
ServiceResponse
<
Page
<
StoreDTO
>>
storeResult
=
storeWidgetApiService
.
listStoreByStoreWidgetId
(
enterpriseId
,
storeResourceId
.
intValue
(),
0
,
Integer
.
MAX_VALUE
);
if
(
storeResult
.
isSuccess
())
{
Page
<
StoreDTO
>
page
=
storeResult
.
getResult
();
if
(
page
==
null
)
{
return
false
;
}
List
<
StoreDTO
>
list
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
StoreDTO
storeDTO
:
list
)
{
storeMap
.
put
(
storeDTO
.
getStoreCode
(),
1
);
regionMap
.
put
(
storeDTO
.
getRegionId
().
toString
(),
1
);
}
}
}
else
{
LOGGER
.
info
(
"对外API权限校验结果-门店资源获取:{}"
,
JSON
.
toJSONString
(
storeResult
));
}
}
else
{
LOGGER
.
info
(
"对外API权限校验结果-门店资源获取:{}"
,
JSON
.
toJSONString
(
storeResult
));
}
}
LOGGER
.
info
(
"对外API权限校验结果-
门店资源获取2
:{}"
,
JSON
.
toJSONString
(
res
));
LOGGER
.
info
(
"对外API权限校验结果-
资源ID
:{}"
,
JSON
.
toJSONString
(
res
));
}
else
{
LOGGER
.
info
(
"对外API权限校验结果:{}"
,
JSON
.
toJSONString
(
res
));
}
...
...
gic-store-service/src/main/resources/dubbo-gic-store-service.xml
View file @
3701fcd6
...
...
@@ -58,6 +58,7 @@
<dubbo:reference
interface=
"com.gic.erp.operation.api.service.ApiFieldApiService"
id=
"apiFieldApiService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.application.center.api.service.AuthorizeService"
id=
"authorizeService"
timeout=
"60000"
/>
<dubbo:reference
interface=
"com.gic.auth.service.ResourceApiService"
id=
"resourceApiService"
timeout=
"60000"
/>
<dubbo:service
interface=
"com.gic.store.service.StoreTagApiService"
ref=
"storeTagApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.store.service.StoreTagTmpApiService"
ref=
"storeTagTmpApiService"
timeout=
"6000"
/>
...
...
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