commit by yzf

master
Yang 3 years ago
parent ef181c2af2
commit 16096d7f1f

@ -788,6 +788,15 @@ namespace FactorySystemApi.Controllers
FTestCode = item.SP_VALUE, FTestCode = item.SP_VALUE,
FVersionCode = item.SP_Version, FVersionCode = item.SP_Version,
FParentID = parentId FParentID = parentId
//FID = DateTime.Now.DayOfYear * 10 + dataId,
//FPlmCode = item.Code,
//FName = item.Name,
////FCode = item.Code,
//FType = item.Type.ToLower(),
//FTestCode = item.TestNO,
//FVersionCode = item.Version,
//FParentID = parentId
}; };
TFS_ViewMaterial view = new TFS_ViewMaterial() TFS_ViewMaterial view = new TFS_ViewMaterial()

@ -782,41 +782,46 @@ namespace FactorySystemBll
{ {
SqlSugarClient db = AppSettingsHelper.GetSqlSugar(); SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
List<TFS_Material> materialList = null; List<TFS_Material> materialList = null;
List<int> factoryList = new List<int>();
if (factory != null)
materialList = db.Queryable<TFS_Material>().Where(m => m.FTestCode == testCode).ToList();
List<int> ids = materialList.Select(m => m.FID).ToList();
//更新配方
string sql = "";
if (string.IsNullOrWhiteSpace(idList))
{ {
if (factory.FType != (int)Constant.FactoryType.) sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1});update TFS_ViewMaterial set FHalfMaterialTeamID={2} WHERE FMaterialID in ({1})", testCode2, string.Join(",", ids), temId);
{ }
factoryList.Add(factory.FID); else
factoryList.Add(factory.FFactoryID); {
} sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1})", testCode, idList);
else }
{ if (materialList.Count() > 0)
factoryList.Add(factory.FID); {
} db.Ado.ExecuteCommand(sql);
}
materialList = db.Queryable<TFS_Material>().Where(m => m.FTestCode == testCode&&string.Join(",", factoryList).Contains(m.FFactoryID.ToString())).ToList(); //List<int> factoryList = new List<int>();
List<int> ids = materialList.Select(m => m.FID).ToList(); //if (factory != null)
//更新配方 //{
string sql = ""; // if (factory.FType != (int)Constant.FactoryType.单工厂)
// {
// factoryList.Add(factory.FID);
// factoryList.Add(factory.FFactoryID);
// }
// else
// {
// factoryList.Add(factory.FID);
// }
if (string.IsNullOrWhiteSpace(idList))
{
sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1});update TFS_ViewMaterial set FHalfMaterialTeamID={2} WHERE FMaterialID in ({1})", testCode2, string.Join(",", ids), temId);
}
else
{
sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1})", testCode, idList);
}
if (materialList.Count() > 0)
{
db.Ado.ExecuteCommand(sql);
}
}
//}

@ -772,10 +772,10 @@ namespace FactorySystemBll
break; break;
} }
} }
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 += HalfMaterialUnionModifyData(viewList, "TFS_ViewMaterial", teamId, db, "FMaterialID"); result += HalfMaterialUnionModifyData(viewList, "TFS_ViewMaterial", teamId, db, "FMaterialID");
} }

Loading…
Cancel
Save