package com.objecteye.controller; import com.objecteye.common.CommonResult; import com.objecteye.entity.LocusOrbitQueryParams; import com.objecteye.entity.LocusOrbitResultParams; import com.objecteye.entity.PageResult; import com.objecteye.service.ILocusOrbitService; 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; /** * 轨迹分析 * * @author liuhaoyu */ @RestController @RequestMapping("locusOrbit") @Api(tags = "LocusOrbitController", description = "轨迹分析") @CrossOrigin public class LocusOrbitController { @Autowired private ILocusOrbitService locusOrbitService; /** * 轨迹分析接口 * * @param locusOrbitQueryParams 请求参数模型 * @return 结果集 */ @PostMapping("locusOrbitAnalysis") @ResponseBody @ApiOperation("轨迹分析接口") public CommonResult locusOrbitByPlateNumber(@RequestBody LocusOrbitQueryParams locusOrbitQueryParams) { List resultList = locusOrbitService.locusOrbitByPlateNumber(locusOrbitQueryParams); if (resultList.size() > 0) { return CommonResult.success(resultList); } else { return CommonResult.success(201, "没有符合要求的值", new ArrayList<>()); } } /** * 轨迹分析页面列表 * * @param startTime 开始时间 * @param endTime 结束时间 * @param plateNumber 车牌号 * @param currentpage 页码 * @param pagevolume 页面容量 * @return 结果集 */ @PostMapping("locusOrbitTableByPlateNumber") @ResponseBody @ApiOperation("轨迹分析页面列表") public CommonResult locusOrbitTableByPlateNumber(@RequestParam Integer currentpage, @RequestParam Integer pagevolume, @RequestParam Long startTime, @RequestParam Long endTime, @RequestParam String plateNumber) { LocusOrbitQueryParams queryParams = new LocusOrbitQueryParams(); queryParams.setPlateNumber(plateNumber); queryParams.setStartTime(startTime); queryParams.setEndTime(endTime); PageResult pageResult = locusOrbitService.locusOrbitTableByPlateNumber(queryParams, currentpage, pagevolume); if (pageResult.getRow().size() > 0) { return CommonResult.success(pageResult); } else { return CommonResult.success(201, "没有符合要求的值", new PageResult<>()); } } /** * 轨迹分析接口(图片搜索) * * @param gcxh 车辆序号 * @param customsPass 地区id, 设备id, 自行判断是地区的还是设备的 * @param startTime 起始时间戳 * @param endTime 结束时间戳 * @param multipartFile 文件信息 * @return 结果集 */ @PostMapping("locusOrbitAnalysisByFile") @ResponseBody @ApiOperation("轨迹分析接口") public CommonResult locusOrbitByPlateNumber(int gcxh, Integer customsPass, Long startTime, Long endTime, MultipartFile multipartFile) { LocusOrbitQueryParams queryParams = new LocusOrbitQueryParams(customsPass, startTime, endTime, null); List resultList = locusOrbitService.locusOrbitByPlateNumber(gcxh, queryParams, multipartFile); return resultList.size() > 0 ? CommonResult.success(resultList) : CommonResult.success(201, "没有符合要求的值", new ArrayList<>()); } }