提交代码

This commit is contained in:
2023-11-23 16:50:57 +08:00
parent aedd071d96
commit 1530dd850b
27 changed files with 974 additions and 250 deletions
@@ -0,0 +1,5 @@
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('2C66A01D-B53F-46A1-89F0-30ED137C7498','检测结果汇总','HJGL/WeldingReport/CheckResult.aspx',100,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1)
GO
INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('C5671119-2DDD-4A64-B7C6-492B96C5AEC7','2C66A01D-B53F-46A1-89F0-30ED137C7498','查看',1)
GO
@@ -543,6 +543,12 @@ GO
INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('47A49DB1-4689-421A-A93E-DCBD7C34D917','854C79DF-A1C0-4E3C-BCB4-7D5CD044F72B','查看',1) INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('47A49DB1-4689-421A-A93E-DCBD7C34D917','854C79DF-A1C0-4E3C-BCB4-7D5CD044F72B','查看',1)
GO GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('2C66A01D-B53F-46A1-89F0-30ED137C7498','检测结果汇总','HJGL/WeldingReport/CheckResult.aspx',100,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1)
GO
INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('C5671119-2DDD-4A64-B7C6-492B96C5AEC7','2C66A01D-B53F-46A1-89F0-30ED137C7498','查看',1)
GO
--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) --INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
--VALUES('CF3CB43C-4031-4CFD-905F-154DC1CB881E','管线综合信息','HJGL/WeldingReport/IsoCompreInfo.aspx',80,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1) --VALUES('CF3CB43C-4031-4CFD-905F-154DC1CB881E','管线综合信息','HJGL/WeldingReport/IsoCompreInfo.aspx',80,'F3B157B7-9BEE-4150-80CB-087828F1C51D','Menu_HJGL',0,1,1)
+4
View File
@@ -3451,6 +3451,10 @@ namespace BLL
/// 公司平均工效统计模板文件原始虚拟路径 /// 公司平均工效统计模板文件原始虚拟路径
/// </summary> /// </summary>
public const string CompanyConstructionLogWorkEfficiencyTemplateUrl = "File\\Excel\\ConstructionLog\\公司平均工效统计.xlsx"; public const string CompanyConstructionLogWorkEfficiencyTemplateUrl = "File\\Excel\\ConstructionLog\\公司平均工效统计.xlsx";
/// <summary>
/// 焊口二次设计信息模板文件原始虚拟路径
/// </summary>
public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx";
#endregion #endregion
#region #region
+2 -2
View File
@@ -65,10 +65,10 @@ namespace BLL
/// <param name="welderId"></param> /// <param name="welderId"></param>
/// <param name="welderCode"></param> /// <param name="welderCode"></param>
/// <returns></returns> /// <returns></returns>
public static bool IsExisWelderCode(string welderId, string welderCode) public static bool IsExisWelderCode(string welderId, string welderCode, string projectId)
{ {
bool isExitCode = false; bool isExitCode = false;
var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId select x; var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId && x.ProjectId == projectId select x;
if (q.Count() > 0) if (q.Count() > 0)
{ {
isExitCode = true; isExitCode = true;
+29 -4
View File
@@ -100,7 +100,7 @@ namespace BLL
{ {
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId); var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
if (newWeldJoint != null ) if (newWeldJoint != null)
{ {
var isTrust = from x in Funs.DB.HJGL_Batch_BatchTrustItem var isTrust = from x in Funs.DB.HJGL_Batch_BatchTrustItem
where x.WeldJointId == weldJointId where x.WeldJointId == weldJointId
@@ -115,7 +115,7 @@ namespace BLL
// 删除批信息 // 删除批信息
var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x; var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x;
if (!string .IsNullOrEmpty(pointBatchId) && !batch.Any()) if (!string.IsNullOrEmpty(pointBatchId) && !batch.Any())
{ {
DeleteBatch(pointBatchId); DeleteBatch(pointBatchId);
} }
@@ -236,8 +236,33 @@ namespace BLL
batch.PointBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_PointBatch)); batch.PointBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_PointBatch));
batchId = batch.PointBatchId; batchId = batch.PointBatchId;
string perfix = project.ProjectCode + "-" + unitWork.UnitWorkCode + "-GD-DK-" + ndt.DetectionTypeCode + "-" + ndtr.DetectionRateValue.ToString() + "%-"; string perfix = project.ProjectCode + "-" + unitWork.UnitWorkCode + "-GD-DK-" + ndt.DetectionTypeCode + "-" + ndtr.DetectionRateValue.ToString() + "%-";
batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix); //batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix);
var maxBatch = (from x in Funs.DB.HJGL_Batch_PointBatch where x.ProjectId == project.ProjectId && x.PointBatchCode.Contains(perfix) select x).FirstOrDefault();
if (maxBatch == null)
{
batch.PointBatchCode = perfix + "0001";
}
else
{
int code = Funs.GetNewIntOrZero(maxBatch.PointBatchCode.Substring(maxBatch.PointBatchCode.Length - 4));
code = code + 1;
if (code < 10)
{
batch.PointBatchCode = perfix + "000" + code.ToString();
}
else if (code >= 10 && code < 100)
{
batch.PointBatchCode = perfix + "00" + code.ToString();
}
else if (code >= 100 && code < 1000)
{
batch.PointBatchCode = perfix + "0" + code.ToString();
}
else
{
batch.PointBatchCode = perfix + code.ToString();
}
}
batch.ProjectId = project.ProjectId; batch.ProjectId = project.ProjectId;
batch.UnitWorkId = pipeline.UnitWorkId; batch.UnitWorkId = pipeline.UnitWorkId;
batch.BatchCondition = batchCondition; batch.BatchCondition = batchCondition;
@@ -72,7 +72,7 @@ namespace BLL
public static Model.HJGL_WeldJoint GetWeldJointsByWeldJointCode(string PipelineId, string WeldJointCode) public static Model.HJGL_WeldJoint GetWeldJointsByWeldJointCode(string PipelineId, string WeldJointCode)
{ {
var q=(from x in Funs.DB.HJGL_WeldJoint where x.PipelineId==PipelineId && x.WeldJointCode==WeldJointCode select x ).FirstOrDefault(); var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId && x.WeldJointCode == WeldJointCode select x).FirstOrDefault();
return q; return q;
} }
@@ -87,7 +87,6 @@ namespace BLL
Model.SGGLDB db = Funs.DB; Model.SGGLDB db = Funs.DB;
Model.HJGL_WeldJoint newWeldJoint = new Model.HJGL_WeldJoint Model.HJGL_WeldJoint newWeldJoint = new Model.HJGL_WeldJoint
{ {
WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint)),
ProjectId = weldJoint.ProjectId, ProjectId = weldJoint.ProjectId,
PipelineId = weldJoint.PipelineId, PipelineId = weldJoint.PipelineId,
PipelineCode = weldJoint.PipelineCode, PipelineCode = weldJoint.PipelineCode,
@@ -97,7 +96,7 @@ namespace BLL
Material2Id = weldJoint.Material2Id, Material2Id = weldJoint.Material2Id,
Thickness = weldJoint.Thickness, Thickness = weldJoint.Thickness,
Dia = weldJoint.Dia, Dia = weldJoint.Dia,
DNDia=weldJoint.DNDia, DNDia = weldJoint.DNDia,
Size = weldJoint.Size, Size = weldJoint.Size,
DetectionTypeId = weldJoint.DetectionTypeId, DetectionTypeId = weldJoint.DetectionTypeId,
JointArea = weldJoint.JointArea, JointArea = weldJoint.JointArea,
@@ -120,9 +119,16 @@ namespace BLL
Remark = weldJoint.Remark, Remark = weldJoint.Remark,
IsTwoJoint = weldJoint.IsTwoJoint, IsTwoJoint = weldJoint.IsTwoJoint,
SubmitMan = weldJoint.SubmitMan, SubmitMan = weldJoint.SubmitMan,
TwoJointType=weldJoint.TwoJointType TwoJointType = weldJoint.TwoJointType
}; };
if (!string.IsNullOrEmpty(weldJoint.WeldJointId))
{
newWeldJoint.WeldJointId = weldJoint.WeldJointId;
}
else
{
newWeldJoint.WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint));
}
db.HJGL_WeldJoint.InsertOnSubmit(newWeldJoint); db.HJGL_WeldJoint.InsertOnSubmit(newWeldJoint);
db.SubmitChanges(); db.SubmitChanges();
} }
@@ -451,7 +457,8 @@ namespace BLL
&& (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId)) && (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId))
&& (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode)) && (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode))
&& (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode)) && (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode))
orderby x.WeldJointCode select x).AsParallel().ToList(); orderby x.WeldJointCode
select x).AsParallel().ToList();
return q; return q;
} }
/// <summary> /// <summary>
@@ -39,6 +39,15 @@
EmptyText="输入查询条件" Width="190px" LabelWidth="80px" EmptyText="输入查询条件" Width="190px" LabelWidth="80px"
LabelAlign="Right"> LabelAlign="Right">
</f:TextBox> </f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar4" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtName" runat="server" Label="焊工姓名"
EmptyText="输入查询条件" Width="190px" LabelWidth="80px"
LabelAlign="Right">
</f:TextBox>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" <f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnQuery_Click1" runat="server"> EnablePostBack="true" OnClick="btnQuery_Click1" runat="server">
</f:Button> </f:Button>
@@ -191,11 +191,15 @@ namespace FineUIPro.Web.CQMS.PersonManage
rootNode.Text = item.UnitName; rootNode.Text = item.UnitName;
rootNode.EnableClickEvent = true; rootNode.EnableClickEvent = true;
this.tvControlItem.Nodes.Add(rootNode); this.tvControlItem.Nodes.Add(rootNode);
var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.States == Const.ProjectPersonStates_1 && x.UnitId == item.UnitId select x).ToList(); var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.UnitId == item.UnitId select x).ToList();
if (!string.IsNullOrEmpty(txtQueryWelderCode.Text.Trim())) if (!string.IsNullOrEmpty(txtQueryWelderCode.Text.Trim()))
{ {
getWelders = getWelders.Where(x => x.WelderCode.Contains(txtQueryWelderCode.Text.Trim())).ToList(); getWelders = getWelders.Where(x => x.WelderCode.Contains(txtQueryWelderCode.Text.Trim())).ToList();
} }
if (!string.IsNullOrEmpty(txtName.Text.Trim()))
{
getWelders = getWelders.Where(x => x.PersonName.Contains(txtName.Text.Trim())).ToList();
}
foreach (var sitem in getWelders) foreach (var sitem in getWelders)
{ {
TreeNode tn = new TreeNode(); TreeNode tn = new TreeNode();
@@ -7,12 +7,10 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.PersonManage namespace FineUIPro.Web.CQMS.PersonManage {
{
public partial class WelderManage public partial class WelderManage {
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -68,6 +66,24 @@ namespace FineUIPro.Web.CQMS.PersonManage
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtQueryWelderCode; protected global::FineUIPro.TextBox txtQueryWelderCode;
/// <summary>
/// Toolbar4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar4;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary> /// <summary>
/// btnQuery 控件。 /// btnQuery 控件。
/// </summary> /// </summary>
@@ -170,7 +170,18 @@ namespace FineUIPro.Web.CQMS.PersonManage
//newWelder.Sex = this.rblSex.SelectedValue; //newWelder.Sex = this.rblSex.SelectedValue;
//newWelder.Birthday = Funs.GetNewDateTime(this.txtBirthday.Text.Trim()); //newWelder.Birthday = Funs.GetNewDateTime(this.txtBirthday.Text.Trim());
newWelder.IdentityCard = this.txtIdentityCard.Text.Trim(); newWelder.IdentityCard = this.txtIdentityCard.Text.Trim();
if (!string.IsNullOrEmpty(this.txtCertificateCode.Text.Trim()))
{
newWelder.CertificateCode = this.txtCertificateCode.Text.Trim(); newWelder.CertificateCode = this.txtCertificateCode.Text.Trim();
}
else
{
var welder = BLL.SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, PersonId);
if (welder != null)
{
newWelder.CertificateCode = welder.IdentityCard;
}
}
//newWelder.CertificateLimitTime = Funs.GetNewDateTime(this.txtCertificateLimitTime.Text.Trim()); //newWelder.CertificateLimitTime = Funs.GetNewDateTime(this.txtCertificateLimitTime.Text.Trim());
newWelder.WelderLevel = this.txtWelderLevel.Text.Trim(); newWelder.WelderLevel = this.txtWelderLevel.Text.Trim();
//if (this.cbIsOnDuty.Checked) //if (this.cbIsOnDuty.Checked)
@@ -187,7 +198,7 @@ namespace FineUIPro.Web.CQMS.PersonManage
// newWelder.IsUsed = true; // newWelder.IsUsed = true;
if (!string.IsNullOrEmpty(PersonId)) if (!string.IsNullOrEmpty(PersonId))
{ {
if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId))
{ {
newWelder.PersonId = PersonId; newWelder.PersonId = PersonId;
BLL.WelderService.UpdateWelder(newWelder); BLL.WelderService.UpdateWelder(newWelder);
@@ -201,7 +212,7 @@ namespace FineUIPro.Web.CQMS.PersonManage
else else
{ {
PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person)); PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person));
if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId))
{ {
newWelder.PersonId = PersonId; newWelder.PersonId = PersonId;
// BLL.WelderService.AddWelder(newWelder); // BLL.WelderService.AddWelder(newWelder);
+8
View File
@@ -721,6 +721,7 @@
<Content Include="HJGL\WeldingManage\WeldReport.aspx" /> <Content Include="HJGL\WeldingManage\WeldReport.aspx" />
<Content Include="HJGL\WeldingManage\WeldReportEdit.aspx" /> <Content Include="HJGL\WeldingManage\WeldReportEdit.aspx" />
<Content Include="HJGL\WeldingManage\WeldTask.aspx" /> <Content Include="HJGL\WeldingManage\WeldTask.aspx" />
<Content Include="HJGL\WeldingReport\CheckResult.aspx" />
<Content Include="HJGL\WeldingReport\DefectStatistics.aspx" /> <Content Include="HJGL\WeldingReport\DefectStatistics.aspx" />
<Content Include="HJGL\WeldingReport\FirstPassRate.aspx" /> <Content Include="HJGL\WeldingReport\FirstPassRate.aspx" />
<Content Include="HJGL\WeldingReport\IsoCmprehensive.aspx" /> <Content Include="HJGL\WeldingReport\IsoCmprehensive.aspx" />
@@ -8977,6 +8978,13 @@
<Compile Include="HJGL\WeldingManage\WeldTask.aspx.designer.cs"> <Compile Include="HJGL\WeldingManage\WeldTask.aspx.designer.cs">
<DependentUpon>WeldTask.aspx</DependentUpon> <DependentUpon>WeldTask.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="HJGL\WeldingReport\CheckResult.aspx.cs">
<DependentUpon>CheckResult.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\WeldingReport\CheckResult.aspx.designer.cs">
<DependentUpon>CheckResult.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\WeldingReport\DefectStatistics.aspx.cs"> <Compile Include="HJGL\WeldingReport\DefectStatistics.aspx.cs">
<DependentUpon>DefectStatistics.aspx</DependentUpon> <DependentUpon>DefectStatistics.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@@ -39,6 +39,15 @@
EmptyText="输入查询条件" Width="190px" LabelWidth="80px" EmptyText="输入查询条件" Width="190px" LabelWidth="80px"
LabelAlign="Right"> LabelAlign="Right">
</f:TextBox> </f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar4" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtName" runat="server" Label="焊工姓名"
EmptyText="输入查询条件" Width="190px" LabelWidth="80px"
LabelAlign="Right">
</f:TextBox>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" <f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnQuery_Click1" runat="server"> EnablePostBack="true" OnClick="btnQuery_Click1" runat="server">
</f:Button> </f:Button>
@@ -37,9 +37,9 @@ namespace FineUIPro.Web.HJGL.PersonManage
Model.SitePerson_Person welder = BLL.SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNodeID); Model.SitePerson_Person welder = BLL.SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNodeID);
if (welder != null) if (welder != null)
{ {
this.btnEdit.Hidden = false; //this.btnEdit.Hidden = false;
this.btnNew.Hidden = false; //this.btnNew.Hidden = false;
this.btnDelete.Hidden = false; //this.btnDelete.Hidden = false;
this.txtWelderCode.Text = welder.WelderCode; this.txtWelderCode.Text = welder.WelderCode;
this.txtWelderName.Text = welder.PersonName; this.txtWelderName.Text = welder.PersonName;
@@ -191,7 +191,15 @@ namespace FineUIPro.Web.HJGL.PersonManage
rootNode.Text = item.UnitName; rootNode.Text = item.UnitName;
rootNode.EnableClickEvent = true; rootNode.EnableClickEvent = true;
this.tvControlItem.Nodes.Add(rootNode); this.tvControlItem.Nodes.Add(rootNode);
var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.UnitId == item.UnitId && x.WelderCode.Contains(txtQueryWelderCode.Text.Trim()) select x).ToList(); var getWelders = (from x in Funs.DB.SitePerson_Person where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkPostId == Const.WorkPost_Welder && x.UnitId == item.UnitId select x).ToList();
if (!string.IsNullOrEmpty(txtQueryWelderCode.Text.Trim()))
{
getWelders = getWelders.Where(x => x.WelderCode.Contains(txtQueryWelderCode.Text.Trim())).ToList();
}
if (!string.IsNullOrEmpty(txtName.Text.Trim()))
{
getWelders = getWelders.Where(x => x.PersonName.Contains(txtName.Text.Trim())).ToList();
}
foreach (var sitem in getWelders) foreach (var sitem in getWelders)
{ {
TreeNode tn = new TreeNode(); TreeNode tn = new TreeNode();
@@ -202,7 +210,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
} }
else else
{ {
tn.Text = sitem.PersonName+"【"+ sitem.WelderCode + "】"; tn.Text = sitem.PersonName + "【" + sitem.WelderCode + "】";
} }
tn.EnableClickEvent = true; tn.EnableClickEvent = true;
rootNode.Nodes.Add(tn); rootNode.Nodes.Add(tn);
@@ -7,12 +7,10 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.PersonManage namespace FineUIPro.Web.HJGL.PersonManage {
{
public partial class WelderManage public partial class WelderManage {
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -68,6 +66,24 @@ namespace FineUIPro.Web.HJGL.PersonManage
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtQueryWelderCode; protected global::FineUIPro.TextBox txtQueryWelderCode;
/// <summary>
/// Toolbar4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar4;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary> /// <summary>
/// btnQuery 控件。 /// btnQuery 控件。
/// </summary> /// </summary>
@@ -178,7 +178,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
// newWelder.IsUsed = true; // newWelder.IsUsed = true;
if (!string.IsNullOrEmpty(PersonId)) if (!string.IsNullOrEmpty(PersonId))
{ {
if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId))
{ {
newWelder.PersonId = PersonId; newWelder.PersonId = PersonId;
BLL.WelderService.UpdateWelder(newWelder); BLL.WelderService.UpdateWelder(newWelder);
@@ -192,7 +192,7 @@ namespace FineUIPro.Web.HJGL.PersonManage
else else
{ {
PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person)); PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person));
if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text)) if (!BLL.WelderService.IsExisWelderCode(PersonId, this.txtWelderCode.Text, this.CurrUser.LoginProjectId))
{ {
newWelder.PersonId = PersonId; newWelder.PersonId = PersonId;
// BLL.WelderService.AddWelder(newWelder); // BLL.WelderService.AddWelder(newWelder);
@@ -83,6 +83,9 @@
<f:Button ID="btnOut2" runat="server" Text="导出" ToolTip="导出焊口初始数据信息" Hidden="true" <f:Button ID="btnOut2" runat="server" Text="导出" ToolTip="导出焊口初始数据信息" Hidden="true"
Icon="FolderUp" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnOut2_Click"> Icon="FolderUp" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnOut2_Click">
</f:Button> </f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<f:Button ID="btnPrint" Text="打印" Icon="Printer" runat="server" <f:Button ID="btnPrint" Text="打印" Icon="Printer" runat="server"
OnClick="btnPrint_Click"> OnClick="btnPrint_Click">
</f:Button> </f:Button>
@@ -1,8 +1,10 @@
using BLL; using BLL;
using NPOI.SS.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Web; using System.Web;
@@ -839,27 +841,171 @@ namespace FineUIPro.Web.HJGL.WeldingManage
#endregion #endregion
#region #region
/// <summary> /// 导出按钮
/// 导出焊口信息
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e) protected void btnOut_Click(object sender, EventArgs e)
{ {
//var iso = BLL.Pipeline_PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); string rootPath = Server.MapPath("~/");
//var workArea = BLL.Project_WorkAreaService.GetProject_WorkAreaByWorkAreaId(this.tvControlItem.SelectedNodeID); string initTemplatePath = string.Empty;
//if (iso != null) string uploadfilepath = string.Empty;
//{ string newUrl = string.Empty;
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("JointInfoOut.aspx?PipelineId={0}", this.tvControlItem.SelectedNodeID, "导出 - "))); string filePath = string.Empty;
//} initTemplatePath = Const.JotTwoDesignTemplateUrl;
//else if (workArea != null) uploadfilepath = rootPath + initTemplatePath;
//{ string constructionLogId = this.tvControlItem.SelectedNodeID;
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("JointInfoOut.aspx?WorkAreaId={0}", this.tvControlItem.SelectedNodeID, "导出 - "))); Model.SGGLDB db = Funs.DB;
//} var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
//else where x.ConstructionLogId == constructionLogId
//{ select x;
// Alert.ShowInTop("请选择"PipelineOrArea, MessageBoxIcon.Warning); var persons = from x in db.ZHGL_ConstructionLogPerson
//} where x.ConstructionLogId == constructionLogId
select x;
var machines = from x in db.ZHGL_ConstructionLogMachine
where x.ConstructionLogId == constructionLogId
select x;
if (this.Grid1.Rows.Count > 0)
{
newUrl = uploadfilepath.Replace(".xlsx", "(" + string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ")" + ".xlsx");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
NPOI.SS.UserModel.IWorkbook workbook;
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
{
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
}
// 创建单元格样式
NPOI.SS.UserModel.ICellStyle cellStyle0 = workbook.CreateCellStyle();
cellStyle0.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
cellStyle0.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
cellStyle0.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
cellStyle0.WrapText = true;
var font = workbook.CreateFont();
font.FontHeightInPoints = 11;
font.IsBold = false;
cellStyle0.SetFont(font);
// 第二步:创建新数据行
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
int rowCount = 2;
for (int i = 0; i < this.Grid1.Rows.Count; i++)
{
NPOI.SS.UserModel.IRow row1 = sheet.CreateRow(rowCount);
NPOI.SS.UserModel.ICell cell;
cell = row1.CreateCell(0);
cell.CellStyle = cellStyle0;
cell.SetCellValue((i+1).ToString());
cell = row1.CreateCell(1);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[2].ToString());
cell = row1.CreateCell(2);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[3].ToString());
cell = row1.CreateCell(3);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[4].ToString());
cell = row1.CreateCell(4);
cell.CellStyle = cellStyle0;
string date1 = this.Grid1.Rows[i].Values[5].ToString();
if (!string.IsNullOrEmpty(date1))
{
date1 = string.Format("{0:yyyy-MM-dd}",Funs.GetNewDateTime(date1));
}
cell.SetCellValue(date1);
cell = row1.CreateCell(5);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[6].ToString());
cell = row1.CreateCell(6);
cell.CellStyle = cellStyle0;
string date2 = this.Grid1.Rows[i].Values[7].ToString();
if (!string.IsNullOrEmpty(date2))
{
date2 = string.Format("{0:yyyy-MM-dd}", Funs.GetNewDateTime(date2));
}
cell.SetCellValue(date2);
cell = row1.CreateCell(7);
cell.CellStyle = cellStyle0;
string weldJointCode = string.Empty;
var weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(this.Grid1.Rows[i].RowID);
if (weldJoint != null)
{
weldJointCode = weldJoint.WeldJointCode;
}
cell.SetCellValue(weldJointCode);
cell = row1.CreateCell(8);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[10].ToString());
cell = row1.CreateCell(9);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[11].ToString());
cell = row1.CreateCell(10);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[12].ToString());
cell = row1.CreateCell(11);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[13].ToString());
cell = row1.CreateCell(12);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[14].ToString());
cell = row1.CreateCell(13);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[15].ToString());
cell = row1.CreateCell(14);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[16].ToString());
cell = row1.CreateCell(15);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[17].ToString());
cell = row1.CreateCell(16);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[18].ToString());
cell = row1.CreateCell(17);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[20].ToString());
cell = row1.CreateCell(18);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[21].ToString());
cell = row1.CreateCell(19);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[22].ToString());
cell = row1.CreateCell(20);
cell.CellStyle = cellStyle0;
cell.SetCellValue(this.Grid1.Rows[i].Values[27].ToString());
rowCount++;
}
// 第三步:写入文件流
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
{
workbook.Write(stream);
workbook.Close();
}
string fileName = Path.GetFileName(newUrl);
FileInfo info = new FileInfo(newUrl);
long fileSize = info.Length;
Response.Clear();
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AddHeader("Content-Length", fileSize.ToString());
Response.TransmitFile(newUrl, 0, fileSize);
Response.Flush();
Response.Close();
File.Delete(newUrl);
}
else
{
ShowNotify("无数据可导出!", MessageBoxIcon.Warning);
}
} }
/// <summary> /// <summary>
@@ -887,47 +1033,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// Alert.ShowInTop("请选择"PipelinetFirst, MessageBoxIcon.Warning); // Alert.ShowInTop("请选择"PipelinetFirst, MessageBoxIcon.Warning);
//} //}
} }
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
if (column.HeaderText != "序号")
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID != "tfNumber")
{
//html = (row.FindControl("lblNumber") as AspNet.Label).Text;
sb.AppendFormat("<td>{0}</td>", html);
}
//sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion #endregion
#region #region
@@ -201,6 +201,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnOut2; protected global::FineUIPro.Button btnOut2;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary> /// <summary>
/// btnPrint 控件。 /// btnPrint 控件。
/// </summary> /// </summary>
@@ -167,7 +167,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var columns = MiniExcel.GetColumns(fileName); var columns = MiniExcel.GetColumns(fileName);
var cnt = columns.Count; var cnt = columns.Count;
var reposedata = AddDatasetToSQL(ds, cnt); var reposedata = AddDatasetToSQL(ds, cnt);
if (reposedata.code==1) if (reposedata.code == 1)
{ {
State = (int)ButtonState.Import; State = (int)ButtonState.Import;
ShowNotify("审核完成请点击导入"); ShowNotify("审核完成请点击导入");
@@ -245,7 +245,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string pipeLineId = string.Empty; string pipeLineId = string.Empty;
if (string.IsNullOrEmpty(col0)) if (string.IsNullOrEmpty(col0))
{ {
result.Add( "第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"); result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|");
} }
else else
{ {
@@ -266,7 +266,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (Medium == null) if (Medium == null)
{ {
// result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|"; // result += "第" + (i + 1).ToString() + "行," + "该介质不存在!" + "|";
result .Add( col3 + "-该介质不存在!" + "|"); result.Add(col3 + "-该介质不存在!" + "|");
} }
else else
{ {
@@ -316,26 +316,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col6 = pds[i].G; string col6 = pds[i].G;
if (!string.IsNullOrEmpty(col6)) if (!string.IsNullOrEmpty(col6))
{ {
string[] types = col6.ToString().Split(','); string typeStr = col6.ToString();
foreach (string t in types) var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == typeStr);
{
var type = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == t);
if (type == null) if (type == null)
{ {
//result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|"; //result += "第" + (i + 1).ToString() + "行," + "探伤类型【" + t + "】不存在!" + "|";
result.Add("探伤类型【" + t + "】不存在!" + "|"); result.Add("探伤类型【" + typeStr + "】不存在!" + "|");
} }
else else
{ {
pipeline.DetectionType += type.DetectionTypeId + "|"; pipeline.DetectionType = type.DetectionTypeId;
}
}
if (!string.IsNullOrEmpty(pipeline.DetectionType))
{
pipeline.DetectionType = pipeline.DetectionType.Substring(0, pipeline.DetectionType.Length - 1);
pipeline.DetectionTypeStr = col6; pipeline.DetectionTypeStr = col6;
} }
} }
else else
{ {
@@ -456,7 +448,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
pipeline.PipeMaterialCode = col17; pipeline.PipeMaterialCode = col17;
} }
} }
pipeline.FlowingSection= Convert.ToString(pds[i].S); pipeline.FlowingSection = Convert.ToString(pds[i].S);
pipeline.Remark = Convert.ToString(pds[i].T); pipeline.Remark = Convert.ToString(pds[i].T);
// 以下是焊口信息 // 以下是焊口信息
@@ -480,7 +472,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
string col20 = ""; string col20 = "";
if (pds[i].V!=null) if (pds[i].V != null)
{ {
col20 = pds[i].V.ToString(); col20 = pds[i].V.ToString();
} }
@@ -505,7 +497,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
string col21 = ""; string col21 = "";
if (pds[i].W!=null) if (pds[i].W != null)
{ {
col21 = pds[i].W.ToString(); col21 = pds[i].W.ToString();
} }
@@ -531,9 +523,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
string col22 = Convert.ToString(pds[i].X); string col22 = Convert.ToString(pds[i].X);
string col27 = ""; string col27 = "";
if (pds[i].AC!=null) if (pds[i].AC != null)
{ {
col27= pds[i].AC.ToString(); col27 = pds[i].AC.ToString();
} }
if (rbDiaType.SelectedValue == "1") if (rbDiaType.SelectedValue == "1")
{ {
@@ -576,7 +568,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var col23 = Convert.ToString(pds[i].Y); var col23 = Convert.ToString(pds[i].Y);
if (col23!=null) if (col23 != null)
{ {
try try
{ {
@@ -594,7 +586,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
var col24 = Convert.ToString(pds[i].Z); var col24 = Convert.ToString(pds[i].Z);
if (col24!=null) if (col24 != null)
{ {
// var Thickness = Convert.ToDecimal(col24); // var Thickness = Convert.ToDecimal(col24);
decimal Thickness = 0; decimal Thickness = 0;
@@ -603,12 +595,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
if (rbDiaType.SelectedValue == "1")//外径 if (rbDiaType.SelectedValue == "1")//外径
{ {
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia,thickness); Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDia(pipeline.Dia, thickness);
pipeline.Thickness = Thickness; pipeline.Thickness = Thickness;
} }
else //DN直径 else //DN直径
{ {
Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse( pipeline.DNDia.Replace("DN","")), thickness); Thickness = (decimal)BLL.Base_DNCompareService.GetThicknessByDNDia(int.Parse(pipeline.DNDia.Replace("DN", "")), thickness);
pipeline.Thickness = Thickness; pipeline.Thickness = Thickness;
} }
} }
@@ -840,9 +832,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
string rootPath = Server.MapPath("~/"); string rootPath = Server.MapPath("~/");
string oldefilePath = rootPath+initPath + this.hdFileName.Text; string oldefilePath = rootPath + initPath + this.hdFileName.Text;
string unitworkId = Request.Params["UnitWorkId"]; string unitworkId = Request.Params["UnitWorkId"];
string filePath = rootPath+ Const.DesignBasisDataImportPath + this.hdFileName.Text; string filePath = rootPath + Const.DesignBasisDataImportPath + this.hdFileName.Text;
if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath)) if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath))
{ {
if (!Directory.Exists(rootPath + Const.DesignBasisDataImportPath)) if (!Directory.Exists(rootPath + Const.DesignBasisDataImportPath))
@@ -863,8 +855,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线 BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线
AddView_HJGL_WeldJoint(PipelineList);//导入数据 AddView_HJGL_WeldJoint(PipelineList);//导入数据
Model .HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model .HJGL_DesignBasisDataImport(); Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport();
hJGL_DesignBasisDataImport.DesignBasisDataImportId= SQLHelper.GetNewID(); hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID();
hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId; hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId;
hJGL_DesignBasisDataImport.UnitWorkId = unitworkId; hJGL_DesignBasisDataImport.UnitWorkId = unitworkId;
hJGL_DesignBasisDataImport.ImportType = "1"; hJGL_DesignBasisDataImport.ImportType = "1";
@@ -872,7 +864,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
hJGL_DesignBasisDataImport.FileName = FileName; hJGL_DesignBasisDataImport.FileName = FileName;
hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, ""); hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, "");
hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName); hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName);
hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId,DataClassification); hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId, DataClassification);
hJGL_DesignBasisDataImport.Remark = txtRemark.Text; hJGL_DesignBasisDataImport.Remark = txtRemark.Text;
hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId; hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId;
hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss"); hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
@@ -95,7 +95,7 @@
</f:Button> </f:Button>
<f:Button ID="btnUpdateImport" Text="更新导入" ToolTip="更新导入" Icon="PackageIn" runat="server" Hidden="true" OnClick="btnUpdateImport_Click"> <f:Button ID="btnUpdateImport" Text="更新导入" ToolTip="更新导入" Icon="PackageIn" runat="server" Hidden="true" OnClick="btnUpdateImport_Click">
</f:Button> </f:Button>
<f:Button ID="btnPDMSImport" Text="PDMS导入" ToolTip="PDMS导入" Icon="PackageIn" runat="server" OnClick="btnPDMSImport_Click"> <f:Button ID="btnPDMSImport" Text="导入" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnPDMSImport_Click">
</f:Button> </f:Button>
<f:Button ID="btnMatImport" Text="材料导入" ToolTip="材料导入" Icon="PackageIn" runat="server" OnClick="btnMatImport_Click" Hidden="true"> <f:Button ID="btnMatImport" Text="材料导入" ToolTip="材料导入" Icon="PackageIn" runat="server" OnClick="btnMatImport_Click" Hidden="true">
</f:Button> </f:Button>
@@ -11,6 +11,16 @@
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" /> <f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Form runat="server" ShowBorder="true" ShowHeader="false"> <f:Form runat="server" ShowBorder="true" ShowHeader="false">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnAttachUrl" Text="详情" ToolTip="附件上传及查看" Icon="TableCell" runat="server"
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill runat="server"/>
</Items>
</f:Toolbar>
</Toolbars>
<Items> <Items>
<f:GroupPanel ID="GroupPanel3" Layout="Anchor" Title="管线数据" runat="server"> <f:GroupPanel ID="GroupPanel3" Layout="Anchor" Title="管线数据" runat="server">
<Items> <Items>
@@ -139,6 +149,10 @@
</Items> </Items>
</f:Form> </f:Form>
<f:Window ID="WindowAtt" Title="附件" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form> </form>
</body> </body>
</html> </html>
@@ -160,5 +160,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
} }
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WeldJoint&menuId={1}&type=-1", Request.Params["WeldJointId"], BLL.Const.HJGL_WeldJointMenuId)));
}
} }
} }
@@ -30,6 +30,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.PageManager PageManager1; protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary> /// <summary>
/// GroupPanel3 控件。 /// GroupPanel3 控件。
/// </summary> /// </summary>
@@ -281,5 +299,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox hdGrooveType; protected global::FineUIPro.TextBox hdGrooveType;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
} }
} }
@@ -0,0 +1,99 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckResult.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingReport.CheckResult" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>检测结果汇总</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊工一次合格率"
EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="WelderCode"
AllowCellEditing="true" ClicksToEdit="2" DataIDField="WelderCode" AllowSorting="true"
SortField="WelderCode" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpUnitId" runat="server" Label="单位名称"
LabelAlign="Right" Width="240px" LabelWidth="80px" >
</f:DropDownList>
<f:DropDownList ID="drpDetectionType" runat="server" Label="探伤类型"
LabelAlign="Right" Width="240px" LabelWidth="80px">
</f:DropDownList>
<f:DatePicker runat="server" Label="日期" ID="txtStarTime" LabelAlign="Right"
Width="180px" LabelWidth="80px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="至">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" Width="180px" LabelWidth="80px">
</f:DatePicker>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" ColumnID="tfNumber" />
<f:RenderField HeaderText="施工单位" ColumnID="UnitName"
DataField="UnitName" SortField="UnitName" FieldType="String" HeaderTextAlign="Center"
Width="250px">
</f:RenderField>
<f:RenderField HeaderText="焊口号" ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="探伤类型" ColumnID="DetectionTypeCode"
DataField="DetectionTypeCode" FieldType="String" HeaderTextAlign="Center"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="拍片数量" ColumnID="TotalFilm"
DataField="TotalFilm" FieldType="String" HeaderTextAlign="Center"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="合格片数" ColumnID="PassFilm"
DataField="PassFilm" FieldType="String" HeaderTextAlign="Center"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="检测结果" ColumnID="CheckResult"
DataField="CheckResult" FieldType="String" HeaderTextAlign="Center"
Width="120px">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,174 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.WeldingReport
{
public partial class CheckResult : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(drpDetectionType, true, string.Empty);
}
}
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@unitcode", this.drpUnitId.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@unitcode", null));
}
if (this.drpDetectionType.SelectedValue != BLL.Const._Null)
{
listStr.Add(new SqlParameter("@detectionTypeId", this.drpDetectionType.SelectedValue));
}
else
{
listStr.Add(new SqlParameter("@detectionTypeId", null));
}
if (!string.IsNullOrEmpty(this.txtStarTime.Text))
{
listStr.Add(new SqlParameter("@date1", this.txtStarTime.Text.Trim()));
}
else
{
listStr.Add(new SqlParameter("@date1", null));
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
{
listStr.Add(new SqlParameter("@date2", this.txtEndTime.Text.Trim()));
}
else
{
listStr.Add(new SqlParameter("@date2", null));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunProc("sp_rpt_WelderFirstPassRate", parameter);
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页下拉选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("焊工一次合格率" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
grid.PageSize = 10000;
BindGrid();
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID == "tfNumber")
{
html = (row.FindControl("labNumber") as AspNet.Label).Text;
}
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
}
}
@@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.WeldingReport {
public partial class CheckResult {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpUnitId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitId;
/// <summary>
/// drpDetectionType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDetectionType;
/// <summary>
/// txtStarTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStarTime;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}