2023-11-08

This commit is contained in:
2023-11-08 17:26:59 +08:00
parent 1b7463957c
commit 11357590c9
19 changed files with 389 additions and 135 deletions
@@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web.UI.WebControls;
@@ -1115,5 +1116,55 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.BindGrid(GetWeldingTaskList);
}
}
protected void btnPrint_Click(object sender, EventArgs e)
{
DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[1]);
if (taskTime != null)
{
var pipelines = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNode.ParentNode.NodeID, Convert.ToDateTime(taskTime)).Select(x=>x.PipelineId).Distinct().ToList();
if (pipelines.Any())
{
BLL.FastReportService.ResetData();
var result = HJGL_PipelineComponentService.GetPrintModelByPipelineComponentIds(null, pipelines.ToArray(),true);
var PipelineComponentIds = result.Select(x => x.PipelineComponentId).ToArray();
var tb = LINQToDataTable(result);
if (tb != null && tb.Rows.Count>0)
{
tb.TableName = "Table1";
}
else
{
ShowNotify("该管线已打印完成", MessageBoxIcon.Question);
return;
}
BLL.FastReportService.AddFastreportTable(tb);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\组件打印.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
HJGL_PipelineComponentService.UpdateIsPrint(PipelineComponentIds);
}
}
else
{
ShowNotify("无关联管线", MessageBoxIcon.Question);
}
}
else
{
ShowNotify("请选择任务单",MessageBoxIcon.Question);
}
}
}
}