diff --git a/FactorySystemApi/Controllers/FormulaController.cs b/FactorySystemApi/Controllers/FormulaController.cs index 08ec4c2..2acfde4 100644 --- a/FactorySystemApi/Controllers/FormulaController.cs +++ b/FactorySystemApi/Controllers/FormulaController.cs @@ -303,24 +303,35 @@ namespace FactorySystemApi.Controllers double dVersion; bool isVersionNum = double.TryParse(sVersion, out dVersion); - + int task = -1; if (isVersionNum) { sVersion = string.Format("{0:F4}", dVersion); } - TFS_UpdateFormula tFS_UpdateFormula = new TFS_UpdateFormula() + if (inParam .ContainsKey("Change_List") && inParam["Change_List"] != null&& inParam["Change_List"].ToString() !="") { - SP = inParam["SP"].ToString(), - SP_VERSION = sVersion, - SP_VALUE = inParam["SP_VALUE"].ToString(), - Name = inParam["Name"].ToString(), - Type = inParam["Type"].ToString(), - SP_AUTHOR = inParam["SP_AUTHOR"].ToString(), - //Change_Content = inParam["Change_Content"].ToString(), - Change_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm"), - Change_Content = inParam.ContainsKey("Change_List")?inParam["Change_List"].ToString():"", - }; - apiResult.Data = FormulaBll.SevaTFS_UpdateFormula(tFS_UpdateFormula); + List jsonList = JsonConvert.DeserializeObject>(inParam["Change_List"].ToString()); + + foreach (var item in jsonList) + { + TFS_UpdateFormula tFS_UpdateFormula = new TFS_UpdateFormula() + { + SP = inParam["SP"].ToString(), + SP_VERSION = sVersion, + SP_VALUE = inParam["SP_VALUE"].ToString(), + Name = inParam["Name"].ToString(), + Type = inParam["Type"].ToString(), + SP_AUTHOR = inParam["SP_AUTHOR"].ToString(), + //Change_Content = inParam["Change_Content"].ToString(), + Change_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm"), + Change_Content = JsonConvert.SerializeObject(item), + }; + task = FormulaBll.SevaTFS_UpdateFormula(tFS_UpdateFormula); + } + + } + + apiResult.Data = task; //userId = Request.Properties["token"] is ApiAuthInfo user ? user.FID : userId; //apiResult.Data = FormulaBll.DockingRecipeData(new List() { formula }, userId); diff --git a/FactorySystemApi/Web.config b/FactorySystemApi/Web.config index 91dd930..96a188f 100644 --- a/FactorySystemApi/Web.config +++ b/FactorySystemApi/Web.config @@ -13,7 +13,7 @@ - + diff --git a/FactorySystemBll/FormulaBll.cs b/FactorySystemBll/FormulaBll.cs index 3301e55..48e9578 100644 --- a/FactorySystemBll/FormulaBll.cs +++ b/FactorySystemBll/FormulaBll.cs @@ -80,7 +80,7 @@ namespace FactorySystemBll totalNumber = 0; var db = AppSettingsHelper.GetSqlSugar(); List list = db.Queryable() - .WhereIF(tr.FPlmCode != null, s => s.SP.Contains(tr.FPlmCode)) + .WhereIF(tr.FPlmCode != null, s => s.Change_Content.Contains(tr.FPlmCode)) .WhereIF(tr.FTestCode != null, s => s.SP_VALUE.Contains(tr.FTestCode)) .WhereIF(tr.FStatus != null, s => s.Status.Contains(tr.FStatus)) .Select("*").ToPageList(tr.FPageIndex, tr.FPageSize, ref totalNumber); @@ -536,7 +536,7 @@ namespace FactorySystemBll //taskId = db.Insertable(model).IgnoreColumns(true).ExecuteReturnIdentity(); taskId = db.Updateable(model).IgnoreColumns(true).ExecuteCommand(); } - catch (Exception) + catch (Exception ex) { taskId = -1; ;