智慧保安后台管理-外网项目备份
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -66,6 +66,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.springframework.web.bind.annotation.*;
import sun.net.www.http.HttpClient;
@@ -100,6 +101,7 @@
   private final IInformationService informationService;
   private final IUserService userService;
   private final IAttachService attachService;
   private final MyAsyncService myAsyncService;
   /**
    * 详情
@@ -183,7 +185,8 @@
         "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
         + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
         "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
      FtpUtil.sqlFileUpload(s);
      //FtpUtil.sqlFileUpload(s);
      myAsyncService.FTP(s);
      return R.success("许可提交成功");
   }
@@ -203,9 +206,10 @@
      permit.setType("2");
      permit.setStorage("1");
      permit.setPermitime(new Date());
      permitService.save(permit);
      boolean save = permitService.save(permit);
      //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime());
      String overtime = new SimpleDateFormat("yyyy-MM-dd").format(permit.getOvertime());
      if (save) {
      String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," +
         "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
         "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" +
@@ -219,7 +223,8 @@
         "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
         + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
         "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
      FtpUtil.sqlFileUpload(s);
         myAsyncService.FTP(s);
      }
      //返回
      return R.data(permit);
   }
@@ -323,7 +328,8 @@
         user.setRoleId("1414575196264300546");
         user.setStatus(1);
         user.setIsDeleted(0);
         userService.save(user);
         boolean save = userService.save(user);
         if (save) {
         String roleid = "1415563428727328770";
         String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
            ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
@@ -349,14 +355,14 @@
            "," + "'" + information.getContacts() + "'" +
            "," + "'" + information.getContactscell() + "'" +
            "," + "'" + information.getCreateUserId() + "'" + ")";
         FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
         String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
            + "'" + dept.getTenantId() + "'" +
            "," + "'" + information.getEnterprisename() + "'" +
            "," + "'" + dept.getAncestors() + "'" +
            "," + "'" + dept.getDeptCategory() + "'" +
            "," + "'" + isDeleted + "'" + ")";
         FtpUtil.sqlFileUpload(ss);
            myAsyncService.FTP(ss);
         String rtime;
         String paperTime;
         if (user.getRtime() == null) {
@@ -415,24 +421,16 @@
            "," + "'" + user.getStatus() + "'" +
            "," + "'" + user.getIsDeleted() + "'" +
            "," + "'" + user.getDispatch() + "'" + ")";
         FtpUtil.sqlFileUpload(sss);
////         //注册用户
////         User user = new User();
////         user.setAccount(permit.getEnterprisename());
////         String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
////         user.setPassword(initPassword);
////         user.setRoleId("1414575196264300546");
////         user.setDeptId(information.getDepartmentid());
////         userService.saveOrUpdate(user);
//         //把附件添加单位id
//         attachService.updat(information.getDepartmentid(), permit.getCardid());
            myAsyncService.FTP(sss);
            //把附件添加单位id
         String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
            " " + "where id = " + "'" + permit.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }
      } else {
         String s1 = "update sys_permit set type = " + "'" + 1 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
            " " + "where id = " + "'" + permit.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      }
      return R.success("成功");
   }
@@ -460,6 +458,7 @@
   /**
    * 保安公司/培训学校许可设立详情(基本信息和附件列表信息)
    *
    * @param record
    * @return
    */
@@ -471,6 +470,7 @@
   /**
    * 许可备案集合信息
    *
    * @param record
    * @return
    */