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