智慧保安后台管理-外网项目备份
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
@@ -14,6 +14,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.workreport.entity.WorkReport;
import org.springblade.modules.workreport.service.WorkReportService;
import org.springblade.modules.workreport.vo.WorkReportVo;
@@ -42,9 +43,11 @@
   private final IUserService userService;
   private final IDeptService deptService;
   private final MyAsyncService myAsyncService;
   /**
    * 自定义分页
    *
    * @param query page,size
    * @param workReport 工作汇报信息对象
    */
@@ -62,6 +65,7 @@
   /**
    * 自定义分页--接收到的汇报信息page
    *
    * @param query page,size
    * @param workReport 工作汇报信息对象
    */
@@ -73,6 +77,7 @@
   /**
    * 新增
    *
    * @param workReport 工作汇报信息对象
    */
   @PostMapping("/save")
@@ -83,6 +88,7 @@
   /**
    * 修改
    *
    * @param workReport 工作汇报信息对象
    */
   @PostMapping("/update")
@@ -92,6 +98,7 @@
   /**
    * 新增或修改
    *
    * @param workReport 工作汇报信息对象
    */
   @PostMapping("/submit")
@@ -102,7 +109,7 @@
         workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
         //新增
         status = workReportService.save(workReport);
         if (status) {
         //数据同步
         String s1 =
            "insert into sys_work_report(id,type,content,work_desc,report_time,received_ids,dept_id,reply_dept_ids,category,user_id) " +
@@ -116,7 +123,9 @@
               "'" + workReport.getReplyDeptIds() + "'" + "," +
               "'" + workReport.getCategory() + "'" + "," +
               "'" +workReport.getUserId() + "'" + ")";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }else {
         workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
         if (null==workReport.getReplyTime()){
@@ -125,7 +134,7 @@
         //修改
         status = workReportService.updateById(workReport);
         if (status) {
         //内网同步
         String s1 =
            "update sys_work_report set type = " + "'" + workReport.getType() + "'" +
@@ -139,13 +148,16 @@
               ",category = " + "'" + workReport.getCategory() + "'" +
               ",user_id = " + "'" + workReport.getUserId() + "'" +
               " " +"where id = " + "'" + workReport.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }
      return R.status(status);
   }
   /**
    * 删除
    *
    * @param ids 工作汇报信息ids 数组
    */
   @PostMapping("/remove")
@@ -155,13 +167,15 @@
      list.forEach(id ->{
         //内网同步
         String s1 = "delete from sys_work_report where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      });
      return R.status(workReportService.removeByIds(Func.toLongList(ids)));
   }
   /**
    * 详情
    *
    * @param workReport 工作汇报信息对象
    */
   @GetMapping("/detail")
@@ -177,6 +191,7 @@
   /**
    * 获取接收人的单位信息
    *
    * @param detail 汇报详情
    * @return
    */
@@ -204,6 +219,7 @@
   /**
    * 获取接收人的单位id(dept)信息
    *
    * @param
    * @return
    */