| | |
| | | import net.sf.json.JSONObject; |
| | | import org.apache.commons.codec.Charsets; |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.config.FileConfig; |
| | | import org.springblade.common.config.FtpConfig; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.common.excel.CustomCellWriteHeightConfig; |
| | |
| | | } |
| | | |
| | | //判断是否持证 |
| | | // if (user.getHold().equals("1") && null!=user.getSecuritynumber() && !user.getSecuritynumber().equals("")){ |
| | | // //持证,校验保安证编号是否合法 |
| | | // SecurityPaper securityPaper = new SecurityPaper(); |
| | | // securityPaper.setIdCardNo(user.getCardid()); |
| | | // List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper)); |
| | | // if (securityPaperList.size()>0){ |
| | | // boolean status = false; |
| | | // //遍历 |
| | | // for (SecurityPaper paper : securityPaperList) { |
| | | // if (paper.getNumber().equals(user.getSecuritynumber())){ |
| | | // status = true; |
| | | // } |
| | | // } |
| | | // if (!status){ |
| | | // throw new ServiceException("保安证编号不匹配,请核实!"); |
| | | // } |
| | | // }else { |
| | | // throw new ServiceException("保安证编号不匹配,请核实!"); |
| | | // } |
| | | // } |
| | | boolean states = false; |
| | | if (user.getHold().equals("1") && null!=user.getSecuritynumber() && !user.getSecuritynumber().equals("")){ |
| | | //持证,校验保安证编号是否合法 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper)); |
| | | if (securityPaperList.size()>0){ |
| | | //遍历 |
| | | for (SecurityPaper paper : securityPaperList) { |
| | | if (paper.getNumber().equals(user.getSecuritynumber())){ |
| | | states = true; |
| | | } |
| | | } |
| | | if (!states){ |
| | | user.setHold("2"); |
| | | // throw new ServiceException("保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!"); |
| | | } |
| | | }else { |
| | | // throw new ServiceException("保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!"); |
| | | states = false; |
| | | user.setHold("2"); |
| | | } |
| | | } |
| | | if (user.getHold().equals("2")){ |
| | | states = true; |
| | | } |
| | | |
| | | //如果是离职 |
| | | if (null != user.getStatus()) { |
| | |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | return R.success("修改成功"); |
| | | if (!states) { |
| | | return R.data(201,null,"保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!"); |
| | | } |
| | | return R.data(200,null,"修改成功!"); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://223.82.109.183:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | //外围url |
| | | String urls = "http://223.82.109.183:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/zhba/" + newName; |
| | | //内网 |
| | | String inUrl = FtpConfig.ip + "/zhba/" + newName; |
| | | //返回 |
| | |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "导入用户", notes = "传入excel") |
| | | public R importSecurityTest(MultipartFile file, Integer isCovered, String deptId) { |
| | | SecurityImporterTest securityImporter = new SecurityImporterTest(userService, false, deptId); |
| | | SecurityImporterTest securityImporter = new SecurityImporterTest(userService); |
| | | ExcelUtil.save(file, securityImporter, SecurityExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | |
| | | } |
| | | |
| | | //判断是否持证 |
| | | // if (user.getHold().equals("1")){ |
| | | // //持证,校验保安证编号是否合法 |
| | | // SecurityPaper securityPaper = new SecurityPaper(); |
| | | // securityPaper.setIdCardNo(user.getCardid()); |
| | | // List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper)); |
| | | // if (securityPaperList.size()>0){ |
| | | // boolean status = false; |
| | | // //遍历 |
| | | // for (SecurityPaper paper : securityPaperList) { |
| | | // if (paper.getNumber().equals(user.getSecuritynumber())){ |
| | | // status = true; |
| | | // } |
| | | // } |
| | | // if (!status){ |
| | | // throw new ServiceException("保安证编号不匹配,请核实!"); |
| | | // } |
| | | // }else { |
| | | // throw new ServiceException("保安证编号不匹配,请核实!"); |
| | | // } |
| | | // } |
| | | boolean state = false; |
| | | if (user.getHold().equals("1")){ |
| | | //持证,校验保安证编号是否合法 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper)); |
| | | if (securityPaperList.size()>0){ |
| | | //遍历 |
| | | for (SecurityPaper paper : securityPaperList) { |
| | | if (paper.getNumber().equals(user.getSecuritynumber())){ |
| | | state = true; |
| | | } |
| | | } |
| | | if (!state){ |
| | | user.setHold("2"); |
| | | user.setSecuritynumber(null); |
| | | } |
| | | }else { |
| | | user.setHold("2"); |
| | | user.setSecuritynumber(null); |
| | | } |
| | | }else { |
| | | state = true; |
| | | } |
| | | |
| | | String url = ""; |
| | | if (null != user.getFingerprint() && !user.getFingerprint().equals("")) { |
| | |
| | | // } |
| | | // } |
| | | //判断是否持证是否为空 |
| | | return R.status(status); |
| | | if (!state) { |
| | | return R.data(201, null, "保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!"); |
| | | } |
| | | return R.data(200,null,"新增成功!"); |
| | | } |
| | | |
| | | /** |