增加焊接任务单打印

This commit is contained in:
李鹏飞 2024-11-06 16:03:58 +08:00
parent 92f20a5913
commit 693c914869
9 changed files with 359 additions and 10 deletions

View File

@ -53,7 +53,6 @@ namespace BLL
from p in pp.DefaultIfEmpty() from p in pp.DefaultIfEmpty()
join unitwork in db.WBS_UnitWork on y.UnitWorkId equals unitwork.UnitWorkId into unitworks join unitwork in db.WBS_UnitWork on y.UnitWorkId equals unitwork.UnitWorkId into unitworks
from unitwork in unitworks.DefaultIfEmpty() from unitwork in unitworks.DefaultIfEmpty()
where x.PipelineComponentId== PipelineComponentId where x.PipelineComponentId== PipelineComponentId
select new PipelineComponentItem select new PipelineComponentItem
{ {
@ -63,7 +62,6 @@ namespace BLL
DrawingName = x.DrawingName, DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber, BoxNumber = x.BoxNumber,
State = x.State, State = x.State,
StateStr = HJGL_PipelineComponentService.GetState().FirstOrDefault(q=>q.Value==x.State.ToString()).Text.Trim(),
PlanStartDate = string.Format("{0:g}", y.PlanStartDate), PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
QRCode = x.QRCode, QRCode = x.QRCode,
ReceiveMan = p.PersonName, ReceiveMan = p.PersonName,
@ -71,9 +69,17 @@ namespace BLL
UnitWorkName=unitwork.UnitWorkName, UnitWorkName=unitwork.UnitWorkName,
Remark = x.Remark Remark = x.Remark
}).FirstOrDefault(); }).FirstOrDefault();
if (q != null)
{
q.StateStr = HJGL_PipelineComponentService.GetState()
.FirstOrDefault(x => x.Value == q.State.ToString())
?.Text.Trim();
}
bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId); bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId);
pipelineComponentDetail.pipelineComponentItem = q; pipelineComponentDetail.pipelineComponentItem = q;
pipelineComponentDetail.isPower=isPower; pipelineComponentDetail.isPower = isPower;
return pipelineComponentDetail; return pipelineComponentDetail;
} }

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Media.Animation;
namespace BLL namespace BLL
{ {
@ -132,6 +133,70 @@ namespace BLL
} }
} }
public static decimal? GetPipeMatch(string pipelineId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var twPipeMatMatchOutputs = new List<Tw_PipeMatMatchOutput>();
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipelineId);
string warehouseCode = PipelineService
.GetPipeArea().FirstOrDefault(x => x.Value == pipelineModel.PipeArea.ToString())
?.Text;
// 获取所需材料列表
var requiredMaterials = (from x in db.HJGL_PipeLineMat
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in db.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
where z.PipelineId== pipelineId && x.PrefabricatedComponents != "" //x.PrefabricatedComponents!="" 用于筛选非散件材料
select new Tw_PipeMatMatchOutput
{
Id = Guid.NewGuid().ToString(),
PipelineId = x.PipelineId,
PipelineCode = z.PipelineCode,
UnitWorkId = z.UnitWorkId,
UnitWorkName = m.UnitWorkName,
PrefabricatedComponents = x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
MaterialName = y.MaterialName,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
MaterialDef = y.MaterialDef,
NeedNum = x.Number,
}
).ToList();
Tw_MaterialStockOutput tw_MaterialStockOutput = new Tw_MaterialStockOutput();
tw_MaterialStockOutput.WarehouseCode = warehouseCode;
var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表
// 模拟库存管理
foreach (var material in requiredMaterials)
{
var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum ?? 0;
if (thisMaterialStockNum >= material.NeedNum)
{
material.MatchNum = material.NeedNum;
material.MatchRate = 1;
material.MatchRateString = "100%";
}
else
{
material.MatchNum = thisMaterialStockNum < 0 ? 0 : thisMaterialStockNum;
material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum ?? 0 / material.NeedNum);
material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%";
}
//修改stockList对应的库存数量
var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode);
if (stock != null)
{
stock.StockNum -= material.MatchNum;
}
}
twPipeMatMatchOutputs = requiredMaterials;
var result = twPipeMatMatchOutputs.Count==0?0: twPipeMatMatchOutputs.Sum(x=>x.MatchRate)/ twPipeMatMatchOutputs.Count;
return result;
}
}
public static List<Tw_PipeMatMatchOutput> GetMatMatchByOutPlanMasterId(string outPlanMasterId) public static List<Tw_PipeMatMatchOutput> GetMatMatchByOutPlanMasterId(string outPlanMasterId)
{ {

View File

@ -547,7 +547,7 @@ namespace BLL
{ {
return; return;
} }
string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMMMdd}", date); string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMdd}", date);
//判断是否已经生成过出库计划单 //判断是否已经生成过出库计划单
var queryIsExitInMaster = new Tw_InOutMasterOutput(); var queryIsExitInMaster = new Tw_InOutMasterOutput();
queryIsExitInMaster.WeldTaskId = WeldTaskId; queryIsExitInMaster.WeldTaskId = WeldTaskId;

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="09/27/2024 11:39:16" ReportInfo.CreatorVersion="2017.1.16.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="11/06/2024 10:23:55" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System; <ScriptText>using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@ -84,7 +84,7 @@ namespace FastReport
} }
</ScriptText> </ScriptText>
<Dictionary> <Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRG9XKG9HiDKEQP9THrIIH65"/> <MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRF67i6IehnB4bwXHeNNj9k1"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true"> <TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="BillName" DataType="System.String" PropName="CH_TrustCode"/> <Column Name="BillName" DataType="System.String" PropName="CH_TrustCode"/>
<Column Name="ReqUnitName" DataType="System.String" PropName="CH_TrustUnit"/> <Column Name="ReqUnitName" DataType="System.String" PropName="CH_TrustUnit"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="11/04/2024 15:03:44" ReportInfo.CreatorVersion="2017.1.16.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="11/06/2024 10:24:12" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System; <ScriptText>using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@ -84,7 +84,7 @@ namespace FastReport
} }
</ScriptText> </ScriptText>
<Dictionary> <Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRGg7xY+1Irk5SK3YJ4IIGaM"/> <MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFseuh+sOz5dBo5fumo4Mv+"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true"> <TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="BillName" DataType="System.String" PropName="CH_TrustCode"/> <Column Name="BillName" DataType="System.String" PropName="CH_TrustCode"/>
<Column Name="ReqUnitName" DataType="System.String" PropName="CH_TrustUnit"/> <Column Name="ReqUnitName" DataType="System.String" PropName="CH_TrustUnit"/>

