Exemplo n.º 1
0
        public async Task <IActionResult> AddOrderForm(CreateUpdateFactoryProgramRecordDto entity)
        {
            #region 字段合法性验证
            //所属车间 必填
            if (entity.SpinningMillId == Guid.Empty)
            {
                return(Fail("车间信息必传!"));
            }
            //所属车间 有效
            HttpResponseMessage SpinningMillResult = await HTTPMethods.Get(_httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["GetSpinningMillData"].ToString() + entity.SpinningMillId);

            if (SpinningMillResult.StatusCode != System.Net.HttpStatusCode.OK)
            {
                return(Fail("车间信息不存在!"));
            }
            //订单号 必填
            if (!string.IsNullOrEmpty(entity.Code))
            {
                return(Fail("订单号必填!"));
            }
            #endregion
            HttpResponseMessage result = await HTTPMethods.Post(_httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["AddOrderForm"].ToString(), entity.ToJson());

            if (result.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return(SuccessInfo("新增成功!"));
            }
            else
            {
                return(Fail("未知错误!"));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetOrderList()
        {
            HttpResponseMessage result = await HTTPMethods.Get(_httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["GetOrderList"].ToString());

            if (result.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return(SuccessInfo(await result.Content.ReadAsStringAsync()));
            }
            else
            {
                return(Fail("未知错误!"));
            }
        }
        public async Task <IActionResult> GetMachineStatisticsList(string process_Id, string variety_Id, DateTime?searchDate)
        {
            try
            {
                string requestUrl = _httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["GetMachineStatisticsList"].ToString();
                var    result     = await HTTPMethods.Get(requestUrl);

                return(Success(result));
            }
            catch (Exception e)
            {
                return(Fail("未知错误"));
            }
        }
Exemplo n.º 4
0
        public async Task <IActionResult> GetOrderData(string keyValue)
        {
            #region 字段合法性验证
            //主键必填
            if (!string.IsNullOrEmpty(keyValue))
            {
                return(Fail("订单ID必填!"));
            }
            #endregion
            HttpResponseMessage result = await HTTPMethods.Get(_httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["GetOrderData"].ToString() + keyValue);

            if (result.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return(SuccessInfo(await result.Content.ReadAsStringAsync()));
            }
            else
            {
                return(Fail("未知错误!"));
            }
        }
        public async Task <IActionResult> Getlist()
        {
            var result = await HTTPMethods.Get(_httpApiUrlStrs.Value.BusinessApiUrl + AjaxUrls["GetTable"].ToString());

            return(Success(result));
        }