CwjyController.java
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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;
}
}