| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.DesensitizedUtil; |
| | | import org.springblade.common.utils.QRCodeUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.FTP.Monitor; |
| | | import org.springblade.modules.FTP.Result; |
| | | import org.springblade.modules.accreditation.excel.ExportSecurityPaperExcel; |
| | | import org.springblade.modules.exam.entity.ExamScore; |
| | | import org.springblade.modules.exam.entity.ScoreAuditRecords; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 考试成绩修改申请记录服务实现类 |
| | |
| | | //去生成保安证编号 |
| | | String pre = SecurityPaperUtil.getSecurityPaper(); |
| | | //查询当前年份已有的保安证编号 |
| | | int count = userService.getSecurityPaperCount(pre); |
| | | // int count = userService.getSecurityPaperCount(pre); |
| | | //需调用内网查询 |
| | | //生成随机数 |
| | | String uuid = UUID.randomUUID().toString(); |
| | | |
| | | //数据推送 |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | map.put(uuid,pre); |
| | | myAsyncService.FTPSecurityNumberBit(map); |
| | | |
| | | int count = 0; |
| | | Result result0 = new Result(); |
| | | //调用ftp获取返回数据 |
| | | while (true){ |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //调用ftp获取返回数据 |
| | | result0 = Monitor.getSecurityNumberBit(uuid); |
| | | //如果返回true,就退处 |
| | | if (result0.getCode()==200){ |
| | | break; |
| | | }else{ |
| | | //计数 |
| | | count++; |
| | | //如果超过100s 没有读取到,则退出 |
| | | if (count == 100) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | int max = Integer.parseInt(result0.getMsg()); |
| | | String result = null; |
| | | if (count == 0) { |
| | | if (max == 0) { |
| | | result = pre + "00001"; |
| | | } else { |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | count++; |
| | | result = pre + (decimalFormat.format(count)); |
| | | max++; |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | | //修改为持证保安 |
| | |
| | | securityPaper.setApplyId(examScore.getApplyId()); |
| | | securityPaper.setSource(1); |
| | | //创建内网对象 |
| | | SecurityPaper paper = securityPaper; |
| | | SecurityPaper paper = Objects.requireNonNull(BeanUtil.copy(securityPaper,SecurityPaper.class)); |
| | | //脱敏 |
| | | securityPaper.setNumber(DesensitizedUtil.desensitizedSecurityNumber(result)); |
| | | securityPaper.setIdCardNo(""); |