智慧保安后台管理-外网项目备份
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -250,7 +250,8 @@
            user.setJurisdiction(one.getId().toString());
         }
         //新增
         userService.save(user);
         boolean stats = userService.save(user);
         if (stats) {
         //内网同步
         String s = "insert into blade_user(" +
            "id,tenant_id,code,account,password,real_name,phone,sex,role_id,dept_id," +
@@ -272,14 +273,15 @@
            "," + "'" + user.getIsDeleted() + "'" +
            "," + "'" + user.getJurisdiction() + "'"
            + ")";
         FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
         }
      }else {
         //修改
         User user1 = userService.getById(user.getId());
         user.setPassword(user1.getPassword());
         user.setUpdateTime(new Date());
         userService.updateById(user);
         boolean b = userService.updateById(user);
         if (b) {
         String s1 =
            "update blade_user set account = " + "'" + user.getAccount() + "'"
               + ",code = " + "'" + user.getCode() + "'"
@@ -292,7 +294,8 @@
               + ",cardid = " + "'" + user.getCardid() + "'"
               + ",guncode = " + "'" + user.getGuncode() + "'"
               + " " + "where id = " + "'" + user.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      }
      //返回
@@ -357,13 +360,14 @@
               dispatcherList.forEach(dispatcher1 -> {
                  dispatcher1.setStatus(1);
                  dispatcher1.setUpdateTime(new Date());
                  dispatcherService.updateById(dispatcher1);
                  boolean b = dispatcherService.updateById(dispatcher1);
                  if (b) {
                  String s1 =
                     "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
                        + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                        + " " + "where id = " + "'" + dispatcher1.getId() + "'";
                  FtpUtil.sqlFileUpload(s1);
                     myAsyncService.FTP(s1);
                  }
               });
            }
@@ -386,7 +390,8 @@
               String s1 =
                  "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
                     + " " + "where id = " + "'" + experience1.getId() + "'";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            }else {
               //新增
               if (null!=user.getRtime()){
@@ -402,8 +407,8 @@
               experience.setCardid(user.getCardid());
               experience.setSecurityid(user.getId().toString());
               //新增
               experienceService.save(experience);
               boolean save = experienceService.save(experience);
               if (save) {
               //内网同步
               String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " +
                  "values(" + "'" + experience.getId() + "'" +
@@ -415,20 +420,21 @@
                  "," + "'" + experience.getCompanyname() + "'" +
                  "," + "'" + experience.getSecurityid() + "'"
                  + ")";
               FtpUtil.sqlFileUpload(s);
                  myAsyncService.FTP(s);
               }
            }
            boolean status = userService.updateById(user);
            //qfqk 数据推送
            if (status){
               myAsyncService.updateUserByQfqk(user);
            }
            //内网更新
            String s1 =
               "update blade_user set status = " + "'" + user.getStatus() + "'"
                  + " " + "where id = " + "'" + user.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            }
            return R.success("修改成功");
         }
      }
@@ -512,7 +518,8 @@
               + ",guncode = " + "'" + user.getGuncode() + "'"
               + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
               + " " + "where id = " + "'" + user.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      } else {
         rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
         String s1 =
@@ -545,7 +552,8 @@
               + ",guncode = " + "'" + user.getGuncode() + "'"
               + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
               + " " + "where id = " + "'" + user.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      }
      return R.success("修改成功");
   }
@@ -617,13 +625,15 @@
            + ",hold = " + "'" + user.getHold() + "'"
            + ",cell = " + "'" + user.getCell() + "'"
            + " " + "where id = " + "'" + user.getId() + "'";
      FtpUtil.sqlFileUpload(s1);
      //FtpUtil.sqlFileUpload(s1);
      myAsyncService.FTP(s1);
      return R.success("修改成功");
   }
   /**
    * 指纹图片上传
    *
    * @return
    * @throws Exception
    */
@@ -723,7 +733,8 @@
               + " " + "where id = " + "'" + user.getId() + "';" +
            "update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
               " " + "where id = " + "'" + accreditationRecords1.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
         //返回
         return R.success("修改成功");
      }
@@ -733,7 +744,8 @@
            + ",user_type = " + "'" + user.getUserType() + "'"
            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
            + " " + "where id = " + "'" + user.getId() + "'";
      FtpUtil.sqlFileUpload(s1);
      //FtpUtil.sqlFileUpload(s1);
      myAsyncService.FTP(s1);
      return R.success("修改成功");
   }
@@ -757,7 +769,8 @@
         myAsyncService.deleteUserByQfqk(user1);
         //内网同步
         String s1 = "update blade_user set is_deleted = 1 where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      });
      return R.status(userService.removeUser(ids));
   }
@@ -1177,7 +1190,8 @@
                     String s1 = "update blade_user set status = " + user2.getStatus() +
                        ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'" +
                        " where id = " + "'" + user2.getId() + "'";
                     FtpUtil.sqlFileUpload(s1);
                     //FtpUtil.sqlFileUpload(s1);
                     myAsyncService.FTP(s1);
                     //人员离职后修改派遣记录,修改从业记录
                     updateUserDispatcherExp(user2);
@@ -1272,9 +1286,6 @@
      //1.群访群控数据推送(异步)
      if (status) {
         myAsyncService.qfqkUserSave(user);
      }
      //2.内网数据推送
      String s = "insert into blade_user(" +
         "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
@@ -1324,7 +1335,9 @@
         "," + "'" + experience.getCompanyname() + "'" +
         "," + "'" + experience.getSecurityid() + "'"
         + ")";
      FtpUtil.sqlFileUpload(s);
         myAsyncService.FTP(s);
      }
      //获取从业记录
//      List<Experience> experiences = (List<Experience>) userMap.get("userPractitionersInfo");
@@ -1346,6 +1359,7 @@
   /**
    * 修改派遣记录,修改从业记录
    *
    * @param user
    */
   private void updateUserDispatcherExp(User user) {
@@ -1365,7 +1379,8 @@
               "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
                  + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                  + " " + "where id = " + "'" + dispatcher1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         });
      }
@@ -1387,7 +1402,8 @@
         String s1 =
            "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
               + " " + "where id = " + "'" + experience1.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      }else {
         //新增
         if (null!=user.getRtime()){
@@ -1416,7 +1432,8 @@
            "," + "'" + experience.getCompanyname() + "'" +
            "," + "'" + experience.getSecurityid() + "'"
            + ")";
         FtpUtil.sqlFileUpload(s);
         //FtpUtil.sqlFileUpload(s);
         myAsyncService.FTP(s);
      }
   }
@@ -1448,6 +1465,7 @@
   /**
    * 用户详情
    *
    * @param user
    * @return
    */
@@ -1466,6 +1484,7 @@
   /**
    * 保安员导出
    *
    * @param response
    * @param user 查询条件
    */
@@ -1489,6 +1508,7 @@
   /**
    * 保安员账号校验
    *
    * @param user
    * @return
    */
@@ -1517,6 +1537,7 @@
   /**
    * 年龄分布查询
    *
    * @param user
    * @return
    */
@@ -1528,6 +1549,7 @@
   /**
    * 查询登录密码还是 123456 的单位信息
    *
    * @return
    */
   @GetMapping("/getNotUpdatePwdInfo")