643 lines
30 KiB
C#
643 lines
30 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
namespace BLL
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 焊口管理
|
|||
|
/// </summary>
|
|||
|
public class PW_JointInfoService
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 根据焊口Id获取焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static Model.PW_JointInfo GetJointInfoByJotID(string jot_id)
|
|||
|
{
|
|||
|
return Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jot_id);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
public static List<ListItem> GetJOTSchList()
|
|||
|
{
|
|||
|
List<ListItem> res = new List<ListItem>();
|
|||
|
var q = from x in Funs.DB.PW_JointInfo select x.JOT_Sch;
|
|||
|
var list = q.Distinct().OrderBy(x=>x).ToList();
|
|||
|
foreach (string item in list){
|
|||
|
res.Add(new ListItem(item, item));
|
|||
|
}
|
|||
|
return res;
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 添加
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static string AddJointInfo(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
if (!IsExitJointNo(jointInfo.ProjectId, jointInfo.ISO_ID, jointInfo.JOT_JointNo))
|
|||
|
{
|
|||
|
string newKeyID = SQLHelper.GetNewID(typeof(Model.PW_JointInfo));
|
|||
|
Model.PW_JointInfo newJointInfo = new Model.PW_JointInfo();
|
|||
|
|
|||
|
newJointInfo.JOT_ID = newKeyID;
|
|||
|
newJointInfo.ProjectId = jointInfo.ProjectId;
|
|||
|
newJointInfo.JOT_JointNo = jointInfo.JOT_JointNo;
|
|||
|
newJointInfo.DReportID = jointInfo.DReportID;
|
|||
|
newJointInfo.ISO_ID = jointInfo.ISO_ID;
|
|||
|
newJointInfo.MaterialId = jointInfo.MaterialId;
|
|||
|
newJointInfo.MaterialId2 = jointInfo.MaterialId2;
|
|||
|
newJointInfo.JOT_CellWelder = jointInfo.JOT_CellWelder;
|
|||
|
newJointInfo.JOT_FloorWelder = jointInfo.JOT_FloorWelder;
|
|||
|
newJointInfo.WLO_Code = jointInfo.WLO_Code;
|
|||
|
newJointInfo.JOT_DoneDin = jointInfo.JOT_DoneDin;
|
|||
|
newJointInfo.JOT_FloorGroup = jointInfo.JOT_FloorGroup;
|
|||
|
newJointInfo.JOT_CellGroup = jointInfo.JOT_CellGroup;
|
|||
|
newJointInfo.IS_Compute = jointInfo.IS_Compute;
|
|||
|
newJointInfo.JOT_NDTResult = jointInfo.JOT_NDTResult;
|
|||
|
newJointInfo.JOT_Component1 = jointInfo.JOT_Component1;
|
|||
|
newJointInfo.JOT_Component2 = jointInfo.JOT_Component2;
|
|||
|
newJointInfo.JOT_HeartNo1 = jointInfo.JOT_HeartNo1;
|
|||
|
newJointInfo.JOT_HeartNo2 = jointInfo.JOT_HeartNo2;
|
|||
|
newJointInfo.JOT_WeldMat = jointInfo.JOT_WeldMat;
|
|||
|
newJointInfo.JOT_JointStatus = "100";
|
|||
|
newJointInfo.JOT_FaceCheckResult = jointInfo.JOT_FaceCheckResult;
|
|||
|
newJointInfo.JOT_FaceCheckDate = jointInfo.JOT_FaceCheckDate;
|
|||
|
newJointInfo.JOT_PHWTDate = jointInfo.JOT_PHWTDate;
|
|||
|
newJointInfo.JOT_PHWTReportNo = jointInfo.JOT_PHWTReportNo;
|
|||
|
newJointInfo.JOT_PHWTResult = jointInfo.JOT_PHWTResult;
|
|||
|
newJointInfo.JOT_FaceChecker = jointInfo.JOT_FaceChecker;
|
|||
|
newJointInfo.JOT_Dia = jointInfo.JOT_Dia;
|
|||
|
newJointInfo.DetectionRateId = jointInfo.DetectionRateId;
|
|||
|
newJointInfo.DetectionTypeId = jointInfo.DetectionTypeId;
|
|||
|
newJointInfo.Extend_Length = jointInfo.Extend_Length;
|
|||
|
newJointInfo.ISO_Type = jointInfo.ISO_Type;
|
|||
|
|
|||
|
|
|||
|
if (jointInfo.JOT_Size.HasValue)
|
|||
|
{
|
|||
|
newJointInfo.JOT_Size = jointInfo.JOT_Size;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
newJointInfo.JOT_Size = 0;
|
|||
|
}
|
|||
|
|
|||
|
newJointInfo.JOT_Sch = jointInfo.JOT_Sch;
|
|||
|
newJointInfo.JOT_FactSch = jointInfo.JOT_FactSch;
|
|||
|
newJointInfo.JOT_JointFlag = jointInfo.JOT_JointFlag;
|
|||
|
newJointInfo.JOT_TrustFlag = jointInfo.JOT_TrustFlag;
|
|||
|
newJointInfo.JOT_BecauseJointNo = jointInfo.JOT_BecauseJointNo;
|
|||
|
newJointInfo.JOT_JointDesc = jointInfo.JOT_JointDesc;
|
|||
|
newJointInfo.JOT_WeldSilk = jointInfo.JOT_WeldSilk;
|
|||
|
newJointInfo.JOTY_ID = jointInfo.JOTY_ID;
|
|||
|
newJointInfo.JOT_CheckFlag = jointInfo.JOT_CheckFlag;
|
|||
|
newJointInfo.JOT_RepairFlag = jointInfo.JOT_RepairFlag;
|
|||
|
newJointInfo.WME_ID = jointInfo.WME_ID;
|
|||
|
newJointInfo.JST_ID = jointInfo.JST_ID;
|
|||
|
newJointInfo.JOT_BelongPipe = jointInfo.JOT_BelongPipe;
|
|||
|
newJointInfo.JOT_CheckResult = jointInfo.JOT_CheckResult;
|
|||
|
newJointInfo.JOT_Electricity = jointInfo.JOT_Electricity;
|
|||
|
newJointInfo.JOT_Voltage = jointInfo.JOT_Voltage;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.JOT_ProessDate = jointInfo.JOT_ProessDate;
|
|||
|
newJointInfo.JOT_HotRpt = jointInfo.JOT_HotRpt;
|
|||
|
newJointInfo.JOT_PrepareTemp = jointInfo.JOT_PrepareTemp;
|
|||
|
newJointInfo.JOT_CellTemp = jointInfo.JOT_CellTemp;
|
|||
|
newJointInfo.JOT_LastTemp = jointInfo.JOT_LastTemp;
|
|||
|
newJointInfo.JOT_JointAttribute = jointInfo.JOT_JointAttribute;
|
|||
|
newJointInfo.JOT_CellWeldRules = jointInfo.JOT_CellWeldRules;
|
|||
|
newJointInfo.JOT_FloorWeldRules = jointInfo.JOT_FloorWeldRules;
|
|||
|
newJointInfo.Fix1_FloorWeld = jointInfo.Fix1_FloorWeld;
|
|||
|
newJointInfo.Fix1_CellWelder = jointInfo.Fix1_CellWelder;
|
|||
|
newJointInfo.Fix2_FloorWeld = jointInfo.Fix2_FloorWeld;
|
|||
|
newJointInfo.Fix2_CellWelder = jointInfo.Fix2_CellWelder;
|
|||
|
newJointInfo.PW_PointID = jointInfo.PW_PointID;
|
|||
|
newJointInfo.NDT_ID = jointInfo.NDT_ID;
|
|||
|
newJointInfo.CH_RepairID1 = jointInfo.CH_RepairID1;
|
|||
|
newJointInfo.CH_RepairID2 = jointInfo.CH_RepairID2;
|
|||
|
newJointInfo.Fix1_date = jointInfo.Fix1_date;
|
|||
|
newJointInfo.Fix2_date = jointInfo.Fix2_date;
|
|||
|
newJointInfo.JOT_Location = jointInfo.JOT_Location;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.JOT_Remark = jointInfo.JOT_Remark;
|
|||
|
newJointInfo.WeldingGasProtection = jointInfo.WeldingGasProtection;
|
|||
|
newJointInfo.WeldingSpeed = jointInfo.WeldingSpeed;
|
|||
|
newJointInfo.ActualPrepareTemp = jointInfo.ActualPrepareTemp;
|
|||
|
newJointInfo.ComponentNum = jointInfo.ComponentNum;
|
|||
|
|
|||
|
Funs.DB.PW_JointInfo.InsertOnSubmit(newJointInfo);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
|
|||
|
return newJointInfo.JOT_ID;
|
|||
|
}
|
|||
|
return "";
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static void UpdateJointInfo(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
Model.PW_JointInfo newJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jointInfo.JOT_ID);
|
|||
|
if (newJointInfo != null)
|
|||
|
{
|
|||
|
newJointInfo.JOT_JointNo = jointInfo.JOT_JointNo;
|
|||
|
//newJointInfo.DReportID = jointInfo.DReportID;
|
|||
|
newJointInfo.ISO_ID = jointInfo.ISO_ID;
|
|||
|
newJointInfo.MaterialId = jointInfo.MaterialId;
|
|||
|
newJointInfo.MaterialId2 = jointInfo.MaterialId2;
|
|||
|
//newJointInfo.JOT_CellWelder = jointInfo.JOT_CellWelder;
|
|||
|
//newJointInfo.JOT_FloorWelder = jointInfo.JOT_FloorWelder;
|
|||
|
//newJointInfo.WLO_Code = jointInfo.WLO_Code;
|
|||
|
newJointInfo.JOT_DoneDin = jointInfo.JOT_DoneDin;
|
|||
|
//newJointInfo.JOT_FloorGroup = jointInfo.JOT_FloorGroup;
|
|||
|
//newJointInfo.JOT_CellGroup = jointInfo.JOT_CellGroup;
|
|||
|
//newJointInfo.IS_Compute = jointInfo.IS_Compute;
|
|||
|
newJointInfo.Extend_Length = jointInfo.Extend_Length;
|
|||
|
newJointInfo.JOT_NDTResult = jointInfo.JOT_NDTResult;
|
|||
|
newJointInfo.JOT_Component1 = jointInfo.JOT_Component1;
|
|||
|
newJointInfo.DetectionRateId = jointInfo.DetectionRateId;
|
|||
|
newJointInfo.DetectionTypeId = jointInfo.DetectionTypeId;
|
|||
|
newJointInfo.JOT_Component2 = jointInfo.JOT_Component2;
|
|||
|
newJointInfo.JOT_HeartNo1 = jointInfo.JOT_HeartNo1;
|
|||
|
newJointInfo.JOT_HeartNo2 = jointInfo.JOT_HeartNo2;
|
|||
|
newJointInfo.JOT_WeldMat = jointInfo.JOT_WeldMat;
|
|||
|
newJointInfo.JOT_JointStatus = jointInfo.JOT_JointStatus;
|
|||
|
//newJointInfo.JOT_FaceCheckResult = jointInfo.JOT_FaceCheckResult;
|
|||
|
//newJointInfo.JOT_FaceCheckDate = jointInfo.JOT_FaceCheckDate;
|
|||
|
//newJointInfo.JOT_PHWTDate = jointInfo.JOT_PHWTDate;
|
|||
|
//newJointInfo.JOT_PHWTReportNo = jointInfo.JOT_PHWTReportNo;
|
|||
|
//newJointInfo.JOT_PHWTResult = jointInfo.JOT_PHWTResult;
|
|||
|
newJointInfo.JOT_FaceChecker = jointInfo.JOT_FaceChecker;
|
|||
|
newJointInfo.JOT_Dia = jointInfo.JOT_Dia;
|
|||
|
newJointInfo.JOT_Size = jointInfo.JOT_Size;
|
|||
|
newJointInfo.JOT_Sch = jointInfo.JOT_Sch;
|
|||
|
newJointInfo.JOT_FactSch = jointInfo.JOT_FactSch;
|
|||
|
//newJointInfo.JOT_JointFlag = jointInfo.JOT_JointFlag;
|
|||
|
//newJointInfo.JOT_TrustFlag = jointInfo.JOT_TrustFlag;
|
|||
|
newJointInfo.JOT_BecauseJointNo = jointInfo.JOT_BecauseJointNo;
|
|||
|
newJointInfo.JOT_JointDesc = jointInfo.JOT_JointDesc;
|
|||
|
newJointInfo.JOT_WeldSilk = jointInfo.JOT_WeldSilk;
|
|||
|
newJointInfo.JOTY_ID = jointInfo.JOTY_ID;
|
|||
|
//newJointInfo.JOT_CheckFlag = jointInfo.JOT_CheckFlag;
|
|||
|
//newJointInfo.JOT_RepairFlag = jointInfo.JOT_RepairFlag;
|
|||
|
newJointInfo.WME_ID = jointInfo.WME_ID;
|
|||
|
newJointInfo.JST_ID = jointInfo.JST_ID;
|
|||
|
newJointInfo.JOT_BelongPipe = jointInfo.JOT_BelongPipe;
|
|||
|
newJointInfo.JOT_CheckResult = jointInfo.JOT_CheckResult;
|
|||
|
newJointInfo.JOT_Electricity = jointInfo.JOT_Electricity;
|
|||
|
newJointInfo.JOT_Voltage = jointInfo.JOT_Voltage;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.JOT_ProessDate = jointInfo.JOT_ProessDate;
|
|||
|
newJointInfo.JOT_HotRpt = jointInfo.JOT_HotRpt;
|
|||
|
newJointInfo.JOT_PrepareTemp = jointInfo.JOT_PrepareTemp;
|
|||
|
newJointInfo.JOT_CellTemp = jointInfo.JOT_CellTemp;
|
|||
|
newJointInfo.JOT_LastTemp = jointInfo.JOT_LastTemp;
|
|||
|
newJointInfo.ISO_Type = jointInfo.ISO_Type;
|
|||
|
//newJointInfo.JOT_JointAttribute = jointInfo.JOT_JointAttribute;
|
|||
|
newJointInfo.JOT_CellWeldRules = jointInfo.JOT_CellWeldRules;
|
|||
|
newJointInfo.JOT_FloorWeldRules = jointInfo.JOT_FloorWeldRules;
|
|||
|
//newJointInfo.Fix1_FloorWeld = jointInfo.Fix1_FloorWeld;
|
|||
|
//newJointInfo.Fix1_CellWelder = jointInfo.Fix1_CellWelder;
|
|||
|
//newJointInfo.Fix2_FloorWeld = jointInfo.Fix2_FloorWeld;
|
|||
|
//newJointInfo.Fix2_CellWelder = jointInfo.Fix2_CellWelder;
|
|||
|
//newJointInfo.PW_PointID = jointInfo.PW_PointID;
|
|||
|
newJointInfo.NDT_ID = jointInfo.NDT_ID;
|
|||
|
//newJointInfo.CH_RepairID1 = jointInfo.CH_RepairID1;
|
|||
|
//newJointInfo.CH_RepairID2 = jointInfo.CH_RepairID2;
|
|||
|
//newJointInfo.Fix1_date = jointInfo.Fix1_date;
|
|||
|
//newJointInfo.Fix2_date = jointInfo.Fix2_date;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.JOT_Remark = jointInfo.JOT_Remark;
|
|||
|
//newJointInfo.JOT_Location = jointInfo.JOT_Location;
|
|||
|
newJointInfo.WeldingGasProtection = jointInfo.WeldingGasProtection;
|
|||
|
newJointInfo.ActualPrepareTemp = jointInfo.ActualPrepareTemp;
|
|||
|
newJointInfo.WeldingSpeed = jointInfo.WeldingSpeed;
|
|||
|
newJointInfo.ComponentNum = jointInfo.ComponentNum;
|
|||
|
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改更新导入焊口
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static void UpdateExportJoint(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
Model.PW_JointInfo newJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jointInfo.JOT_ID);
|
|||
|
if (newJointInfo != null)
|
|||
|
{
|
|||
|
newJointInfo.MaterialId = jointInfo.MaterialId;
|
|||
|
newJointInfo.MaterialId2 = jointInfo.MaterialId2;
|
|||
|
newJointInfo.JOTY_ID = jointInfo.JOTY_ID;
|
|||
|
newJointInfo.WLO_Code = jointInfo.WLO_Code;
|
|||
|
newJointInfo.JOT_JointAttribute = jointInfo.JOT_JointAttribute;
|
|||
|
newJointInfo.JOT_Size = jointInfo.JOT_Size;
|
|||
|
newJointInfo.JOT_JointDesc = jointInfo.JOT_JointDesc;
|
|||
|
newJointInfo.JOT_Sch = jointInfo.JOT_Sch;
|
|||
|
newJointInfo.WME_ID = jointInfo.WME_ID;
|
|||
|
newJointInfo.JOT_WeldMat = jointInfo.JOT_WeldMat;
|
|||
|
newJointInfo.JOT_WeldSilk = jointInfo.JOT_WeldSilk;
|
|||
|
newJointInfo.JST_ID = jointInfo.JST_ID;
|
|||
|
newJointInfo.JOT_Component1 = jointInfo.JOT_Component1;
|
|||
|
newJointInfo.JOT_Component2 = jointInfo.JOT_Component2;
|
|||
|
newJointInfo.JOT_HeartNo1 = jointInfo.JOT_HeartNo1;
|
|||
|
newJointInfo.JOT_HeartNo2 = jointInfo.JOT_HeartNo2;
|
|||
|
newJointInfo.JOT_BelongPipe = jointInfo.JOT_BelongPipe;
|
|||
|
newJointInfo.JOT_PrepareTemp = jointInfo.JOT_PrepareTemp;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.JOT_HotRpt = jointInfo.JOT_HotRpt;
|
|||
|
newJointInfo.JOT_Location = jointInfo.JOT_Location;
|
|||
|
newJointInfo.JOT_Dia = jointInfo.JOT_Dia;
|
|||
|
newJointInfo.WeldingGasProtection = jointInfo.WeldingGasProtection;
|
|||
|
|
|||
|
newJointInfo.DetectionTypeId = jointInfo.DetectionTypeId;
|
|||
|
newJointInfo.DetectionRateId = jointInfo.DetectionRateId;
|
|||
|
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改点口后焊接信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static void UpdateJointPoint(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
Model.PW_JointInfo newJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jointInfo.JOT_ID);
|
|||
|
if (newJointInfo != null)
|
|||
|
{
|
|||
|
newJointInfo.JOT_JointStatus = jointInfo.JOT_JointStatus;
|
|||
|
newJointInfo.PW_PointID = jointInfo.PW_PointID;
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 批量添加焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static void AddJointInfoFatch(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
Model.PW_JointInfo newJointInfo = new Model.PW_JointInfo();
|
|||
|
string NewKeyID = SQLHelper.GetNewID(typeof(Model.PW_JointInfo));
|
|||
|
newJointInfo.JOT_ID = NewKeyID;
|
|||
|
newJointInfo.ProjectId = jointInfo.ProjectId;
|
|||
|
newJointInfo.ISO_ID = jointInfo.ISO_ID;
|
|||
|
newJointInfo.JOT_JointNo = jointInfo.JOT_JointNo;
|
|||
|
newJointInfo.WLO_Code = jointInfo.WLO_Code;
|
|||
|
newJointInfo.MaterialId = jointInfo.MaterialId;
|
|||
|
newJointInfo.MaterialId2 = jointInfo.MaterialId2;
|
|||
|
newJointInfo.JOT_JointDesc = jointInfo.JOT_JointDesc;
|
|||
|
newJointInfo.JOTY_ID = jointInfo.JOTY_ID;
|
|||
|
newJointInfo.JOT_Size = jointInfo.JOT_Size;
|
|||
|
newJointInfo.JOT_Dia = jointInfo.JOT_Dia;
|
|||
|
newJointInfo.JOT_JointAttribute = jointInfo.JOT_JointAttribute;
|
|||
|
newJointInfo.JOT_Sch = jointInfo.JOT_Sch;
|
|||
|
newJointInfo.JOT_TrustFlag = jointInfo.JOT_TrustFlag;
|
|||
|
newJointInfo.JOT_CheckFlag = jointInfo.JOT_CheckFlag;
|
|||
|
newJointInfo.JOT_JointStatus = jointInfo.JOT_JointStatus;
|
|||
|
newJointInfo.JOT_WeldMat = jointInfo.JOT_WeldMat;
|
|||
|
newJointInfo.JOT_WeldSilk = jointInfo.JOT_WeldSilk;
|
|||
|
newJointInfo.WME_ID = jointInfo.WME_ID;
|
|||
|
newJointInfo.IS_Proess = jointInfo.IS_Proess;
|
|||
|
newJointInfo.DetectionTypeId = jointInfo.DetectionTypeId;
|
|||
|
newJointInfo.DetectionRateId = jointInfo.DetectionRateId;
|
|||
|
|
|||
|
|
|||
|
Funs.DB.PW_JointInfo.InsertOnSubmit(newJointInfo);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 删除
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_id"></param>
|
|||
|
public static void DeleteJointInfo(string jot_id)
|
|||
|
{
|
|||
|
Model.PW_JointInfo jointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jot_id);
|
|||
|
if (jointInfo!=null)
|
|||
|
{
|
|||
|
Funs.DB.PW_JointInfo.DeleteOnSubmit(jointInfo);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 删除管线下焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_id"></param>
|
|||
|
public static void DeleteJointInfoByIsoId(string iso_id)
|
|||
|
{
|
|||
|
var jointInfos = Funs.DB.PW_JointInfo.Where(e => e.ISO_ID == iso_id);
|
|||
|
if (jointInfos != null)
|
|||
|
{
|
|||
|
Funs.DB.PW_JointInfo.DeleteAllOnSubmit(jointInfos);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointInfo"></param>
|
|||
|
public static void UpdateJointInfoByDReport(Model.PW_JointInfo jointInfo)
|
|||
|
{
|
|||
|
Model.PW_JointInfo newJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jointInfo.JOT_ID);
|
|||
|
if (newJointInfo != null)
|
|||
|
{
|
|||
|
newJointInfo.JOT_JointNo = jointInfo.JOT_JointNo;
|
|||
|
newJointInfo.DReportID = jointInfo.DReportID;
|
|||
|
newJointInfo.JOT_CellWelder = jointInfo.JOT_CellWelder;
|
|||
|
newJointInfo.JOT_FloorWelder = jointInfo.JOT_FloorWelder;
|
|||
|
newJointInfo.WLO_Code = jointInfo.WLO_Code;
|
|||
|
newJointInfo.JOT_DoneDin = jointInfo.JOT_DoneDin;
|
|||
|
newJointInfo.JOT_JointAttribute = jointInfo.JOT_JointAttribute;
|
|||
|
newJointInfo.JOT_JointStatus = jointInfo.JOT_JointStatus;
|
|||
|
newJointInfo.JOT_Location = jointInfo.JOT_Location;
|
|||
|
newJointInfo.JOT_Electricity = jointInfo.JOT_Electricity;
|
|||
|
newJointInfo.JOT_Voltage = jointInfo.JOT_Voltage;
|
|||
|
newJointInfo.WeldingSpeed = jointInfo.WeldingSpeed;
|
|||
|
newJointInfo.JOT_PrepareTemp = jointInfo.JOT_PrepareTemp;
|
|||
|
newJointInfo.ActualPrepareTemp = jointInfo.ActualPrepareTemp;
|
|||
|
newJointInfo.JOT_CellTemp = jointInfo.JOT_CellTemp;
|
|||
|
newJointInfo.JOT_LastTemp = jointInfo.JOT_LastTemp;
|
|||
|
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 更新焊口号 固定焊口号后 +G
|
|||
|
/// </summary>
|
|||
|
/// <param name="jotId">焊口id</param>
|
|||
|
/// <param name="jointAttribute">焊口属性</param>
|
|||
|
/// <param name="operateState">日报操作(增加、删除)</param>
|
|||
|
public static void UpdateJointNoAddG(string jotId, string jointAttribute, string operateState)
|
|||
|
{
|
|||
|
if (operateState == Const.BtnDelete || jointAttribute != "固定")
|
|||
|
{
|
|||
|
Model.PW_JointInfo deleteJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jotId);
|
|||
|
if (deleteJointInfo.JOT_JointNo.Last() == 'G')
|
|||
|
{
|
|||
|
deleteJointInfo.JOT_JointNo = deleteJointInfo.JOT_JointNo.Substring(0, deleteJointInfo.JOT_JointNo.Length - 1);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Model.PW_JointInfo addJointInfo = Funs.DB.PW_JointInfo.FirstOrDefault(e => e.JOT_ID == jotId);
|
|||
|
if (addJointInfo.JOT_JointNo.Last() != 'G')
|
|||
|
{
|
|||
|
addJointInfo.JOT_JointNo += "G";
|
|||
|
}
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据焊接日报ID获取焊接日期
|
|||
|
/// </summary>
|
|||
|
/// <param name="dReportID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static DateTime GetReportDateByDReportID(string dReportID)
|
|||
|
{
|
|||
|
return (from y in Funs.DB.BO_WeldReportMain where y.DReportID == dReportID select y.JOT_WeldDate).FirstOrDefault();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据日报告号获取未切除焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static List<Model.PW_JointInfo> GetJointInfosByDReportID(string DReportID)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.DReportID == DReportID && x.JOT_JointStatus != "104" select x).ToList();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据日报获取焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="DReportID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static List<Model.PW_JointInfo> GetJointInfosAllByDReportID(string DReportID)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.DReportID == DReportID select x).ToList();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据点口编号获取未切除焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="PW_PointID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static List<Model.View_JointInfo> GetViewJointInfosByPointID(string PW_PointID)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.View_JointInfo where x.PW_PointID == PW_PointID && x.JOT_JointStatus != "104" orderby x.WorkAreaCode,x.ISO_IsoNo,x.JOT_JointNo select x).ToList();
|
|||
|
}
|
|||
|
public static List<Model.View_JointInfo> GetDistinctViewJointInfosByPointID(string PW_PointID)
|
|||
|
{
|
|||
|
List<Model.View_JointInfo> res = new List<Model.View_JointInfo>();
|
|||
|
|
|||
|
var q = (from x in Funs.DB.PW_JointInfo where x.PW_PointID == PW_PointID && x.JOT_JointStatus != "104" orderby x.ISO_ID, x.JOT_JointNo select x).ToList();
|
|||
|
foreach (var item in q)
|
|||
|
{
|
|||
|
|
|||
|
Model.View_JointInfo jot = new Model.View_JointInfo();
|
|||
|
jot.ISO_ID = item.ISO_ID;
|
|||
|
jot.JOT_ID = item.JOT_ID;
|
|||
|
var iso = Funs.DB.PW_IsoInfo.FirstOrDefault(x => x.ISO_ID == item.ISO_ID);
|
|||
|
if (iso != null)
|
|||
|
{
|
|||
|
jot.ISO_IsoNo = iso.ISO_IsoNo;
|
|||
|
var area = Funs.DB.ProjectData_WorkArea.FirstOrDefault(x => x.WorkAreaId == iso.WorkAreaId);
|
|||
|
if (area != null)
|
|||
|
{
|
|||
|
jot.WorkAreaCode = area.WorkAreaCode;
|
|||
|
}
|
|||
|
}
|
|||
|
jot.JOT_JointNo = item.JOT_JointNo;
|
|||
|
jot.JOTY_ID = item.JOTY_ID;
|
|||
|
jot.WLO_Code = item.WLO_Code;
|
|||
|
jot.JOT_JointAttribute = item.JOT_JointAttribute;
|
|||
|
jot.JOT_Size = item.JOT_Size;
|
|||
|
jot.JOT_JointDesc = item.JOT_JointDesc;
|
|||
|
jot.JOT_Sch = item.JOT_Sch;
|
|||
|
jot.WME_ID = item.WME_ID;
|
|||
|
jot.JOT_HeartNo1 = item.JOT_HeartNo1;
|
|||
|
jot.JOT_HeartNo2 = item.JOT_HeartNo2;
|
|||
|
jot.JOT_BelongPipe = item.JOT_BelongPipe;
|
|||
|
jot.JOT_PrepareTemp = item.JOT_PrepareTemp;
|
|||
|
jot.IS_Proess = item.IS_Proess;
|
|||
|
jot.JOT_HotRpt = item.JOT_HotRpt;
|
|||
|
jot.JOT_Location = item.JOT_Location;
|
|||
|
jot.JOT_Dia = item.JOT_Dia;
|
|||
|
var cellWelder = Funs.DB.BS_Welder.FirstOrDefault(x => x.WED_ID == item.JOT_CellWelder);
|
|||
|
if (cellWelder != null)
|
|||
|
{
|
|||
|
jot.WED_Code1 = cellWelder.WED_Code;
|
|||
|
}
|
|||
|
var floorWelder = Funs.DB.BS_Welder.FirstOrDefault(x => x.WED_ID == item.JOT_FloorWelder);
|
|||
|
if (floorWelder != null)
|
|||
|
{
|
|||
|
jot.WED_Code2 = floorWelder.WED_Code;
|
|||
|
}
|
|||
|
jot.DetectionTypeId = item.DetectionTypeId;
|
|||
|
jot.DetectionRateId = item.DetectionRateId;
|
|||
|
|
|||
|
|
|||
|
res.Add(jot);
|
|||
|
}
|
|||
|
return res;// (from x in Funs.DB.View_JointInfo where x.PW_PointID == PW_PointID && x.JOT_JointStatus != "104" orderby x.WorkAreaCode, x.ISO_IsoNo, x.JOT_JointNo select x).ToList();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据点口号获取焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="PW_PointID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static List<Model.PW_JointInfo> GetJointInfosAllByPointID(string PW_PointID)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.PW_PointID == PW_PointID select x).ToList();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据管线Id获取已焊接的焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="iso_id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetDeReportByJotID(string iso_id)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_id && x.DReportID != null select x.DReportID).FirstOrDefault();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据焊口号、管线号及区域号获取焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jointNo">焊口号</param>
|
|||
|
/// <param name="isoNo"></param>
|
|||
|
/// <param name="bAW_ID"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static Model.PW_JointInfo GetJointInfoByJointNoAndIsoNoAndBAW_ID(string projectId, string bAW_ID, string isoNo, string jointNo)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo join y in Funs.DB.PW_IsoInfo on x.ISO_ID equals y.ISO_ID where x.ProjectId == projectId && y.WorkAreaId == bAW_ID && y.ISO_IsoNo == isoNo && x.JOT_JointNo == jointNo select x).FirstOrDefault();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据焊口信息查找焊口信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_no"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetJointInfoByJOTNO(string iso_id, string jot_no)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_id && x.JOT_JointNo == jot_no select x.JOT_JointNo).FirstOrDefault();
|
|||
|
}
|
|||
|
public static List<Model.PW_JointInfo> GetJointInfoByISOId(string iso_id )
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_id select x).ToList();
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 根据焊接日报获取焊口数
|
|||
|
/// </summary>
|
|||
|
/// <param name="dreportId"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetJointInfoByDReportId(string dreportId)
|
|||
|
{
|
|||
|
var q = (from x in Funs.DB.PW_JointInfo where x.DReportID == dreportId select x).ToList();
|
|||
|
return q.Count();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据管线判断该管线下焊口是否已焊接
|
|||
|
/// </summary>
|
|||
|
/// <param name="iso_id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool IsExistJointInfoWeld(string iso_id)
|
|||
|
{
|
|||
|
var q = from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_id && x.DReportID != null select x;
|
|||
|
if (q.Count() > 0)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 判断是否存在相同焊口号
|
|||
|
/// </summary>
|
|||
|
/// <param name="projectId"></param>
|
|||
|
/// <param name="unitId"></param>
|
|||
|
/// <param name="baw_Id"></param>
|
|||
|
/// <param name="iso_Id"></param>
|
|||
|
/// <param name="jointNo"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool IsExitJointNo(string projectId, string iso_Id, string jointNo)
|
|||
|
{
|
|||
|
var q = from x in Funs.DB.PW_JointInfo where x.ProjectId == projectId && x.ISO_ID == iso_Id && x.JOT_JointNo == jointNo select x;
|
|||
|
|
|||
|
if (q.Count() > 0)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据管线Id获取点口不为空的焊口数量
|
|||
|
/// </summary>
|
|||
|
/// <param name="iso_Id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetJointCountByIsoIdPoint(string iso_Id)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_Id && x.PW_PointID != null select x).Count();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据管线焊口属性获取点口不为空的焊口数量
|
|||
|
/// </summary>
|
|||
|
/// <param name="iso_Id"></param>
|
|||
|
/// <param name="jointAttribute"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static int GetJointCountByIsoIdJointAttribute(string iso_Id, string jointAttribute)
|
|||
|
{
|
|||
|
return (from x in Funs.DB.PW_JointInfo where x.ISO_ID == iso_Id && x.PW_PointID != null && x.JOT_JointAttribute == jointAttribute select x).Count();
|
|||
|
}
|
|||
|
|
|||
|
public static System.Nullable<decimal> GetMaxJOTDiaByIsoIdPoint(string projectId, string iso_Id)
|
|||
|
{
|
|||
|
var list = (from x in Funs.DB.PW_JointInfo where x.ProjectId == projectId && x.ISO_ID == iso_Id && x.PW_PointID == null && x.DReportID != null && x.JOT_JointStatus != "104" select x.JOT_Dia).ToList();
|
|||
|
if (list != null && list.Count > 0)
|
|||
|
{
|
|||
|
return list.Max();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// 根据焊口Id获取焊口视图信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="jot_Id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static Model.View_JointInfo GetViewJointInfoByJotId(string jot_Id)
|
|||
|
{
|
|||
|
return Funs.DB.View_JointInfo.FirstOrDefault(e => e.JOT_ID == jot_Id);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|