From 0d19c345e00efd60293b523ce7a1bb8f766b4445 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Fri, 4 Aug 2023 21:02:03 +0800 Subject: [PATCH] commit by yzf --- .../Controllers/SapUploadController.cs | 22 +++++++++++++++++++ .../Controllers/TeamworkController.cs | 13 ++++++++++- FactorySystemApi/Web.config | 4 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/FactorySystemApi/Controllers/SapUploadController.cs b/FactorySystemApi/Controllers/SapUploadController.cs index 6c2ab09..f6b958f 100644 --- a/FactorySystemApi/Controllers/SapUploadController.cs +++ b/FactorySystemApi/Controllers/SapUploadController.cs @@ -9,6 +9,7 @@ using Newtonsoft.Json; using FactorySystemApi.Sap_ProductVersion; using FactorySystemApi.Sap_Bom; using FactorySystemApi.Sap_ViewMaterial; +using System.Linq; namespace FactorySystemApi.Controllers { @@ -91,12 +92,22 @@ namespace FactorySystemApi.Controllers return ExceptionHelper.TryReturnException(() => { + si_pp079_mcs_senderClient senderClient = new si_pp079_mcs_senderClient(); senderClient.ClientCredentials.UserName.UserName = AppSettingsHelper.GetAppSettingVal("Sap_Upload_UserName"); senderClient.ClientCredentials.UserName.Password = AppSettingsHelper.GetAppSettingVal("Sap_Password"); dt_pp079_resHEAD[] resData = senderClient.si_pp079_mcs_sender(req); apiResult.Data = 1; + for (int i = 0; i < resData.Count(); i++) + { + if ("E".Equals(resData[i].TYPE)) + { + apiResult.Data = resData[i].INFOTEXT; + apiResult.Message = resData[i].INFOTEXT; + break; + } + } }, apiResult, Request, req); } else @@ -166,6 +177,17 @@ namespace FactorySystemApi.Controllers dt_pp080_resHEAD[] resData = senderClient.si_pp080_mcs_sender(req); apiResult.Data = 1; + for (int i = 0; i < resData.Count(); i++) + { + if ("E".Equals(resData[i].STATUS)) + { + apiResult.Data = resData[i].INFOTEXT; + apiResult.Message = resData[i].INFOTEXT; + break; + } + } + + }, apiResult, Request, req); } else diff --git a/FactorySystemApi/Controllers/TeamworkController.cs b/FactorySystemApi/Controllers/TeamworkController.cs index 570450d..ea81fe2 100644 --- a/FactorySystemApi/Controllers/TeamworkController.cs +++ b/FactorySystemApi/Controllers/TeamworkController.cs @@ -1167,7 +1167,18 @@ namespace FactorySystemApi.Controllers } else { - selectSql += string.Format("isnull({0},'') as '{1}'", field.FField, field.FName); + if (field.FName == "基本数量") + { + selectSql += string.Format("isnull({0},(select TFS_PackageMain.FBomUnit*1000 from TFS_PackageMain where TFS_PackageMain.FID =(select top 1 FPackID from TFS_FTeamwork where FID=@FTeamID@))) as '{1}'", field.FField, field.FName); + } + else if (field.FName == "组件数量") + { + selectSql += string.Format(@"isnull( ( CASE WHEN TFS_ViewMaterial.FExtraQuantity IS NULL OR TFS_ViewMaterial.FExtraQuantity= '' THEN TFS_PackageChild.FCount ELSE TFS_ViewMaterial.FExtraQuantity END ), (select TFS_PackageMain.FBomUnit*1000 from TFS_PackageMain where TFS_PackageMain.FID =(select top 1 FPackID from TFS_FTeamwork where FID=@FTeamID@)) ) AS '组件数量'"); + } + else + { + selectSql += string.Format("isnull({0},'') as '{1}'", field.FField, field.FName); + } } selectSql += ","; } diff --git a/FactorySystemApi/Web.config b/FactorySystemApi/Web.config index 118d3cc..817139d 100644 --- a/FactorySystemApi/Web.config +++ b/FactorySystemApi/Web.config @@ -12,8 +12,8 @@ - - + +