package com.mandi.fendan.controller;
|
|
|
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
|
import org.apache.log4j.Logger;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import com.mandi.common.Jacksonmethod;
|
import com.mandi.common.RequestParam;
|
import com.mandi.common.SessionMethod;
|
import com.mandi.dao.common.ObjectResult;
|
import com.mandi.dao.common.PageRequest;
|
import com.mandi.dao.common.PageResult;
|
import com.mandi.fendan.persist.Fd_Systemconfig;
|
import com.mandi.fendan.service.Ifd_systemconfigService;
|
|
|
|
@Controller("fd_systemconfig_con")
|
@RequestMapping(value="/systemconfig",method={RequestMethod.POST})
|
public class Fd_SystemconfigController {
|
private Logger log=Logger.getLogger(Fd_SystemconfigController.class);
|
@Resource
|
private Ifd_systemconfigService isfs;
|
|
@RequestMapping(value = "/getList.htm", method = {RequestMethod.POST })
|
@ResponseBody
|
public String getList(HttpServletRequest r,HttpServletResponse re){
|
int page=RequestParam.getInt(r, "page");
|
int pagesize=RequestParam.getInt(r, "pagesize");
|
int pages=RequestParam.getInt(r, "pages");
|
String name=RequestParam.getSqlString(r, "name");
|
|
PageRequest pr=new PageRequest(page,pagesize,null);
|
if(pages>0)
|
pr.setNeedPages(true);
|
else
|
pr.setNeedPages(false);
|
|
|
PageResult<Fd_Systemconfig> prr = isfs.getlist(name, pr);
|
SessionMethod.writeresp(re, Jacksonmethod.tojson(prr, false));
|
return null;
|
}
|
|
|
@RequestMapping(value = "/saveItem.htm", method = {RequestMethod.POST })
|
@ResponseBody
|
public String saveItem(HttpServletRequest r,HttpServletResponse re){
|
Fd_Systemconfig fsf = RequestParam.getobj(r, new Fd_Systemconfig());
|
ObjectResult<Fd_Systemconfig> orr=new ObjectResult<Fd_Systemconfig>();
|
try {
|
orr = isfs.saveFd_Systemconfig(fsf);
|
} catch (Exception e) {
|
orr.setCode(1);
|
orr.setErrmsg(e.getMessage());
|
}
|
|
SessionMethod.writeresp(re, Jacksonmethod.tojson(orr, false));
|
return null;
|
}
|
@RequestMapping(value = "/getItem.htm", method = {RequestMethod.POST })
|
@ResponseBody
|
public String getItem(HttpServletRequest r,HttpServletResponse re){
|
String id=RequestParam.getSqlString(r, "id");
|
|
|
ObjectResult<Fd_Systemconfig> orr=new ObjectResult<Fd_Systemconfig>();
|
try {
|
orr = isfs.getFd_Systemconfig(id);
|
} catch (Exception e) {
|
orr.setCode(1);
|
orr.setErrmsg(e.getMessage());
|
}
|
|
SessionMethod.writeresp(re, Jacksonmethod.tojson(orr, false));
|
return null;
|
}
|
|
|
}
|