diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index 809a674e..c2c0eec0 100644 Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ diff --git a/SGGL/BLL/API/HJGL/APIPipeJointService.cs b/SGGL/BLL/API/HJGL/APIPipeJointService.cs index 4d88808e..a5e440d5 100644 --- a/SGGL/BLL/API/HJGL/APIPipeJointService.cs +++ b/SGGL/BLL/API/HJGL/APIPipeJointService.cs @@ -7,6 +7,7 @@ namespace BLL public static class APIPipeJointService { #region 获取管线信息 + /// /// 根据单位工程ID获取管线列表 /// @@ -23,16 +24,31 @@ namespace BLL { BaseInfoId = x.PipelineId, BaseInfoCode = x.PipelineCode - } ).ToList(); return getDataLists; } } - #endregion + public static List GetPipelineidListByCode(string pipelineCode, string projectid) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + // 从数据库中获取符合条件的管线数据 + var pipelines = db.HJGL_Pipeline + .Where(p =>p.ProjectId==projectid&& p.PipelineCode.Contains(pipelineCode)) + .OrderBy(p => p.PipelineCode) + .ToList(); + return pipelines; + } + } + + #endregion 获取管线信息 + + #region 获取未焊接的焊口信息 + /// /// 根据管线ID获取未焊接的焊口信息 /// @@ -53,13 +69,14 @@ namespace BLL } ).ToList(); - return getData; } } - #endregion + + #endregion 获取未焊接的焊口信息 #region 根据管线ID获取所有焊口信息 + /// /// 根据管线ID获取所有焊口信息 /// @@ -81,9 +98,11 @@ namespace BLL return getDataLists; } } - #endregion + + #endregion 根据管线ID获取所有焊口信息 #region 获取焊工列表 + /// /// 根据管线ID获取焊口列表 /// @@ -162,6 +181,7 @@ namespace BLL } #region 焊工资质判断 + /// /// 一种焊接方法资质判断 /// @@ -216,6 +236,7 @@ namespace BLL return isok; } + /// /// 两种焊接方法资质判断 /// @@ -273,7 +294,6 @@ namespace BLL { isok = true; } - else { fThicknessMax = floorQ.Max(x => x.ThicknessMax); @@ -295,12 +315,13 @@ namespace BLL return isok; } - #endregion - #endregion + #endregion 焊工资质判断 + #endregion 获取焊工列表 #region 根据焊口ID获取焊口信息 + /// /// 根据焊口ID获取焊口信息 /// @@ -329,12 +350,12 @@ namespace BLL DetectionRate = GetDetectionRate(x.PipelineId), IsHotProess = x.IsHotProess == true ? "是" : "否", AttachUrl = x.AttachUrl - }; return getDateInfo.FirstOrDefault(); } } - #endregion + + #endregion 根据焊口ID获取焊口信息 /// /// 根据管线ID获取探伤比例 @@ -354,6 +375,7 @@ namespace BLL } #region 根据焊口标识获取焊口详细信息 + /// /// 根据焊口标识获取焊口详细信息 /// @@ -387,14 +409,15 @@ namespace BLL CoverWelderCode = db.SitePerson_Person.First(z => z.PersonId == x.CoverWelderId).WelderCode, IsHotProess = x.IsHotProess == true ? "是" : "否", AttachUrl = x.AttachUrl - }; return getDateInfo.FirstOrDefault(); } } - #endregion + + #endregion 根据焊口标识获取焊口详细信息 #region 保存管线焊口信息 + /// /// 保存管线焊口信息 /// @@ -461,7 +484,6 @@ namespace BLL db.HJGL_Pipeline.InsertOnSubmit(newPipe); db.SubmitChanges(); - } var jot = db.HJGL_WeldJoint.Where(x => x.PipelineId == pipelineId && (x.WeldJointCode == addItem.WeldJointCode || x.WeldJointIdentify == addItem.WeldJointIdentify)).FirstOrDefault(); @@ -532,9 +554,11 @@ namespace BLL } } } - #endregion + + #endregion 保存管线焊口信息 #region 批量保存管线焊口信息 + /// /// 批量保存管线焊口信息 /// @@ -550,7 +574,7 @@ namespace BLL } } - #endregion + #endregion 批量保存管线焊口信息 /// /// 保存预提交日报 @@ -583,13 +607,10 @@ namespace BLL JointAttribute = addItem.JointAttribute, WeldingMode = addItem.WeldingMode, AttachUrl = addItem.AttachUrl - }; db.HJGL_PreWeldingDaily.InsertOnSubmit(newP); db.SubmitChanges(); } - } - } -} +} \ No newline at end of file diff --git a/SGGL/WebAPI/Controllers/HJGL/PipeJointController.cs b/SGGL/WebAPI/Controllers/HJGL/PipeJointController.cs index 97645038..3dbd3398 100644 --- a/SGGL/WebAPI/Controllers/HJGL/PipeJointController.cs +++ b/SGGL/WebAPI/Controllers/HJGL/PipeJointController.cs @@ -1,6 +1,7 @@ using BLL; using System; using System.Collections.Generic; +using System.Linq; using System.Web.Http; namespace WebAPI.Controllers @@ -30,7 +31,36 @@ namespace WebAPI.Controllers return responeData; } + /// + /// 根据管线号查找pipelinid + /// + /// + /// + /// + /// + /// + public Model.ResponeData GetPipelineidListByCode(string pipelineCode, string projectid,int pageindex, int pageSize) + { + var responeData = new Model.ResponeData(); + try + { + var pipelineidList = APIPipeJointService.GetPipelineidListByCode(pipelineCode,projectid); + + int pageCount = pipelineidList.Count; + if (pageCount > 0 && pageindex > 0 && pageSize > 0) + { + pipelineidList = pipelineidList.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); + } + responeData.data = new { pageCount, pipelineidList }; + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } /// /// 根据管线ID获取未焊接的焊口信息 ///