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
a2161807
Commit
a2161807
authored
Feb 27, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店对外api修改
parent
b0e6b424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
StoreOpenApiServiceImpl.java
...gic/store/service/outer/impl/StoreOpenApiServiceImpl.java
+17
-12
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreOpenApiServiceImpl.java
View file @
a2161807
...
...
@@ -205,22 +205,26 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
ServiceResponse
<
List
<
CountyDTO
>>
countyResponse
=
provincesApiService
.
selectAllCounty
();
List
<
ProvinceDTO
>
provinceDTOList
=
provinceResponse
.
getResult
();
String
finalProvince
=
storeOpenDTO
.
getProvince
();
long
provinceCount
=
provinceDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getProvinceName
(),
finalProvince
)).
count
(
);
ProvinceDTO
provinceDTO
=
provinceDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getProvinceName
(),
finalProvince
)).
findFirst
().
orElse
(
null
);
List
<
CityDTO
>
cityDTOList
=
cityResponse
.
getResult
();
String
finalCity
=
storeOpenDTO
.
getCity
();
long
cityCount
=
cityDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCityName
(),
finalCity
)).
count
(
);
CityDTO
cityDTO
=
cityDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCityName
(),
finalCity
)).
findFirst
().
orElse
(
null
);
List
<
CountyDTO
>
countyDTOList
=
countyResponse
.
getResult
();
String
finalCounty
=
storeOpenDTO
.
getCounty
();
long
countyCount
=
countyDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCountyName
(),
finalCounty
)).
count
(
);
if
(
county
Count
==
0
)
{
CountyDTO
countyDTO
=
countyDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCountyName
(),
finalCounty
)).
findFirst
().
orElse
(
null
);
if
(
county
DTO
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"输入的区县信息有误"
);
}
if
(
city
Count
==
0
)
{
if
(
city
DTO
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"输入的市信息有误"
);
}
if
(
province
Count
==
0
)
{
if
(
province
DTO
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"输入的省信息有误"
);
}
storeDTO
.
setProvinceId
(
provinceDTO
.
getProvinceId
());
storeDTO
.
setCityId
(
cityDTO
.
getCityId
());
storeDTO
.
setCountyId
(
countyDTO
.
getCountyId
());
storeDTO
.
setProvinces
(
provinceDTO
.
getProvinceName
()
+
"/"
+
cityDTO
.
getCityName
()
+
"/"
+
countyDTO
.
getCountyName
());
}
// 营业时间
if
(
StringUtils
.
isNotBlank
(
storeOpenDTO
.
getBusinessTime
()))
{
...
...
@@ -299,12 +303,13 @@ public class StoreOpenApiServiceImpl implements StoreOpenApiService {
storeDTO
.
setCreateType
(
CreateTypeEnum
.
API
.
getCode
());
// 保存门店
// this.storeService.save(storeDTO);
ServiceResponse
<
Integer
>
serviceResponse
=
storeApiService
.
saveOrUpdate
(
storeDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
else
{
return
EnterpriseServiceResponse
.
success
();
}
return
null
;
// ServiceResponse<Integer> serviceResponse = storeApiService.saveOrUpdate(storeDTO);
// if (!serviceResponse.isSuccess()) {
// return EnterpriseServiceResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
// } else {
// return EnterpriseServiceResponse.success();
// }
}
@Override
...
...
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