| | |
| | | } |
| | | if (month<=9){ |
| | | months = "0" + month; |
| | | }else { |
| | | months = String.valueOf(month); |
| | | } |
| | | if (day<=9){ |
| | | days = "0" + day; |
| | |
| | | // + quarter; |
| | | |
| | | //前缀 = 年的最后两位 + 月份(两位) + 日 (两位) + 考试类型 正式考试 z 模拟考试 m |
| | | String result = year |
| | | String pre = year |
| | | + months |
| | | + days |
| | | + type; |
| | | //查询是当前前缀已生成的数量 |
| | | int count = this.getCandidateNoCount(result); |
| | | if (count==0){ |
| | | return result + "0000"; |
| | | } |
| | | //查询是当前前缀已生成准考证号码最大的一位 |
| | | int count = examPaperService.getCandidateNoCount(pre); |
| | | String result = null; |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("0000"); |
| | | count++; |
| | | result = pre + (decimalFormat.format(count)); |
| | | //返回 |
| | | return result + (decimalFormat.format(count++)); |
| | | return result; |
| | | } |
| | | return null; |
| | | } |