|
@@ -13,10 +13,10 @@ public class StudentArchiveGenerator {
|
|
|
|
|
|
private static final String STUDENT_CODE_PEREFIX = "ST";
|
|
|
private static final int STUDENT_CODE_LENGTH = 25;
|
|
|
- private static final int STUDENT_NUM_LENGTH = 10;
|
|
|
+ private static final int STUDENT_NUM_LENGTH = 8;
|
|
|
|
|
|
public static String generateArchiveCode(String studentNumber, String fileTypeCode) {
|
|
|
- String studentNum = studentNumber.substring(2, STUDENT_NUM_LENGTH);
|
|
|
+ String studentNum = studentNumber.substring(2, STUDENT_NUM_LENGTH + 3).replace("X", "");
|
|
|
String nowDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHhmmss", Locale.CHINA));
|
|
|
String archiveCode = ARCHIVE_CODE_PREFIX + studentNum + nowDate + fileTypeCode;
|
|
|
if (archiveCode.length() < ARCHIVE_CODE_LENGTH) {
|