| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IUserDeptService userDeptService; |
| | | @Autowired |
| | | private MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 枪支分页信息 |
| | |
| | | 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 { |