记得上下班打卡 | git大法好,push需谨慎

Commit 7fe9b9d3 authored by 胡佳晨's avatar 胡佳晨

生成取货码

parent 357923cb
...@@ -69,11 +69,27 @@ public class IDGenerator { ...@@ -69,11 +69,27 @@ public class IDGenerator {
} }
public static String storeRefundCode(String orderMasterCode) { public static String storeRefundCode(String orderMasterCode) {
return orderMasterCode.concat("R").concat(RandomUtil.getRandomInt(0, 50) + ""); return orderMasterCode.concat("R").concat(RandomUtil.getRandomInt(0, 99) + "");
} }
public static String getWriteOffCode() { public static String getWriteOffCode() {
return ""; LocalDateTime now = LocalDateTime.now();
String year = (now.getYear()+"").substring(2);
String day = now.getDayOfYear()+"";
String hour = now.getHour()+"";
String sec = now.getSecond()+"";
String random = RandomUtil.getRandomInt(0,100)+"";
if(day.length()==1){
day="0"+day;
}
if(hour.length()==1){
hour="0"+hour;
}
if(sec.length()==1){
sec="0"+sec;
}
String code = year+day+hour+sec+random;
return StringUtil.switchPosition(StringUtil.switchPosition(code,1,4),3,6);
} }
/** /**
...@@ -123,12 +139,6 @@ public class IDGenerator { ...@@ -123,12 +139,6 @@ public class IDGenerator {
} }
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("" + IDGenerator.payCode()); System.out.println(getWriteOffCode());
System.out.println("" + IDGenerator.refundCode());
System.out.println("nextTimeId===" + IDGenerator.nextTimeId());
System.out.println("nextMilliId===" + IDGenerator.nextMilliId());
System.out.println("nextMilliId2===" + IDGenerator.nextMilliId2());
System.out.println("nextSnowId===" + IDGenerator.nextSnowId());
System.out.println("get32UUID===" + IDGenerator.get32UUID());
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment