智慧保安后台管理-外网
Administrator
2022-05-06 3c1126fbff1aaed94a2e16c2ef98a03e36bf49f1
src/main/java/org/springblade/modules/recordLegalperson/controller/RecordLegalpersonController.java
@@ -26,6 +26,7 @@
import org.springblade.common.cache.ParamCache;
import org.springblade.common.config.FtpConfig;
import org.springblade.common.enums.DictEnum;
import org.springblade.common.utils.DesensitizedUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.log.exception.ServiceException;
@@ -33,20 +34,24 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DigestUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.record.entity.Record;
import org.springblade.modules.recordLegalperson.dto.RecordLegalpersonDTO;
import org.springblade.modules.recordLegalperson.entity.RecordLegalperson;
import org.springblade.modules.recordLegalperson.service.IRecordLegalpersonService;
import org.springblade.modules.recordLegalperson.vo.RecordLegalpersonVO;
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.resource.service.IAttachService;
import org.springblade.modules.system.entity.Dept;
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 javax.validation.Valid;
@@ -54,6 +59,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
@@ -75,6 +81,7 @@
   private final IInformationService informationService;
   private final IUserService userService;
   private final IAttachService attachService;
   private final MyAsyncService myAsyncService;
   /**
    * 详情
@@ -140,12 +147,27 @@
         String id = map.get("id").toString();
         recordService.removeByIds(Func.toLongList(id));
         String s1 = "delete from sys_record where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      }
      record.setStorage("1");
      record.setType("2");
      record.setPermitime(new Date());
      recordService.save(record);
      //脱敏处理
      RecordLegalperson record1 = Objects.requireNonNull(BeanUtil.copy(record, RecordLegalperson.class));
      //敏感数据处理
      if (null!=record1.getRepresentativecell() && !record1.getRepresentativecell().equals("")) {
         record1.setRepresentativecell(DesensitizedUtil.desensitizedPhoneNumber(record1.getRepresentativecell()));
      }
      if (null!=record1.getContacts() && !record1.getContacts().equals("")) {
         record1.setContacts(DesensitizedUtil.desensitizedName(record1.getContacts()));
      }
      if (null!=record1.getContactscell() && !record1.getContactscell().equals("")) {
         record1.setContactscell(DesensitizedUtil.desensitizedPhoneNumber(record1.getContactscell()));
      }
      recordService.save(record1);
      //String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
      //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
      String s = "insert into sys_record(id,representative," +
@@ -154,7 +176,7 @@
         "changecontacts," +
         "changecontactscell" +
         ")" +
         "values(" + "'" + record.getId() + "'" + "," +
         "values(" + "'" + record1.getId() + "'" + "," +
         "'" + record.getRepresentative() + "'" + "," + "'" +
         record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + record.getPtype() + "'" + "," +
         "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," + "'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + record.getJurisdiction() + "'" +
@@ -164,7 +186,8 @@
         "," + "'" + record.getChangecontacts() + "'" +
         "," + "'" + record.getChangecontactscell() + "'" +
         ")";
      FtpUtil.sqlFileUpload(s);
      //FtpUtil.sqlFileUpload(s);
      myAsyncService.FTP(s);
      return R.success("成功");
   }
@@ -222,7 +245,8 @@
                     "update sys_information set representative = " + "'" + information1.getRepresentative() + "'" +
                     ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                     " " + "where id = " + "'" + information1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         }else {
            //按组织机构查询
            Information information2 = new Information();
@@ -245,7 +269,8 @@
                  "update sys_information set representative = " + "'" + information1.getRepresentative() + "'" +
                  ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                  " " + "where id = " + "'" + information1.getId() + "'";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            }else {
               //设置未审核不通过
               record.setType("1");
@@ -255,7 +280,8 @@
               String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                  ",approve = " + "'" + record.getApprove() + "'" +
                  " " + "where id = " + "'" + record.getId() + "'";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
               throw new ServiceException("当前公司单位未保安服务系统存在,请先注册!");
            }
         }
@@ -268,7 +294,8 @@
         String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
            ",approve = " + "'" + record.getApprove() + "'" +
            " " + "where id = " + "'" + record.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      }
      //返回数据
      return R.status(status);