BerthController.java
2.39 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.bsth.controller.berth;
import com.bsth.controller.BaseController;
import com.bsth.controller.berth.dto.Car2Berth;
import com.bsth.data.in_out.buffer.BerthDataBuffer;
import com.bsth.data.in_out.buffer.ElectricDataBuffer;
import com.bsth.data.in_out.carpark.RealBerthManager;
import com.bsth.entity.berth.RegionBerth;
import com.bsth.service.berth.BerthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by panzhao on 2017/8/22.
*/
@RestController
@RequestMapping("/berth")
public class BerthController extends BaseController<RegionBerth, Integer> {
/* @Autowired
BerthService berthService;
@RequestMapping("max_order_no")
public String maxOrderNo() {
String rs = berthService.maxOrderNo();
return rs==null?"0":rs;
}*/
@Autowired
BerthService berthService;
@Autowired
RealBerthManager realBerthManager;
@Autowired
BerthDataBuffer berthDataBuffer;
@RequestMapping("findCar2Berths")
public List<Car2Berth> findCar2Berths(){
return berthService.car2Berths();
}
@RequestMapping("all_list")
public List<RegionBerth> all(){
return BerthDataBuffer.all();
}
@RequestMapping("addCar")
public Map<String, Object> addCar(@RequestParam String berthName,@RequestParam String nbbm){
return realBerthManager.addCar2Berth(nbbm, berthName);
}
@RequestMapping("removeCar")
public Map<String, Object> removeCar(@RequestParam String b){
return realBerthManager.removeCar2Berth(b);
}
@RequestMapping("changeCar2Berth")
public Map<String, Object> changeCar2Berth(@RequestParam String s,@RequestParam String d){
return RealBerthManager.changeCar2Berth(s, d);
}
@RequestMapping("lockBerth")
public Map<String, Object> lockBerth(@RequestParam String berthName){
return berthDataBuffer.lockBerth(berthName);
}
@RequestMapping("unlockBerth")
public Map<String, Object> unlockBerth(@RequestParam String berthName){
return berthDataBuffer.unlockBerth(berthName);
}
@RequestMapping("elecs")
public Map<String, Double> elecs(){
return ElectricDataBuffer.elecs();
}
}