代码无效引用清理,试压包资料界面看板修改

This commit is contained in:
2025-10-10 14:33:21 +08:00
parent 87fb529521
commit 55b798135c
933 changed files with 5897 additions and 7541 deletions
@@ -110,8 +110,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -122,8 +122,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -1,5 +1,4 @@
using BLL;
using FineUIPro.Web.DataShow;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -215,7 +214,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
bool flag_B = true;
Model.Project_Sys_Set PressMustCheckBItem = BLL.Project_SysSetService.GetSysSetBySetId("10", this.CurrUser.LoginProjectId);
bool isMustCheckBItem = false;
isMustCheckBItem= (bool)PressMustCheckBItem?.IsAuto;//是否必须检查B项
isMustCheckBItem = (bool)PressMustCheckBItem?.IsAuto;//是否必须检查B项
///保存明细
if (saveType == Const.BtnSubmit)
{
@@ -230,7 +229,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
flag_A = false;
}
if (isMustCheckBItem && item.ItemType == "B" && item.Result != "合格")
{
flag_B = false;
@@ -115,8 +115,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -360,7 +360,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
int totalWeldingJointNum = totalJoint.Count(x => x.WeldingDailyId != null); //已焊总焊口
int notCloseBatch = (from x in db.HJGL_Batch_PointBatch
join y in db.PTP_PipelineList on x.PipelineId equals y.PipelineId
where y.PTP_ID==this.PTP_ID //x.UnitWorkId == pipeline.UnitWorkId
where y.PTP_ID == this.PTP_ID //x.UnitWorkId == pipeline.UnitWorkId
&& x.DetectionRateId == pipeline.DetectionRateId
&& x.DetectionTypeId == pipeline.DetectionType && x.EndDate == null
select x).Count(); //未关闭批
@@ -562,24 +562,24 @@ namespace FineUIPro.Web.HJGL.TestPackage
//string inspectionIsoRate = BLL.TestPackageEditService.InspectionIsoRate(this.PTP_ID);
//if (string.IsNullOrEmpty(inspectionIsoRate))
//{
updateTestPackage.Check1 = drpInstallationSpecification.SelectedValue;
updateTestPackage.Check2 = drpPressureTest.SelectedValue;
updateTestPackage.Check3 = drpWorkRecord.SelectedValue;
updateTestPackage.Check4 = drpNDTConform.SelectedValue;
updateTestPackage.Check5 = drpHotConform.SelectedValue;
updateTestPackage.Check6 = drpInstallationCorrectness.SelectedValue;
updateTestPackage.Check7 = drpMarkClearly.SelectedValue;
updateTestPackage.Check8 = drpIsolationOpening.SelectedValue;
updateTestPackage.Check9 = drpConstructionPlanAsk.SelectedValue;
updateTestPackage.Check10 = drpCover.SelectedValue;
updateTestPackage.Check11 = drpMeetRequirements.SelectedValue;
updateTestPackage.Check12 = drpStainlessTestWater.SelectedValue;
updateTestPackage.AduditDate = DateTime.Now;
updateTestPackage.Auditer = this.CurrUser.PersonId;
BLL.TestPackageEditService.UpdateTestPackage(updateTestPackage);
this.InitTreeMenu();
this.BindGrid();
ShowNotify("保存成功!", MessageBoxIcon.Success);
updateTestPackage.Check1 = drpInstallationSpecification.SelectedValue;
updateTestPackage.Check2 = drpPressureTest.SelectedValue;
updateTestPackage.Check3 = drpWorkRecord.SelectedValue;
updateTestPackage.Check4 = drpNDTConform.SelectedValue;
updateTestPackage.Check5 = drpHotConform.SelectedValue;
updateTestPackage.Check6 = drpInstallationCorrectness.SelectedValue;
updateTestPackage.Check7 = drpMarkClearly.SelectedValue;
updateTestPackage.Check8 = drpIsolationOpening.SelectedValue;
updateTestPackage.Check9 = drpConstructionPlanAsk.SelectedValue;
updateTestPackage.Check10 = drpCover.SelectedValue;
updateTestPackage.Check11 = drpMeetRequirements.SelectedValue;
updateTestPackage.Check12 = drpStainlessTestWater.SelectedValue;
updateTestPackage.AduditDate = DateTime.Now;
updateTestPackage.Auditer = this.CurrUser.PersonId;
BLL.TestPackageEditService.UpdateTestPackage(updateTestPackage);
this.InitTreeMenu();
this.BindGrid();
ShowNotify("保存成功!", MessageBoxIcon.Success);
//}
//else
//{
@@ -21,6 +21,10 @@
background-color: Purple;
}
.f-grid-row.Red {
background-color: red;
}
.f-grid-row.Cyan {
background-color: Cyan;
}
@@ -71,6 +75,27 @@
<f:Panel ID="panelTopRegion" runat="server" RegionPosition="Top" ShowBorder="true" RegionPercent="40%"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="试压看板"
TitleToolTip="试压看板" AutoScroll="true">
<Toolbars>
<f:Toolbar runat="server" ToolbarAlign="Right">
<Items>
<f:TextBox ID="txtGrid2code" runat="server" Label="试压包号" EmptyText="输入查询条件" LabelWidth="80px" LabelAlign="Right"></f:TextBox>
<f:DropDownList runat="server" ID="drpCanPressureTest" Label="是否具备试压条件" AutoSelectFirstItem="false" EmptyText="--请选择--"
EnableCheckBoxSelect="true" LabelWidth="150px" LabelAlign="Right" EnableMultiSelect="true"
AutoShowClearIcon="true">
<f:ListItem Text="已具备" Value="已具备" />
<f:ListItem Text="易具备" Value="易具备" />
<f:ListItem Text="未具备" Value="未具备" />
</f:DropDownList>
<f:DropDownList runat="server" ID="drpStateStr" Label="状态" AutoSelectFirstItem="false" EmptyText="--请选择--"
EnableCheckBoxSelect="true" LabelWidth="150px" LabelAlign="Right" EnableMultiSelect="true"
AutoShowClearIcon="true">
</f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnQuery" OnClick="btnSearch_Click" ToolTip="查询" Text="查询" Icon="SystemSearch" EnablePostBack="true" runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="true" Title="试压包明细" EnableCollapse="true" Collapsed="false"
runat="server" BoxFlex="1" DataKeyNames="PTP_ID" AllowCellEditing="true"
@@ -85,20 +110,20 @@
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="检测完成百分比" ColumnID="DetectionCompletionPercent" DataField="DetectionCompletionPercent" SortField="DetectionCompletionPercent"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px" HeaderToolTip="检测完成百分比=当前试压包下已检测的焊口数/当前试压包下的焊口总数">
</f:RenderField>
<f:RenderField HeaderText="焊口完成百分比" ColumnID="WeldCompletionPercent" DataField="WeldCompletionPercent" SortField="WeldCompletionPercent"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px" HeaderToolTip="焊口完成百分比=当前试压包下已焊接的焊口数/当前试压包下的焊口总数">
</f:RenderField>
<f:RenderField HeaderText="具备程度比值" ColumnID="PipelinePassPercent" DataField="PipelinePassPercent" SortField="PipelinePassPercent"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px" HeaderToolTip="当前试压包下具备试压条件管线数/当前试压包管线总数">
</f:RenderField>
<f:RenderField HeaderText="是否具备试压条件" ColumnID="CanPressureTest" DataField="CanPressureTest" SortField="CanPressureTest"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px" HeaderToolTip="具备程度比值>=100% -> 已具备;>=80% and <100% -> 易具备;<80% -> 未具备">
</f:RenderField>
<f:RenderField HeaderText="状态" ColumnID="StateStr" DataField="StateStr" SortField="StateStr"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="是否具备试压条件" ColumnID="CanPressureTest" DataField="CanPressureTest" SortField="CanPressureTest"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="具备程度比值" ColumnID="PipelinePassPercent" DataField="PipelinePassPercent" SortField="PipelinePassPercent"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
</f:RenderField>
</f:RenderField>
</Columns>
</f:Grid>
@@ -11,6 +11,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
public partial class TestPackageComplete : PageBase
{
#region
/// <summary>
/// 试压包主键
/// </summary>
@@ -25,93 +26,10 @@ namespace FineUIPro.Web.HJGL.TestPackage
ViewState["PTP_ID"] = value;
}
}
#endregion
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
@@ -122,6 +40,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
drpStateStr.DataTextField = "Value";
drpStateStr.DataValueField = "Value";
drpStateStr.DataSource= BLL.TestPackageEditService.StateMap;
drpStateStr.DataBind();
this.PTP_ID = string.Empty;
Model.Project_Sys_Set pressUnit = BLL.Project_SysSetService.GetSysSetBySetId("8", this.CurrUser.LoginProjectId);
if (pressUnit != null && pressUnit.SetValue == "2")
@@ -133,9 +56,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
BindGrid2();
}
}
#endregion
#endregion
#region --
/// <summary>
/// 加载树
/// </summary>
@@ -177,7 +102,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
testPackageLists = (from x in Funs.DB.PTP_TestPackage
where x.ProjectId == this.CurrUser.LoginProjectId
select x).ToList();
}
}
List<Model.WBS_UnitWork> unitWork1 = null;
List<Model.WBS_UnitWork> unitWork2 = null;
@@ -193,20 +118,20 @@ namespace FineUIPro.Web.HJGL.TestPackage
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
var dicUnitWorkTestPackagePassPercent= BLL.TestPackageEditService.GetTestPackagePassPercentByProjectId(this.CurrUser.LoginProjectId);
var dicUnitWorkTestPackagePassPercent = BLL.TestPackageEditService.GetTestPackagePassPercentByProjectId(this.CurrUser.LoginProjectId);
if (unitWork1.Count() > 0)
{
foreach (var q in unitWork1)
{
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
var unitWorkTestPackagePassPercent = dicUnitWorkTestPackagePassPercent.TryGetValue(q.UnitWorkId, out var value) ? value : 0;
TreeNode tn1 = new TreeNode();
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName+"(已完成"+ unitWorkTestPackagePassPercent+"%)";
tn1.Text = q.UnitWorkName + "(已完成" + unitWorkTestPackagePassPercent + "%)";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
tn1.CommandName = "单位工程";
rootNode1.Nodes.Add(tn1);
@@ -232,9 +157,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
}
}
}
#endregion
#endregion --
#region
/// <summary>
/// 绑定树节点
/// </summary>
@@ -280,9 +207,10 @@ namespace FineUIPro.Web.HJGL.TestPackage
}
}
#endregion
#endregion
#region TreeView
/// <summary>
/// 点击TreeView
/// </summary>
@@ -294,7 +222,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
this.BindGrid();
}
#endregion
#endregion TreeView
#region
/// <summary>
@@ -304,10 +232,10 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
this.SetTextTemp();
this.PageInfoLoad(); ///页面输入保存信息
string strSql = @" SELECT ptpPipe.PT_PipeId, ptpPipe.PTP_ID, ptpPipe.PipelineId, ptpPipe.DesignPress,
ptpPipe.DesignTemperature, ptpPipe.AmbientTemperature, ptpPipe.TestMedium,
string strSql = @" SELECT ptpPipe.PT_PipeId, ptpPipe.PTP_ID, ptpPipe.PipelineId, ptpPipe.DesignPress,
ptpPipe.DesignTemperature, ptpPipe.AmbientTemperature, ptpPipe.TestMedium,
ptpPipe.TestMediumTemperature, ptpPipe.TestPressure, ptpPipe.HoldingTime,IsoInfo.PipelineCode,testMedium.MediumName
FROM dbo.PTP_PipelineList AS ptpPipe
FROM dbo.PTP_PipelineList AS ptpPipe
LEFT JOIN dbo.HJGL_Pipeline AS IsoInfo ON ptpPipe.PipelineId = IsoInfo.PipelineId
LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId = IsoInfo.TestMedium
WHERE ptpPipe.PTP_ID=@PTP_ID";
@@ -336,22 +264,58 @@ namespace FineUIPro.Web.HJGL.TestPackage
Grid2.DataSource = null;
Grid2.DataBind();
return;
}
}
if (!string.IsNullOrEmpty(this.txtGrid2code.Text.Trim()))
{
projectTestPackages = projectTestPackages.Where(x => x.TestPackageNo.Contains(this.txtGrid2code.Text.Trim())).ToList();
}
// 分析每个试压包
var analyzeList = new List<Model.TestPackageAnalyzeOutput>();
foreach (var pkg in projectTestPackages)
{
var analyze = BLL.TestPackageEditService.getTestPackageAnalyze(pkg.PTP_ID, pkg.ProjectId);
var analyze = BLL.TestPackageEditService.getTestPackageAnalyze(pkg.PTP_ID, pkg.ProjectId);
analyzeList.Add(analyze);
}
analyzeList = analyzeList.OrderBy(x => x.UnitWorkName).ThenBy(x => x.TestPackageNo).ToList();
if (drpCanPressureTest.SelectedValueArray.Length>0)
{
analyzeList = analyzeList.Where(x => drpCanPressureTest.SelectedValueArray.ToList().Contains(x.CanPressureTest)).ToList();
}
if (drpStateStr.SelectedValueArray.Length > 0)
{
analyzeList = analyzeList.Where(x => drpStateStr.SelectedValueArray.ToList().Contains(x.StateStr)).ToList();
}
// 绑定到Grid1
Grid2.RecordCount = analyzeList.Count;
Grid2.DataSource = analyzeList;
Grid2.DataBind();
// 设置行样式(保留原逻辑)
for (int i = 0; i < Grid2.Rows.Count; i++)
{
string ptpId = Grid2.Rows[i].DataKeys[0].ToString();
var ptpModel = analyzeList.FirstOrDefault(x=>x.PTP_ID== ptpId);
if (ptpModel != null)
{
if (ptpModel.CanPressureTest== "未具备")
{
Grid2.Rows[i].RowCssClass = "Red";
}
else if (ptpModel.CanPressureTest == "易具备")
{
Grid2.Rows[i].RowCssClass = "Yellow";
}
}
}
}
#region
/// <summary>
/// 加载页面输入保存信息
/// </summary>
@@ -370,9 +334,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
this.txtTestMediumTemperature.Text = testPackageManage.TestMediumTemperature.ToString();
}
}
#endregion
#endregion
#region
/// <summary>
/// 清空页面输入信息
/// </summary>
@@ -386,416 +352,65 @@ namespace FineUIPro.Web.HJGL.TestPackage
this.txtTestMediumTemperature.Text = string.Empty;
}
#endregion
#endregion
#endregion
#endregion
#region
#region
/// <summary>
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
#endregion
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
#endregion
#endregion
#region
/// <summary>
/// 分页选择下拉改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
/// 分页选择下拉改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
#endregion
#endregion
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
this.PTP_ID = this.hdPTP_ID.Text;
this.BindGrid();
@@ -803,79 +418,18 @@ namespace FineUIPro.Web.HJGL.TestPackage
this.hdPTP_ID.Text = string.Empty;
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Tree_TextChanged(object sender, EventArgs e)
protected void Tree_TextChanged(object sender, EventArgs e)
{
this.InitTreeMenu();
this.BindGrid();
}
#endregion
#endregion
protected void btnMenuModify_Click(object sender, EventArgs e)
{
@@ -925,6 +479,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
}
#region
/// <summary>
/// 查询
/// </summary>
@@ -934,6 +489,12 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
InitTreeMenu();
}
#endregion
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid2();
}
#endregion
}
}
@@ -104,6 +104,42 @@ namespace FineUIPro.Web.HJGL.TestPackage
/// </remarks>
protected global::FineUIPro.Panel panelTopRegion;
/// <summary>
/// txtGrid2code 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtGrid2code;
/// <summary>
/// drpCanPressureTest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCanPressureTest;
/// <summary>
/// drpStateStr 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpStateStr;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// Grid2 控件。
/// </summary>
@@ -1,16 +1,11 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.IO;
using Model;
using Microsoft.SqlServer.Server;
using NPOI.SS.Formula.Functions;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.TestPackage
{
@@ -247,7 +242,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
protected void btnPrint_Click(object sender, EventArgs e)
{
var selectedRows = this.Grid1.SelectedRowIDArray;
if (selectedRows.Length==0)
if (selectedRows.Length == 0)
{
Alert.ShowInTop("请选择一条试压包", MessageBoxIcon.Warning);
return;
@@ -257,11 +252,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
var item = exportWord(ptp_id);
TestPackagePrintService.AddPrintCountByPTP_ID(ptp_id);//增加明细打印次数
printFiles.Add(item.FirstOrDefault().Key, item.FirstOrDefault().Value);
printFiles.Add(item.FirstOrDefault().Key, item.FirstOrDefault().Value);
}
if (printFiles.Count>1)
if (printFiles.Count > 1)
{
string zipName = "";
string zipName = "";
string rootPath = Funs.RootPath;
string startPath = rootPath + "FileUpload\\试压包资料" + DateTime.Now.GetHashCode();
if (!Directory.Exists(startPath))
@@ -273,20 +268,20 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
var sourceFile = item.Key;
var destFile = startPath + "\\" + item.Value;
zipName+= item.Value.Replace(".pdf","")+"," ;
zipName += item.Value.Replace(".pdf", "") + ",";
if (File.Exists(sourceFile))
{
File.Copy(sourceFile, destFile, true);
File.Delete(sourceFile);
}
}
zipName= zipName.TrimEnd(',');
zipName = zipName.TrimEnd(',');
System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
FileInfo info = new FileInfo(zipPath);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(zipName+".zip", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(zipName + ".zip", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(zipPath, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
@@ -305,8 +300,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
System.Web.HttpContext.Current.Response.TransmitFile(printFiles.FirstOrDefault().Key, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
}
}
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
@@ -316,8 +311,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestPackageDatePrint.aspx?PTP_ID={0}", keys[0], "编辑 - ")));
}
}
protected Dictionary<string,string> exportWord(string ptp_id)
}
protected Dictionary<string, string> exportWord(string ptp_id)
{
var keyValuePairs = new Dictionary<string, string>();
if (string.IsNullOrEmpty(ptp_id))
@@ -345,7 +340,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
if (this.drpPrintType.SelectedValue == "1")//pdf格式
{
exportName+=".pdf";
exportName += ".pdf";
ListItem[] list = new ListItem[10];
list[0] = new ListItem("0", "File\\Fastreport\\JGZL\\管道试压包文件资料.frx");
list[1] = new ListItem("1", "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx");
@@ -368,21 +363,21 @@ namespace FineUIPro.Web.HJGL.TestPackage
BLL.FastReportService.ExportMergeReport(FastReportItemList, Path, this.drpPrintType.SelectedValue);
keyValuePairs.Add(Path, exportName);
/* FileInfo info = new FileInfo(Path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ClearHeaders();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(exportName + ".pdf", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(Path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(Path);*/
/* FileInfo info = new FileInfo(Path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ClearHeaders();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(exportName + ".pdf", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(Path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(Path);*/
}
else if (this.drpPrintType.SelectedValue == "2")//word格式
{
exportName += ".docx";
exportName += ".docx";
ListItem[] list = new ListItem[3];
list[0] = new ListItem("0", "File\\Fastreport\\JGZL\\管道试压包文件资料.frx");
list[1] = new ListItem("1", "File\\Fastreport\\JGZL\\管道压力试验技术要求.frx");
@@ -455,21 +450,21 @@ namespace FineUIPro.Web.HJGL.TestPackage
doc1.AppendDocument(doc5, Aspose.Words.ImportFormatMode.KeepSourceFormatting);
//将合并的文档保存为 DOCX 文件
var Path = Funs.RootPath + "FileUpload/"+ ptp_id + "Result.docx";
var Path = Funs.RootPath + "FileUpload/" + ptp_id + "Result.docx";
doc1.Save(Path);
keyValuePairs.Add(Path, exportName);
keyValuePairs.Add(Path, exportName);
/* FileInfo info = new FileInfo(Path);
long fileSize = info.Length;
/* FileInfo info = new FileInfo(Path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(exportName + ".docx", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(Path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();*/
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(exportName + ".docx", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(Path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();*/
//File.Delete(Path);
File.Delete(PathA);
File.Delete(PathB);
@@ -481,7 +476,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
}
return keyValuePairs;
}
}
#endregion
@@ -498,7 +493,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
select new { MaterialCode1 = y.MaterialCode, MaterialCode2 = z.MaterialCode }).FirstOrDefault();
if (weldjoint != null)
{
if (!string.IsNullOrEmpty(weldjoint.MaterialCode1)&&!string.IsNullOrEmpty(weldjoint.MaterialCode2))
if (!string.IsNullOrEmpty(weldjoint.MaterialCode1) && !string.IsNullOrEmpty(weldjoint.MaterialCode2))
{
materialCode = weldjoint.MaterialCode1 + "/" + weldjoint.MaterialCode2;
}
@@ -513,7 +508,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
materialCode = weldjoint.MaterialCode2;
}
}
}
}
return materialCode;
@@ -1,17 +1,13 @@
using BLL;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.TestPackage
{
public partial class TestPackageDatePrint : PageBase
{
{
/// <summary>
/// 试压包主键
/// </summary>
@@ -40,7 +36,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
}
private void BindGrid()
{
var list = BLL.TestPackagePrintService.GetListByPTP_ID(PTP_ID);
var list = BLL.TestPackagePrintService.GetListByPTP_ID(PTP_ID);
//根据 BLL.TestPackagePrintService.TypeIntMap 和 list 进行左连接,确保所有类型都显示,获取对应的 PrintCount,没有的类型 PrintCount 为 0
var result = from type in BLL.TestPackagePrintService.TypeIntMap
join item in list on type.Key equals item.TypeInt into gj
@@ -69,7 +65,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
// 在文件名中加入时间戳,例如:PTP_ID_2025-09-17-14-30-00.pdf
string timeStamp = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
string fileName = $"{PTP_ID}_{timeStamp}.pdf";
string filePath = System.IO.Path.Combine(Funs.RootPath, "FileUpload", fileName);
string filePath = System.IO.Path.Combine(Funs.RootPath, "FileUpload", fileName);
BLL.FastReportService.ExportMergeReport(FastReportItemList, filePath, "1");
FileInfo info = new FileInfo(filePath);
long fileSize = info.Length;
@@ -80,6 +76,6 @@ namespace FineUIPro.Web.HJGL.TestPackage
System.Web.HttpContext.Current.Response.TransmitFile(filePath, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
}
}
}
}
@@ -256,11 +256,11 @@ namespace FineUIPro.Web.HJGL.TestPackage
else if (this.tvControlItem.SelectedNode.CommandName == "TestPackage")
{
var testPackageManage = BLL.TestPackageEditService.GetTestPackageByID(this.PTP_ID);
if (testPackageManage != null && !string.IsNullOrEmpty(testPackageManage.UnitWorkId))
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(testPackageManage.UnitWorkId);
}
}
}
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
@@ -577,8 +577,8 @@ namespace FineUIPro.Web.HJGL.TestPackage
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
var pTP_Pipeline = (from x in Funs.DB.PTP_PipelineList
where x.PT_PipeId == Grid1.SelectedRowID
select x).FirstOrDefault();
where x.PT_PipeId == Grid1.SelectedRowID
select x).FirstOrDefault();
var pipe = PipelineService.GetPipelineByPipelineId(pTP_Pipeline.PipelineId);
var pipecode = "/" + pipe.PipelineCode;
Model.Parameter3D parameter3D = new Model.Parameter3D();
@@ -587,7 +587,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
parameter3D.ColorModel = colorModel;
parameter3D.TagNum = pipecode;
parameter3D.ButtonType = "4";
// parameter3D.Line_No = Line_No;
// parameter3D.Line_No = Line_No;
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
@@ -1,15 +1,10 @@
using BLL;
using FineUIPro.Web.ProjectData;
using MiniExcelLibs;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.TestPackage
@@ -191,7 +186,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
if (unitWork != null)
{
pipeline.UnitWorkId = Request.Params["UnitWorkId"];
pipeline.UnitId = unitWork.UnitId;
pipeline.UnitId = unitWork.UnitId;
}
if (pds[i].B != null)
@@ -255,7 +250,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
}
pipeline.Tabler = this.CurrUser.PersonId;
pipeline.TableDate = DateTime.Now;
@@ -392,12 +387,12 @@ namespace FineUIPro.Web.HJGL.TestPackage
ProjectId = this.CurrUser.LoginProjectId,
UnitId = x.UnitId,
UnitWorkId = x.UnitWorkId,
TestPackageNo=x.TestPackageNo,
TestPackageName=x.TestPackageName,
Tabler =x.Tabler,
TableDate=x.TableDate,
TestPackageNo = x.TestPackageNo,
TestPackageName = x.TestPackageName,
Tabler = x.Tabler,
TableDate = x.TableDate,
Remark = x.Remark,
AdjustTestPressure=x.AdjustTestPressure
AdjustTestPressure = x.AdjustTestPressure
}).DistinctBy(temp => new
{
temp.PTP_ID,
@@ -441,16 +436,16 @@ namespace FineUIPro.Web.HJGL.TestPackage
Model.SGGLDB db = Funs.DB;
var getTestPackage = from y in db.PTP_TestPackage where y.UnitWorkId == UnitWorkId select y;
var allPipelineLists = from x in db.PTP_PipelineList
join y in db.PTP_TestPackage on x.PTP_ID equals y.PTP_ID
where y.UnitWorkId == UnitWorkId
select x;
join y in db.PTP_TestPackage on x.PTP_ID equals y.PTP_ID
where y.UnitWorkId == UnitWorkId
select x;
List<Model.PTP_PipelineList> pipelineList_add = new List<Model.PTP_PipelineList>();
var weldJoints = (from x in PipelineList
select new Model.PTP_PipelineList
{
{
PTP_ID = x.PTP_ID,
TestPackageNo=x.TestPackageNo,
TestPackageNo = x.TestPackageNo,
PipelineId = x.PipelineId,
//TestPressure = x.TestPressure,
}).DistinctBy(temp => new
@@ -517,20 +512,20 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
string UnitWorkId = Request.Params["UnitWorkId"];
var queryList = from x in Funs.DB.View_HJGL_Pipeline
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId into yGroup
from y in yGroup.DefaultIfEmpty()
where x.UnitWorkId == UnitWorkId && y==null
select new
{
x.PipelineId,
x.PipelineCode,
x.PipingClassCode,
x.MediumName,
x.DesignPress,
x.DesignTemperature,
x.TestMediumCode,
x.TestPressure
};
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId into yGroup
from y in yGroup.DefaultIfEmpty()
where x.UnitWorkId == UnitWorkId && y == null
select new
{
x.PipelineId,
x.PipelineCode,
x.PipingClassCode,
x.MediumName,
x.DesignPress,
x.DesignTemperature,
x.TestMediumCode,
x.TestPressure
};
// materialize and add sequence number
var list = queryList.ToList();
@@ -557,9 +552,9 @@ namespace FineUIPro.Web.HJGL.TestPackage
{
var value = new
{
model = ""
model = new List<object>()
};
MiniExcel.SaveAsByTemplate(path, uploadfilepath, value);
MiniExcel.SaveAsByTemplate(path, uploadfilepath, value);
}
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
@@ -569,7 +564,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString().Trim());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Flush();
File.Delete(path);
System.Web.HttpContext.Current.Response.End();
@@ -148,7 +148,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
LEFT JOIN dbo.PTP_PipelineList AS IsoList ON IsoList.PipelineId = IsoInfo.PipelineId
WHERE IsoInfo.ProjectId= @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.PTP_ID))
{
strSql += " AND (IsoList.PTP_ID IS NULL OR IsoList.PTP_ID = @PTP_ID)";
@@ -270,7 +270,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
ShowNotify("此施压包已审核不能修改!", MessageBoxIcon.Warning);
return;
}
Model.PTP_TestPackage testPackage = new Model.PTP_TestPackage();
testPackage.ProjectId = this.CurrUser.LoginProjectId;
if (this.drpUnitWork.SelectedValue != BLL.Const._Null)