From 2a8508ed858c961923f49087d42e4c1b2d090312 Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Fri, 19 May 2023 22:51:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=8F=E5=90=8C=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=88=86=E7=B1=BB=E4=BB=BB=E5=8A=A1=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=88=90=E5=85=B6=E4=BB=96=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BA=8B=E9=A1=B9=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ViewController.cs | 3 -- FactorySystemBll/BaseBll.cs | 6 +++- FactorySystemBll/ViewBll.cs | 35 ++++++++++++++++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/FactorySystemApi/Controllers/ViewController.cs b/FactorySystemApi/Controllers/ViewController.cs index c49687d..74cc427 100644 --- a/FactorySystemApi/Controllers/ViewController.cs +++ b/FactorySystemApi/Controllers/ViewController.cs @@ -217,9 +217,6 @@ namespace FactorySystemApi.Controllers TeamworkBll.CreateMaterialTask(hasNewView, teamwork, user.FID); } - - - //补充包材规格 BaseBll.CreateTaskData(teamId, user.FID, "14"); //成品视图 diff --git a/FactorySystemBll/BaseBll.cs b/FactorySystemBll/BaseBll.cs index 631b3f5..bd5516c 100644 --- a/FactorySystemBll/BaseBll.cs +++ b/FactorySystemBll/BaseBll.cs @@ -312,14 +312,17 @@ namespace FactorySystemBll string taskDesc = basicCode.F1; List funcVal = new List(); + string funcTypes = "4, 5"; switch (temp0) { case (int)Constant.BasicCode.事项权限: funcType = (int)Constant.RoleType.事项权限; + funcTypes = "2"; funcVal.Add(temps[1]); break; case (int)Constant.BasicCode.物料视图编辑: funcType = (int)Constant.RoleType.物料视图编辑; + funcTypes = "4, 5"; string tType = temps[1]; funcVal = db.Queryable().Where(s => s.FType == (int)Constant.BasicCode.物料视图编辑 && s.F1 == tType && s.FState == 1).Select(s => s.FValue).ToList(); @@ -339,7 +342,8 @@ namespace FactorySystemBll )) .Where((a, b, c) => factoryId.Contains(a.FFactoryID)) .Where((a, b, c) => b.FState == 1 && b.FDeleted != 1) - .Where((a, b, c) => c.FType == funcType && funcVal.Contains(c.FFunctionID.ToString())) + //.Where((a, b, c) => c.FType == funcType && funcVal.Contains(c.FFunctionID.ToString())) + .Where((a, b, c) => funcTypes.Contains(c.FType.ToString()) && funcVal.Contains(c.FFunctionID.ToString())) .GroupBy("b.FID, a.FFactoryID, b.FName, b.FUser") .Select("b.FID, cast(a.FFactoryID as int), b.FName, b.FUser") .ToList(); diff --git a/FactorySystemBll/ViewBll.cs b/FactorySystemBll/ViewBll.cs index fda3cc5..1a8906b 100644 --- a/FactorySystemBll/ViewBll.cs +++ b/FactorySystemBll/ViewBll.cs @@ -537,9 +537,42 @@ namespace FactorySystemBll } } } + else if (viewList[i]["FMRP1ProductType"].ToString() == "10") + { + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.成品视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.成品视图); + } + } + else if (viewList[i]["FMRP1ProductType"].ToString() == "20") + { + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.半成品视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.半成品视图); + } + } + else if (viewList[i]["FMRP1ProductType"].ToString() == "40") + { + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.原料视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.原料视图); + } + } if (viewList[i].ContainsKey("FTypeID2")) viewList[i].Remove("FTypeID2"); - result += db.Updateable(viewList[i]).AS("TFS_ViewMaterial").WhereColumns("FMaterialID").Where(sqlWhere).ExecuteCommand(); + result += db.Updateable(viewList[i]).AS("TFS_ViewMaterial").WhereColumns("FMaterialID").ExecuteCommand(); } result += UnionModifyData(viewList, "TFS_ViewMaterial", teamId, db, "FMaterialID");