View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="11/06/2024 15:25:46" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
namespace FastReport
{
public class ReportScript
{  
private int x;
private void Tabel_Data_ManualBuild(object sender, EventArgs e)
{
DataSourceBase rowData = Report.GetDataSource(&quot;Data&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
Tabel_Data.PrintRow(0);
// each PrintRow call must be followed by either PrintColumn or PrintColumns call
// to print cells on the row
Tabel_Data.PrintColumns();
x=0;
// now enumerate the data source and print the table body
while (rowData.HasMoreRows)
{
x++;
// print the table body
Tabel_Data.PrintRow(1);
Tabel_Data.PrintColumns();
// go next data source row
rowData.Next();
}  
}
}
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWREAK3yJ/a7DCIkXW2TdHWfL"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="BillName" DataType="System.String" PropName="CH_TrustCode"/>
<Column Name="ReqUnitName" DataType="System.String" PropName="CH_TrustUnit"/>
<Column Name="AuditManName" DataType="System.String" PropName="CH_SlopeType"/>
<Column Name="CreateManName" DataType="System.String" PropName="CH_WeldMethod"/>
<Column Name="AuditDate" DataType="System.String" PropName="CH_NDTRate"/>
<Column Name="CreateDate" DataType="System.String" PropName="CH_NDTMethod"/>
<Column Name="CusBillCode" DataType="System.String" PropName="CH_NDTCriteria"/>
<Column Name="ProjectName" DataType="System.String" PropName="ProjectId"/>
<Column Name="CategoryString" DataType="System.String" PropName="Column"/>
<Column Name="WarehouseManName" DataType="System.String" PropName="Column"/>
<Column Name="WarehouseManAuditDate" DataType="System.String" PropName="Column"/>
</TableDataSource>
<TableDataSource Name="Data" ReferenceName="Data" DataType="System.Int32" Enabled="true" TableName="Data">
<Column Name="PipelineCode" DataType="System.String" PropName="CH_TrustID"/>
<Column Name="MaterialCode" DataType="System.String" PropName="Column"/>
<Column Name="MaterialSpec" DataType="System.String" PropName="Column3"/>
<Column Name="FlowingSection" DataType="System.String" PropName="Column"/>
<Column Name="MatchRate" DataType="System.String" PropName="Column"/>
</TableDataSource>
<TableDataSource Name="ApproveOutData" ReferenceName="ApproveInData" DataType="System.Int32" PropName="ApproveInData" Enabled="true">
<Column Name="ProfessionalEngineer" DataType="System.String" PropName="CH_TrustID"/>
<Column Name="ConstructionManager" DataType="System.String" PropName="Column"/>
<Column Name="ControlManager" DataType="System.String" PropName="Column"/>
<Column Name="ProjectManager" DataType="System.String" PropName="Column2"/>
<Column Name="PurchasingMan" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="ConUnitMaterialOfficer" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="ConUnitProjectManager" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
</TableDataSource>
<Parameter Name="Code" DataType="System.String"/>
<Parameter Name="TaskDate" DataType="System.String"/>
<Parameter Name="UnitName" DataType="System.String"/>
<Parameter Name="UnitWorkName" DataType="System.String"/>
</Dictionary>
<ReportPage Name="Page1" Landscape="true" PaperWidth="297" PaperHeight="210" RawPaperSize="9">
<PageHeaderBand Name="PageHeader1" Width="1047.06" Height="166.32">
<TableObject Name="Table4" Left="9.45" Top="18.9" Width="1030.05" Height="147.42" Border.Lines="Top">
<TableColumn Name="Column75" Width="41.58"/>
<TableColumn Name="Column76" Width="117.23"/>
<TableColumn Name="Column77" Width="126.62"/>
<TableColumn Name="Column78" Width="79.37"/>
<TableColumn Name="Column79" Width="343.97"/>
<TableColumn Name="Column80" Width="75.59"/>
<TableColumn Name="Column81" Width="66.14"/>
<TableColumn Name="Column82" Width="75.59"/>
<TableColumn Name="Column84" Width="103.96"/>
<TableRow Name="Row37" Height="56.7">
<TableCell Name="Cell311" Border.Lines="Left" HorzAlign="Center" VertAlign="Center" ColSpan="4"/>
<TableCell Name="Cell312" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell313" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell314" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell315" Border.Lines="Top" Text="管道焊接任务单" HorzAlign="Center" VertAlign="Center" Font="宋体, 16pt, style=Bold"/>
<TableCell Name="Cell316" Border.Lines="Right, Top" Text="编号:[Code]&#13;&#10;" VertAlign="Center" ColSpan="4"/>
<TableCell Name="Cell317" Border.Lines="Left, Right, Top" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TableCell Name="Cell318" Border.Lines="Left, Right, Top" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TableCell Name="Cell320" Border.Lines="Left, Right, Top" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
</TableRow>
<TableRow Name="Row38" Height="45.36">
<TableCell Name="Cell321" Border.Lines="Left, Top" Text="委托单位:[UnitName]" VertAlign="Center" Font="宋体, 10pt" ColSpan="5"/>
<TableCell Name="Cell322" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell323" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell324" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell325" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt, style=Bold"/>
<TableCell Name="Cell326" Border.Lines="Right, Top" Text="&#13;&#10;日期:[TaskDate]" VertAlign="Center" Font="宋体, 10pt" ColSpan="4"/>
<TableCell Name="Cell327" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt, style=Bold"/>
<TableCell Name="Cell328" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt, style=Bold"/>
<TableCell Name="Cell330" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt, style=Bold"/>
</TableRow>
<TableRow Name="Row39" Height="45.36">
<TableCell Name="Cell339" Border.Lines="Left, Right, Top" Text="装置名称:[UnitWorkName]" VertAlign="Center" ColSpan="9"/>
<TableCell Name="Cell340" Border.Lines="All"/>
<TableCell Name="Cell341" Border.Lines="All"/>
<TableCell Name="Cell342" Border.Lines="All"/>
<TableCell Name="Cell343" Border.Lines="All"/>
<TableCell Name="Cell344" Border.Lines="All"/>
<TableCell Name="Cell345" Border.Lines="All"/>
<TableCell Name="Cell346" Border.Lines="All"/>
<TableCell Name="Cell347" Border.Lines="All"/>
</TableRow>
</TableObject>
</PageHeaderBand>
<DataBand Name="Data1" Top="170.36" Width="1047.06" Height="71.82">
<TableObject Name="Tabel_Data" Left="9.45" Width="1030.05" Height="71.82" Border.Lines="Top" ManualBuildEvent="Tabel_Data_ManualBuild">
<TableColumn Name="Column21" Width="85.32"/>
<TableColumn Name="Column22" Width="227.12"/>
<TableColumn Name="Column24" Width="142.01"/>
<TableColumn Name="Column25" Width="113.66"/>
<TableColumn Name="Column26" Width="194.93"/>
<TableColumn Name="Column27" Width="128.78"/>
<TableColumn Name="Column28" Width="138.23"/>
<TableRow Name="Row30" Height="22.68">
<TableCell Name="Cell229" Border.Lines="All" Text="序号" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell230" Border.Lines="All" Text="管线号" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell232" Border.Lines="All" Text="流水段" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell348" Text="材质" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell234" Border.Lines="All" Text="焊口规格" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell235" Border.Lines="All" Text="材料匹配率" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell236" Border.Lines="All" Text="焊接工程量" HorzAlign="Center" VertAlign="Center"/>
</TableRow>
<TableRow Name="Row21" Height="49.14">
<TableCell Name="Cell137" Border.Lines="All" Text="x" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell138" Border.Lines="All" Text=" [Data.PipelineCode]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell140" Border.Lines="All" Text=" [Data.FlowingSection]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell141" Border.Lines="All" Text="[Data.MaterialCode]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell142" Border.Lines="All" Text="[Data.MaterialSpec]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell143" Border.Lines="All" Text="[Data.MatchRate]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell144" Border.Lines="All" Text=" " HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
</TableRow>
</TableObject>
<DataFooterBand Name="DataFooter1" Top="246.22" Width="1047.06" Height="175.72">
<TableObject Name="Table6" Left="9.45" Width="1030.03" Height="175.72" Border.Lines="Top">
<TableColumn Name="Column65" Width="83.78"/>
<TableColumn Name="Column66" Width="178.33"/>
<TableColumn Name="Column67" Width="178.27"/>
<TableColumn Name="Column85" Width="187.1"/>
<TableColumn Name="Column87" Width="130.4"/>
<TableColumn Name="Column88" Width="272.15"/>
<TableRow Name="Row33" Height="74.62">
<TableCell Name="Cell271" Border.Lines="All" Text="备注" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell272" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt" ColSpan="5"/>
<TableCell Name="Cell273" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell331" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell335" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell336" Border.Lines="All" HorzAlign="Center" VertAlign="Center"/>
</TableRow>
<TableRow Name="Row34" Height="101.1">
<TableCell Name="Cell281" Text="分包制单:" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell282" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell283" Text="分包审核:" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt"/>
<TableCell Name="Cell332" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell337" Text="总包(专工)审核:" HorzAlign="Center" VertAlign="Center"/>
<TableCell Name="Cell338" HorzAlign="Center" VertAlign="Center"/>
</TableRow>
</TableObject>
</DataFooterBand>
</DataBand>
</ReportPage>
</Report>

View File

@ -86,6 +86,7 @@
</f:Button> </f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="预制组件打印" ToolTip="预制组件打印" OnClick="btnPrint_Click"></f:Button> <f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="预制组件打印" ToolTip="预制组件打印" OnClick="btnPrint_Click"></f:Button>
<f:Button ID="btnPrintTask" runat="server" Icon="Printer" EnableAjax="false" Text="焊接任务单打印" ToolTip="焊接任务单打印" OnClick="btnPrintTask_Click"></f:Button>
<f:DatePicker ID="txtTaskDate" Label="计划焊接日期" runat="server" <f:DatePicker ID="txtTaskDate" Label="计划焊接日期" runat="server"
DateFormatString="yyyy-MM-dd" LabelAlign="Left" LabelWidth="110px" Hidden="true"> DateFormatString="yyyy-MM-dd" LabelAlign="Left" LabelWidth="110px" Hidden="true">
</f:DatePicker> </f:DatePicker>

View File

@ -1,4 +1,5 @@
using BLL; using BLL;
using FineUIPro.Web.HJGL.HotProcessHard;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -1332,5 +1333,84 @@ namespace FineUIPro.Web.HJGL.WeldingManage
ShowNotify("请选择焊口", MessageBoxIcon.Question); ShowNotify("请选择焊口", MessageBoxIcon.Question);
} }
} }
protected void btnPrintTask_Click(object sender, EventArgs e)
{
DateTime? taskTime = Funs.GetNewDateTime(tvControlItem.SelectedNodeID.Split('|')[2]);
if (taskTime != null)
{
var weldTaskList = BLL.WeldTaskService.GetWeldingTaskList(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID.Split('|')[0], tvControlItem.SelectedNodeID.Split('|')[1], Convert.ToDateTime(taskTime), this.rbIsAudit.SelectedValue);
var pipelines = weldTaskList.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;
//}
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("Code", UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]).UnitWorkCode+ string.Format("{0:yyyyMMdd}", taskTime.Value));
keyValuePairs.Add("TaskDate", string.Format("{0:yyyy-MM-dd}", taskTime.Value));
keyValuePairs.Add("UnitName", UnitService.GetUnitNameByUnitId(tvControlItem.SelectedNodeID.Split('|')[1]));
keyValuePairs.Add("UnitWorkName]", UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]).UnitWorkName);
// 创建一个新的DataTable
DataTable dataTable = new DataTable();
dataTable.TableName = "Data";
// 添加列
dataTable.Columns.Add("PipelineCode", typeof(string));
dataTable.Columns.Add("FlowingSection", typeof(string));
dataTable.Columns.Add("MaterialCode", typeof(string));
dataTable.Columns.Add("MaterialSpec", typeof(string));
dataTable.Columns.Add("MatchRate", typeof(string));
foreach (string pipeline in pipelines)
{
DataRow dr = dataTable.NewRow();
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipeline);
List<string > list=new List<string> { pipeline };
dr["PipelineCode"] = pipelineModel.PipelineCode;
dr["FlowingSection"] = pipelineModel.FlowingSection;
dr["MaterialCode"] = Base_MaterialService.GetMaterialByMaterialId(pipelineModel.MaterialId).MaterialCode ;
dr["MaterialSpec"] = string.Join(",", weldTaskList.Select(x => x.Specification).Distinct().ToList()) ;
dr["MatchRate"] = Math.Round((decimal)TwArrivalStatisticsService.GetPipeMatch(pipeline) * 100, 2).ToString() + "%" ;
dataTable.Rows.Add(dr);
}
BLL.FastReportService.AddFastreportTable(dataTable);
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
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)));
}
}
else
{
ShowNotify("无关联管线", MessageBoxIcon.Question);
}
}
else
{
ShowNotify("请选择任务单", MessageBoxIcon.Question);
}
}
} }
} }

View File

@ -221,6 +221,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnPrint; protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnPrintTask 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrintTask;
/// <summary> /// <summary>
/// txtTaskDate 控件。 /// txtTaskDate 控件。
/// </summary> /// </summary>