From 55f10446405d2569bea86214357d2f7107669406 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 5 Sep 2023 22:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E6=96=B9=E7=94=B3=E8=AF=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BB=93=E6=9E=9C=E5=A2=9E=E5=8A=A0=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E6=8C=87=E5=AF=BC=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PlmApiController.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/FactorySystemApi/Controllers/PlmApiController.cs b/FactorySystemApi/Controllers/PlmApiController.cs index 9be79f9..8db5af3 100644 --- a/FactorySystemApi/Controllers/PlmApiController.cs +++ b/FactorySystemApi/Controllers/PlmApiController.cs @@ -6,6 +6,7 @@ using FactorySystemApi.Plm_WebSite; using FactorySystemBll; using FactorySystemModel.SqlSugarModel; using Newtonsoft.Json; +using System; namespace FactorySystemApi.Controllers { @@ -102,5 +103,54 @@ namespace FactorySystemApi.Controllers }, apiResult, Request, inParam); } } + + /// + /// 获取工艺指导书链接(配方清单) + /// + /// + /// + [HttpPost] + public ApiResult GetPlmWebSiteInOrder(Dictionary inParam) + { + ApiResult apiResult = new ApiResult(); + + if (inParam["FPlmCode"] != null && inParam["FVersionCode"] != null) + { + List specifList = new List() { new Specifications() }; + + return ExceptionHelper.TryReturnException(() => { + + specifList[0].SP = inParam["FPlmCode"].ToString(); + + string sVersion = inParam["FVersionCode"].ToString(); + double dVersion; + bool isVersionNum = double.TryParse(sVersion, out dVersion); + + if (isVersionNum) + { + sVersion = string.Format("{0:F4}", dVersion); + } + specifList[0].SP_Version = sVersion.ToString(); + + OAServiceSoapClient oAService = new OAServiceSoapClient(); + RestResult restResult = oAService.GetCraftURL(specifList.ToArray()); + + if (restResult != null && restResult.data != null) + { + List> data = JsonConvert.DeserializeObject>>(restResult.data.ToString()); + if (data != null && data.Count > 0) + { + apiResult.Data = data[0]; + } + } + }, apiResult, Request, specifList); + } + else + { + return ExceptionHelper.TryReturnException(() => { + apiResult.Data = null; + }, apiResult, Request, inParam); + } + } } } \ No newline at end of file