Administrator
2022-06-16 66979951781551f5acbcbf55f81b2a6da061bf04
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -16,6 +16,7 @@
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.MyAsyncService;
import org.springblade.modules.accreditation.entity.AccreditationRecords;
import org.springblade.modules.accreditation.excel.ExportSecurityBookPaperExcel;
import org.springblade.modules.accreditation.excel.ExportSecurityPaperExcel;
@@ -51,6 +52,8 @@
   private final AccreditationRecordsService accreditationRecordsService;
   private final IUserService userService;
   private final MyAsyncService myAsyncService;
   /**
    * 自定义分页
@@ -125,7 +128,36 @@
            user.setUpdateTime(new Date());
            //更新
            userService.updateById(user);
            //外网同步
            String s =
               "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                  ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                  ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                  ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                  "where id = " + "'" + accreditationRecords.getId() + "';" +
                  "update blade_user set user_type = " + user.getUserType() + "" +
                  ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                  "where id = " + "'" + user.getId() + "'";
            myAsyncService.FTP(s);
         }else {
            //外网同步
            String s =
               "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                  ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                  ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                  ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                  "where id = " + "'" + accreditationRecords.getId() + "'";
            myAsyncService.FTP(s);
         }
      }else {
         //外网同步
         String s =
            "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
               ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
               ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
               ",audit_user = " + accreditationRecords.getAuditUser() + " " +
               "where id = " + "'" + accreditationRecords.getId() + "'";
         myAsyncService.FTP(s);
      }
      //返回
      return R.status(b);
@@ -156,7 +188,36 @@
               user.setUpdateTime(new Date());
               //更新
               userService.updateById(user);
               //外网同步
               String s =
                  "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                     ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                     ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                     ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                     "where id = " + "'" + accreditationRecords.getId() + "';" +
                     "update blade_user set user_type = " + user.getUserType() + "" +
                     ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                     "where id = " + "'" + user.getId() + "'";
               myAsyncService.FTP(s);
            }else {
               //外网同步
               String s =
                  "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                     ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                     ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                     ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                     "where id = " + "'" + accreditationRecords.getId() + "'";
               myAsyncService.FTP(s);
            }
         }else {
            //外网同步
            String s =
               "update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
                  ",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
                  ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                  ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                  "where id = " + "'" + accreditationRecords.getId() + "'";
            myAsyncService.FTP(s);
         }
      });
      //返回
@@ -311,7 +372,7 @@
//      titleRow.createCell(1).setCellValue("员工照片");
      HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
      //如果总数小于等于7
      if (list.size()<=7){
      if (list.size()<=6){
         HSSFRow row = sheet.createRow(0);
         row.setHeight((short) 1980);
@@ -365,7 +426,7 @@
         int rowNum = -2;
         for (int i = 0; i < list.size(); i++) {
            //每次从集合中读取7个对象,求余数
            if (i != 0 && (i + 1) % 7 == 0) {
            if (i != 0 && (i + 1) % 6 == 0) {
               excelList.add(list.get(i));
               rowNum = rowNum + 2;
               //写入表格