From d5d0c615e5b3c8157c9cc2eeddb793c1e882d49c Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Sun, 7 May 2023 19:53:15 +0800 Subject: [PATCH] commit by yzf --- FactorySystemBll/UserBll.cs | 1 + FactorySystemBll/ViewBll.cs | 62 ++++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/FactorySystemBll/UserBll.cs b/FactorySystemBll/UserBll.cs index 56466fb..21e8af9 100644 --- a/FactorySystemBll/UserBll.cs +++ b/FactorySystemBll/UserBll.cs @@ -206,6 +206,7 @@ namespace FactorySystemBll if (roleType == 84) { + resultList = db.Queryable().Where(s => (s.FType == 44 && s.FState == 1)).OrderBy(s => s.FOrder).ToList(); hasIds = db.Queryable((a, b) => new JoinQueryInfos(JoinType.Left, a.FID == b.FRoleID)) .Where((a, b) => a.FDeleted != (int)Constant.DeleteCode.已删除 && b.FType == 5 && roles.Contains(a.FID.ToString())) diff --git a/FactorySystemBll/ViewBll.cs b/FactorySystemBll/ViewBll.cs index 0a2773b..94d04aa 100644 --- a/FactorySystemBll/ViewBll.cs +++ b/FactorySystemBll/ViewBll.cs @@ -691,18 +691,18 @@ namespace FactorySystemBll if (viewList != null && viewList.Count > 0) { - string sqlWhere = string.Format("FViewType={0} and FHalfMaterialTeamID={1}", viewType, teamId); + string sqlWhere = string.Format(" FHalfMaterialTeamID={1}", viewType, teamId); - if (viewType == 10) - { - sqlWhere = string.Format("FViewType in (2, 3, 4, 5) and FHalfMaterialTeamID={1}", viewType, teamId); - } + //if (viewType == 10) + //{ + // sqlWhere = string.Format("FViewType in (2, 3, 4, 5) and FHalfMaterialTeamID={1}", viewType, teamId); + //} for (int i = 0; i < viewList.Count; i++) { //判断是否等于中间品 - if (viewList[i]["FMRP1Type"].ToString() == "30") + if (viewList[i].ContainsKey("FMRP1ProductType") &&viewList[i]["FMRP1ProductType"].ToString() == "30") { - TFS_MaterialType materialType = materialTypeBll.GetMaterialTypeByID(int.Parse(viewList[i]["FTypeID2"].ToString())).LastOrDefault(); + TFS_MaterialType materialType = materialTypeBll.GetMaterialTypeByID(int.Parse(materialList[i]["FTypeID2"].ToString())).LastOrDefault(); if (materialType.FName.Contains("香基")) { if (viewList[i].ContainsKey("FViewType")) @@ -726,9 +726,56 @@ namespace FactorySystemBll } } } + else + { + switch (viewList[i]["FMRP1ProductType"].ToString()) + { + case "10": + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.成品视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.成品视图); + } + break; + case "20": + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.半成品视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.半成品视图); + } + break; + case "40": + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = (int)Constant.ViewType.原料视图; + } + else + { + viewList[i].Add("FViewType", (int)Constant.ViewType.原料视图); + } + break; + default: + if (viewList[i].ContainsKey("FViewType")) + { + viewList[i]["FViewType"] = -1; + } + else + { + viewList[i].Add("FViewType", -1); + } + break; + } + } } result += db.Updateable(viewList).AS("TFS_ViewMaterial").WhereColumns("FMaterialID").Where(sqlWhere).ExecuteCommand(); + result += HalfMaterialUnionModifyData(viewList, "TFS_ViewMaterial", teamId, db, "FMaterialID"); } if (materialList != null && materialList.Count > 0) @@ -762,6 +809,7 @@ namespace FactorySystemBll infoList[i]["FDataID"] = infoList[i]["FMaterialID"]; infoList[i].Remove("FMaterialID"); infoList[i].Add("FType", 2); + infoList[i].Add("FType2", int.Parse(materialList[i]["FTypeID2"].ToString())); } result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FType", "FDataID").ExecuteCommand(); result += UnionModifyData(infoList, "TFS_MaterialInfo", teamId, db, "FDataID");