This commit is contained in:
佘春生 2024-05-27 15:18:01 +08:00
parent 9dae8f88fb
commit a3876cde11
5 changed files with 123 additions and 43 deletions

Binary file not shown.

View File

@ -123,6 +123,8 @@
<f:Button ID="btnSelectExpandPoint" Text="重新选择扩口" ToolTip="重新选择扩口" Icon="ArrowRefresh"
runat="server" OnClick="btnSelectExpandPoint_Click" Hidden="true">
</f:Button>
<f:Button ID="btnPTIn" Text="PT导入" runat="server" OnClick="btnPTIn_Click" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -1,9 +1,14 @@
using BLL;
using FineUIPro.Web.common.BaseInfo;
using FineUIPro.Web.common.ProjectSet;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Asn1.Tsp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Management;
using System.Reflection;
using System.Web.UI.WebControls;
@ -1534,6 +1539,66 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
}
#endregion
protected void btnPTIn_Click(object sender, EventArgs e)
{
string strSql = @"SELECT pipe.PipelineId,pipe.PipelineCode,pipe.DetectionRateId,rate.DetectionRateCode
FROM dbo.Pipeline_Pipeline pipe
LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = pipe.DetectionRateId
WHERE (SELECT COUNT(*) FROM dbo.Pipeline_WeldJoint jot
WHERE jot.PipelineId=pipe.PipelineId
AND jot.WeldingDailyId IS NOT NULL
AND jot.DetectionType LIKE '%53704a2c-ce45-41d9-a6e7-be24f0780d87%' )>0";
DataTable tb = SQLHelper.GetDataTableRunText(strSql, null);
if (tb != null)
{
foreach (DataRow dr in tb.Rows)
{
string pipelineId =dr["PipelineId"].ToString();
string pipelineCode = dr["PipelineCode"].ToString();
string detectionRateId = dr["DetectionRateId"].ToString();
string detectionRateCode = dr["DetectionRateCode"].ToString();
Model.Batch_PointBatch newPointBatch = new Model.Batch_PointBatch();
string pointBatchId = SQLHelper.GetNewID(typeof(Model.Batch_PointBatch));
string pointBatchCode = Batch_PointBatchService.GetNewPointBatchCode("0bbe1ae1-e643-4f86-9695-4381ed792ec9", pipelineCode, "PT", detectionRateCode);
newPointBatch.PointBatchId = pointBatchId;
newPointBatch.PointBatchCode = pointBatchCode;
newPointBatch.ProjectId = "0bbe1ae1-e643-4f86-9695-4381ed792ec9";
newPointBatch.UnitId = "8c730dfc-07a5-424e-8f58-75098493e0c5";
newPointBatch.PipelineId = pipelineId;
newPointBatch.InstallationId = "2990422b-4589-42a1-b2b5-b0c2e39324d0";
newPointBatch.DetectionTypeId = "53704a2c-ce45-41d9-a6e7-be24f0780d87";
newPointBatch.DetectionRateId = detectionRateId;
newPointBatch.StartDate = System.DateTime.Now;
newPointBatch.IsTrust = true;
Batch_PointBatchService.AddPointBatch(newPointBatch); // 生成主表
// 增加明细
var jotList = (from x in Funs.DB.Pipeline_WeldJoint
join y in Funs.DB.Pipeline_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
where x.PipelineId == pipelineId && x.WeldingDailyId != null
&& x.DetectionType.Contains("53704a2c-ce45-41d9-a6e7-be24f0780d87")
select new { x.WeldJointId, y.WeldingDate }).ToList();
foreach (var jot in jotList)
{
Model.Batch_PointBatchItem newPointBatchItem = new Model.Batch_PointBatchItem();
string pointBatchItemId = SQLHelper.GetNewID(typeof(Model.Batch_PointBatchItem));
newPointBatchItem.PointBatchItemId = pointBatchItemId;
newPointBatchItem.PointBatchId = pointBatchId;
newPointBatchItem.WeldJointId = jot.WeldJointId;
newPointBatchItem.WeldingDate = jot.WeldingDate;
newPointBatchItem.IsCheckRepair = false;
newPointBatchItem.AcceptLevel = "";
newPointBatchItem.IsCompletedPoint = true;
BLL.Batch_PointBatchItemService.AddPointBatchItem(newPointBatchItem); // 插入明细表
}
}
}
}
private string GetNewTrust(string code)
{
int r_num = 0;
@ -1558,5 +1623,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
return newTrustCode;
}
}
}

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class PointManage {
public partial class PointManage
{
/// <summary>
/// form1 控件。
@ -228,6 +230,15 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage {
/// </remarks>
protected global::FineUIPro.Button btnSelectExpandPoint;
/// <summary>
/// btnPTIn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPTIn;
/// <summary>
/// SimpleForm1 控件。
/// </summary>