initproject

This commit is contained in:
2024-05-08 10:02:08 +08:00
commit 98f03b1780
3859 changed files with 348243 additions and 0 deletions
@@ -0,0 +1,101 @@
using Model;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public static class Hard_ReportService
{
/// <summary>
///获取硬度报告信息
/// </summary>
/// <returns></returns>
public static Model.Hard_Report GetHardReportByHardReportId(string strHardReportId)
{
return Funs.DB.Hard_Report.FirstOrDefault(e => e.HardReportId == strHardReportId);
}
/// <summary>
///获取硬度报告视图信息
/// </summary>
/// <returns></returns>
public static Model.View_Hard_Report GetViewHardReportByHardReportId(string strHardReportId)
{
return Funs.DB.View_Hard_Report.FirstOrDefault(e => e.HardReportId == strHardReportId);
}
/// <summary>
/// 增加硬度报告信息
/// </summary>
/// <param name="setHardReport"></param>
public static void AddHard_Report(Model.Hard_Report setHardReport)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Report newHardReport = new Hard_Report
{
HardReportId = setHardReport.HardReportId,
HardTrustItemID = setHardReport.HardTrustItemID,
WeldJointId = setHardReport.WeldJointId,
HardReportNo = setHardReport.HardReportNo,
TestingPointNo = setHardReport.TestingPointNo,
HardNessValue1 = setHardReport.HardNessValue1,
HardNessValue2 = setHardReport.HardNessValue2,
HardNessValue3 = setHardReport.HardNessValue3,
Remark = setHardReport.Remark,
};
db.Hard_Report.InsertOnSubmit(newHardReport);
db.SubmitChanges();
}
/// <summary>
/// 修改硬度报告信息
/// </summary>
/// <param name="updateHardReport"></param>
public static void UpdateHard_Report(Model.Hard_Report updateHardReport)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Report newHardReport = db.Hard_Report.FirstOrDefault(e => e.HardReportId == updateHardReport.HardReportId);
if (newHardReport != null)
{
newHardReport.HardReportNo = updateHardReport.HardReportNo;
newHardReport.TestingPointNo = updateHardReport.TestingPointNo;
newHardReport.HardNessValue1 = updateHardReport.HardNessValue1;
newHardReport.HardNessValue2 = updateHardReport.HardNessValue2;
newHardReport.HardNessValue3 = updateHardReport.HardNessValue3;
newHardReport.Remark = updateHardReport.Remark;
db.SubmitChanges();
}
}
/// <summary>
/// 根据硬度报告Id删除一个硬度报告信息
/// </summary>
/// <param name="strHardReportId">装置ID</param>
public static void DeleteHard_ReportByHardReportId(string strHardReportId)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Report delHardReport = db.Hard_Report.FirstOrDefault(e => e.HardReportId == strHardReportId);
if (delHardReport != null)
{
db.Hard_Report.DeleteOnSubmit(delHardReport);
db.SubmitChanges();
}
}
/// <summary>
/// 根据硬度委托明细Id删除一个硬度报告信息
/// </summary>
/// <param name="strHardReportId">装置ID</param>
public static void DeleteHard_ReportsByHardTrustItemID(string strHardTrustItemID)
{
Model.HJGLDB db = Funs.DB;
var delHardReports = from x in db.Hard_Report where x.HardTrustItemID == strHardTrustItemID select x;
if (delHardReports.Count() >0)
{
db.Hard_Report.DeleteAllOnSubmit(delHardReports);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 硬度明细
/// </summary>
public static class Hard_TrustItemService
{
/// <summary>
/// 根据主键获取硬度明细
/// </summary>
/// <param name="hardTrustItemId"></param>
/// <returns></returns>
public static Model.Hard_TrustItem GetHardTrustItemById(string hardTrustItemId)
{
return Funs.DB.Hard_TrustItem.FirstOrDefault(e => e.HardTrustItemID == hardTrustItemId);
}
/// <summary>
/// 根据硬度Id获取相关明细信息
/// </summary>
/// <param name="hardTrustId"></param>
/// <returns></returns>
public static List<Model.Hard_TrustItem> GetHardTrustItemByHardTrustId(string hardTrustId)
{
return (from x in Funs.DB.Hard_TrustItem where x.HardTrustID == hardTrustId select x).ToList();
}
/// <summary>
/// 添加硬度明细
/// </summary>
/// <param name="hardTrustItem"></param>
public static void AddHardTrustItem(Model.Hard_TrustItem hardTrustItem)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_TrustItem newHardTrustItem = new Model.Hard_TrustItem();
newHardTrustItem.HardTrustItemID = SQLHelper.GetNewID(typeof(Model.Hard_TrustItem));
newHardTrustItem.HardTrustID = hardTrustItem.HardTrustID;
newHardTrustItem.HotProessTrustItemId = hardTrustItem.HotProessTrustItemId;
newHardTrustItem.WeldJointId = hardTrustItem.WeldJointId;
newHardTrustItem.IsPass = hardTrustItem.IsPass;
newHardTrustItem.IsTrust = hardTrustItem.IsTrust;
db.Hard_TrustItem.InsertOnSubmit(newHardTrustItem);
db.SubmitChanges();
}
/// <summary>
/// 修改硬度
/// </summary>
/// <param name="hardTrustItem"></param>
public static void UpdateHardTrustItem(Model.Hard_TrustItem hardTrustItem)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_TrustItem newHardTrustItem = db.Hard_TrustItem.FirstOrDefault(e => e.HardTrustItemID == hardTrustItem.HardTrustItemID);
if (newHardTrustItem != null)
{
newHardTrustItem.IsPass = hardTrustItem.IsPass;
newHardTrustItem.IsTrust = hardTrustItem.IsTrust;
newHardTrustItem.HardTrustItemID = hardTrustItem.HardTrustItemID;
db.SubmitChanges();
}
}
/// <summary>
/// 根据硬度主键删除相关明细信息
/// </summary>
/// <param name="hardTrustId"></param>
public static void DeleteHardTrustItemById(string hardTrustId)
{
Model.HJGLDB db = Funs.DB;
var hardTrustItem = (from x in db.Hard_TrustItem where x.HardTrustID == hardTrustId select x).ToList();
if (hardTrustItem != null)
{
db.Hard_TrustItem.DeleteAllOnSubmit(hardTrustItem);
db.SubmitChanges();
}
}
/// <summary>
/// 根据项目ID、硬度Id获取相关明细视图信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="hardTrustId"></param>
/// <returns></returns>
public static List<Model.View_Hard_TrustItem> GetViewHardTrustItem(string hardTrustId)
{
return (from x in Funs.DB.View_Hard_TrustItem where x.HardTrustID == hardTrustId select x).ToList();
}
}
}
@@ -0,0 +1,207 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 硬度委托
/// </summary>
public static class Hard_TrustService
{
/// <summary>
/// 根据主键获取硬度委托
/// </summary>
/// <param name="hardTrustID"></param>
/// <returns></returns>
public static Model.Hard_Trust GetHardTrustById(string hardTrustID)
{
return Funs.DB.Hard_Trust.FirstOrDefault(e => e.HardTrustID == hardTrustID);
}
/// <summary>
/// 添加硬度委托
/// </summary>
/// <param name="hardTrust"></param>
public static void AddHardTrust(Model.Hard_Trust hardTrust)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Trust newHardTrust = new Model.Hard_Trust();
newHardTrust.HardTrustID = hardTrust.HardTrustID;
newHardTrust.HardTrustNo = hardTrust.HardTrustNo;
newHardTrust.HardTrustUnit = hardTrust.HardTrustUnit;
newHardTrust.HardTrustDate = hardTrust.HardTrustDate;
newHardTrust.AuditMan = hardTrust.AuditMan;
newHardTrust.AuditDate = hardTrust.AuditDate;
newHardTrust.HardnessRate = hardTrust.HardnessRate;
newHardTrust.HardnessMethod = hardTrust.HardnessMethod;
newHardTrust.CheckUnit = hardTrust.CheckUnit;
newHardTrust.ProjectId = hardTrust.ProjectId;
newHardTrust.InstallationId = hardTrust.InstallationId;
newHardTrust.DetectionTime = hardTrust.DetectionTime;
newHardTrust.Sendee = hardTrust.Sendee;
newHardTrust.Standards = hardTrust.Standards;
newHardTrust.InspectionNum = hardTrust.InspectionNum;
newHardTrust.CheckNum = hardTrust.CheckNum;
newHardTrust.TestWeldNum = hardTrust.TestWeldNum;
newHardTrust.HardTrustMan = hardTrust.HardTrustMan;
db.Hard_Trust.InsertOnSubmit(newHardTrust);
db.SubmitChanges();
}
/// <summary>
/// 修改硬度委托
/// </summary>
/// <param name="hardTrust"></param>
public static void UpdateHardTrust(Model.Hard_Trust hardTrust)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Trust newHardTrust = db.Hard_Trust.FirstOrDefault(e => e.HardTrustID == hardTrust.HardTrustID);
if (newHardTrust != null)
{
newHardTrust.HardTrustNo = hardTrust.HardTrustNo;
newHardTrust.HardTrustUnit = hardTrust.HardTrustUnit;
newHardTrust.HardTrustDate = hardTrust.HardTrustDate;
newHardTrust.AuditMan = hardTrust.AuditMan;
newHardTrust.AuditDate = hardTrust.AuditDate;
newHardTrust.HardnessRate = hardTrust.HardnessRate;
newHardTrust.HardnessMethod = hardTrust.HardnessMethod;
newHardTrust.CheckUnit = hardTrust.CheckUnit;
newHardTrust.ProjectId = hardTrust.ProjectId;
newHardTrust.InstallationId = hardTrust.InstallationId;
newHardTrust.DetectionTime = hardTrust.DetectionTime;
newHardTrust.Sendee = hardTrust.Sendee;
newHardTrust.Standards = hardTrust.Standards;
newHardTrust.InspectionNum = hardTrust.InspectionNum;
newHardTrust.CheckNum = hardTrust.CheckNum;
newHardTrust.TestWeldNum = hardTrust.TestWeldNum;
newHardTrust.HardTrustMan = hardTrust.HardTrustMan;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除硬度委托
/// </summary>
/// <param name="hardTrustID"></param>
public static void DeleteHardTrustById(string hardTrustID)
{
Model.HJGLDB db = Funs.DB;
Model.Hard_Trust hardTrust = db.Hard_Trust.FirstOrDefault(e => e.HardTrustID == hardTrustID);
if (hardTrust != null)
{
db.Hard_Trust.DeleteOnSubmit(hardTrust);
db.SubmitChanges();
}
}
/// <summary>
/// 硬度委托委托单编号是否存在
/// </summary>
/// <param name="pointNo"></param>
/// <param name="pointId"></param>
/// <returns></returns>
public static bool IsExistTrustCode(string hardTrustNo, string hardTrustID, string projectId)
{
var q = Funs.DB.Hard_Trust.FirstOrDefault(x => x.HardTrustNo == hardTrustNo && x.ProjectId == projectId && x.HardTrustID != hardTrustID);
if (q != null)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 查找后返回集合增加到列表集团中
/// </summary>
/// <param name="hdItemsString"></param>
/// <returns></returns>
public static List<Model.View_Hard_TrustItem> GetHardTrustAddItem(string hdItemsString)
{
var jointInfos = from x in Funs.DB.View_Pipeline_WeldJoint select x;
List<Model.View_Hard_TrustItem> returnViewMatch = new List<Model.View_Hard_TrustItem>();
if (!string.IsNullOrEmpty(hdItemsString))
{
List<string> jotIds = Funs.GetStrListByStr(hdItemsString, '|');
foreach (var jotItem in jotIds)
{
string[] strs = jotItem.Split(',');
var jotInfo = jointInfos.FirstOrDefault(x => x.WeldJointId == strs[0]);
Model.View_Hard_TrustItem newItem = new Model.View_Hard_TrustItem();
newItem.HardTrustItemID = SQLHelper.GetNewID(typeof(Model.View_Hard_TrustItem));
newItem.WeldJointId = jotInfo.WeldJointId;
newItem.HotProessTrustItemId = strs[1];
newItem.PipelineCode = jotInfo.PipelineCode;
newItem.WeldJointCode = jotInfo.WeldJointCode;
newItem.WelderCode = jotInfo.WelderCode;
newItem.Specification = jotInfo.Specification;
newItem.MaterialCode = jotInfo.MaterialCode;
newItem.SingleNumber = jotInfo.SingleNumber;
newItem.Remark = jotInfo.Remark;
returnViewMatch.Add(newItem);
}
}
return returnViewMatch;
}
/// <summary>
/// 根据项目状态获取硬度委托委托明细信息
/// </summary>
/// <param name="ManagerTotalId"></param>
/// <returns></returns>
public static List<Model.View_Hard_TrustItem> GetHardTrustItem(string hardTrustID)
{
List<Model.View_Hard_TrustItem> returnViewMatch = (from x in Funs.DB.View_Hard_TrustItem
where x.HardTrustID == hardTrustID
select x).ToList();
return returnViewMatch;
}
/// <summary>
/// 查找需要硬度委托的焊口信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="hardTrustID"></param>
/// <param name="iso_id"></param>
/// <returns></returns>
public static List<Model.View_Hard_TrustItem> GetHardTrustFind(string projectId, string hardTrustID, string pipelineId)
{
///根据已经热处理且需要硬度检测且未进行硬度检测的焊口获取焊口视图集合
var weldJoints = (from x in Funs.DB.HotProess_TrustItem
join y in Funs.DB.View_Pipeline_WeldJoint
on x.WeldJointId equals y.WeldJointId
where y.PipelineId == pipelineId && x.IsHardness == true && x.IsTrust == null
select new {
WeldJointId = y.WeldJointId,
PipelineCode = y.PipelineCode,
WeldJointCode = y.WeldJointCode,
WelderCode = y.WelderCode,
Specification = y.Specification,
MaterialCode = y.MaterialCode,
SingleNumber = y.SingleNumber,
Remark=y.Remark,
HotProessTrustItemId = x.HotProessTrustItemId,
}).Distinct().ToList();
List<Model.View_Hard_TrustItem> returnViewMatch = new List<Model.View_Hard_TrustItem>();
foreach (var item in weldJoints)
{
Model.View_Hard_TrustItem newItem = new Model.View_Hard_TrustItem();
newItem.WeldJointId = item.WeldJointId;
newItem.PipelineCode = item.PipelineCode;
newItem.WeldJointCode = item.WeldJointCode;
newItem.WelderCode = item.WelderCode;
newItem.Specification = item.Specification;
newItem.MaterialCode = item.MaterialCode;
newItem.SingleNumber = item.SingleNumber;
newItem.Remark = item.Remark;
newItem.HotProessTrustItemId = item.HotProessTrustItemId;
returnViewMatch.Add(newItem);
}
return returnViewMatch;
}
}
}
@@ -0,0 +1,76 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 热处理报告
/// </summary>
public static class HotProessReportService
{
/// <summary>
/// 根据主键获取热处理报告
/// </summary>
/// <param name="hotProessReportId"></param>
/// <returns></returns>
public static Model.HotProess_Report GetHotProessReportById(string hotProessReportId)
{
return Funs.DB.HotProess_Report.FirstOrDefault(e => e.HotProessReportId == hotProessReportId);
}
/// <summary>
/// 添加热处理报告
/// </summary>
/// <param name="hotProessReport"></param>
public static void AddHotProessReport(Model.HotProess_Report hotProessReport)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Report newHotProessReport = new Model.HotProess_Report();
newHotProessReport.HotProessReportId = hotProessReport.HotProessReportId;
newHotProessReport.HotProessTrustItemId = hotProessReport.HotProessTrustItemId;
newHotProessReport.WeldJointId = hotProessReport.WeldJointId;
newHotProessReport.PointCount = hotProessReport.PointCount;
newHotProessReport.RequiredT = hotProessReport.RequiredT;
newHotProessReport.ActualT = hotProessReport.ActualT;
newHotProessReport.RequestTime = hotProessReport.RequestTime;
newHotProessReport.ActualTime = hotProessReport.ActualTime;
newHotProessReport.RecordChartNo = hotProessReport.RecordChartNo;
db.HotProess_Report.InsertOnSubmit(newHotProessReport);
db.SubmitChanges();
}
/// <summary>
/// 修改热处理报告
/// </summary>
/// <param name="hotProessReport"></param>
public static void UpdateHotProessReport(Model.HotProess_Report hotProessReport)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Report newHotProessReport = db.HotProess_Report.FirstOrDefault(e => e.HotProessReportId == hotProessReport.HotProessReportId);
if (newHotProessReport != null)
{
newHotProessReport.PointCount = hotProessReport.PointCount;
newHotProessReport.RequiredT = hotProessReport.RequiredT;
newHotProessReport.ActualT = hotProessReport.ActualT;
newHotProessReport.RequestTime = hotProessReport.RequestTime;
newHotProessReport.ActualTime = hotProessReport.ActualTime;
newHotProessReport.RecordChartNo = hotProessReport.RecordChartNo;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除热处理报告
/// </summary>
/// <param name="hotProessReportId"></param>
public static void DeleteHotProessReportById(string hotProessReportId)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Report hotProessReport = db.HotProess_Report.FirstOrDefault(e => e.HotProessReportId == hotProessReportId);
if (hotProessReport != null)
{
db.HotProess_Report.DeleteOnSubmit(hotProessReport);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 热处理明细
/// </summary>
public static class HotProessTrustItemService
{
/// <summary>
/// 根据主键获取热处理明细
/// </summary>
/// <param name="hotProessTrustItemId"></param>
/// <returns></returns>
public static Model.HotProess_TrustItem GetHotProessTrustItemById(string hotProessTrustItemId)
{
return Funs.DB.HotProess_TrustItem.FirstOrDefault(e => e.HotProessTrustItemId == hotProessTrustItemId);
}
/// <summary>
/// 根据热处理Id获取相关明细信息
/// </summary>
/// <param name="hotProessTrustId"></param>
/// <returns></returns>
public static List<Model.HotProess_TrustItem> GetHotProessTrustItemByHotProessTrustId(string hotProessTrustId)
{
return (from x in Funs.DB.HotProess_TrustItem where x.HotProessTrustId == hotProessTrustId select x).ToList();
}
/// <summary>
/// 添加热处理明细
/// </summary>
/// <param name="hotProessTrustItem"></param>
public static void AddHotProessTrustItem(Model.HotProess_TrustItem hotProessTrustItem)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_TrustItem newHotProessTrustItem = new Model.HotProess_TrustItem();
newHotProessTrustItem.HotProessTrustItemId = SQLHelper.GetNewID(typeof(Model.HotProess_TrustItem));
newHotProessTrustItem.HotProessTrustId = hotProessTrustItem.HotProessTrustId;
newHotProessTrustItem.WeldJointId = hotProessTrustItem.WeldJointId;
newHotProessTrustItem.IsPass = hotProessTrustItem.IsPass;
newHotProessTrustItem.IsHardness = hotProessTrustItem.IsHardness;
newHotProessTrustItem.IsTrust = hotProessTrustItem.IsTrust;
newHotProessTrustItem.HardTrustItemID = hotProessTrustItem.HardTrustItemID;
db.HotProess_TrustItem.InsertOnSubmit(newHotProessTrustItem);
db.SubmitChanges();
}
/// <summary>
/// 修改热处理
/// </summary>
/// <param name="hotProessTrustItem"></param>
public static void UpdateHotProessTrustItem(Model.HotProess_TrustItem hotProessTrustItem)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_TrustItem newHotProessTrustItem = db.HotProess_TrustItem.FirstOrDefault(e => e.HotProessTrustItemId == hotProessTrustItem.HotProessTrustItemId);
if (newHotProessTrustItem != null)
{
newHotProessTrustItem.HotProessTrustId = hotProessTrustItem.HotProessTrustId;
newHotProessTrustItem.WeldJointId = hotProessTrustItem.WeldJointId;
newHotProessTrustItem.IsPass = hotProessTrustItem.IsPass;
newHotProessTrustItem.IsHardness = hotProessTrustItem.IsHardness;
newHotProessTrustItem.IsTrust = hotProessTrustItem.IsTrust;
newHotProessTrustItem.HardTrustItemID = hotProessTrustItem.HardTrustItemID;
db.SubmitChanges();
}
}
/// <summary>
/// 修改热处理反馈及硬度委托信息
/// </summary>
/// <param name="hotProessTrustItem"></param>
public static void UpdateHotProessFeedback(Model.HotProess_TrustItem hotProessTrustItem)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_TrustItem newHotProessTrustItem = db.HotProess_TrustItem.FirstOrDefault(e => e.HotProessTrustItemId == hotProessTrustItem.HotProessTrustItemId);
if (newHotProessTrustItem != null)
{
newHotProessTrustItem.IsPass = hotProessTrustItem.IsPass;
newHotProessTrustItem.IsHardness = hotProessTrustItem.IsHardness;
db.SubmitChanges();
}
}
/// <summary>
/// 根据热处理主键删除相关明细信息
/// </summary>
/// <param name="hotProessTrustId"></param>
public static void DeleteHotProessTrustItemById(string hotProessTrustId)
{
Model.HJGLDB db = Funs.DB;
var hotProessTrustItem = (from x in db.HotProess_TrustItem where x.HotProessTrustId == hotProessTrustId select x).ToList();
if (hotProessTrustItem != null)
{
db.HotProess_TrustItem.DeleteAllOnSubmit(hotProessTrustItem);
db.SubmitChanges();
}
}
/// <summary>
/// 根据项目ID、热处理Id获取相关明细视图信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="hotProessTrustId"></param>
/// <returns></returns>
public static List<Model.View_HotProess_TrustItem> GetViewHotProessTrustItem(string projectId, string hotProessTrustId)
{
return (from x in Funs.DB.View_HotProess_TrustItem where x.ProjectId == projectId && x.HotProessTrustId == hotProessTrustId select x).ToList();
}
}
}
@@ -0,0 +1,198 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 热处理设备
/// </summary>
public static class HotProess_TrustService
{
/// <summary>
/// 根据主键获取热处理
/// </summary>
/// <param name="hotProessTrustId"></param>
/// <returns></returns>
public static Model.HotProess_Trust GetHotProessTrustById(string hotProessTrustId)
{
return Funs.DB.HotProess_Trust.FirstOrDefault(e => e.HotProessTrustId == hotProessTrustId);
}
/// <summary>
/// 添加热处理
/// </summary>
/// <param name="hotProessTrust"></param>
public static void AddHotProessTrust(Model.HotProess_Trust hotProessTrust)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Trust newHotProessTrust = new Model.HotProess_Trust();
newHotProessTrust.HotProessTrustId = hotProessTrust.HotProessTrustId;
newHotProessTrust.HotProessTrustNo = hotProessTrust.HotProessTrustNo;
newHotProessTrust.ProessDate = hotProessTrust.ProessDate;
newHotProessTrust.InstallationId = hotProessTrust.InstallationId;
newHotProessTrust.ProjectId = hotProessTrust.ProjectId;
newHotProessTrust.UnitId = hotProessTrust.UnitId;
newHotProessTrust.Tabler = hotProessTrust.Tabler;
newHotProessTrust.Remark = hotProessTrust.Remark;
newHotProessTrust.ProessMethod = hotProessTrust.ProessMethod;
newHotProessTrust.ProessEquipment = hotProessTrust.ProessEquipment;
db.HotProess_Trust.InsertOnSubmit(newHotProessTrust);
db.SubmitChanges();
}
/// <summary>
/// 修改热处理
/// </summary>
/// <param name="hotProessTrust"></param>
public static void UpdateHotProessTrust(Model.HotProess_Trust hotProessTrust)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Trust newHotProessTrust = db.HotProess_Trust.FirstOrDefault(e => e.HotProessTrustId == hotProessTrust.HotProessTrustId);
if (newHotProessTrust != null)
{
newHotProessTrust.HotProessTrustNo = hotProessTrust.HotProessTrustNo;
newHotProessTrust.ProessDate = hotProessTrust.ProessDate;
newHotProessTrust.InstallationId = hotProessTrust.InstallationId;
newHotProessTrust.ProjectId = hotProessTrust.ProjectId;
newHotProessTrust.UnitId = hotProessTrust.UnitId;
newHotProessTrust.Tabler = hotProessTrust.Tabler;
newHotProessTrust.Remark = hotProessTrust.Remark;
newHotProessTrust.ProessMethod = hotProessTrust.ProessMethod;
newHotProessTrust.ProessEquipment = hotProessTrust.ProessEquipment;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除热处理
/// </summary>
/// <param name="hotProessTrustId"></param>
public static void DeleteHotProessTrustById(string hotProessTrustId)
{
Model.HJGLDB db = Funs.DB;
Model.HotProess_Trust hotProessTrust = db.HotProess_Trust.FirstOrDefault(e => e.HotProessTrustId == hotProessTrustId);
if (hotProessTrust != null)
{
db.HotProess_Trust.DeleteOnSubmit(hotProessTrust);
db.SubmitChanges();
}
}
/// <summary>
/// 热处理委托单编号是否存在
/// </summary>
/// <param name="pointNo"></param>
/// <param name="pointId"></param>
/// <returns></returns>
public static bool IsExistTrustCode(string hotProessTrustNo, string hotProessTrustId, string projectId)
{
var q = Funs.DB.HotProess_Trust.FirstOrDefault(x => x.HotProessTrustNo == hotProessTrustNo && x.ProjectId == projectId && x.HotProessTrustId != hotProessTrustId);
if (q != null)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 查找后返回集合增加到列表集团中
/// </summary>
/// <param name="hdItemsString"></param>
/// <returns></returns>
public static List<Model.View_HotProess_TrustItem> GetHotProessTrustAddItem(string hdItemsString)
{
var jointInfos = from x in Funs.DB.View_Pipeline_WeldJoint select x;
List<Model.View_HotProess_TrustItem> returnViewMatch = new List<Model.View_HotProess_TrustItem>();
if (!string.IsNullOrEmpty(hdItemsString))
{
List<string> jotIds = Funs.GetStrListByStr(hdItemsString, '|');
foreach (var jotItem in jotIds)
{
string[] strs = jotItem.Split(',');
var jotInfo = jointInfos.FirstOrDefault(x => x.WeldJointId == strs[0]);
Model.View_HotProess_TrustItem newItem = new Model.View_HotProess_TrustItem();
newItem.HotProessTrustItemId = SQLHelper.GetNewID(typeof(Model.View_HotProess_TrustItem));
newItem.WeldJointId = jotInfo.WeldJointId;
newItem.WeldJointCode = jotInfo.WeldJointCode;
newItem.PipelineCode = jotInfo.PipelineCode;
newItem.Specification = jotInfo.Specification;
newItem.MaterialCode = jotInfo.Material1Code;
returnViewMatch.Add(newItem);
}
}
return returnViewMatch;
}
/// <summary>
/// 根据项目状态获取热处理委托明细信息
/// </summary>
/// <param name="ManagerTotalId"></param>
/// <returns></returns>
public static List<Model.View_HotProess_TrustItem> GetHotProessTrustItem(string projectId, string hotProessTrustId)
{
List<Model.View_HotProess_TrustItem> returnViewMatch = (from x in Funs.DB.View_HotProess_TrustItem
where x.ProjectId == projectId && x.HotProessTrustId == hotProessTrustId
select x).ToList();
return returnViewMatch;
}
/// <summary>
/// 查找需要热处理的焊口信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="hotProessTrustId"></param>
/// <param name="iso_id"></param>
/// <returns></returns>
public static List<Model.View_HotProessTrustItemSearch> GetHotProessTrustFind(string projectId, string hotProessTrustId, string pipelineId)
{
Model.HJGLDB db = Funs.DB;
var weldJoints = (from x in db.View_Pipeline_WeldJoint select x).ToList();
List<Model.View_HotProessTrustItemSearch> returnViewMatch = new List<Model.View_HotProessTrustItemSearch>();
var hotProessTrustItems = from x in Funs.DB.HotProess_TrustItem
join z in Funs.DB.Pipeline_WeldJoint
on x.WeldJointId equals z.WeldJointId
where z.ProjectId == projectId && z.PipelineId == pipelineId
select x;
if (weldJoints.Count() > 0)
{
foreach (var item in weldJoints)
{
var jothotProessTrustItems = from x in hotProessTrustItems where x.WeldJointId == item.WeldJointId select x;
bool isShow = false;
if (item.IsHotProess == true)//需要热处理
{
if (jothotProessTrustItems.Count() == 0) //未进行过热处理
{
isShow = true;
}
if (isShow)
{
Model.View_HotProessTrustItemSearch newItem = new Model.View_HotProessTrustItemSearch();
newItem.WeldJointId = item.WeldJointId;
newItem.PipelineId = item.PipelineId;
newItem.PipelineCode = item.PipelineCode;
newItem.WeldJointCode = item.WeldJointCode;
newItem.Specification = item.Specification;
newItem.MaterialCode = item.Material1Code;
newItem.WeldingDailyId = item.WeldingDailyId;
var weldingDaily = BLL.Pipeline_WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
if (weldingDaily != null)
{
newItem.WeldingDate = weldingDaily.WeldingDate;
}
returnViewMatch.Add(newItem);
}
}
}
}
return returnViewMatch;
}
}
}