Blame view

src/main/java/com/objecteye/controller/VehicleCurrencyController.java 5.05 KB
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
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
  package com.objecteye.controller;
  
  import com.alibaba.fastjson.JSONArray;
  import com.alibaba.fastjson.JSONObject;
  import com.objecteye.common.CommonResult;
  import com.objecteye.pojo.NameValue;
  import com.objecteye.pojo.PicVehicleDataResult;
  import com.objecteye.pojo.VehicleCurrencyReques;
  import com.objecteye.service.VehicleCurrencyService;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.*;
  import org.springframework.web.multipart.MultipartFile;
  
  import java.util.List;
  import java.util.Map;
  
  @CrossOrigin
  @RestController
  @RequestMapping("/vehicle")
  public class VehicleCurrencyController {
  
      @Autowired
      private VehicleCurrencyService vehicleCurrencyService;
  
      /**
       * 通过车牌(支持模糊)、多条件查询车辆信息(平铺)
       *
       * @param vehicleCurrencyReques
       * @return
       */
      @RequestMapping("/car/findByCondition")
      public CommonResult<JSONObject> findByCondition(@RequestBody VehicleCurrencyReques vehicleCurrencyReques) {
          JSONObject byCondition = vehicleCurrencyService.findByCondition(vehicleCurrencyReques);
          JSONArray row = byCondition.getJSONArray("row");
          if (row != null && row.size() > 0 && byCondition.getInteger("total") > 0) {
              return CommonResult.success(byCondition);
          } else if (row == null || row.size() == 0) {
              return CommonResult.success(201, "没有符合要求的数据", byCondition);
          } else {
              return CommonResult.success(byCondition, "数据异常");
          }
  
      }
  
      /**
       * 通过车辆图片以及其他条件查询车辆
       *
       * @param number
       * @param threshold
       * @param currentpage
       * @param pagevolume
       * @param picfile
       * @param starttime
       * @param endtime
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
55
56
57
58
59
60
       * @return
       */
      @RequestMapping("/car/findByPic")
      public CommonResult<PicVehicleDataResult> findByPic(@RequestParam int number, @RequestParam double threshold,
                                                          @RequestParam int currentpage, @RequestParam int pagevolume,
                                                          MultipartFile picfile, @RequestParam Long starttime,
fddd4673   Liu Haoyu   去掉设备相关内容;
61
                                                          @RequestParam Long endtime) throws InterruptedException {
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
62
          return vehicleCurrencyService.findVehicleByPic(number, threshold, currentpage, pagevolume, picfile, starttime,
fddd4673   Liu Haoyu   去掉设备相关内容;
63
                  endtime);
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
64
65
66
67
68
69
70
71
72
73
      }
  
      /**
       * 返回所有车辆类型的首字母
       * List<String> selectDisplayForInitials();
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleModelId")
      public CommonResult<List<String>> selectDisplayForInitials() {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
74
          return vehicleCurrencyService.selectDisplayForInitials();
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
75
76
77
78
79
80
81
82
83
84
85
      }
  
  
      /**
       * 根据首字母返回符合要求的车辆品牌
       * List<String> selectDisplayForBrand();
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleModelInitials")
      public CommonResult<List<String>> selectDisplayForBrand(@RequestBody Map<String, String> map) {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
86
          return vehicleCurrencyService.selectDisplayForBrand(map.get("vehicleModelInitials"));
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
87
88
89
90
91
92
93
94
95
96
97
      }
  
  
      /**
       * 根据车辆品牌返回符合要求的车辆子品牌
       * List<String> selectDisplayForSubbrand();
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleModelSubbrandByBrand")
      public CommonResult<List<String>> selectDisplayForSubbrand(@RequestBody Map<String, String> map) {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
98
          return vehicleCurrencyService.selectDisplayForSubbrand(map.get("vehicleModelBrand"));
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
99
100
101
102
103
104
105
106
107
108
      }
  
      /**
       * 根据车辆子品牌查询生产年限
       * List<String> selectDisplayForBirthday();
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleModelBirthdayBySubbrand")
      public CommonResult<List<String>> selectDisplayForBirthday(@RequestBody Map<String, String> map) {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
109
          return vehicleCurrencyService.selectDisplayForBirthday(map.get("vehicleModelSubbrand"));
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
110
111
112
113
114
115
116
117
118
119
      }
  
  
      /**
       * 返回所有车辆类型列表
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleTypeList")
      public CommonResult<List<String>> displayVehicleTypeList() {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
120
          return vehicleCurrencyService.displayVehicleTypeList();
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
121
122
123
124
125
126
127
128
129
      }
  
      /**
       * 返回所有车辆车身颜色列表
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleColorList")
      public CommonResult<List<NameValue>> displayVehicleColorList() {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
130
          return vehicleCurrencyService.displayVehicleColorList();
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
131
132
133
134
135
136
137
138
139
      }
  
      /**
       * 返回所有车辆号牌类型列表
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehiclePlateTypeList")
      public CommonResult<List<NameValue>> displayVehiclePlateTypeList() {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
140
          return vehicleCurrencyService.displayVehiclePlateTypeList();
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
141
142
143
144
145
146
147
148
149
      }
  
      /**
       * 返回所有车辆年检标个数列表
       *
       * @return
       */
      @RequestMapping("/vehicleBase/getVehicleNjbNumberList")
      public CommonResult<List<String>> displayVehicleNjbNumberList() {
40c853a1   Liu Haoyu   去掉MySQL相关内容, 去掉my...
150
          return vehicleCurrencyService.displayVehicleNjbNumberList();
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
151
152
      }
  }