Yang 3 years ago
commit b9a9a63a62

@ -210,6 +210,7 @@ namespace FactorySystemApi.Controllers
public ApiResult UpdateMaterial(Dictionary<string, object> inParam) public ApiResult UpdateMaterial(Dictionary<string, object> inParam)
{ {
var apiResult = new ApiResult(); var apiResult = new ApiResult();
int step = -1;
return ExceptionHelper.TryReturnException(() => { return ExceptionHelper.TryReturnException(() => {
if (Request.Properties["token"] is ApiAuthInfo user) if (Request.Properties["token"] is ApiAuthInfo user)
@ -319,5 +320,22 @@ namespace FactorySystemApi.Controllers
return result; return result;
} }
private Dictionary<string, int> CreateProdMaterialData(TFS_ViewMaterial createViewMaterial, TFS_FMaterialTeamwork teamwork)
{
Dictionary<string, int> result = new Dictionary<string, int>();
createViewMaterial.FFactoryID = teamwork.FProdFactoryID;
createViewMaterial.FFactoryCode = teamwork.FProdFactoryCode; // 工厂Code
result.Add("ViewId", createViewMaterial.FID);
int prodVmId = MaterialTeamworkBll.InsertMaterialView(createViewMaterial);
result.Add("ProdViewId", prodVmId);
return result;
}
} }
} }

@ -204,8 +204,9 @@ namespace FactorySystemBll
materialList[i].Add("FK3ShortCode", k3Code.ToString().Split('.').Last()); 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); result += UnionModifyData(materialList, "TFS_Material", teamId, db);
} }
@ -227,8 +228,10 @@ namespace FactorySystemBll
infoList[i]["FEditDate"] = DateTime.Now; infoList[i]["FEditDate"] = DateTime.Now;
infoList[i].Remove("FMaterialID"); infoList[i].Remove("FMaterialID");
infoList[i].Add("FType", 2); infoList[i].Add("FType", 2);
result += db.Updateable(infoList[i]).AS("TFS_MaterialInfo").WhereColumns("FDataID", "FType").ExecuteCommand();
} }
result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FType", "FDataID").ExecuteCommand(); //result += db.Updateable(infoList).AS("TFS_MaterialInfo").WhereColumns("FDataID", "FType").ExecuteCommand();
result += UnionModifyData(infoList, "TFS_MaterialInfo", teamId, db, "FDataID"); result += UnionModifyData(infoList, "TFS_MaterialInfo", teamId, db, "FDataID");
} }
@ -272,8 +275,11 @@ namespace FactorySystemBll
if (sqlList.Count > 0) if (sqlList.Count > 0)
{ {
string updateSql = string.Join(";", sqlList); string updateSql = string.Join(";", sqlList);
try { result = db.Ado.ExecuteCommand(updateSql); } try {
catch (Exception) { } result = db.Ado.ExecuteCommand(updateSql);
}
catch (Exception ex) {
}
} }
} }
} }

Loading…
Cancel
Save