根据层级生成各个层级的编号(示例):
public class SequenceNum {private static String BASESTEP = "A100";
public static String autoSequenceNum(String inCode) {
if(inCode == null || inCode.trim().equals("")) {
return null;
}
String _code;
try {
_code = inCode;
} catch (NumberFormatException e) {
e.printStackTrace();
return null;
}
Long code1=Long.parseLong(_code);
code1 ++;
return String.valueOf(code1);
}
public static String getSequenceNumByFather(String fatherCode) {
if(fatherCode== null || fatherCode.trim().equals("")) {
return null;
}
String inCode = fatherCode+ BASESTEP;
return String.valueOf(inCode);
}
}