guoyong 4 лет назад
Родитель
Сommit
991f6a0b44
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      src/main/java/com/aoyang/tms/controller/WorkerController.java

+ 7 - 4
src/main/java/com/aoyang/tms/controller/WorkerController.java

@@ -82,17 +82,20 @@ public class WorkerController {
             return new Result(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
             return new Result(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
         }
         }
         WorkOrderVO vo = new WorkOrderVO();
         WorkOrderVO vo = new WorkOrderVO();
-        WorkOrder workerInfo1 = workOrderService.getById(workOrder.getId());
-        if (workerInfo1 != null) {
+        WorkOrder workOrder1 = workOrderService.getById(workOrder.getId());
+        if (workOrder1 != null) {
+            BeanUtils.copyProperties(workOrder1, vo);
+
             //取ExecuteTime第一条GPS上报时间作为开始运单时间,累计用时
             //取ExecuteTime第一条GPS上报时间作为开始运单时间,累计用时
-            LocationVO locationVO = commonService.getLocationByDate(workerInfo1.getTruckId(), workerInfo1.getExecuteTime());
+            LocationVO locationVO = commonService.getLocationByDate(workOrder1.getTruckId(), workOrder1.getExecuteTime());
             if (locationVO != null) {
             if (locationVO != null) {
                 vo.setTime(DateUtils.betweenTime(locationVO.getDate(), LocalDateTime.now()));
                 vo.setTime(DateUtils.betweenTime(locationVO.getDate(), LocalDateTime.now()));
+                vo.setLatitude(locationVO.getLatitude());
+                vo.setLongitude(locationVO.getLongitude());
             }
             }
             List<String> routeGps = commonService.getLocationtrip(workOrder.getTruckId(), workOrder.getGotoSpotTime(), LocalDateTime.now());
             List<String> routeGps = commonService.getLocationtrip(workOrder.getTruckId(), workOrder.getGotoSpotTime(), LocalDateTime.now());
             vo.setRouteGps(routeGps);
             vo.setRouteGps(routeGps);
         }
         }
-        BeanUtils.copyProperties(workerInfo1, vo);
 
 
         return new Result<>(vo);
         return new Result<>(vo);
     }
     }