package com.ssj.framework.weixin.pay;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class OrderUtil {

	/** 
     * 生成订单号
     *  
     * @return 
     */  
    public static String getOrderCode() {  
    	String base = "ssj";
        SimpleDateFormat simpleDateFormat;  
        simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");  
        Date date = new Date();  
        String str = simpleDateFormat.format(date);  
        Random random = new Random();  
        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数  
        return base + str + rannum;// 当前时间  
    } 
    
    /** 
     * 生成退单号
     *  
     * @return 
     */  
    public static String getRefundCode() {  
    	String base = "ssjtd";
        SimpleDateFormat simpleDateFormat;  
        simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");  
        Date date = new Date();  
        String str = simpleDateFormat.format(date);  
        Random random = new Random();  
        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数  
        return base + str + rannum;// 当前时间  
    } 
    
    /** 
     * 生成企业付款订单号
     *  
     * @return 
     */  
    public static String getOrderCodeB2C() {  
    	String base = "ssjb2c";
        SimpleDateFormat simpleDateFormat;  
        simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");  
        Date date = new Date();  
        String str = simpleDateFormat.format(date);  
        Random random = new Random();  
        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数  
        return base + str + rannum;// 当前时间  
    } 
  
}  
