亲宝软件园·资讯

展开

code唯一码 java 快速解决code唯一码(java)的简便方法

人气:0
想了解快速解决code唯一码(java)的简便方法的相关内容吗,在本文为您仔细讲解code唯一码 java的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:code唯一码,java,下面大家一起来学习吧。

如下所示:

public String next() {
 long appBootTimes = systemVariableService.getAppBootTimes();
 return Long.toString(appBootTimes * 10000000000000000l + seq.incrementAndGet(), Character.MAX_RADIX);
}

解释:找数据库中的最近新增的账号

public String nextNo() {
  return Long.toString(seq.incrementAndGet());
}
 
public String nextTradeNo() {
  return "T" + LocalDate.now().format(DateTimeFormatter.ofPattern("uuuuMMdd")) + next();
 }
  
public String nextFileName(String suffix) {
  return LocalDate.now().format(DateTimeFormatter.ofPattern("uuuuMMdd")) + "/" + UUID.randomUUID() + (StringUtils.isNotBlank(suffix) ? ("." + suffix) : "");
 }
public String nextPurchaseNo(){
  return "PO"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getPurchaseNumbers("PO");
 } 
public String nextSalesNo(){
  System.out.println(systemVariableService.getSalesNumbers("SO"));
  return "SO"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getSalesNumbers("SO");
 } 
public String nextReceiptNo(){
  return "SI"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getReceiptNumbers("SI");
 } 
public String nextLoadingListNo(){
  return "LL"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getLoadingListNumbers("LL");
 } 
public String nextDeliverNo(){
  return "DL"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getDeliverNumbers("DL");
 } 
public String nextOtherInNo(){
  return "OI"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getOtherInNumbers("OI");
 }
public String nextOtherOutNo(){
  return "OO"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.getOtherOutNumbers("OO");
 } 
public String nextPromotionNo(){
  return "HD"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + "-" + systemVariableService.nextPromotionNo("HD");
 }  
public String nextBalanceFeeNo() {
  return "FT" + systemVariableService.getBalanceFeeNumbers();
 }

以上的方法,都比较的好用和方便。其实这些我都要百度,是同事写的,真强!

这篇快速解决code唯一码(java)的简便方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

加载全部内容

相关教程
猜你喜欢
用户评论