From a957d510dd17870e415b89841cc54aeb565c8a06 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Wed, 26 Apr 2023 12:37:57 +0800 Subject: [PATCH] commit by yzf --- .../Controllers/FormulaController.cs | 17 +++++++++++++ .../HalfMaterialTeamworkController.cs | 9 +++++++ .../Controllers/TeamworkController.cs | 24 +++++++++++++++++++ FactorySystemApi/FactorySystemApi.csproj | 21 ++++++++++++++++ .../Web References/Plm_Formula/Reference.cs | 6 ++++- FactorySystemModel/BusinessModel/BomModel.cs | 24 +++++++++++++++++-- 6 files changed, 98 insertions(+), 3 deletions(-) diff --git a/FactorySystemApi/Controllers/FormulaController.cs b/FactorySystemApi/Controllers/FormulaController.cs index 16cbd23..e7c69a1 100644 --- a/FactorySystemApi/Controllers/FormulaController.cs +++ b/FactorySystemApi/Controllers/FormulaController.cs @@ -94,6 +94,22 @@ namespace FactorySystemApi.Controllers } else { + + if (inParam.ContainsKey("SP")&&!inParam.ContainsKey("FPlmCode")) + { + inParam.Add("FPlmCode", inParam["SP"].ToString()); + } + + if (inParam.ContainsKey("SP_VERSION")&& !inParam.ContainsKey("FVersionCode")) + { + inParam.Add("FVersionCode", inParam["SP_VERSION"].ToString()); + } + + if (inParam.ContainsKey("SP_VALUE")&&!inParam.ContainsKey("FTestCode")) + { + inParam.Add("FTestCode", inParam["SP_VALUE"].ToString()); + } + List fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.配方模板导入); TFS_Formula formula = new TFS_Formula(); List propertys = formula.GetType().GetProperties().ToList(); @@ -102,6 +118,7 @@ namespace FactorySystemApi.Controllers PropertyInfo temp = propertys.Find(s => s.Name == field.FColumnFIeld); if (temp != null) temp.SetValue(formula, GetValueByName(inParam, field.FFieldName, field.FDefault)); } + if (string.IsNullOrEmpty(formula.FPlmCode)) { apiResult.Error("FPlmCode不能为空"); diff --git a/FactorySystemApi/Controllers/HalfMaterialTeamworkController.cs b/FactorySystemApi/Controllers/HalfMaterialTeamworkController.cs index dc441f1..f31ce17 100644 --- a/FactorySystemApi/Controllers/HalfMaterialTeamworkController.cs +++ b/FactorySystemApi/Controllers/HalfMaterialTeamworkController.cs @@ -605,6 +605,10 @@ namespace FactorySystemApi.Controllers OAService oAService = new OAService(); specifList[0].Code = formula.FTestCode; specifList[0].Version = formula.FVersionCode; + + specifList[0].SP = formula.FPlmCode; + specifList[0].SP_Version = formula.FVersionCode; + RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData"); @@ -675,6 +679,11 @@ namespace FactorySystemApi.Controllers OAService oAService = new OAService(); specifList[0].Code = teamwork.FNewTestCode; specifList[0].Version = formula.FVersionCode; + + + specifList[0].SP = formula.FPlmCode; + specifList[0].SP_Version = formula.FVersionCode; + RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData"); diff --git a/FactorySystemApi/Controllers/TeamworkController.cs b/FactorySystemApi/Controllers/TeamworkController.cs index 1611686..501aa5f 100644 --- a/FactorySystemApi/Controllers/TeamworkController.cs +++ b/FactorySystemApi/Controllers/TeamworkController.cs @@ -448,6 +448,11 @@ namespace FactorySystemApi.Controllers OAService oAService = new OAService(); specifList[0].Code = formula.FTestCode; specifList[0].Version = formula.FVersionCode; + + //修改 + specifList[0].SP = formula.FPlmCode; + specifList[0].SP_Version = formula.FVersionCode; + RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData"); @@ -516,8 +521,14 @@ namespace FactorySystemApi.Controllers { TFS_Formula formula = BaseBll.GetTempModel(teamwork.FFormulaID); OAService oAService = new OAService(); + specifList[0].Code = formula.FTestCode; specifList[0].Version = formula.FVersionCode; + + //修改 + specifList[0].SP= formula.FPlmCode; + specifList[0].SP_Version= formula.FVersionCode; + RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData"); @@ -622,6 +633,19 @@ namespace FactorySystemApi.Controllers { foreach (BomModel item in dataList) { + if (!string.IsNullOrWhiteSpace(item.SP)) + { + item.Code = item.SP; + } + if (!string.IsNullOrWhiteSpace(item.SP_Version)) + { + item.Version=item.SP_Version; + } + if (!string.IsNullOrWhiteSpace(item.SP_VALUE)) + { + item.TestNO = item.SP_VALUE; + } + int dataId = random.Next(1, 99) * random.Next(1, 99); dataId += random.Next(10, 99) * random.Next(10, 99) * 2; dataId += random.Next(1, 99) * random.Next(1, 99) * 10; diff --git a/FactorySystemApi/FactorySystemApi.csproj b/FactorySystemApi/FactorySystemApi.csproj index a819632..edb3462 100644 --- a/FactorySystemApi/FactorySystemApi.csproj +++ b/FactorySystemApi/FactorySystemApi.csproj @@ -186,6 +186,11 @@ + + True + True + Reference.svcmap + @@ -243,6 +248,18 @@ + + + + Reference.svcmap + + + Reference.svcmap + + + WCF Proxy Generator + Reference.cs + @@ -252,6 +269,7 @@ + SettingsSingleFileGenerator Settings.Designer.cs @@ -396,6 +414,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/FactorySystemApi/Web References/Plm_Formula/Reference.cs b/FactorySystemApi/Web References/Plm_Formula/Reference.cs index 78b98ff..115bf5d 100644 --- a/FactorySystemApi/Web References/Plm_Formula/Reference.cs +++ b/FactorySystemApi/Web References/Plm_Formula/Reference.cs @@ -635,7 +635,11 @@ namespace FactorySystemApi.Plm_Formula { private string codeField; private string versionField; - + + + public string SP { get; set; } + public string SP_Version { get; set; } + /// public string Code { get { diff --git a/FactorySystemModel/BusinessModel/BomModel.cs b/FactorySystemModel/BusinessModel/BomModel.cs index b43cf1f..d7cf343 100644 --- a/FactorySystemModel/BusinessModel/BomModel.cs +++ b/FactorySystemModel/BusinessModel/BomModel.cs @@ -9,13 +9,33 @@ namespace FactorySystemModel.BusinessModel Code = Name = Version = Type = Quantity = TestNO = ""; Specifications = new List(); } - public string Code { get; set; } + /// + /// PLM规格内码 + /// + public string SP { get; set; } public string Name { get; set; } - public string Version { get; set; } + + /// + /// 规格英文名称 + /// + public string EnName { get; set; } + /// + /// 版本号 + /// + public string SP_Version { get; set; } public string Type { get; set; } + /// + /// 实验号 + /// + public string SP_VALUE { get; set; } + + + public string Code { get; set; } + public string Version { get; set; } public string Quantity { get; set; } public string TestNO { get; set; } public List Specifications { get; set; } + } ///