CarsController.java
3.82 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package com.bsth.controller.schedule.basicinfo;
import com.bsth.common.ResponseCode;
import com.bsth.controller.schedule.BController;
import com.bsth.entity.Cars;
import com.bsth.service.schedule.CarsService;
import com.bsth.service.schedule.exception.ScheduleException;
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 java.util.HashMap;
import java.util.Map;
/**
* 车辆基础信息controller
*/
@RestController(value = "carsController_sc")
@RequestMapping("cars_sc")
public class CarsController extends BController<Cars, Integer> {
@Autowired
private CarsService carsService;
@RequestMapping(value = "/validate_zbh", method = RequestMethod.GET)
public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) {
Map<String, Object> rtn = new HashMap<>();
try {
// 自编号验证
Cars cars = new Cars(
param.get("id_eq"),
param.get("insideCode_eq"),
null,
null,
null);
carsService.validate_nbbh(cars);
rtn.put("status", ResponseCode.SUCCESS);
} catch (ScheduleException exp) {
rtn.put("status", ResponseCode.ERROR);
rtn.put("msg", exp.getMessage());
}
return rtn;
}
@RequestMapping(value = "/validate_clbh", method = RequestMethod.GET)
public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) {
Map<String, Object> rtn = new HashMap<>();
try {
// 车辆编号验证
Cars cars = new Cars(
param.get("id_eq"),
null,
param.get("carCode_eq"),
null,
null);
carsService.validate_clbh(cars);
rtn.put("status", ResponseCode.SUCCESS);
} catch (ScheduleException exp) {
rtn.put("status", ResponseCode.ERROR);
rtn.put("msg", exp.getMessage());
}
return rtn;
}
@RequestMapping(value = "/validate_cph", method = RequestMethod.GET)
public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) {
Map<String, Object> rtn = new HashMap<>();
try {
// 车牌号验证
Cars cars = new Cars(
param.get("id_eq"),
null,
null,
param.get("carPlate_eq"),
null);
carsService.validate_cph(cars);
rtn.put("status", ResponseCode.SUCCESS);
} catch (ScheduleException exp) {
rtn.put("status", ResponseCode.ERROR);
rtn.put("msg", exp.getMessage());
}
return rtn;
}
@RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET)
public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) {
Map<String, Object> rtn = new HashMap<>();
try {
// 设备编号验证
Cars cars = new Cars(
param.get("id_eq"),
null,
null,
null,
param.get("equipmentCode_eq")
);
carsService.validate_sbbh(cars);
rtn.put("status", ResponseCode.SUCCESS);
} catch (ScheduleException exp) {
rtn.put("status", ResponseCode.ERROR);
rtn.put("msg", exp.getMessage());
}
return rtn;
}
}