智慧保安后台管理-外网
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -36,6 +36,7 @@
import org.springblade.modules.desk.wrapper.NoticeWrapper;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@@ -60,6 +61,7 @@
   private final INoticeService noticeService;
   private final IDeptService iDeptService;
   private final MyAsyncService myAsyncService;
   /**
    * 详情
@@ -134,6 +136,7 @@
         //新增
         status = noticeService.save(notice);
         notice.setIsDeleted(0);
         if (status) {
         //数据同步
         String s1 =
            "insert into blade_notice(id,title,category,release_time,content,create_user,create_dept,create_time,is_deleted,dept_id,cover_url,type) " +
@@ -149,10 +152,13 @@
               "'" + notice.getDeptId() + "'" + "," +
               "'" + notice.getCoverUrl() + "'" + "," +
               "'" +notice.getType() + "'" + ")";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }else {
         //修改
         status = noticeService.updateById(notice);
         if (status) {
         //内网同步
         String s1 =
            "update blade_notice set title = " + "'" + notice.getTitle() + "'" +
@@ -167,7 +173,9 @@
               ",cover_url = " + "'" + notice.getCoverUrl() + "'" +
               ",type = " + "'" + notice.getType() + "'" +
               " " +"where id = " + "'" + notice.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }
      return R.status(status);
   }
@@ -184,7 +192,8 @@
      list.forEach(id ->{
         //内网同步
         String s1 = "delete from blade_notice where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      });
      boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
      return R.status(temp);