|
@@ -6,7 +6,9 @@ import java.util.Date;
|
|
|
public class BusinessIdGenerator {
|
|
|
|
|
|
private static final String PREFIX = "EPD";
|
|
|
+ private static final String PREFIX_P = "P";
|
|
|
private static final String FIXED_MIDDLE_PART = "000";
|
|
|
+ private static final String FIXED_MIDDLE_PART_PRODUCT = "00";
|
|
|
private static final int SERIAL_NUMBER_LENGTH = 1;
|
|
|
|
|
|
private static final String PREFIX_ = "LHTWL";
|
|
@@ -27,6 +29,25 @@ public class BusinessIdGenerator {
|
|
|
return businessId.toString();
|
|
|
}
|
|
|
|
|
|
+ public static String generateBusinessIdForProduct(int currentSerialNumber) {
|
|
|
+ StringBuilder businessId = new StringBuilder();
|
|
|
+ businessId.append(PREFIX_P);
|
|
|
+ businessId.append(getDatePart());
|
|
|
+ businessId.append(FIXED_MIDDLE_PART_PRODUCT);
|
|
|
+ businessId.append(getSerialNumberPart(currentSerialNumber));
|
|
|
+ System.out.println(businessId);
|
|
|
+ return businessId.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String generateBusinessIdForProductYl(int currentSerialNumber) {
|
|
|
+ StringBuilder businessId = new StringBuilder();
|
|
|
+ businessId.append(getDatePart());
|
|
|
+ businessId.append(FIXED_MIDDLE_PART);
|
|
|
+ businessId.append(getSerialNumberPart(currentSerialNumber));
|
|
|
+ System.out.println(businessId);
|
|
|
+ return businessId.toString();
|
|
|
+ }
|
|
|
+
|
|
|
private static String getDatePart() {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
|
|
|
return sdf.format(new Date());
|