智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java
@@ -21,16 +21,13 @@
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.dispatcher.entity.DispatcherUnit;
import org.springblade.modules.dispatcher.service.IDispatcherUnitService;
import org.springblade.modules.system.entity.User;
@@ -165,7 +162,7 @@
            "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
            " " + "where id = " + "'" + user.getId() + "'";
      //FtpUtil.sqlFileUpload(s1);
      myAsyncService.FTP(s1);
      myAsyncService.dataSync(s1);
      return R.status(status);
   }
@@ -205,8 +202,7 @@
                  "'" + dispatcher.getStatus() + "'" + ");" +
                  "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                  " " + "where id = " + "'" + user.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
         }
      } else {
         dispatcher.setUpdateTime(new Date());
@@ -255,7 +251,7 @@
                     "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                     " " + "where id = " + "'" + user1.getId() + "'";
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               myAsyncService.dataSync(s1);
            }
         } else {
            //没有修改保安员,只修改了派遣时间等信息
@@ -274,7 +270,7 @@
                     ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                     " " + "where id = " + "'" + dispatcher.getId() + "'";
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               myAsyncService.dataSync(s1);
            }
         }
      }
@@ -336,8 +332,7 @@
                           "'" + dispatcher.getStatus() + "'" + ");" +
                           "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                           " " + "where id = " + "'" + user.getId() + "'";
                     //FtpUtil.sqlFileUpload(s1);
                     myAsyncService.FTP(s1);
                     myAsyncService.dataSync(s1);
                  }
               } else {
                  User user = new User();
@@ -363,7 +358,7 @@
                        "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                  //FtpUtil.sqlFileUpload(s1);
                  myAsyncService.FTP(s1);
                  myAsyncService.dataSync(s1);
               }
            } else {
               User user = new User();
@@ -388,8 +383,7 @@
                     "'" + dispatcher.getStatus() + "'" + ");" +
                     "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                     " " + "where id = " + "'" + user.getId() + "'";
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               myAsyncService.dataSync(s1);
            }
         });
@@ -466,7 +460,7 @@
                        "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                        " " + "where id = " + "'" + user1.getId() + "'";
                  //FtpUtil.sqlFileUpload(s1);
                  myAsyncService.FTP(s1);
                  myAsyncService.dataSync(s1);
               }
            } else {
               //修改原保安人员的派遣状态
@@ -511,7 +505,7 @@
                     "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                     " " + "where id = " + "'" + user1.getId() + "'";
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               myAsyncService.dataSync(s1);
            }
         } else {
            //修改原保安人员的派遣状态
@@ -556,7 +550,7 @@
                  "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                  " " + "where id = " + "'" + user1.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
         }
      } else {
         if (null != dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
@@ -585,7 +579,7 @@
                        ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + dispatcher.getId() + "'";
                  //FtpUtil.sqlFileUpload(s1);
                  myAsyncService.FTP(s1);
                  myAsyncService.dataSync(s1);
               }
            } else {
               //没有修改保安员,只修改了派遣时间等信息
@@ -604,7 +598,7 @@
                     ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                     " " + "where id = " + "'" + dispatcher.getId() + "'";
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               myAsyncService.dataSync(s1);
            }
         } else {
            //没有修改保安员,只修改了派遣时间等信息
@@ -623,7 +617,7 @@
                  ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                  " " + "where id = " + "'" + dispatcher.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
         }
      }
      return R.status(status);
@@ -643,7 +637,7 @@
         //内网同步
         String s1 = "delete from sys_dispatcher where id = " + "'" + id + "'";
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
         myAsyncService.dataSync(s1);
      });
      return R.status(dispatcherService.removeByIds(Func.toLongList(ids)));
   }