Blame view

src/main/java/com/objecteye/controller/HumanVehicleAssociationController.java 3.95 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
  package com.objecteye.controller;
  
  import com.objecteye.common.CommonResult;
  import com.objecteye.entity.PageResult;
  import com.objecteye.pojo.FaceInfoParam;
  import com.objecteye.pojo.SearchPeopleOfHphmInfo;
  import com.objecteye.pojo.SearchPeopleOfHphmRequest;
  import com.objecteye.pojo.SearchPeopleOfhphmResult;
  import com.objecteye.service.HumanVehicleAssociationService;
  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.List;
  
  /**
   * 人车关联类
   */
  @RestController
  @RequestMapping("/HumanVehicle")
  @Api(tags = "HumanVehicleAssociationController", description = "人车关联类")
  @CrossOrigin
  public class HumanVehicleAssociationController {
  
      @Autowired
      private HumanVehicleAssociationService humanVehicleAssociationService;
  
      @ApiOperation("以人搜车")
      @RequestMapping(value = "/hvAssociation/searchVehicleFromHuman", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
fddd4673   Liu Haoyu   去掉设备相关内容;
32
      public CommonResult searchVehicleFromHuman(@RequestParam Long starttime, @RequestParam Long endtime, @RequestParam Float thresholds, @RequestParam int currentpage, @RequestParam int pagevolume, MultipartFile picfile) {
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
33
          try {
fddd4673   Liu Haoyu   去掉设备相关内容;
34
              PageResult pageResult = humanVehicleAssociationService.searchVehicleFromHuman(starttime, endtime, thresholds, currentpage, pagevolume, picfile);
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
              if (pageResult == null || pageResult.getRow().size() == 0) {
                  return CommonResult.success(201, "没有符合要求的数据", null);
              }
              return CommonResult.success(pageResult, "数据查询成功!!");
          } catch (Exception e) {
              e.printStackTrace();
              return CommonResult.failed();
          }
  
      }
  
      @ApiOperation("以车牌搜人")
      @RequestMapping(value = "/hvAssociation/searchPeopleFromHphm", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult searchPeopleFromHphm(@RequestBody SearchPeopleOfHphmRequest searchPeopleOfHphmRequest) {
          try {
fddd4673   Liu Haoyu   去掉设备相关内容;
50
              SearchPeopleOfhphmResult searchPeopleOfhphmResult = humanVehicleAssociationService.searchPeopleFromHphm(searchPeopleOfHphmRequest.getStarttime(), searchPeopleOfHphmRequest.getEndtime(), searchPeopleOfHphmRequest.getCurrentpage(),
c83b5b39   Liu Haoyu   项目创建, 集成spring-se...
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
                      searchPeopleOfHphmRequest.getPagevolume(), searchPeopleOfHphmRequest.getHphm());
              List<SearchPeopleOfHphmInfo> row = searchPeopleOfhphmResult.getRow();
              if (row == null || row.size() == 0) {
                  return CommonResult.success(201, "没有符合要求的数据", searchPeopleOfhphmResult);
              }
              return CommonResult.success(searchPeopleOfhphmResult, "数据查询成功!!");
          } catch (Exception e) {
              e.printStackTrace();
              return CommonResult.failed();
          }
      }
  
      @ApiOperation("以车辆图片搜人")
      @RequestMapping(value = "/hvAssociation/searchPeopleFromVehiclePic", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
      public CommonResult searchPeopleFromVehiclePic(@RequestParam int number, @RequestParam double threshold, @RequestParam int currentpage,
                                                     @RequestParam int pagevolume, @RequestParam MultipartFile picfile) {
          try {
              List<FaceInfoParam> faceInfoParam = humanVehicleAssociationService.searchPeopleOfVehiclePic(number, threshold, currentpage, pagevolume, picfile);
              if (faceInfoParam == null || faceInfoParam.size() == 0) {
                  return CommonResult.success(201, "没有符合要求的数据", faceInfoParam);
              }
              return CommonResult.success(faceInfoParam, "数据查询成功!!");
          } catch (Exception e) {
              e.printStackTrace();
              return CommonResult.failed();
          }
      }
  }