diff --git a/FactorySystemBll/TeamworkBll.cs b/FactorySystemBll/TeamworkBll.cs index f0a6ffc..e17eecd 100644 --- a/FactorySystemBll/TeamworkBll.cs +++ b/FactorySystemBll/TeamworkBll.cs @@ -366,6 +366,11 @@ namespace FactorySystemBll if (!hasNewView.ContainsKey(vItem.FViewType)) hasNewView.Add(vItem.FViewType, vItem.FFactoryID.ToString() + ","); else hasNewView[vItem.FViewType] = hasNewView[vItem.FViewType] + vItem.FFactoryID.ToString() + ","; } + else + { + vData.FTeamID = teamInfo.FID; + db.Updateable(vData).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + } //是否有工厂视图 vData = db.Queryable().Where(s => s.FFactoryID == teamInfo.FProdFactoryID && s.FMaterialID == mItem.FID).First(); if (vData == null) @@ -397,6 +402,12 @@ namespace FactorySystemBll if (!hasNewView.ContainsKey(vItem.FViewType)) hasNewView.Add(vItem.FViewType, vItem.FFactoryID.ToString() + ","); else hasNewView[vItem.FViewType] = hasNewView[vItem.FViewType] + vItem.FFactoryID.ToString() + ","; } + else + { + vData.FTeamID = teamInfo.FID; + db.Updateable(vData).WhereColumns("FID").IgnoreColumns(true).ExecuteCommand(); + } + mItem.FIsNew = isAddFormula; mItem.FOldID = oldId; mItem.FLevelID = vItem.FLevel; diff --git a/FactorySystemBll/ViewBll.cs b/FactorySystemBll/ViewBll.cs index 0accab6..5892a5b 100644 --- a/FactorySystemBll/ViewBll.cs +++ b/FactorySystemBll/ViewBll.cs @@ -511,7 +511,7 @@ namespace FactorySystemBll for (int i = 0; i < viewList.Count; i++) { //判断是否等于中间品 - if (viewList[i]["FMRP1Type"].ToString() == "30") + if (viewList[i]["FMRP1ProductType"].ToString() == "30") { TFS_MaterialType materialType = materialTypeBll.GetMaterialTypeByID(int.Parse(viewList[i]["FTypeID2"].ToString())).LastOrDefault(); if (materialType.FName.Contains("香基")) @@ -537,10 +537,10 @@ namespace FactorySystemBll } } } - } + result += db.Updateable(viewList[i]).AS("TFS_ViewMaterial").WhereColumns("FMaterialID").Where(sqlWhere).ExecuteCommand(); + } - result += db.Updateable(viewList).AS("TFS_ViewMaterial").WhereColumns("FMaterialID").Where(sqlWhere).ExecuteCommand(); result += UnionModifyData(viewList, "TFS_ViewMaterial", teamId, db, "FMaterialID"); } if (materialList != null && materialList.Count > 0) @@ -560,8 +560,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); } if (infoList != null && infoList.Count > 0) @@ -571,8 +572,9 @@ namespace FactorySystemBll infoList[i]["FDataID"] = infoList[i]["FMaterialID"]; infoList[i].Remove("FMaterialID"); infoList[i].Add("FType", 2); + result += db.Updateable(infoList[i]).AS("TFS_MaterialInfo").WhereColumns("FType", "FDataID").ExecuteCommand(); } - result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FType", "FDataID").ExecuteCommand(); + result += UnionModifyData(infoList, "TFS_MaterialInfo", teamId, db, "FDataID"); } result += CheckTaskComplete(db, teamId, viewType, userId);