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");