CwjyController.java 2 KB
package com.bsth.controller.oil;


import java.util.Date;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.bsth.controller.BaseController;
import com.bsth.entity.oil.Cwjy;
import com.bsth.entity.oil.Ylxxb;
import com.bsth.entity.sys.SysUser;
import com.bsth.security.util.SecurityUtils;
import com.bsth.service.oil.CwjyService;
import com.bsth.util.PageObject;

@RestController
@RequestMapping("cwjy")
public class CwjyController extends BaseController<Cwjy, Integer>{
	@Autowired
	private CwjyService service;
	@RequestMapping(method = RequestMethod.POST)
	public Map<String, Object> save(Cwjy t){
		SysUser sysUser = SecurityUtils.getCurrentUser();
		t.setCreateDate(new Date());
		t.setXgr(sysUser.getUserName());
		return service.save(t);
	}
	
	@RequestMapping(value = "/pagequery",method = RequestMethod.GET)
	public PageObject<Ylxxb> pagequery(@RequestParam Map<String, Object> map){
		PageObject<Ylxxb> pagequery=null;
		map.put("curPage", map.get("page").toString());
		map.put("pageData","10");
		pagequery=service.Pagequery(map);
		return pagequery;
	}
	
	@RequestMapping(value="/bynbbm",method = RequestMethod.GET)
	public Ylxxb bynbbm(@RequestParam Map<String, Object> map){
		
		return service.bynbbm(map);
	}
	
	/**
	 * 
	 * @Title: save 
	 * @Description: TODO(持久化对象) 
	 * @param @param t
	 * @param @return    设定文件 
	 * @return Map<String,Object>  {status: 1(成功),-1(失败)}
	 * @throws
	 */
	@RequestMapping(value="/savejzl",method = RequestMethod.POST)
	public Map<String, Object> savejzl(Ylxxb t){
		Map<String, Object> map=service.savejzl(t);
		return map;
	}
	
	
}