SpecialtyVehicleController.java
4.81 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package com.objecteye.controller;
import com.alibaba.fastjson.JSONObject;
import com.objecteye.dao.MongoTemplates;
import com.objecteye.pojo.VehicleCondition;
import com.objecteye.service.SpecialtyServices;
import com.objecteye.utils.CustomAssert;
import com.objecteye.utils.CustomParamCollections;
import com.objecteye.utils.VehicleEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
@CrossOrigin
@RestController
@RequestMapping("/vehicle")
public class SpecialtyVehicleController {
@Autowired
private MongoTemplates mongoTemplates;
@Autowired
private SpecialtyServices specialtyServices;
@Autowired
private VehicleEngine vehicleEngine;
/**
* 通过车牌(支持模糊)、多条件查询车辆信息(平铺)
*
* @param vehicleCondition
* @return
*/
@RequestMapping("/slagCar/findByCondition")
public JSONObject findByCondition(@RequestBody VehicleCondition vehicleCondition) {
//渣土车查询
JSONObject by = mongoTemplates.findBy(vehicleCondition, 2);
return by;
}
/**
* 通过图片返回各种车的坐标
*
* @param picfile
* @return
*/
@RequestMapping("/slagCar/findCoordinateByPic")
public JSONObject siteByPic(@RequestParam("picfile") MultipartFile picfile, Integer vehicle_special_type_number) {
//渣土车坐标 vehicle_special_type_number
JSONObject coordinateByPic = specialtyServices.findCoordinateByPic(picfile, vehicle_special_type_number);
return coordinateByPic;
}
/**
* 通过车辆特征码、时间、地点范围进行搜索
*
* @return
*/
@RequestMapping("/slagCar/findByPic")
public JSONObject findByPic(@RequestParam int number, @RequestParam double threshold, @RequestParam int currentpage,
@RequestParam int pagevolume, MultipartFile picfile, @RequestParam Long starttime,
@RequestParam Long endtime) throws InterruptedException {
return specialtyServices.findByPic(number, threshold, currentpage, pagevolume, picfile, starttime, endtime, 2);
}
/**
* 通过id搜索相关车辆
*
* @return
*/
@RequestMapping("/slagCar/findById")
public JSONObject findById(@RequestBody Map<String, String> map) {
JSONObject byPic = specialtyServices.findById(map.get("id"));
return byPic;
}
/**
* 通过过车序号搜索相关车辆
*
* @return
*/
@RequestMapping("/slagCar/findByGcxh")
public JSONObject findByGcxh(int gcxh, MultipartFile picfile) {
JSONObject coordinateByPic = specialtyServices.findByGcxh(gcxh, picfile);
return coordinateByPic;
/*
//老接口
JSONObject byPic = specialtyServices.findByGcxh1(gcxh, picfile);
return byPic;*/
}
/**
* 危化品车
* 通过车牌(支持模糊)、多条件查询车辆信息(平铺)
*
* @return
*/
@RequestMapping("/chemistryCar/findByCondition")
public JSONObject chemistryFindByCondition(@RequestBody VehicleCondition vehicleCondition) {
//危化品车查询
JSONObject vehicleInfoRes = mongoTemplates.findBy(vehicleCondition, 1);
return vehicleInfoRes;
}
/**
* 危化品车
* 通通过车辆特征码、时间、地点范围进行搜索
*
* @return
*/
@RequestMapping("/chemistryCar/findByPic")
public JSONObject chemistryFindByPic(@RequestParam int number, @RequestParam Double threshold, @RequestParam int currentpage,
@RequestParam int pagevolume, MultipartFile picfile, @RequestParam Long starttime,
@RequestParam Long endtime) throws InterruptedException {
return specialtyServices.findByPic(number, threshold, currentpage, pagevolume, picfile, starttime, endtime, 1);
}
/**
* 测试
*
* @return
*/
@RequestMapping("/chemistryCar/test")
public JSONObject test(Integer gcxh, @RequestParam("picfile") MultipartFile picfile) {
JSONObject coordinateByPic = specialtyServices.findByGcxh(gcxh, picfile);
return coordinateByPic;
}
/**
* 测试
*
* @return
*/
@RequestMapping("/getResult")
public Object getResult(@RequestBody Map<String, Object> body) {
//CustomAssert.checkHeader(header);
CustomAssert.checkField(body, CustomParamCollections.VEHICLE_SINGLE_PARAM);
CustomAssert.checkSimpleMapParam(body, CustomParamCollections.VEHICLE_SINGLE_PARAM);
Map<String, Object> colorAndBrand = specialtyServices.getColorAndBrand(body);
return colorAndBrand;
}
}