2023-11-08
This commit is contained in:
@@ -131,6 +131,7 @@
|
||||
<asp:Label ID="lbProductionState" runat="server" Text='<%# ConvertProductionState(Eval("ProductionState"))%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderCheckField Width="100px" ColumnID="IsPrint" DataField="IsPrint" HeaderText="是否已打印" EnableColumnEdit="False" />
|
||||
<f:RenderField Width="200px" ColumnID="FlowingSection" DataField="FlowingSection" SortField="FlowingSection"
|
||||
FieldType="String" HeaderText="流水段"
|
||||
HeaderTextAlign="Center"
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @" SELECT distinct com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,
|
||||
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,
|
||||
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,com.IsPrint,
|
||||
com.QRCode,com.State,com.ProductionState,pipe.PlanStartDate,pipe.FlowingSection,com.DrawingName,com.ReceiveDate,
|
||||
person.PersonName
|
||||
FROM HJGL_Pipeline_Component com
|
||||
@@ -355,58 +355,24 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
Print(tvControlItem.SelectedNodeID, Grid1.SelectedRowIDArray);
|
||||
Print(Grid1.SelectedRowIDArray);
|
||||
HJGL_PipelineComponentService.UpdateIsPrint(Grid1.SelectedRowIDArray); //打印后修改打印状态
|
||||
}
|
||||
private void Print(string PipelineId ,string[] PipelineComponentId)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
private void Print(string[] PipelineComponentId)
|
||||
{
|
||||
BLL.FastReportService.ResetData();
|
||||
|
||||
var query =
|
||||
from com in db.HJGL_Pipeline_Component
|
||||
join mat in db.HJGL_PipeLineMat on com.PipeLineMatId equals mat.PipeLineMatId into matJoin
|
||||
from mat in matJoin.DefaultIfEmpty()
|
||||
join pipe in db.HJGL_Pipeline on com.PipelineId equals pipe.PipelineId into pipeJoin
|
||||
from pipe in pipeJoin.DefaultIfEmpty()
|
||||
join punit in db.Base_Unit on com.PreUnit equals punit.UnitId into punitJoin
|
||||
from punit in punitJoin.DefaultIfEmpty()
|
||||
join aunit in db.Base_Unit on com.AssembleUnit equals aunit.UnitId into aunitJoin
|
||||
from aunit in aunitJoin.DefaultIfEmpty()
|
||||
join unitwork in db.WBS_UnitWork on pipe.UnitWorkId equals unitwork.UnitWorkId into unitworkJoin
|
||||
from unitwork in unitworkJoin.DefaultIfEmpty()
|
||||
join mater in db.Base_Material on pipe.MaterialId equals mater.MaterialId into materJoin
|
||||
from mater in materJoin.DefaultIfEmpty()
|
||||
where com.QRCode != "" & com.PipelineId == PipelineId
|
||||
orderby com.PipelineComponentCode
|
||||
select new
|
||||
{
|
||||
com.PipelineComponentId,
|
||||
com.PipelineComponentCode,
|
||||
com.BoxNumber,
|
||||
UnitWorkName = unitwork.UnitWorkName,
|
||||
com.PipelineId,
|
||||
PreUnit = punit.UnitName,
|
||||
AssembleUnit = aunit.UnitName,
|
||||
mat.PrefabricatedComponents,
|
||||
com.QRCode,
|
||||
com.State,
|
||||
PlanStartDate = string.Format("yyyy-MM-dd", pipe.PlanStartDate),
|
||||
pipe.PipelineCode,
|
||||
pipe.FlowingSection,
|
||||
QRCode2 = "PrePipeline$" + com.PipelineComponentId,
|
||||
mater.MaterialCode
|
||||
};
|
||||
|
||||
var result = query.ToList();
|
||||
if (PipelineComponentId.Length>0)
|
||||
{
|
||||
result = result.Where(x => PipelineComponentId.Contains(x.PipelineComponentId)).ToList();
|
||||
}
|
||||
var result = HJGL_PipelineComponentService.GetPrintModelByPipelineComponentIds(PipelineComponentId, null, false);
|
||||
var tb = LINQToDataTable(result);
|
||||
if (tb != null)
|
||||
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("~/");
|
||||
@@ -416,40 +382,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
||||
|
||||
}
|
||||
/*string strSql = @" SELECT com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,unitwork.UnitWorkName,
|
||||
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,mat.PrefabricatedComponents,
|
||||
com.QRCode,com.State,CONVERT(varchar(100), pipe.PlanStartDate, 23) as PlanStartDate,pipe.PipelineCode,pipe.FlowingSection,
|
||||
('PrePipeline$'+com.PipelineComponentId )as QRCode2,mater.*
|
||||
FROM HJGL_Pipeline_Component com
|
||||
LEFT JOIN HJGL_PipeLineMat mat ON mat.PipeLineMatId=com.PipeLineMatId
|
||||
LEFT JOIN HJGL_Pipeline pipe ON pipe.PipelineId =com.PipelineId
|
||||
LEFT JOIN dbo.Base_Unit punit ON punit.UnitId=com.PreUnit
|
||||
LEFT JOIN dbo.Base_Unit aunit ON aunit.UnitId=com.AssembleUnit
|
||||
LEFT JOIN dbo.WBS_UnitWork unitwork on pipe.UnitWorkId=unitwork.UnitWorkId
|
||||
LEFT JOIN dbo.Base_Material AS mater ON mater.MaterialId=pipe.MaterialId
|
||||
WHERE com.QRCode!=''";
|
||||
List<SqlParameter> listStr = new List<SqlParameter> { };
|
||||
|
||||
strSql += " AND com.PipelineId =@PipelineId";
|
||||
listStr.Add(new SqlParameter("@PipelineId", PipelineId));
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
if (tb != null)
|
||||
{
|
||||
tb.TableName = "Table1";
|
||||
}
|
||||
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)));
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -73,8 +73,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
pipeline.AssembleUnit = this.drpAssembleUnit.SelectedValue;
|
||||
}
|
||||
pipeline.BoxNumber = this.txtBoxNumber.Text.Trim();
|
||||
pipeline.PipelineId = hdPipelineId.Text;
|
||||
|
||||
pipeline.PipelineId = hdPipelineId.Text;
|
||||
BLL.HJGL_PipelineComponentService.AddPipelineComponent(pipeline);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user