Commit baa60211 authored by 扫地僧's avatar 扫地僧

修改方法名

parent c3fe709a
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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment