import time
import random


def creat_order_num(user_id):
    """
    生成订单号
    :param user_id: 用户id
    :return: 订单号
    """
    time_stamp = int(round(time.time() * 1000))
    randomnum = '%04d' % random.randint(0, 100000)
    order_num = str(time_stamp) + str(randomnum) + str(user_id)
    return order_num