|
@@ -3,7 +3,9 @@ package com.jpsoft.bus.modules.bus.controller;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.bus.config.OSSConfig;
|
|
|
import com.jpsoft.bus.modules.bus.entity.CompanyInfo;
|
|
|
+import com.jpsoft.bus.modules.bus.entity.GpsDataInfo;
|
|
|
import com.jpsoft.bus.modules.bus.service.CompanyInfoService;
|
|
|
+import com.jpsoft.bus.modules.bus.service.GpsDataInfoService;
|
|
|
import com.jpsoft.bus.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.bus.modules.common.dto.Sort;
|
|
|
import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
|
|
@@ -21,6 +23,7 @@ import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -48,6 +51,9 @@ public class VehicleInfoController {
|
|
|
@Autowired
|
|
|
private CompanyInfoService companyInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GpsDataInfoService gpsDataInfoService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<VehicleInfo> create(){
|
|
@@ -363,4 +369,43 @@ public class VehicleInfoController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("gpsHistoryList")
|
|
|
+ public MessageResult<Map> gpsHistoryList(
|
|
|
+ String deviceNo,
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestAttribute String subject){
|
|
|
+
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<Map>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ searchParams.put("deviceNo",deviceNo);
|
|
|
+
|
|
|
+ if(startTime != null) {
|
|
|
+ searchParams.put("startTime", startTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(endTime != null) {
|
|
|
+ searchParams.put("endTime", endTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
+
|
|
|
+ if (pageSize>100){
|
|
|
+ pageSize = 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<GpsDataInfo> page = gpsDataInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
}
|