Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-system
Project
Project
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
luoyangfei
store-system
Commits
e1269c17
Commit
e1269c17
authored
Nov 09, 2018
by
wangyihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 店铺接口返回值 新增 接口
parent
655297a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
13 deletions
+64
-13
AdministratorsController.java
...a/cn/com/fqy/controller/mgt/AdministratorsController.java
+44
-8
StoreController.java
.../main/java/cn/com/fqy/controller/mgt/StoreController.java
+20
-5
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/AdministratorsController.java
View file @
e1269c17
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
...
...
@@ -15,7 +17,6 @@ import cn.com.fqy.core.common.BaseController;
import
cn.com.fqy.core.common.PageFinder
;
import
cn.com.fqy.core.model.Administrators
;
import
cn.com.fqy.core.model.Query
;
import
cn.com.fqy.core.model.Store
;
import
cn.com.fqy.core.service.AdministratorsService
;
@Controller
@RequestMapping
(
"administrators"
)
...
...
@@ -77,23 +78,26 @@ public class AdministratorsController extends BaseController{
}
/**
* 获取店铺
信息
* 获取店铺
管理员信息(针对系统用户)
*/
@RequestMapping
(
"getAdministrators"
)
@ResponseBody
public
ResultInfo
<
List
<
Administrators
>>
getAdministrators
(){
ResultInfo
<
List
<
Administrators
>>
result
=
new
ResultInfo
<>();
List
<
Administrators
>
admListQuery
=
new
ArrayList
<>();
public
ResultInfo
<
List
<
Map
<
String
,
Object
>
>>
getAdministrators
(){
ResultInfo
<
List
<
Map
<
String
,
Object
>
>>
result
=
new
ResultInfo
<>();
List
<
Map
<
String
,
Object
>
>
admListQuery
=
new
ArrayList
<>();
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
0
);
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
if
(
administratorsList
.
size
()>
0
)
{
if
(
administratorsList
.
size
()>
0
&&
administratorsList
!=
null
)
{
for
(
Administrators
list:
administratorsList
)
{
if
(
list
.
getSystemId
()
==
null
||
""
.
equals
(
list
.
getSystemId
()))
{
admListQuery
.
add
(
list
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"administratorsId"
,
list
.
getAdministratorsId
());
map
.
put
(
"administratorsName"
,
list
.
getAdministratorsName
());
admListQuery
.
add
(
map
);
}
}
if
(
admListQuery
.
size
()>
0
)
{
if
(
admListQuery
.
size
()>
0
&&
admListQuery
!=
null
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
admListQuery
);
}
else
{
...
...
@@ -106,4 +110,36 @@ public class AdministratorsController extends BaseController{
}
return
result
;
}
/**
* 获取店铺管理员信息(针对店铺)
*/
@RequestMapping
(
"getStoreAdministrators"
)
@ResponseBody
public
ResultInfo
<
List
<
Map
<
String
,
Object
>>>
getStoreAdministrators
(){
ResultInfo
<
List
<
Map
<
String
,
Object
>>>
result
=
new
ResultInfo
<>();
List
<
Map
<
String
,
Object
>>
listQuery
=
new
ArrayList
<>();
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
0
);
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
if
(
administratorsList
.
size
()>
0
&&
administratorsList
!=
null
)
{
for
(
Administrators
list:
administratorsList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"administratorsId"
,
list
.
getAdministratorsId
());
map
.
put
(
"administratorsName"
,
list
.
getAdministratorsName
());
listQuery
.
add
(
map
);
}
if
(
listQuery
.
size
()>
0
&&
listQuery
!=
null
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
listQuery
);
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无可用店铺管理员数据"
);
}
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无店铺管理员数据"
);
}
return
result
;
}
}
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/StoreController.java
View file @
e1269c17
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
...
...
@@ -78,15 +81,27 @@ public class StoreController extends BaseController {
*/
@RequestMapping
(
"getStores"
)
@ResponseBody
public
ResultInfo
<
List
<
Store
>>
getStores
(){
ResultInfo
<
List
<
Store
>>
result
=
new
ResultInfo
<>();
public
ResultInfo
<
List
<
Map
<
String
,
Object
>>>
getStores
(){
ResultInfo
<
List
<
Map
<
String
,
Object
>>>
result
=
new
ResultInfo
<>();
List
<
Map
<
String
,
Object
>>
listQuery
=
new
ArrayList
<>();
Store
store
=
new
Store
();
store
.
setIsDeleted
(
0
);
store
.
setIsAuditing
(
1
);
List
<
Store
>
storeList
=
storeService
.
getStoreList
(
new
Query
(
store
));
if
(
storeList
.
size
()>
0
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
storeList
);
if
(
storeList
.
size
()>
0
&&
storeList
!=
null
)
{
for
(
Store
list:
storeList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"storeId"
,
list
.
getStoreId
());
map
.
put
(
"storeName"
,
list
.
getStoreName
());
listQuery
.
add
(
map
);
}
if
(
listQuery
.
size
()>
0
&&
listQuery
!=
null
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
listQuery
);
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无可用店铺数据"
);
}
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无店铺数据"
);
...
...
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