智慧保安后台管理-外网
Administrator
2022-06-21 f61f487b258cf68b77ec9b9ddb0badfd94ce430b
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -295,16 +295,29 @@
   @ApiOperationSupport(order = 5)
   @ApiOperation(value = "修改", notes = "传入information")
   public R update(@Valid @RequestBody Information information) throws Exception {
      Information information1 = Objects.requireNonNull(BeanUtil.copy(information, Information.class));;
      Information information1 = Objects.requireNonNull(BeanUtil.copy(information, Information.class));
      StringBuilder builder = new StringBuilder();
      //敏感数据处理
      if (null!=information1.getRepresentativecell() && !information1.getRepresentativecell().equals("")) {
         information1.setRepresentativecell(DesensitizedUtil.desensitizedPhoneNumber(information1.getRepresentativecell()));
         //如果带 * 则不修改
         if (!information.getRepresentativecell().contains("*")){
            builder.append(",representativecell = " + "'" + information.getRepresentativecell() + "'");
         }
      }
      if (null!=information1.getContacts() && !information1.getContacts().equals("")) {
         information1.setContacts(DesensitizedUtil.desensitizedName(information1.getContacts()));
         //如果带 * 则不修改
         if (!information.getContacts().contains("*")){
            builder.append(",contacts = " + "'" + information.getContacts() + "'");
         }
      }
      if (null!=information1.getContactscell() && !information1.getContactscell().equals("")) {
         information1.setContactscell(DesensitizedUtil.desensitizedPhoneNumber(information1.getContactscell()));
         //如果带 * 则不修改
         if (!information.getContactscell().contains("*")){
            builder.append(",contactscell = " + "'" + information.getContactscell() + "'");
         }
      }
      boolean b = informationService.updateById(information1);
      if (b) {
@@ -328,11 +341,12 @@
         if (information.getEstablishtime() != null && !"".equals(information.getEstablishtime())) {
            format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
            builder.append(",establishTime = " + "'" + format + "'");
            //内网同步
            String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
               ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
               ",representative = " + "'" + information.getRepresentative() + "'" +
               ",establishTime = " + "'" + format + "'" +
               ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
               ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
               ",enterprises = " + "'" + information.getEnterprises() + "'" +
@@ -343,12 +357,12 @@
               ",industry = " + "'" + information.getIndustry() + "'" +
               ",departmentid = " + "'" + information.getDepartmentid() + "'" +
               ",stats = " + "'" + information.getStats() + "'" +
               ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
               ",contacts = " + "'" + information.getContacts() + "'" +
               ",contactscell = " + "'" + information.getContactscell() + "'" +
               builder.toString() +
               ",business_License = " + "'" + businessLicenses + "'" +
               ",licence = " + "'" + licences + "'" +
               " " + "where id = " + "'" + information.getId() + "'";
            //同步内网
            myAsyncService.FTP(s1);
         }else {
            //内网同步
            String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
@@ -364,13 +378,11 @@
               ",industry = " + "'" + information.getIndustry() + "'" +
               ",departmentid = " + "'" + information.getDepartmentid() + "'" +
               ",stats = " + "'" + information.getStats() + "'" +
               ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
               ",contacts = " + "'" + information.getContacts() + "'" +
               ",contactscell = " + "'" + information.getContactscell() + "'" +
               builder.toString() +
               ",business_License = " + "'" + businessLicenses + "'" +
               ",licence = " + "'" + licences + "'" +
               " " + "where id = " + "'" + information.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            //同步内网
            myAsyncService.FTP(s1);
         }
      }