diff --git a/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs b/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs index 775af25c..e1282f93 100644 --- a/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs +++ b/SGGL/BLL/CQMS/ProcessControl/InspectionManagementService.cs @@ -87,7 +87,7 @@ namespace BLL if (!string.IsNullOrEmpty(controlPointType)) { string[] types = controlPointType.Split(','); - q = q.Where(e=> types.Contains(e.ControlPointType)); + q = q.Where(e => types.Contains(e.ControlPointType)); } if (UnitWorkId != "0") { @@ -155,8 +155,8 @@ namespace BLL /// /// /// - public static int GetListCount(string projectId, string name, string startDate, string endDate) - { + public static int GetListCount(string projectId, string name, string startDate, string endDate) + { return count; } public static DataSet GetListData(string projectId, string name, string startDate, string endDate, int startRowIndex, int maximumRows) @@ -196,13 +196,13 @@ namespace BLL dataTable.Columns.Add(row.ToString()); } data.Tables.Add(dataTable); - for (int i = startRowIndex; i <= (startRowIndex + maximumRows)&&i /// 根据id修改验收日期和是否一次合格 /// - public static void UpdateByInspectionManagementId(Model.ProcessControl_InspectionManagement inspectionManagement) { + public static void UpdateByInspectionManagementId(Model.ProcessControl_InspectionManagement inspectionManagement) + { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { Model.ProcessControl_InspectionManagement newInspectionManagement = db.ProcessControl_InspectionManagement.FirstOrDefault(e => e.InspectionId == inspectionManagement.InspectionId); @@ -385,6 +386,11 @@ namespace BLL { newInspectionManagement.InspectionDate = inspectionManagement.InspectionDate; newInspectionManagement.IsOnceQualified = inspectionManagement.IsOnceQualified; + if (newInspectionManagement.IsOnceQualified == false) + { + newInspectionManagement.UnqualifiedReason = inspectionManagement.UnqualifiedReason; + } + newInspectionManagement.InspectionCode = inspectionManagement.InspectionCode; db.SubmitChanges(); } } diff --git a/SGGL/WebAPI/Controllers/CQMS/InspectionManagementController.cs b/SGGL/WebAPI/Controllers/CQMS/InspectionManagementController.cs index 632f6eea..b4ad158a 100644 --- a/SGGL/WebAPI/Controllers/CQMS/InspectionManagementController.cs +++ b/SGGL/WebAPI/Controllers/CQMS/InspectionManagementController.cs @@ -25,6 +25,8 @@ namespace WebAPI.Controllers.CQMS try { InspectionManagementService.UpdateByInspectionManagementId(model); + //上传附件 + SaveAttachFile(model.InspectionId + "R", BLL.Const.InspectionNoticeMenuId, model.AttachUrl); } catch (Exception ex) { @@ -35,5 +37,16 @@ namespace WebAPI.Controllers.CQMS return responeData; } #endregion + + public static void SaveAttachFile(string dataId, string menuId, string url) + { + Model.ToDoItem toDoItem = new Model.ToDoItem + { + MenuId = menuId, + DataId = dataId, + UrlStr = url, + }; + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } } } \ No newline at end of file