//生成订单号orderCode string orderCode = DateTime.Now.ToString("yyyyMMddhhmmssffff") + userId; userOrderEntity.OrderCode = orderCode;