智慧保安后台管理-外网
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/equipage/controller/fixed.java
@@ -13,9 +13,11 @@
import org.springblade.modules.location.service.LiveLocationService;
import org.springblade.modules.location.service.LocusService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
@@ -33,6 +35,8 @@
   private LocusService locusService;
   @Autowired
   private CarService carService;
   @Autowired
   private MyAsyncService myAsyncService;
   /**
    * 押运人员
@@ -111,7 +115,8 @@
                     "'" + liveLocation.getLongitude() + "'" + "," +
                     "'" + liveLocation.getLatitude() + "'" + "," +
                     "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            } else {
               status = liveLocationService.updateById(liveLocationInfo);
               //内网同步
@@ -122,7 +127,8 @@
                     ",latitude = " + "'" + liveLocationInfo.getLatitude() + "'" +
                     ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                     " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            }
         }
      }
@@ -164,8 +170,7 @@
         String track = jsonArray.getJSONObject(0).get("track").toString();
         if (track.equals("[]")){
            System.out.println("数据为空");
         }
         else {
         } else {
            JSONArray jsonArray1 = JSONArray.fromObject(track);
            for (int j = 0; j < jsonArray1.size(); j++) {
               String gis_jd = jsonArray1.getJSONObject(j).get("gis_jd").toString();
@@ -195,7 +200,8 @@
                  s1 += ";";
               }
            }
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }
   }
@@ -251,6 +257,7 @@
               if (null == liveLocationInfo) {
                  //新增
                  status = liveLocationService.save(liveLocation);
                  if (status) {
                  //数据推送
                  String s1 =
                     "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time) " +
@@ -260,10 +267,13 @@
                        "'" + liveLocation.getLongitude() + "'" + "," +
                        "'" + liveLocation.getLatitude() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                  FtpUtil.sqlFileUpload(s1);
                     //FtpUtil.sqlFileUpload(s1);
                     myAsyncService.FTP(s1);
                  }
               } else {
                  status = liveLocationService.updateById(liveLocationInfo);
                  //内网同步
                  if (status) {
                  String s1 =
                     "update sys_live_location set type = " + "'" + liveLocationInfo.getType() + "'" +
                        ",worker_id = " + "'" + liveLocationInfo.getWorkerId() + "'" +
@@ -271,7 +281,9 @@
                        ",latitude = " + "'" + liveLocationInfo.getLatitude() + "'" +
                        ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                        " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                  FtpUtil.sqlFileUpload(s1);
                     //FtpUtil.sqlFileUpload(s1);
                     myAsyncService.FTP(s1);
                  }
               }
            }
         } catch (Exception e) {