using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Collections.Concurrent;
using Newtonsoft.Json.Linq;
using System.Threading;
using SlMesDbIterface;
using PLMTEST;
using System.Net;
using System.Net.Http.Headers;
using System.IO;
using ExternalDataSync;


/////http://127.0.0.1:9981/api/IOrder/InsertOrder



/// <summary>
/// 
/// </summary>
namespace WebApi
{
    /// <summary>
    /// 
    /// </summary>
    [RoutePrefix("api/IOrder")] 
    public class IOrderController : ApiController
    {
        readonly string headUrl = "Project/";

        /// <summary>
        /// 上传测试接收
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost]
        public HttpResponseMessage test([FromBody] JObject jobj)
        {
            string JsonStr = jobj.ToString();

            return new HttpResponseMessage
            {
                Content = new StringContent(AnalysisMsg.ProductionCalendarData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj.ToString()), Encoding.GetEncoding("UTF-8"), "application/json")
            };
        }

        /// <summary>
        /// 生产建模基础数据
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost]
        public HttpResponseMessage productCalendar([FromBody] JObject jobj)
        {
            return new HttpResponseMessage
            {
                Content = new StringContent(AnalysisMsg.ProductionCalendarData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj.ToString()), Encoding.GetEncoding("UTF-8"), "application/json")
            };
        }
    }
}
