智慧保安后台管理-外网
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/equipage/controller/CarController.java
@@ -20,6 +20,7 @@
import org.springblade.modules.equipage.excel.CarImporter;
import org.springblade.modules.equipage.service.CarService;
import org.springblade.modules.equipage.vo.CarVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -42,9 +43,11 @@
public class CarController {
   private final CarService carService;
   private final MyAsyncService myAsyncService;
   /**
    * 自定义分页
    *
    * @param query page,size
    * @param car 车辆信息对象
    */
@@ -56,6 +59,7 @@
   /**
    * 新增
    *
    * @param car 车辆信息对象
    */
   @PostMapping("/save")
@@ -66,6 +70,7 @@
   /**
    * 修改
    *
    * @param car 车辆信息对象
    */
   @PostMapping("/update")
@@ -75,6 +80,7 @@
   /**
    * 新增或修改
    *
    * @param car 车辆信息对象
    */
   @PostMapping("/submit")
@@ -84,7 +90,7 @@
         car.setDateForProduction(new Date());
         //新增
         status = carService.save(car);
         if (status) {
         //数据同步
         String s1 =
            "insert into sys_car(id,car_number,number_type,car_type,dept_id," +
@@ -100,10 +106,14 @@
               "'" + car.getUmweltsatz() + "'" + "," +
               "'" + car.getMode() + "'" + "," +
               "'" +car.getJurisdiction() + "'" + ")";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }else {
         //修改
         status = carService.updateById(car);
         if (status) {
         //内网同步
         String s1 =
            "update sys_car set car_number = " + "'" + car.getCarNumber() + "'" +
@@ -117,13 +127,16 @@
               ",mode = " + "'" + car.getMode() + "'" +
               ",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
               " " +"where id = " + "'" + car.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }
      return R.status(status);
   }
   /**
    * 删除
    *
    * @param ids 车辆信息ids 数组
    */
   @PostMapping("/remove")
@@ -133,13 +146,15 @@
      list.forEach(id ->{
         //内网同步
         String s1 = "delete from sys_car where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      });
      return R.status(carService.removeByIds(Func.toLongList(ids)));
   }
   /**
    * 详情
    *
    * @param car 车辆信息对象
    */
   @GetMapping("/detail")