Blame view

src/main/java/com/objecteye/controller/VehicleFileController.java 3.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
  package com.objecteye.controller;
  
  import com.objecteye.common.CommonResult;
  import com.objecteye.entity.*;
  import com.objecteye.service.IVehicleFileService;
  import io.swagger.annotations.Api;
  import io.swagger.annotations.ApiOperation;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.*;
  import org.springframework.web.multipart.MultipartFile;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * 一车一档 controller
   */
  @RestController
  @Api(tags = "VehicleFileController", description = "一车一档")
  @RequestMapping("/vehicleFiles")
  @CrossOrigin
  public class VehicleFileController {
      @Autowired
      private IVehicleFileService iVehicleFileService;
  
      @ApiOperation("档案浏览查询(分页)")
      @RequestMapping(value = "fileQueryByPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult fileQueryByPage(@RequestBody VehicleFileParam vehicleFileParam) {
          PageResult pageResult = iVehicleFileService.fileQueryByPage(vehicleFileParam);
          return pageResult.getRow().size() > 0 ? CommonResult.success(pageResult) : CommonResult.success(201, "没有符合要求的值", new PageResult<>());
      }
  
      @ApiOperation("档案浏览查询(不分页)")
      @RequestMapping(value = "fileQuery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult fileQuery(@RequestBody VehicleFileParam vehicleFileParam) {
          List<VvehicleFileQueryResult> resultList = iVehicleFileService.fileQuery(vehicleFileParam);
          return resultList.size() > 0 ? CommonResult.success(resultList) : CommonResult.success(201, "没有符合要求的值", new ArrayList<>());
      }
  
      @ApiOperation("车牌搜档(分页)")
      @RequestMapping(value = "plateNumberQueryByPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult plateNumberQueryByPage(@RequestBody VehicleFilePlateNumParam vehicleFilePlateNumParam) {
          PageResult pageResult = iVehicleFileService.plateNumberQueryByPage(vehicleFilePlateNumParam);
          return pageResult.getRow().size() > 0 ? CommonResult.success(pageResult) : CommonResult.success(201, "没有符合要求的值", new PageResult<>());
      }
  
      @ApiOperation("车牌搜档(不分页)")
      @RequestMapping(value = "plateNumberQuery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult plateNumberQuery(@RequestBody VehicleFilePlateNumParam vehicleFilePlateNumParam) {
          List<VvehicleFilePlateNumberQueryResult> resultList = iVehicleFileService.plateNumberQuery(vehicleFilePlateNumParam);
          return resultList.size() > 0 ? CommonResult.success(resultList) : CommonResult.success(201, "没有符合要求的值", new ArrayList<>());
      }
  
      @ApiOperation("以图搜档")
      @RequestMapping(value = "picQuery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult picQuery(int gcxh, MultipartFile multipartFile) {
          VvehicleFilePicQueryResult picQueryResult = iVehicleFileService.picQuery(gcxh, multipartFile);
          return null == picQueryResult ? CommonResult.success(201, "没有符合要求的值", new VvehicleFilePicQueryResult()) : CommonResult.success(picQueryResult);
      }
  
      @ApiOperation("司机信息")
      @RequestMapping(value = "driverFiles", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult driverFiles(@RequestBody VehicleFilePlateNumParam vehicleFilePlateNumParam) {
          PageResult pageResult = iVehicleFileService.driverFiles(vehicleFilePlateNumParam);
          return pageResult.getRow().size() > 0 ? CommonResult.success(pageResult) : CommonResult.success(201, "驾驶人信息努力获取中", new PageResult<>());
      }
  }