From 88fd8e64685a6791503f427d3a12cc63170e9189 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Tue, 18 Apr 2023 22:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=81=E7=A8=8B=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ViewController.cs | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/FactorySystemApi/Controllers/ViewController.cs b/FactorySystemApi/Controllers/ViewController.cs index d5e5844..2f7a20d 100644 --- a/FactorySystemApi/Controllers/ViewController.cs +++ b/FactorySystemApi/Controllers/ViewController.cs @@ -225,8 +225,8 @@ namespace FactorySystemApi.Controllers int teamId = int.Parse(inParam["FTeamID"].ToString()); int viewType = int.Parse(inParam["FViewType"].ToString()); apiResult.Data = _viewBll.UpdateBatchById3(viewList, materialList, infoList, teamId, viewType, user.FID); - - if (viewType == 10) + List ids = new List { 2,3,4,5,10}; + if (ids.Contains(viewType)) { // 创建物料视图事项 TFS_HalfMaterialFTeamwork teamwork = BaseBll.GetTempModel(teamId); @@ -240,7 +240,7 @@ namespace FactorySystemApi.Controllers int materialType = (int)(long)row["FViewType"]; string factoryId = row["FFactoryID"].ToString(); - if (materialType == 2 || materialType == 3 || materialType == 4 || materialType == 5) + if (ids.Contains(materialType)) { if (hasNewView.ContainsKey(materialType)) { @@ -255,7 +255,7 @@ namespace FactorySystemApi.Controllers HalfMaterialTeamworkBll TeamworkBll = new HalfMaterialTeamworkBll(); TeamworkBll.CreateMaterialTask(hasNewView, teamwork, user.FID); } - BaseBll.CreateTaskData2(teamId, user.FID, "3"); + BaseBll.CreateTaskData2(teamId, user.FID, "2"); BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料分类, 3, 2); BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料编辑, 2, 1); @@ -264,6 +264,38 @@ namespace FactorySystemApi.Controllers }, apiResult, Request); } + /// + /// 保存视图编辑的内容 更换试验号结束 + /// + [HttpPost] + public ApiResult UpdateBatchById4(Dictionary inParam) + { + var apiResult = new ApiResult(); + return ExceptionHelper.TryReturnException(() => + { + if (Request.Properties["token"] is ApiAuthInfo user) + { + inParam.TryGetValue("TFS_ViewMaterial", out object viewObj); + inParam.TryGetValue("TFS_Material", out object materialObj); + inParam.TryGetValue("TFS_MaterialInfo", out object infoObj); + List> viewList = JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(viewObj)); + List> materialList = JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(materialObj)); + List> infoList = JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(infoObj)); + int teamId = int.Parse(inParam["FTeamID"].ToString()); + int viewType = int.Parse(inParam["FViewType"].ToString()); + apiResult.Data = _viewBll.UpdateBatchById3(viewList, materialList, infoList, teamId, viewType, user.FID); + List ids = new List { 2, 3, 4, 5, 10 }; + if (ids.Contains(viewType)) + { + // 创建物料视图事项 + TFS_HalfMaterialFTeamwork teamwork = BaseBll.GetTempModel(teamId); + + BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料编辑, 2, 2); + } + } + }, apiResult, Request); + } + /// /// 保存视图编辑的内容(物料新增条线) ///