diff --git a/SGGL/BLL/API/APICommonService.cs b/SGGL/BLL/API/APICommonService.cs index 4b3ceec3..cd90c67e 100644 --- a/SGGL/BLL/API/APICommonService.cs +++ b/SGGL/BLL/API/APICommonService.cs @@ -327,6 +327,23 @@ db.SubmitChanges(); } } + public static void SaveSysHttpLog(string userName, string httpUrl, string logTxt, string method) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Sys_HttpLog newLog = new Model.Sys_HttpLog() + { + HttpLogId = SQLHelper.GetNewID(), + LogTime = DateTime.Now, + UserName = userName, + HttpUrl = httpUrl, + LogTxt = logTxt, + MeThod = method + }; + db.Sys_HttpLog.InsertOnSubmit(newLog); + db.SubmitChanges(); + } + } /// diff --git a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs index a3304616..c5f796ac 100644 --- a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs +++ b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs @@ -261,7 +261,8 @@ namespace BLL { string res = ""; using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) - { + { + try { var peson=db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid); if (peson == null) { @@ -275,6 +276,7 @@ namespace BLL return res; } var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date); + var weldTask=db.HJGL_WeldTask.FirstOrDefault(x=>x.WeldJointId==joint.WeldJointId); if (weldingDaily == null) { string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-"; @@ -284,7 +286,7 @@ namespace BLL weldingDaily.WeldingDate = Convert.ToDateTime(time).Date; weldingDaily.ProjectId = joint.ProjectId; weldingDaily.UnitWorkId = joint.UnitWorkId; - weldingDaily.UnitId = joint.UnitId; + weldingDaily.UnitId = weldTask?.UnitId; weldingDaily.Tabler = Personid; weldingDaily.TableDate = Convert.ToDateTime(time).Date; db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily); @@ -297,7 +299,11 @@ namespace BLL InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId); } BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd); - + } + catch (Exception ex) + { + APICommonService.SaveSysAPILog("erro", ex.ToString(),"-1"); + } } return res; diff --git a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx index f03b0c43..27e3594e 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -99,7 +99,7 @@ namespace FastReport } - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index 70102ee0..e24f0534 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -549,9 +549,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage { if (Grid2.SelectedRowIDArray.Count() > 0) { SaveTask(); - Response.Redirect(Request.Url.ToString()); ShowNotify("生成任务单成功!", MessageBoxIcon.Warning); - + // Alert.Show("生成任务单成功!", MessageBoxIcon.Warning); + Grid1.DataSource = null; + Grid1.DataBind(); + Grid2.DataSource = null; + Grid2.DataBind(); + Grid3.DataSource = null; + Grid3.DataBind(); } else { @@ -563,14 +568,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage { var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x; var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x; - var toDoMatterList = (from x in Funs.DB.View_HJGL_NoWeldJointFind - where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null - select x).ToList(); var selectRowId = (from x in Funs.DB.View_HJGL_NoWeldJointFind - where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null && !string.IsNullOrEmpty(x.WeldingMethodCode) + where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && + x.WeldTaskId == null && x.WeldingMethodCode != null select x).ToList(); foreach (var weldjoint in selectRowId) - { + { string canWeldingRodName = string.Empty; string canWeldingWireName = string.Empty; Model.HJGL_WeldTask NewTask = new Model.HJGL_WeldTask(); @@ -657,7 +660,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage BLL.WeldTaskService.AddWeldTask(NewTask); } - } + } private bool IsCoverClass(string wpsClass, string matClass) { bool isCover = false; diff --git a/SGGL/WebAPI/Global.asax.cs b/SGGL/WebAPI/Global.asax.cs index a9a583ee..529ee841 100644 --- a/SGGL/WebAPI/Global.asax.cs +++ b/SGGL/WebAPI/Global.asax.cs @@ -8,6 +8,7 @@ using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; +using WebAPI.Log; namespace WebAPI { @@ -32,6 +33,7 @@ namespace WebAPI // 使api返回为json GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); + GlobalConfiguration.Configuration.MessageHandlers.Add(new CustomMessageHandler()); } /// diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 1e6f4f43..24cbf101 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -246,6 +246,7 @@ Global.asax +