Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
e030d109
Commit
e030d109
authored
Mar 19, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
5c294239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+32
-32
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
e030d109
...
...
@@ -8,6 +8,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -180,39 +181,38 @@ public class StoreController extends WebBaseController{
//获取首页销售数据
@IgnoreLogin
@RequestMapping
(
"/get-area-list"
)
public
HaobanResponse
getArea
(
String
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
ProvinceDTO
>
provinceMap
=
GlobalDictMap
.
provinceMap
;
Map
<
String
,
CityDTO
>
cityMap
=
GlobalDictMap
.
cityMap
;
Map
<
String
,
CountyDTO
>
countyMap
=
GlobalDictMap
.
countyMap
;
List
<
ProvinceDTO
>
provinceList
=
new
ArrayList
<
ProvinceDTO
>();
List
<
CityDTO
>
cityList
=
new
ArrayList
<
CityDTO
>();
List
<
CountyDTO
>
countyList
=
new
ArrayList
<
CountyDTO
>();
for
(
String
key
:
provinceMap
.
keySet
())
{
provinceList
.
add
(
provinceMap
.
get
(
key
));
}
for
(
String
key
:
cityMap
.
keySet
())
{
cityList
.
add
(
cityMap
.
get
(
key
));
}
for
(
String
key
:
countyMap
.
keySet
())
{
countyList
.
add
(
countyMap
.
get
(
key
));
}
if
(
StringUtils
.
isEmpty
(
id
)){
//省
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
provinceList
);
}
else
{
if
(
cityMap
.
containsKey
(
id
)){
//市
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
cityList
);
}
else
if
(
countyMap
.
containsKey
(
id
)){
//区
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
countyList
);
}
public
HaobanResponse
getArea
(
Integer
type
,
String
id
)
{
if
(
type
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
map
.
put
(
"province"
,
provinceList
);
map
.
put
(
"city"
,
cityList
);
map
.
put
(
"country"
,
countyList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_8
,
map
);
switch
(
type
)
{
// 省
case
1
:
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
GlobalDictMap
.
provinceMap
);
// 市
case
2
:
Map
<
String
,
CityDTO
>
tabCityMap
=
GlobalDictMap
.
cityMap
;
Map
<
String
,
CityDTO
>
cityMap
=
new
HashMap
<
String
,
CityDTO
>();
Set
<
Map
.
Entry
<
String
,
CityDTO
>>
citySet
=
tabCityMap
.
entrySet
();
for
(
Map
.
Entry
<
String
,
CityDTO
>
entry
:
citySet
)
{
if
(
entry
.
getValue
().
getProvinceId
().
equals
(
id
))
{
cityMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
cityMap
);
case
3
:
Map
<
String
,
CountyDTO
>
tabCountyMap
=
GlobalDictMap
.
countyMap
;
Map
<
String
,
CountyDTO
>
countyMap
=
new
HashMap
<
String
,
CountyDTO
>();
Set
<
Map
.
Entry
<
String
,
CountyDTO
>>
tabSet
=
tabCountyMap
.
entrySet
();
for
(
Map
.
Entry
<
String
,
CountyDTO
>
entry
:
tabSet
)
{
if
(
entry
.
getValue
().
getCityId
().
equals
(
id
))
{
countyMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
countyMap
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_8
);
}
//获取首页销售数据
@RequestMapping
(
"/change-store-detail"
)
...
...
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