NowSpeedingController.java
2.02 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
package com.bsth.controller.excep;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
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.data.BasicData;
import com.bsth.entity.excep.Speeding;
import com.bsth.entity.sys.SysUser;
import com.bsth.service.excep.NowSpeedingService;
import com.bsth.util.PageObject;
@RestController
@RequestMapping("nowspeeding")
public class NowSpeedingController extends BaseController<SysUser, Integer>{
@Autowired
private NowSpeedingService nowSpeedingService;
@RequestMapping(value = "/pagequery",method = RequestMethod.GET)
public PageObject<Speeding> pagequery(@RequestParam Map<String, Object> map){
PageObject<Speeding> pageObject = null;
map.put("curPage", map.get("page").toString());
map.put("pageData","10");
pageObject=nowSpeedingService.Pagequery(map);
return pageObject;
}
@RequestMapping(value = "/getReport", method = RequestMethod.POST)
public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
Map<String, Object> modelMap = new HashMap<String, Object>();
try {
map.put("isShow", 1);
modelMap = nowSpeedingService.getReport(map);
} catch (Exception e) {
e.printStackTrace();
}
return modelMap;
}
@RequestMapping(value = "/findPosition", method = RequestMethod.GET)
public List<Speeding> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
List<Speeding> listSpeeding = nowSpeedingService.findPosition(deviceid,startdate,enddate);
return listSpeeding;
}
}