Commit 65b2a2bc authored by yff's avatar yff

新增测试页面跳转接口

parent 9124ea7f
package com.gavel.kwell.controller;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.BaseURL;
import com.gavel.common.SystemOperation;
import com.gavel.common.annotation.ResourcePermissions;
import com.gavel.common.base.controller.BaseController;
import com.gavel.common.converter.DataConvert;
import com.gavel.common.utils.StringUtils;
import com.gavel.common.utils.ThreadContext;
import com.gavel.kwell.service.GpfkService;
import com.gavel.kwell.vo.GpfkCondition;
import com.gavel.kwell.vo.GpfkVO;
import com.gavel.persistence.sql.RecordSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("kmes/csfk")
public class GpcsController extends BaseController {
@Autowired
private GpfkService gpfkService;
@ResourcePermissions()
@RequestMapping("/index")
public String index() {
return "kmes/gpcs/index";
}
@ResourcePermissions()
@RequestMapping("/zpindex")
public String jyindex() {
return "kmes/gpcs/jyindex";
}
@ResourcePermissions({SystemOperation.BottonResource.ADD})
@RequestMapping("/add")
public String add() {
return "kmes/gpjy/edit";
}
@ResourcePermissions({SystemOperation.BottonResource.EDIT})
@RequestMapping("/edit")
public String edit() {
return "kmes/gpjy/edit";
}
@RequestMapping("/gx")
public String gx() {
return "kmes/gpjy/gx";
}
@RequestMapping(value = BaseURL.QUERY, method = RequestMethod.POST)
@ResponseBody
public Object query(@RequestBody GpfkCondition condition) {
RecordSet<GpfkVO> records = gpfkService.query(condition);
return buildReturnData(records, GpfkVO.class);
}
@ResourcePermissions({"21"})
@RequestMapping(value = "/delGpjy", method = RequestMethod.POST)
@ResponseBody
public Object delGpjy(@RequestBody JSONObject param) {
String gpfkid = param.getString("gpfkid");
if(StringUtils.isEmpty(gpfkid)){
setReturnMessage("请选择一条工票信息进行操作!");
return returnData();
}
gpfkService.delGpfkById(gpfkid);
return ThreadContext.getReturnData();
}
@ResourcePermissions(SystemOperation.BottonResource.EXPORT)
@RequestMapping(value = BaseURL.EXPORT, method = RequestMethod.POST)
@ResponseBody
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject param) throws Exception {
GpfkCondition condition = DataConvert.getCondition(param.getJSONObject("condition"), GpfkCondition.class);
RecordSet<GpfkVO> records = gpfkService.query(condition);
doExport(request, response, param, records.getRecords());
}
}
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