From e098115019aa49eadcea2883f4638f4067b9f799 Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Wed, 19 Apr 2023 00:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=A9=E6=96=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MaterialTeamworkController.cs | 18 ++++++++++++++++++ FactorySystemBll/MaterialTeamworkBll.cs | 14 ++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/FactorySystemApi/Controllers/MaterialTeamworkController.cs b/FactorySystemApi/Controllers/MaterialTeamworkController.cs index f250517..8f90ff4 100644 --- a/FactorySystemApi/Controllers/MaterialTeamworkController.cs +++ b/FactorySystemApi/Controllers/MaterialTeamworkController.cs @@ -210,6 +210,7 @@ namespace FactorySystemApi.Controllers public ApiResult UpdateMaterial(Dictionary inParam) { var apiResult = new ApiResult(); + int step = -1; return ExceptionHelper.TryReturnException(() => { if (Request.Properties["token"] is ApiAuthInfo user) @@ -319,5 +320,22 @@ namespace FactorySystemApi.Controllers return result; } + + + + private Dictionary CreateProdMaterialData(TFS_ViewMaterial createViewMaterial, TFS_FMaterialTeamwork teamwork) + { + Dictionary result = new Dictionary(); + + createViewMaterial.FFactoryID = teamwork.FProdFactoryID; + createViewMaterial.FFactoryCode = teamwork.FProdFactoryCode; // 工厂Code + + result.Add("ViewId", createViewMaterial.FID); + + int prodVmId = MaterialTeamworkBll.InsertMaterialView(createViewMaterial); + result.Add("ProdViewId", prodVmId); + + return result; + } } } diff --git a/FactorySystemBll/MaterialTeamworkBll.cs b/FactorySystemBll/MaterialTeamworkBll.cs index 2e54177..8677e24 100644 --- a/FactorySystemBll/MaterialTeamworkBll.cs +++ b/FactorySystemBll/MaterialTeamworkBll.cs @@ -204,8 +204,9 @@ namespace FactorySystemBll materialList[i].Add("FK3ShortCode", k3Code.ToString().Split('.').Last()); } } + result += db.Updateable(materialList[i]).AS("TFS_Material").WhereColumns("FID").ExecuteCommand(); } - result += db.Updateable(materialList).AS("TFS_Material").WhereColumns("FID").ExecuteCommand(); + result += UnionModifyData(materialList, "TFS_Material", teamId, db); } @@ -227,8 +228,10 @@ namespace FactorySystemBll infoList[i]["FEditDate"] = DateTime.Now; infoList[i].Remove("FMaterialID"); infoList[i].Add("FType", 2); + + result += db.Updateable(infoList[i]).AS("TFS_MaterialInfo").WhereColumns("FDataID", "FType").ExecuteCommand(); } - result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FType", "FDataID").ExecuteCommand(); + //result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FDataID", "FType").ExecuteCommand(); result += UnionModifyData(infoList, "TFS_MaterialInfo", teamId, db, "FDataID"); } @@ -272,8 +275,11 @@ namespace FactorySystemBll if (sqlList.Count > 0) { string updateSql = string.Join(";", sqlList); - try { result = db.Ado.ExecuteCommand(updateSql); } - catch (Exception) { } + try { + result = db.Ado.ExecuteCommand(updateSql); + } + catch (Exception ex) { + } } } }