You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			741 B
		
	
	
	
		
			Java
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			741 B
		
	
	
	
		
			Java
		
	
| package com.glxp.api.util;
 | |
| 
 | |
| import java.text.SimpleDateFormat;
 | |
| import java.util.Date;
 | |
| 
 | |
| public class StockOrderBillNoUtils {
 | |
| 
 | |
|     public static String getBillNo(String action) {
 | |
| 
 | |
|         String prefix = "";
 | |
|         switch (action) {
 | |
|             case "deliveryNote":
 | |
|                 prefix = "SHD";
 | |
|                 break;
 | |
|             default:
 | |
|                 prefix = "SP";
 | |
|                 break;
 | |
|         }
 | |
| 
 | |
|         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
 | |
|         Date date = new Date();
 | |
|         String dateStr = simpleDateFormat.format(date);
 | |
|         String randomStr = String.valueOf(((int) (Math.random() * 89997 + 1) + 10000));
 | |
|         String rStr = prefix + dateStr + randomStr;
 | |
| 
 | |
|         return rStr;
 | |
|     }
 | |
| } |