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

修改方法名

parent c3fe709a
package cn.com.fqy.controller.mgt; package cn.com.fqy.controller.mgt;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.fqy.common.Operator; import cn.com.fqy.common.Operator;
import cn.com.fqy.common.ResultInfo; import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.core.common.BaseController; import cn.com.fqy.core.common.BaseController;
import cn.com.fqy.core.common.PageFinder; import cn.com.fqy.core.common.PageFinder;
import cn.com.fqy.core.model.Administrators; import cn.com.fqy.core.model.Administrators;
import cn.com.fqy.core.model.Query; import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.Store; import cn.com.fqy.core.model.Store;
import cn.com.fqy.core.service.AdministratorsService; import cn.com.fqy.core.service.AdministratorsService;
@Controller @Controller
@RequestMapping("administrators") @RequestMapping("administrators")
public class AdministratorsController extends BaseController{ public class AdministratorsController extends BaseController{
@Resource @Resource
private AdministratorsService administratorsService; private AdministratorsService administratorsService;
/* /*
* 分页展示店铺管理员信息 * 分页展示店铺管理员信息
*/ */
@RequestMapping("getAdministratorsList") @RequestMapping("administratorsList")
@ResponseBody @ResponseBody
public PageFinder<Administrators> getAdministratorsList(Administrators administrators,Query query) { public PageFinder<Administrators> administratorsList(Administrators administrators,Query query) {
administrators.setIsDeleted(0); administrators.setIsDeleted(0);
Query q = new Query(query.getPageNo(),query.getPageSize(),administrators); Query q = new Query(query.getPageNo(),query.getPageSize(),administrators);
return administratorsService.getAdministratorsPagedList(q); return administratorsService.getAdministratorsPagedList(q);
} }
/** /**
* 添加或修改店铺管理员信息 * 添加或修改店铺管理员信息
* @param CarPreiod * @param CarPreiod
* @return * @return
*/ */
@RequestMapping("addOrEditAdministrators") @RequestMapping("addOrEditAdministrators")
@ResponseBody @ResponseBody
public ResultInfo<Administrators> addOrEditAdministrators(Administrators administrators) { public ResultInfo<Administrators> addOrEditAdministrators(Administrators administrators) {
ResultInfo<Administrators> resultInfo = new ResultInfo<>(); ResultInfo<Administrators> resultInfo = new ResultInfo<>();
//操作人 //操作人
Operator op = getOperator(); Operator op = getOperator();
if (administrators!=null&&administrators.getAdministratorsId()!=null&&!"".equals(administrators.getAdministratorsId())) { if (administrators!=null&&administrators.getAdministratorsId()!=null&&!"".equals(administrators.getAdministratorsId())) {
resultInfo = administratorsService.updateAdministrators(administrators, op); resultInfo = administratorsService.updateAdministrators(administrators, op);
}else { }else {
resultInfo = administratorsService.addAdministrators(administrators, op); resultInfo = administratorsService.addAdministrators(administrators, op);
} }
return resultInfo; return resultInfo;
} }
/** /**
* 店铺管理员删除 * 店铺管理员删除
* @param workerId * @param workerId
* @return * @return
*/ */
@RequestMapping("delAdministrators") @RequestMapping("delAdministrators")
@ResponseBody @ResponseBody
public ResultInfo<Administrators> delAdministrators(String administratorsId ) { public ResultInfo<Administrators> delAdministrators(String administratorsId ) {
ResultInfo<Administrators> resultInfo = new ResultInfo<>(); ResultInfo<Administrators> resultInfo = new ResultInfo<>();
if(administratorsId == null || "".equals(administratorsId)) { if(administratorsId == null || "".equals(administratorsId)) {
resultInfo.setCode("0"); resultInfo.setCode("0");
resultInfo.setMsg("店铺管理员ID参数为空"); resultInfo.setMsg("店铺管理员ID参数为空");
return resultInfo; return resultInfo;
} }
Administrators administrators = new Administrators(); Administrators administrators = new Administrators();
administrators.setIsDeleted(1); administrators.setIsDeleted(1);
administrators.setAdministratorsId(administratorsId); administrators.setAdministratorsId(administratorsId);
return administratorsService.updateAdministrators(administrators, getOperator()); return administratorsService.updateAdministrators(administrators, getOperator());
} }
/** /**
* 获取店铺信息 * 获取店铺信息
*/ */
@RequestMapping("getAdministrators") @RequestMapping("getAdministrators")
@ResponseBody @ResponseBody
public ResultInfo<List<Administrators>> getAdministrators(){ public ResultInfo<List<Administrators>> getAdministrators(){
ResultInfo<List<Administrators>> result = new ResultInfo<>(); ResultInfo<List<Administrators>> result = new ResultInfo<>();
Administrators administrators = new Administrators(); Administrators administrators = new Administrators();
administrators.setIsDeleted(0); administrators.setIsDeleted(0);
List<Administrators> administratorsList = administratorsService.getAdministratorsList(new Query(administrators)); List<Administrators> administratorsList = administratorsService.getAdministratorsList(new Query(administrators));
if (administratorsList.size()>0) { if (administratorsList.size()>0) {
result.setCode("1"); result.setCode("1");
result.setData(administratorsList); result.setData(administratorsList);
}else { }else {
result.setCode("0"); result.setCode("0");
result.setMsg("暂无店铺管理员数据"); result.setMsg("暂无店铺管理员数据");
} }
return result; 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