String str = "20200717000057";
String substring = str.substring(8);
Integer num = Integer.parseInt(substring)+1;
String format = String.format("%06d", num);
System.out.println(format);
%06d : 6表示数字一共要几位
private String autoGenericCode(String code, int num) {
String result = "";
result = String.format("%0" + num + "d", Integer.parseInt(code) + 1);
return result;
}