From 31d525a01e27891b202d3223fee88e6d71f1b968 Mon Sep 17 00:00:00 2001
From: 10191 <506754232@qq.com>
Date: Fri, 29 May 2026 09:45:08 +0800
Subject: [PATCH 1/3] 11
---
.../HJGL/JoinMarking/DataInEdit.aspx | 32 +---------
.../HJGL/JoinMarking/DataInEdit.aspx.cs | 43 ++-----------
.../JoinMarking/DataInEdit.aspx.designer.cs | 63 -------------------
3 files changed, 8 insertions(+), 130 deletions(-)
diff --git a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx
index 6e60033c..1a22b1de 100644
--- a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx
@@ -1,4 +1,4 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataInEdit.aspx.cs" Inherits="FineUIPro.Web.HJGL.JoinMarking.DataInEdit" %>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataInEdit.aspx.cs" Inherits="FineUIPro.Web.HJGL.JoinMarking.DataInEdit" %>
@@ -14,40 +14,14 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.cs
index 12941ceb..e25e9c96 100644
--- a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.cs
@@ -42,8 +42,6 @@ namespace FineUIPro.Web.HJGL.JoinMarking
{
if (!IsPostBack)
{
- Base_PipingClassService.InitPipingClassDropDownList(this.drpPipingClass, this.CurrUser.LoginProjectId, true, "请选择");//管线等级
- Base_DetectionRateService.InitDetectionRateDropDownList(drpDetectionRate, true);
BLL.Base_MaterialService.InitMaterialDropDownList(this.drpMaterial1, true, "请选择");//材质1
BLL.Base_MaterialService.InitMaterialDropDownList(this.drpMaterial2, true, "请选择");//材质2
BLL.Base_WeldTypeService.InitWeldTypeDropDownList(this.drpWeldTypeCode, "请选择", true);//焊缝类型
@@ -200,42 +198,12 @@ namespace FineUIPro.Web.HJGL.JoinMarking
}
Model.View_HJGL_Pipeline pipeline = BLL.PipelineService.GetViewPipelineByPipelineId(this.PipelineId);
- if (pipeline != null)
- {
- if (!string.IsNullOrEmpty(pipeline.PipingClassId))
- {
- this.drpPipingClass.SelectedValue = pipeline.PipingClassId;
- }
-
- if (!string.IsNullOrEmpty(pipeline.DetectionRateId))
- {
- this.drpDetectionRate.SelectedValue = pipeline.DetectionRateId;
- }
- if (!string.IsNullOrEmpty(pipeline.DetectionType))
- {
- string[] dtype = pipeline.DetectionType.Split('|');
- string DetectionTypestr = "";
- for (int i = 0; i < dtype.Length; i++)
- {
- var DetectionType = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(dtype[i].ToString());
- if (i == 0)
- {
- DetectionTypestr = DetectionType.DetectionTypeCode;
- }
- else
- {
- DetectionTypestr += "," + DetectionType.DetectionTypeCode;
- }
- }
- this.txtDetectionType.Text = DetectionTypestr;
- }
- this.txtPipelineCode.Text = pipeline.PipelineCode;
- }
+
if (!string.IsNullOrEmpty(isTwoJoint))
{
//string perfix = txtPipelineCode.Text + "/Z-";
- string perfix = txtPipelineCode.Text + "/";
+ string perfix = pipeline.PipelineCode + "/";
this.txtWeldJointCode.Text = perfix;
// txtWeldJointCode.Text = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_WeldJoint", "WeldJointCode", this.CurrUser.LoginProjectId, perfix);
@@ -260,7 +228,7 @@ namespace FineUIPro.Web.HJGL.JoinMarking
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_WeldJointMenuId, BLL.Const.BtnModify))
{
- if (this.drpPipingClass.SelectedValue == BLL.Const._Null || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null)
+ if ( this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("材质1、材质2不能为空", MessageBoxIcon.Warning);
return;
@@ -315,7 +283,7 @@ namespace FineUIPro.Web.HJGL.JoinMarking
private void SaveData(bool isClosed)
{
// if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()) || this.drpPipingClass.SelectedValue == BLL.Const._Null || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null || this.drpWeldTypeCode.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.hdWeldingMethodId.Text) || string.IsNullOrEmpty(this.txtWpqId.Text.Trim()))
- if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()) || this.drpPipingClass.SelectedValue == BLL.Const._Null || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null || this.drpWeldTypeCode.SelectedValue == BLL.Const._Null)
+ if (string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()) || this.drpMaterial1.SelectedValue == BLL.Const._Null || this.drpMaterial2.SelectedValue == BLL.Const._Null || this.drpWeldTypeCode.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("页面必填项不能为空", MessageBoxIcon.Warning);
Alert.ShowInTop("请完善必填项!", MessageBoxIcon.Warning);
@@ -323,8 +291,7 @@ namespace FineUIPro.Web.HJGL.JoinMarking
}
Model.HJGL_WeldJoint joint = dic[WeldJointId];
string weldJointId = WeldJointId;
- joint.PipelineId = this.PipelineId;
- joint.PipelineCode = txtPipelineCode.Text.Trim();
+ joint.PipelineId = this.PipelineId;
joint.ProjectId = this.CurrUser.LoginProjectId;
//if (!this.txtWeldJointCode.Text.Contains("G"))
diff --git a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.designer.cs
index 57614428..9e364a3e 100644
--- a/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/JoinMarking/DataInEdit.aspx.designer.cs
@@ -50,15 +50,6 @@ namespace FineUIPro.Web.HJGL.JoinMarking
///
protected global::FineUIPro.Toolbar Toolbar1;
- ///
- /// btnAttachUrl 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.Button btnAttachUrl;
-
///
/// btnSave 控件。
///
@@ -68,60 +59,6 @@ namespace FineUIPro.Web.HJGL.JoinMarking
///
protected global::FineUIPro.Button btnSave;
- ///
- /// GroupPanel3 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.GroupPanel GroupPanel3;
-
- ///
- /// Form2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.Form Form2;
-
- ///
- /// txtPipelineCode 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.TextBox txtPipelineCode;
-
- ///
- /// drpPipingClass 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.DropDownList drpPipingClass;
-
- ///
- /// drpDetectionRate 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.DropDownList drpDetectionRate;
-
- ///
- /// txtDetectionType 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.TextBox txtDetectionType;
-
///
/// GroupPanel1 控件。
///
From 7ee78c852ee00acbee6b13dfad24ac11a8f8106f Mon Sep 17 00:00:00 2001
From: 10191 <506754232@qq.com>
Date: Fri, 29 May 2026 09:54:46 +0800
Subject: [PATCH 2/3] 1
---
.../HJGL/DataImport/DrawingRecognitionContentEdit.aspx.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingRecognitionContentEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingRecognitionContentEdit.aspx.cs
index eee71f19..47b4cfbe 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingRecognitionContentEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingRecognitionContentEdit.aspx.cs
@@ -74,7 +74,9 @@
dataInTemp["page_no"] = this.txtPageNo.Text;
dataInTemp["description"] = this.txtDescription;
Alert.ShowInTop("信息修改完成!", MessageBoxIcon.Success);
- PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
+
+ PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference("") + ActiveWindow.GetHidePostBackReference());
+
dicDt.Remove(CurrUser.PersonId);
}
#endregion
From cb3c2c65ad0f494f9415382960c3e8101b0fb152 Mon Sep 17 00:00:00 2001
From: fei550 <1420031550@qq.com>
Date: Fri, 29 May 2026 14:35:20 +0800
Subject: [PATCH 3/3] =?UTF-8?q?feat(hjgl):=E5=A2=9E=E5=8A=A0=E7=84=8A?=
=?UTF-8?q?=E6=8E=A5=E6=97=A5=E6=8A=A5=E5=AE=A1=E6=A0=B8=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BLL/API/HJGL/APIPreWeldingDailyService.cs | 240 +--
.../HJGL/WeldingManage/WeldingDailyService.cs | 402 +++++
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +-
.../HJGL/WeldingManage/WeldReport.aspx | 91 +-
.../HJGL/WeldingManage/WeldReport.aspx.cs | 178 +-
.../WeldingManage/WeldReport.aspx.designer.cs | 101 +-
.../HJGL/WeldingManage/WeldReportEdit.aspx | 2 +-
.../HJGL/WeldingManage/WeldReportEdit.aspx.cs | 193 +--
SGGL/Model/Model.cs | 1541 ++++++++++++++---
9 files changed, 2109 insertions(+), 641 deletions(-)
diff --git a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
index 1b3a42ba..c0c884f1 100644
--- a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
+++ b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
@@ -255,125 +255,12 @@ namespace BLL
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
{
- 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)
- {
- res = "人员不存在";
- return res;
- }
- var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
- if (joint == null)
- {
- res = "焊口不存在";
- return res;
- }
- var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
- 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 + "-";
- weldingDaily = new Model.HJGL_WeldingDaily();
- weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
- weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
- weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
- weldingDaily.ProjectId = joint.ProjectId;
- weldingDaily.UnitWorkId = joint.UnitWorkId;
- weldingDaily.UnitId = weldTask?.UnitId;
- weldingDaily.Tabler = Personid;
- weldingDaily.TableDate = Convert.ToDateTime(time).Date;
- db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
- db.SubmitChanges();
- }
- BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
- PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
- var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
- if (batchC != null)
- {
- string batchCondition = batchC.SetValue;
- 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;
+ return BLL.WeldingDailyService.SaveWeldingDailyTempDetailByMobile(WeldJointId, Personid, time, null, 0);
}
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time, string weldingLocation)
{
- 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)
- {
- res = "人员不存在";
- return res;
- }
- var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
- if (joint == null)
- {
- res = "焊口不存在";
- return res;
- }
- var weldingLocationModel = db.Base_WeldingLocation.FirstOrDefault(x => x.WeldingLocationId == weldingLocation);
- if (weldingLocationModel == null)
- {
- res = "焊口位置不存在";
- return res;
- }
- var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
- var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
- var weldJoint = db.HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
- if (weldingDaily == null)
- {
- string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
- weldingDaily = new Model.HJGL_WeldingDaily();
- weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
- weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
- weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
- weldingDaily.ProjectId = joint.ProjectId;
- weldingDaily.UnitWorkId = joint.UnitWorkId;
- weldingDaily.UnitId = weldTask?.UnitId;
- weldingDaily.Tabler = Personid;
- weldingDaily.TableDate = Convert.ToDateTime(time).Date;
- db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
- db.SubmitChanges();
- }
- //更新焊口位置
- if (weldingDaily != null)
- {
- weldJoint.WeldingLocationId= weldingLocation;
- WeldJointService.UpdateWeldJoint(weldJoint);
- }
- BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
- PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
- var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
- if (batchC != null)
- {
- string batchCondition = batchC.SetValue;
- 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;
+ return BLL.WeldingDailyService.SaveWeldingDailyTempDetailByMobile(WeldJointId, Personid, time, weldingLocation, 0);
}
///
@@ -387,101 +274,7 @@ namespace BLL
///
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time, string weldingLocation, int welderType)
{
- 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)
- {
- res = "人员不存在";
- return res;
- }
- var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
- if (joint == null)
- {
- res = "焊口不存在";
- return res;
- }
- var weldingLocationModel = db.Base_WeldingLocation.FirstOrDefault(x => x.WeldingLocationId == weldingLocation);
- if (weldingLocationModel == null)
- {
- res = "焊口位置不存在";
- return res;
- }
- var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
- var weldJoint = db.HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
-
- // 根据焊工类型确定盖面/打底焊工ID,以及是否两者都已填充
- string coverWelderId;
- string backingWelderId;
- bool bothWeldersFilled;
-
- if (welderType == 0)
- {
- // 全部:打底和盖面都是同一人
- coverWelderId = Personid;
- backingWelderId = Personid;
- bothWeldersFilled = true;
- }
- else if (welderType == 1)
- {
- // 打底:只更新backingWelderId,coverWelderId取焊口已有值
- weldJoint.BackingWelderId = Personid;
- coverWelderId = weldJoint.CoverWelderId;
- backingWelderId = Personid;
- bothWeldersFilled = !string.IsNullOrEmpty(coverWelderId) && !string.IsNullOrEmpty(backingWelderId);
- }
- else // welderType == 2
- {
- // 盖面:只更新coverWelderId,backingWelderId取焊口已有值
- weldJoint.CoverWelderId = Personid;
- coverWelderId = Personid;
- backingWelderId = weldJoint.BackingWelderId;
- bothWeldersFilled = !string.IsNullOrEmpty(coverWelderId) && !string.IsNullOrEmpty(backingWelderId);
- }
-
- // 更新焊口位置
- weldJoint.WeldingLocationId = weldingLocation;
- WeldJointService.UpdateWeldJoint(weldJoint);
-
- // 只有打底和盖面都填充了时才保存WeldingDate和进批
- if (bothWeldersFilled)
- {
- var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
- if (weldingDaily == null)
- {
- string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
- weldingDaily = new Model.HJGL_WeldingDaily();
- weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
- weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
- weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
- weldingDaily.ProjectId = joint.ProjectId;
- weldingDaily.UnitWorkId = joint.UnitWorkId;
- weldingDaily.UnitId = weldTask?.UnitId;
- weldingDaily.Tabler = Personid;
- weldingDaily.TableDate = Convert.ToDateTime(time).Date;
- BLL.WeldingDailyService.AddWeldingDaily(weldingDaily);
- }
- BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
- PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
- var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
- if (batchC != null)
- {
- string batchCondition = batchC.SetValue;
- InsertWeldingDailyItem(WeldJointId, coverWelderId, backingWelderId, 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;
+ return BLL.WeldingDailyService.SaveWeldingDailyTempDetailByMobile(WeldJointId, Personid, time, weldingLocation, welderType);
}
#region 保存焊接日报明细
@@ -635,6 +428,25 @@ namespace BLL
///
///
private static string InsertWeldingDailyItem(string weldJointId, string coverWelderId, string backingWelderId, string jointAttribute, DateTime? weldingDate, string batchCondition, bool isSave, string weldingDailyId, string projectId)
+ {
+ return InsertWeldingDailyItem(weldJointId, coverWelderId, backingWelderId, jointAttribute, weldingDate, batchCondition, isSave, weldingDailyId, projectId, null);
+ }
+
+ ///
+ /// 日报明细插入(更新焊口信息),组批等
+ ///
+ /// 焊口ID
+ /// 盖面焊工ID
+ /// 打底焊工ID
+ /// 焊口属性
+ /// 焊接日期
+ /// 组批条件
+ /// 是否保存
+ /// 日报ID
+ /// 项目ID
+ /// 焊接位置ID
+ /// 错误信息
+ private static string InsertWeldingDailyItem(string weldJointId, string coverWelderId, string backingWelderId, string jointAttribute, DateTime? weldingDate, string batchCondition, bool isSave, string weldingDailyId, string projectId, string weldingLocationId)
{
string errlog = string.Empty;
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
@@ -652,10 +464,10 @@ namespace BLL
newWeldJoint.BackingWelderId = backingWelderId;
newWeldJoint.CoverWelderTeamGroupId = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(pipeline.ProjectId, coverWelderId).TeamGroupId;
newWeldJoint.BackingWelderTeamGroupId = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(pipeline.ProjectId, backingWelderId).TeamGroupId;
- //if (item.WeldingLocationId != Const._Null)
- //{
- // newWeldJoint.WeldingLocationId = item.WeldingLocationId;
- //}
+ if (!string.IsNullOrEmpty(weldingLocationId))
+ {
+ newWeldJoint.WeldingLocationId = weldingLocationId;
+ }
newWeldJoint.JointAttribute = jointAttribute;
BLL.WeldJointService.UpdateWeldJoint(newWeldJoint);
diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs
index d0384827..b55df11b 100644
--- a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs
+++ b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs
@@ -293,6 +293,408 @@ namespace BLL
db.SubmitChanges();
}
}
+
+ #region 焊接日报待审核
+ ///
+ /// 移动端按焊口保存焊接日报待审核明细
+ ///
+ /// 焊口ID
+ /// 提交焊工ID
+ /// 焊接日期
+ /// 焊接位置ID
+ /// 焊工类型 0 全部 1 打底 2 盖面
+ /// 错误信息
+ public static string SaveWeldingDailyTempDetailByMobile(string weldJointId, string personId, string time, string weldingLocationId, int welderType)
+ {
+ string res = string.Empty;
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ try
+ {
+ DateTime weldingDate;
+ if (!DateTime.TryParse(time, out weldingDate))
+ {
+ return "焊接日期不正确";
+ }
+ weldingDate = weldingDate.Date;
+
+ var person = db.Person_Persons.FirstOrDefault(x => x.PersonId == personId);
+ if (person == null)
+ {
+ return "人员不存在";
+ }
+
+ var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == weldJointId);
+ string err = CheckWeldingDailyTempJoint(db, joint, weldingLocationId);
+ if (!string.IsNullOrEmpty(err))
+ {
+ return err;
+ }
+
+ var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
+ var weldJoint = db.HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
+ var pending = GetPendingTempDetail(db, weldJointId, weldingDate);
+
+ string coverWelderId = pending != null ? pending.CoverWelderId : weldJoint.CoverWelderId;
+ string backingWelderId = pending != null ? pending.BackingWelderId : weldJoint.BackingWelderId;
+ if (welderType == 0)
+ {
+ coverWelderId = personId;
+ backingWelderId = personId;
+ }
+ else if (welderType == 1)
+ {
+ backingWelderId = personId;
+ }
+ else if (welderType == 2)
+ {
+ coverWelderId = personId;
+ }
+ else
+ {
+ return "焊工类型不正确";
+ }
+
+ SaveWeldingDailyTempDetail(db, joint, weldTask, weldingDate, personId, coverWelderId, backingWelderId,
+ joint.JointAttribute, weldingLocationId, joint.ProjectId, null, null, joint.WeldingMode);
+ db.SubmitChanges();
+ }
+ catch (Exception ex)
+ {
+ APICommonService.SaveSysAPILog("erro", ex.ToString(), "-1");
+ res = ex.Message;
+ }
+ }
+ return res;
+ }
+
+ ///
+ /// Web端保存焊接日报待审核明细
+ ///
+ /// 焊口ID
+ /// 提交人ID
+ /// 焊接日期
+ /// 盖面焊工ID
+ /// 打底焊工ID
+ /// 焊口属性
+ /// 焊接位置ID
+ /// 项目ID
+ /// 单位ID
+ /// 单位工程ID
+ /// 焊接模式
+ /// 错误信息
+ public static string SaveWeldingDailyTempDetailByWeb(string weldJointId, string submitPersonId, DateTime weldingDate, string coverWelderId,
+ string backingWelderId, string jointAttribute, string weldingLocationId, string projectId, string unitId, string unitWorkId, string weldingMode)
+ {
+ string res = string.Empty;
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ try
+ {
+ weldingDate = weldingDate.Date;
+ weldingLocationId = NormalizeNullValue(weldingLocationId);
+ unitId = NormalizeNullValue(unitId);
+ unitWorkId = NormalizeNullValue(unitWorkId);
+
+ if (string.IsNullOrEmpty(weldJointId))
+ {
+ return "焊口不能为空";
+ }
+ if (string.IsNullOrEmpty(coverWelderId) || string.IsNullOrEmpty(backingWelderId))
+ {
+ return "未选择完整焊工";
+ }
+
+ var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == weldJointId);
+ string err = CheckWeldingDailyTempJoint(db, joint, weldingLocationId);
+ if (!string.IsNullOrEmpty(err))
+ {
+ return err;
+ }
+
+ var coverWelder = db.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.PersonId == coverWelderId);
+ if (coverWelder == null)
+ {
+ return "盖面焊工不存在";
+ }
+ var backingWelder = db.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.PersonId == backingWelderId);
+ if (backingWelder == null)
+ {
+ return "打底焊工不存在";
+ }
+
+ var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == weldJointId);
+ SaveWeldingDailyTempDetail(db, joint, weldTask, weldingDate, submitPersonId, coverWelderId, backingWelderId,
+ jointAttribute, weldingLocationId, projectId, unitId, unitWorkId, weldingMode);
+ db.SubmitChanges();
+ }
+ catch (Exception ex)
+ {
+ APICommonService.SaveSysAPILog("erro", ex.ToString(), "-1");
+ res = ex.Message;
+ }
+ }
+ return res;
+ }
+
+ ///
+ /// 审核通过焊接日报待审核明细
+ ///
+ /// 待审核明细ID集合
+ /// 审核人
+ /// 错误信息
+ public static string AuditWeldingDailyTempDetails(string[] tempDetailIds, string auditMan)
+ {
+ string errlog = string.Empty;
+ if (tempDetailIds == null || tempDetailIds.Length == 0)
+ {
+ return "请选择要审核的记录";
+ }
+
+ foreach (string tempDetailId in tempDetailIds.Where(x => !string.IsNullOrEmpty(x)).Distinct())
+ {
+ var tempDetail = Funs.DB.HJGL_WeldingDailyTempDetail.FirstOrDefault(x => x.TempDetailId == tempDetailId);
+ if (tempDetail == null)
+ {
+ errlog += "待审核记录不存在;";
+ continue;
+ }
+ if (tempDetail.AuditState != 0)
+ {
+ errlog += "焊口待审核记录已审核;";
+ continue;
+ }
+ if (string.IsNullOrEmpty(tempDetail.CoverWelderId) || string.IsNullOrEmpty(tempDetail.BackingWelderId))
+ {
+ errlog += "焊口待审核记录未选择完整焊工;";
+ continue;
+ }
+
+ var weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(tempDetail.WeldJointId);
+ if (weldJoint == null)
+ {
+ errlog += "焊口不存在;";
+ continue;
+ }
+ if (!string.IsNullOrEmpty(weldJoint.WeldingDailyId))
+ {
+ errlog += "焊口【" + weldJoint.WeldJointCode + "】已生成焊接日报;";
+ continue;
+ }
+
+ var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", tempDetail.ProjectId);
+ if (batchC == null)
+ {
+ errlog += "请设置项目的组批条件;";
+ continue;
+ }
+
+ var weldingDaily = GetOrCreateWeldingDailyByTempDetail(tempDetail);
+ string itemErr = InsertWeldingDailyItem(tempDetail.WeldJointId, tempDetail.CoverWelderId, tempDetail.BackingWelderId,
+ tempDetail.JointAttribute, weldingDaily.WeldingDate, batchC.SetValue, true, weldingDaily.WeldingDailyId,
+ tempDetail.ProjectId, tempDetail.WeldingLocationId);
+ if (!string.IsNullOrEmpty(itemErr))
+ {
+ errlog += itemErr;
+ continue;
+ }
+
+ BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(tempDetail.WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
+ PipelineService.UpdataDateByWeldJointId(tempDetail.WeldJointId);//更改安装口时间和状态
+ tempDetail.AuditState = 1;
+ tempDetail.AuditMan = auditMan;
+ tempDetail.AuditDate = DateTime.Now;
+ Funs.DB.SubmitChanges();
+ }
+
+ return errlog;
+ }
+
+ ///
+ /// 删除未审核的焊接日报待审核明细
+ ///
+ /// 待审核明细ID集合
+ /// 错误信息
+ public static string DeleteWeldingDailyTempDetails(string[] tempDetailIds)
+ {
+ if (tempDetailIds == null || tempDetailIds.Length == 0)
+ {
+ return "请选择要删除的记录";
+ }
+
+ string errlog = string.Empty;
+ foreach (string tempDetailId in tempDetailIds.Where(x => !string.IsNullOrEmpty(x)).Distinct())
+ {
+ var tempDetail = Funs.DB.HJGL_WeldingDailyTempDetail.FirstOrDefault(x => x.TempDetailId == tempDetailId);
+ if (tempDetail == null)
+ {
+ continue;
+ }
+ if (tempDetail.AuditState != 0)
+ {
+ errlog += "已审核记录不能删除;";
+ continue;
+ }
+ Funs.DB.HJGL_WeldingDailyTempDetail.DeleteOnSubmit(tempDetail);
+ }
+ Funs.DB.SubmitChanges();
+ return errlog;
+ }
+
+ private static string CheckWeldingDailyTempJoint(Model.SGGLDB db, Model.View_HJGL_WeldJoint joint, string weldingLocationId)
+ {
+ if (joint == null)
+ {
+ return "焊口不存在";
+ }
+ if (!string.IsNullOrEmpty(joint.WeldingDailyId))
+ {
+ return "焊口【" + joint.WeldJointCode + "】已生成焊接日报,不能提交待审核";
+ }
+ if (!string.IsNullOrEmpty(weldingLocationId))
+ {
+ var weldingLocationModel = db.Base_WeldingLocation.FirstOrDefault(x => x.WeldingLocationId == weldingLocationId);
+ if (weldingLocationModel == null)
+ {
+ return "焊口位置不存在";
+ }
+ }
+ return string.Empty;
+ }
+
+ private static Model.HJGL_WeldingDailyTempDetail GetPendingTempDetail(Model.SGGLDB db, string weldJointId, DateTime weldingDate)
+ {
+ return db.HJGL_WeldingDailyTempDetail.FirstOrDefault(x => x.WeldJointId == weldJointId
+ && x.WeldingDate >= weldingDate.Date
+ && x.WeldingDate < weldingDate.Date.AddDays(1)
+ && x.AuditState == 0);
+ }
+
+ private static void SaveWeldingDailyTempDetail(Model.SGGLDB db, Model.View_HJGL_WeldJoint joint, Model.HJGL_WeldTask weldTask,
+ DateTime weldingDate, string submitPersonId, string coverWelderId, string backingWelderId, string jointAttribute,
+ string weldingLocationId, string projectId, string unitId, string unitWorkId, string weldingMode)
+ {
+ var pending = GetPendingTempDetail(db, joint.WeldJointId, weldingDate);
+ if (pending == null)
+ {
+ pending = new Model.HJGL_WeldingDailyTempDetail
+ {
+ TempDetailId = Guid.NewGuid().ToString(),
+ WeldJointId = joint.WeldJointId,
+ WeldingDate = weldingDate.Date,
+ AuditState = 0,
+ SubmitDate = DateTime.Now
+ };
+ db.HJGL_WeldingDailyTempDetail.InsertOnSubmit(pending);
+ }
+
+ pending.ProjectId = !string.IsNullOrEmpty(projectId) ? projectId : joint.ProjectId;
+ pending.UnitId = !string.IsNullOrEmpty(unitId) ? unitId : (weldTask != null && !string.IsNullOrEmpty(weldTask.UnitId) ? weldTask.UnitId : joint.UnitId);
+ pending.UnitWorkId = !string.IsNullOrEmpty(unitWorkId) ? unitWorkId : joint.UnitWorkId;
+ pending.CoverWelderId = coverWelderId;
+ pending.BackingWelderId = backingWelderId;
+ pending.JointAttribute = !string.IsNullOrEmpty(jointAttribute) ? jointAttribute : joint.JointAttribute;
+ pending.WeldingLocationId = !string.IsNullOrEmpty(weldingLocationId) ? weldingLocationId : joint.WeldingLocationId;
+ pending.WeldingMode = !string.IsNullOrEmpty(weldingMode) ? weldingMode : joint.WeldingMode;
+ pending.SubmitPersonId = submitPersonId;
+ pending.SubmitDate = DateTime.Now;
+ }
+
+ private static Model.HJGL_WeldingDaily GetOrCreateWeldingDailyByTempDetail(Model.HJGL_WeldingDailyTempDetail tempDetail)
+ {
+ var weldingDaily = Funs.DB.HJGL_WeldingDaily.FirstOrDefault(x => x.UnitWorkId == tempDetail.UnitWorkId
+ && x.WeldingDate >= tempDetail.WeldingDate.Date
+ && x.WeldingDate < tempDetail.WeldingDate.Date.AddDays(1));
+ if (weldingDaily != null)
+ {
+ return weldingDaily;
+ }
+
+ var submitPerson = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == tempDetail.SubmitPersonId);
+ string personName = submitPerson != null ? submitPerson.PersonName : string.Empty;
+ string perfix = string.Format("{0:yyyyMMdd}", tempDetail.WeldingDate) + "-" + personName + "-";
+ weldingDaily = new Model.HJGL_WeldingDaily
+ {
+ WeldingDailyId = Guid.NewGuid().ToString(),
+ WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", tempDetail.ProjectId, perfix),
+ WeldingDate = tempDetail.WeldingDate.Date,
+ ProjectId = tempDetail.ProjectId,
+ UnitWorkId = tempDetail.UnitWorkId,
+ UnitId = tempDetail.UnitId,
+ Tabler = tempDetail.SubmitPersonId,
+ TableDate = tempDetail.WeldingDate.Date,
+ Remark = "焊接日报待审核通过"
+ };
+ BLL.WeldingDailyService.AddWeldingDaily(weldingDaily);
+ return weldingDaily;
+ }
+
+ private static string NormalizeNullValue(string value)
+ {
+ return value == Const._Null ? null : value;
+ }
+
+ ///
+ /// 日报明细插入(更新焊口信息),组批等
+ ///
+ /// 焊口ID
+ /// 盖面焊工ID
+ /// 打底焊工ID
+ /// 焊口属性
+ /// 焊接日期
+ /// 组批条件
+ /// 是否保存
+ /// 日报ID
+ /// 项目ID
+ /// 焊接位置ID
+ /// 错误信息
+ private static string InsertWeldingDailyItem(string weldJointId, string coverWelderId, string backingWelderId, string jointAttribute, DateTime? weldingDate, string batchCondition, bool isSave, string weldingDailyId, string projectId, string weldingLocationId)
+ {
+ string errlog = string.Empty;
+ var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
+ if (newWeldJoint == null)
+ {
+ return "焊口不存在;";
+ }
+
+ var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
+ var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(weldingDailyId);
+ if (pipeline == null || weldingDaily == null)
+ {
+ return "焊口关联管线或日报不存在;";
+ }
+
+ if (!string.IsNullOrEmpty(coverWelderId) && !string.IsNullOrEmpty(backingWelderId))
+ {
+ if (isSave)
+ {
+ newWeldJoint.WeldingDailyId = weldingDailyId;
+ newWeldJoint.WeldingDailyCode = weldingDaily.WeldingDailyCode;
+ newWeldJoint.CoverWelderId = coverWelderId;
+ newWeldJoint.BackingWelderId = backingWelderId;
+ newWeldJoint.CoverWelderTeamGroupId = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(pipeline.ProjectId, coverWelderId).TeamGroupId;
+ newWeldJoint.BackingWelderTeamGroupId = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(pipeline.ProjectId, backingWelderId).TeamGroupId;
+ if (!string.IsNullOrEmpty(weldingLocationId))
+ {
+ newWeldJoint.WeldingLocationId = weldingLocationId;
+ }
+ newWeldJoint.JointAttribute = jointAttribute;
+ BLL.WeldJointService.UpdateWeldJoint(newWeldJoint);
+
+ // 更新焊口号 修改固定焊口号后 +G
+ BLL.WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd);
+ errlog = PointBatchService.AddBatchByWeldJointId(weldJointId, weldingDate, batchCondition);//自动组批
+ }
+ }
+ else
+ {
+ errlog = "焊口" + "【" + newWeldJoint.WeldJointCode + "】" + "未选择焊工";
+ }
+
+ return errlog;
+ }
+ #endregion
+
///
/// 日报明细删除
///
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 65f577f8..d70cb478 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -17042,7 +17042,7 @@
-
+
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx
index 8f0d6882..7653e2cb 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx
@@ -52,10 +52,10 @@
--%>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -245,4 +330,4 @@
}