智慧保安后台管理-外网
Administrator
2022-06-16 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java
@@ -13,6 +13,7 @@
import org.springblade.modules.equipage.service.GunService;
import org.springblade.modules.equipage.vo.GunVo;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -29,6 +30,8 @@
   @Autowired
   private IUserDeptService userDeptService;
   @Autowired
   private  MyAsyncService myAsyncService;
   /**
     * 枪支分页信息
@@ -77,21 +80,39 @@
               throw new ServiceException("导入失败!公司名:["+gunExcel.getDeptId()+"]不存在!");
            }
            //脱敏处理
            Gun gun1 = Objects.requireNonNull(BeanUtil.copy(gun, Gun.class));
            gun1.setCardNumber("***");
            gun1.setIssueTime(null);
            gun1.setValidTime(null);
            if (null!=gun1.getIssueUnit() && !gun1.getIssueUnit().equals("")){
               gun1.setIssueUnit("***");
            }
            if (null!=gun1.getGunMode() && !gun1.getGunMode().equals("")){
               gun1.setGunMode("***");
            }
            if (null!=gun1.getPersonInCharge() && !gun1.getPersonInCharge().equals("")){
               gun1.setPersonInCharge("***");
            }
            if (null!=gun1.getCardNo() && !gun1.getCardNo().equals("")){
               gun1.setCardNo("***");
            }
            //新增车辆数据
            this.save(gun);
            this.save(gun1);
            //数据同步
            String s1 =
               "insert into sys_gun(id,issue_unit,card_number,gun_mode," +
                  "dept_id,person_in_charge,card_no) " +
                  "values(" + "'" + gun.getId() + "'" + "," +
                  "values(" + "'" + gun1.getId() + "'" + "," +
                  "'" + gun.getIssueUnit() + "'" + "," +
                  "'" + gun.getCardNumber() + "'" + "," +
                  "'" + gun.getGunMode() + "'" + "," +
                  "'" + gun.getDeptId() + "'" + "," +
                  "'" + gun.getPersonInCharge() + "'" + "," +
                  "'" +gun.getCardNo() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
         });
      }else {