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
baa60211
Commit
baa60211
authored
Nov 08, 2018
by
扫地僧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改方法名
parent
c3fe709a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
97 deletions
+97
-97
AdministratorsController.java
...a/cn/com/fqy/controller/mgt/AdministratorsController.java
+97
-97
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/AdministratorsController.java
View file @
baa60211
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.Operator
;
import
cn.com.fqy.common.ResultInfo
;
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"
)
public
class
AdministratorsController
extends
BaseController
{
@Resource
private
AdministratorsService
administratorsService
;
/*
* 分页展示店铺管理员信息
*/
@RequestMapping
(
"
getAdministratorsList"
)
@ResponseBody
public
PageFinder
<
Administrators
>
getAdministratorsList
(
Administrators
administrators
,
Query
query
)
{
administrators
.
setIsDeleted
(
0
);
Query
q
=
new
Query
(
query
.
getPageNo
(),
query
.
getPageSize
(),
administrators
);
return
administratorsService
.
getAdministratorsPagedList
(
q
);
}
/**
* 添加或修改店铺管理员信息
* @param CarPreiod
* @return
*/
@RequestMapping
(
"addOrEditAdministrators"
)
@ResponseBody
public
ResultInfo
<
Administrators
>
addOrEditAdministrators
(
Administrators
administrators
)
{
ResultInfo
<
Administrators
>
resultInfo
=
new
ResultInfo
<>();
//操作人
Operator
op
=
getOperator
();
if
(
administrators
!=
null
&&
administrators
.
getAdministratorsId
()!=
null
&&!
""
.
equals
(
administrators
.
getAdministratorsId
()))
{
resultInfo
=
administratorsService
.
updateAdministrators
(
administrators
,
op
);
}
else
{
resultInfo
=
administratorsService
.
addAdministrators
(
administrators
,
op
);
}
return
resultInfo
;
}
/**
* 店铺管理员删除
* @param workerId
* @return
*/
@RequestMapping
(
"delAdministrators"
)
@ResponseBody
public
ResultInfo
<
Administrators
>
delAdministrators
(
String
administratorsId
)
{
ResultInfo
<
Administrators
>
resultInfo
=
new
ResultInfo
<>();
if
(
administratorsId
==
null
||
""
.
equals
(
administratorsId
))
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"店铺管理员ID参数为空"
);
return
resultInfo
;
}
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
1
);
administrators
.
setAdministratorsId
(
administratorsId
);
return
administratorsService
.
updateAdministrators
(
administrators
,
getOperator
());
}
/**
* 获取店铺信息
*/
@RequestMapping
(
"getAdministrators"
)
@ResponseBody
public
ResultInfo
<
List
<
Administrators
>>
getAdministrators
(){
ResultInfo
<
List
<
Administrators
>>
result
=
new
ResultInfo
<>();
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
0
);
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
if
(
administratorsList
.
size
()>
0
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
administratorsList
);
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无店铺管理员数据"
);
}
return
result
;
}
}
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.com.fqy.common.Operator
;
import
cn.com.fqy.common.ResultInfo
;
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"
)
public
class
AdministratorsController
extends
BaseController
{
@Resource
private
AdministratorsService
administratorsService
;
/*
* 分页展示店铺管理员信息
*/
@RequestMapping
(
"
administratorsList"
)
@ResponseBody
public
PageFinder
<
Administrators
>
administratorsList
(
Administrators
administrators
,
Query
query
)
{
administrators
.
setIsDeleted
(
0
);
Query
q
=
new
Query
(
query
.
getPageNo
(),
query
.
getPageSize
(),
administrators
);
return
administratorsService
.
getAdministratorsPagedList
(
q
);
}
/**
* 添加或修改店铺管理员信息
* @param CarPreiod
* @return
*/
@RequestMapping
(
"addOrEditAdministrators"
)
@ResponseBody
public
ResultInfo
<
Administrators
>
addOrEditAdministrators
(
Administrators
administrators
)
{
ResultInfo
<
Administrators
>
resultInfo
=
new
ResultInfo
<>();
//操作人
Operator
op
=
getOperator
();
if
(
administrators
!=
null
&&
administrators
.
getAdministratorsId
()!=
null
&&!
""
.
equals
(
administrators
.
getAdministratorsId
()))
{
resultInfo
=
administratorsService
.
updateAdministrators
(
administrators
,
op
);
}
else
{
resultInfo
=
administratorsService
.
addAdministrators
(
administrators
,
op
);
}
return
resultInfo
;
}
/**
* 店铺管理员删除
* @param workerId
* @return
*/
@RequestMapping
(
"delAdministrators"
)
@ResponseBody
public
ResultInfo
<
Administrators
>
delAdministrators
(
String
administratorsId
)
{
ResultInfo
<
Administrators
>
resultInfo
=
new
ResultInfo
<>();
if
(
administratorsId
==
null
||
""
.
equals
(
administratorsId
))
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"店铺管理员ID参数为空"
);
return
resultInfo
;
}
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
1
);
administrators
.
setAdministratorsId
(
administratorsId
);
return
administratorsService
.
updateAdministrators
(
administrators
,
getOperator
());
}
/**
* 获取店铺信息
*/
@RequestMapping
(
"getAdministrators"
)
@ResponseBody
public
ResultInfo
<
List
<
Administrators
>>
getAdministrators
(){
ResultInfo
<
List
<
Administrators
>>
result
=
new
ResultInfo
<>();
Administrators
administrators
=
new
Administrators
();
administrators
.
setIsDeleted
(
0
);
List
<
Administrators
>
administratorsList
=
administratorsService
.
getAdministratorsList
(
new
Query
(
administrators
));
if
(
administratorsList
.
size
()>
0
)
{
result
.
setCode
(
"1"
);
result
.
setData
(
administratorsList
);
}
else
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"暂无店铺管理员数据"
);
}
return
result
;
}
}
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