소스 검색

站点校正增加日志。

zhengqiang 4 년 전
부모
커밋
d8751e76ff
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java

+ 12 - 1
web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java

@@ -1081,7 +1081,7 @@ public class DriverApiController {
 
     @PostMapping("updateCurrentStation")
     @ApiOperation(value="更新当前站点")
-    public MessageResult<String> updateCurrentStation(String currentStationId,@RequestAttribute String subject){
+    public MessageResult<String> updateCurrentStation(String currentStationId,@RequestAttribute String subject,HttpServletRequest request){
         MessageResult<String> messageResult = new MessageResult<>();
 
         try {
@@ -1098,6 +1098,17 @@ public class DriverApiController {
             ShiftInfo shiftInfo = shiftInfoList.get(0);
             StationInfo currentStation = stationInfoService.get(currentStationId);
 
+            //记录当前站点的校正记录,以便用来记录站点定位
+            if(currentStation!=null){
+                SysLog sysLog = new SysLog();
+                sysLog.setPointcut("站点校正");
+                sysLog.setData("车牌号:" + vehicleInfo.getLicensePlateNumber() + ",经纬度:" +  vehicleInfo.getLongitude() + "." + vehicleInfo.getLatitude());
+                sysLog.setRemark("当前站点:" + currentStation.getName() + ",id=" + currentStationId);
+                sysLog.setRemoteIp(HttpUtil.getIpAddress(request));
+                sysLog.setCreateTime(new Date());
+                logService.insert(sysLog);
+            }
+
             //改gps后,会自动修改当前站点,只能往后改
             if(currentStation.getLongitude()!=null && currentStation.getLatitude()!=null) {
                 gpsDataCallback.receive(vehicleInfo.getGpsDeviceNo(),