材料管理修改
This commit is contained in:
Binary file not shown.
@@ -16,6 +16,7 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
///所需材料数量列表
|
||||
var NeedOutMateriaList = 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
|
||||
@@ -27,7 +28,7 @@ namespace BLL
|
||||
g.Key,
|
||||
NeedNum = g.Sum(x => x.Number) ?? 0,
|
||||
};
|
||||
|
||||
///实际材料入库数量列表
|
||||
var RealInMateriaList = from x in db.Tw_InputDetail
|
||||
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
|
||||
group x by x.MaterialCode
|
||||
@@ -44,9 +45,12 @@ namespace BLL
|
||||
from y in gg.DefaultIfEmpty()
|
||||
join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz
|
||||
from z in zz.DefaultIfEmpty()
|
||||
join m in db.Tw_MaterialStock on x.Key equals m.PipeLineMatCode into mm
|
||||
from m in mm.DefaultIfEmpty()
|
||||
select new Tw_ArrivalStatisticsOutPut
|
||||
{
|
||||
MaterialCode = x.Key,
|
||||
StockNum = m==null?0: (decimal)m.StockNum,
|
||||
NeedNum = x.NeedNum,
|
||||
RealNum = y==null?0:y.RealNum,
|
||||
MaterialName = z.MaterialName,
|
||||
@@ -75,12 +79,15 @@ namespace BLL
|
||||
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.ProjectId == projectid && pipelineIds.Contains(z.PipelineId)
|
||||
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,
|
||||
|
||||
@@ -80,7 +80,14 @@ namespace BLL
|
||||
return Funs.DB.Tw_InOutPlanDetail_Relation.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static Model.Tw_InOutPlanDetail_Relation GetByPipelineId(string pipelineId,string WarehouseCode)
|
||||
{
|
||||
var q= from x in Funs.DB.Tw_InOutPlanDetail_Relation
|
||||
join y in Funs.DB .Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id
|
||||
where x.PipelineId == pipelineId && y.WarehouseCode == WarehouseCode
|
||||
select x;
|
||||
return q.FirstOrDefault();
|
||||
}
|
||||
public static void Add(Model.Tw_InOutPlanDetail_Relation newtable)
|
||||
{
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace BLL
|
||||
ReqUnitId = plan.ReqUnitId,
|
||||
AuditMan = plan.CreateMan,
|
||||
AuditDate = plan.AuditDate,
|
||||
Remark=plan.Remark
|
||||
Remark= remark
|
||||
};
|
||||
if ((TwConst.TypeInt)plan.TypeInt!= TwConst.TypeInt.采购入库)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BLL
|
||||
/// 已装箱
|
||||
/// </summary>
|
||||
public static int state_2 = 2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取状态名称
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="txtMaterialCode" Label="材料编码" EmptyText="输入查询条件" Width="230px" LabelWidth="70px"></f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtMaterialCode" Label="材料编码" EmptyText="输入查询条件" Width="230px" LabelWidth="100px"></f:TextBox>
|
||||
<f:Label runat="server" ID="lbRate"></f:Label>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
@@ -77,6 +77,9 @@
|
||||
<f:RenderField Width="150px" ColumnID="RealNum" DataField="RealNum" SortField="RealNum"
|
||||
FieldType="String" HeaderText="到货量" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="StockNum" DataField="StockNum" SortField="StockNum"
|
||||
FieldType="String" HeaderText="库存量" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
|
||||
FieldType="String" HeaderText="匹配率" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim());
|
||||
|
||||
lbRate.Text="匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%";
|
||||
lbRate.Text="总体匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%";
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<f:DropDownList ID="drpWarehouse" runat="server" Label="仓库"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="170px">
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" ID="txtMatCode" Label="材料编码" LabelWidth="70px" LabelAlign="Right" Width="170px"></f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtMatCode" Label="材料编码" LabelWidth="100px" LabelAlign="Right" Width="200px"></f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" ToolTip="查询" Icon="SystemSearch" runat="server" Text="查询" OnClick="btnSearch_Click">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="09/27/2024 19:25:05" ReportInfo.CreatorVersion="2017.1.16.0">
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="10/09/2024 16:33:27" ReportInfo.CreatorVersion="2017.1.16.0">
|
||||
<ScriptText>using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -99,7 +99,7 @@ namespace FastReport
|
||||
}
|
||||
</ScriptText>
|
||||
<Dictionary>
|
||||
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFs2jrQYFVq2iWHsAGhD/TS"/>
|
||||
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRGKbA2Bx03EOue9PYrCFwa+"/>
|
||||
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
|
||||
<Column Name="pipelineCode" DataType="System.String" PropName="PipelineComponentId"/>
|
||||
<Column Name="Mat" DataType="System.String" PropName="PipelineComponentCode"/>
|
||||
@@ -137,26 +137,26 @@ namespace FastReport
|
||||
<Parameter Name="ConUnit" DataType="System.String"/>
|
||||
<Parameter Name="CheckUnit" DataType="System.String"/>
|
||||
</Dictionary>
|
||||
<ReportPage Name="Page1" RawPaperSize="9" TopMargin="0" BottomMargin="0" MirrorMargins="true">
|
||||
<PageHeaderBand Name="PageHeader1" Width="718.2"/>
|
||||
<DataBand Name="Data1" Top="4" Width="718.2" Height="280.48" Guides="198.45" DataSource="Table1" Columns.Count="1">
|
||||
<TableObject Name="Table2" Left="18.9" Width="500.86" Height="233.1" Border.Lines="All">
|
||||
<TableColumn Name="Column3" Width="231.52"/>
|
||||
<TableColumn Name="Column1" Width="269.34"/>
|
||||
<TableRow Name="Row1" Height="37.17">
|
||||
<ReportPage Name="Page1" RawPaperSize="9" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0" MirrorMargins="true" Columns.Count="2" Columns.Width="105" Columns.Positions="0,105">
|
||||
<PageHeaderBand Name="PageHeader1" Width="793.8"/>
|
||||
<DataBand Name="Data1" Top="4" Width="396.9" Height="224.53" Guides="198.45" DataSource="Table1" Columns.Count="1">
|
||||
<TableObject Name="Table2" Left="18.9" Top="18.9" Width="359.1" Height="186.72" Border.Lines="All">
|
||||
<TableColumn Name="Column3" Width="160.64"/>
|
||||
<TableColumn Name="Column1" Width="198.46"/>
|
||||
<TableRow Name="Row1" Height="21.71">
|
||||
<TableCell Name="Cell23" Text="管线号:[Table1.pipelineCode]" VertAlign="Center" Font="宋体, 11pt" ColSpan="2"/>
|
||||
<TableCell Name="Cell1" VertAlign="Center" Font="宋体, 11pt"/>
|
||||
</TableRow>
|
||||
<TableRow Name="Row2" Height="37.17">
|
||||
<TableRow Name="Row2" Height="21.71">
|
||||
<TableCell Name="Cell24" Text="规格:[Table1.Spec]" VertAlign="Center" Font="宋体, 11pt"/>
|
||||
<TableCell Name="Cell6" Text="材质:[Table1.Mat]" VertAlign="Center" Font="宋体, 11pt"/>
|
||||
</TableRow>
|
||||
<TableRow Name="Row5" Height="158.76">
|
||||
<TableRow Name="Row5" Height="143.3">
|
||||
<TableCell Name="Cell35">
|
||||
<BarcodeObject Name="Barcode1" Left="22.68" Width="151.2" Height="151.2" AutoSize="false" Text="https://sggl.sedin.com.cn/StaticPage/HJGL/index.html?id=[Table1.WeldJointId]&weldjoint=1" ShowText="false" AllowExpressions="true" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
|
||||
<BarcodeObject Name="Barcode1" Left="3.78" Width="141.75" Height="141.75" AutoSize="false" Text="https://sggl.sedin.com.cn/StaticPage/HJGL/index.html?id=[Table1.WeldJointId]&weldjoint=1" ShowText="false" AllowExpressions="true" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
|
||||
</TableCell>
|
||||
<TableCell Name="Cell36" VertAlign="Center" Font="宋体, 11pt">
|
||||
<TextObject Name="Text1" Top="18.9" Width="217.35" Height="103.95" Text="[Table1.SortIndex]#" Font="黑体, 72pt, style=Bold"/>
|
||||
<TextObject Name="Text1" Left="9.45" Top="18.9" Width="217.35" Height="103.95" Text="[Table1.SortIndex]#" Font="黑体, 72pt, style=Bold"/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableObject>
|
||||
|
||||
@@ -21,6 +21,18 @@
|
||||
.tn-color-green .f-tree-folder {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.f-grid-row.yellow {
|
||||
background-color: darkgoldenrod;
|
||||
}
|
||||
|
||||
.f-grid-row.red {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.f-grid-row.green {
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
@@ -47,10 +59,10 @@
|
||||
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
|
||||
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnStatisticsMat" ToolTip="匹配材料" Icon="TabGo" runat="server" OnClick="btnStatisticsMat_Click">
|
||||
<f:Button ID="btnStatisticsMat" ToolTip="匹配材料" Icon="TabGo" runat="server" OnClick="btnStatisticsMat_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnrefresh" ToolTip="同步NET" Icon="ArrowRefresh"
|
||||
EnablePostBack="true" OnClick="btnrefresh_Click" runat="server">
|
||||
EnablePostBack="true" OnClick="btnrefresh_Click" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
@@ -65,7 +77,7 @@
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panel3" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
|
||||
Width="200px" Title="匹配中管线" ShowBorder="true" ShowHeader="true"
|
||||
Width="230px" Title="匹配中管线" ShowBorder="true" ShowHeader="true"
|
||||
BodyPadding="10px">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar4" Position="Bottom" runat="server" ToolbarAlign="Left">
|
||||
@@ -73,9 +85,8 @@
|
||||
<f:Button ID="btnAddPipelineMatchMat" Icon="Add" runat="server" OnClick="btnAddPipelineMatchMat_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDeletePipelineMatchMat" Icon="Delete" runat="server" OnClick="btnDeletePipelineMatchMat_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnGenTask" ToolTip="生成任务单" Icon="ApplicationViewIcons" runat="server" OnClick="btnGenTask_Click" ConfirmText="确定生成任务单吗?">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
@@ -83,7 +94,7 @@
|
||||
<f:Grid ID="Grid3" ShowBorder="false" ShowHeader="false" runat="server" EnableCollapse="false"
|
||||
DataKeyNames="Key" DataIDField="Key" ShowGridHeader="false" EnableRowLines="false" EnableAlternateRowColor="false">
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="Value" DataField="Value" SortField="Value"
|
||||
<f:RenderField Width="200px" ColumnID="Value" DataField="Value" SortField="Value"
|
||||
FieldType="String" HeaderText="管线" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
@@ -96,7 +107,7 @@
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Top" ShowBorder="true" RegionPercent="30%" IsFluid="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="三维模型"
|
||||
TitleToolTip="三维模型显示" AutoScroll="true" IFrameUrl="../../CLGL/MaterialStock.aspx" EnableIFrame="true">
|
||||
TitleToolTip="三维模型显示" AutoScroll="true" IFrameUrl="../../CLGL/ArrivalStatistics.aspx" EnableIFrame="true">
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true" RegionPercent="40%"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="三维模型"
|
||||
@@ -104,16 +115,22 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:Label ID="lbRate" runat="server" LabelWidth="100px"></f:Label>
|
||||
<f:Label ID="lbRate" runat="server" LabelWidth="100px" Hidden="true"></f:Label>
|
||||
<f:Button ID="btnGenTask" ToolTip="生成任务单" Icon="ApplicationViewIcons" runat="server" OnClick="btnGenTask_Click" ConfirmText="确定生成任务单吗?">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="材料匹配" EnableRowClickEvent="true"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineId" ForceFit="true"
|
||||
EnableColumnLines="true" DataIDField="PipelineId" AllowSorting="true" OnRowClick="Grid2_RowClick"
|
||||
SortField="PipelineId" SortDirection="ASC">
|
||||
SortField="PipelineId" SortDirection="ASC" EnableCheckBoxSelect="true" >
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="UnitWorkName" DataField="UnitWorkName" SortField="UnitWorkName"
|
||||
FieldType="String" HeaderText="主项" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
|
||||
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
@@ -131,7 +148,7 @@
|
||||
Title="底部面板" ShowBorder="false" Height="320px" ShowHeader="false" BodyPadding="1px" Layout="Fit">
|
||||
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" EnableRowClickEvent="true"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id" ForceFit="true"
|
||||
EnableColumnLines="true" DataIDField="Id" AllowSorting="true" OnRowDataBound="Grid1_RowDataBound"
|
||||
SortField="Id" SortDirection="ASC" OnSort="Grid1_Sort">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -14,6 +15,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
//public Dictionary<string, string> dicSeclectPipeLine = new Dictionary<string, string>();
|
||||
public static List<Model.Tw_PipeMatMatchOutput> tw_PipeMatMatchOutputs ;
|
||||
public static decimal Rate = 0;
|
||||
public static string WarehouseCode = "工厂预制";
|
||||
public string PipeArea
|
||||
{
|
||||
get
|
||||
@@ -54,6 +56,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
tw_PipeMatMatchOutputs=new List<Model.Tw_PipeMatMatchOutput>();
|
||||
PipeArea = Request.Params["PipeArea"];
|
||||
if (PipeArea == "2")
|
||||
{
|
||||
WarehouseCode = "现场安装";
|
||||
}
|
||||
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
|
||||
dicSeclectPipeLine=new Dictionary<string, string>();
|
||||
@@ -168,18 +174,30 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
private void BindNodes(TreeNode node)
|
||||
{
|
||||
var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID);
|
||||
if (!node.Text.Contains("|"))
|
||||
{
|
||||
node.Text += "|" + NowComPipelineCode.Count();
|
||||
//var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID);
|
||||
//if (!node.Text.Contains("|"))
|
||||
//{
|
||||
// node.Text += "|" + NowComPipelineCode.Count();
|
||||
|
||||
//}
|
||||
var CompleteInOutPlanDetail_RelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation
|
||||
join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id
|
||||
where y.State==(int)TwConst.State.已完成 && y.WarehouseCode == WarehouseCode
|
||||
select x;
|
||||
|
||||
}
|
||||
var pipeline = (from x in Funs.DB.HJGL_Pipeline
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
|
||||
join y in CompleteInOutPlanDetail_RelationList on x.PipelineId equals y.PipelineId into temp
|
||||
from y in temp.DefaultIfEmpty()
|
||||
where y == null && x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
orderby x.PipelineCode
|
||||
select x).ToList();
|
||||
pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList();
|
||||
//pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList();
|
||||
if (!node.Text.Contains("|"))
|
||||
{
|
||||
node.Text += "|" + pipeline.Count();
|
||||
|
||||
}
|
||||
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
|
||||
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
|
||||
if (pageindex <= pageCount)
|
||||
@@ -274,11 +292,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
void BindGrid2()
|
||||
{
|
||||
var result = tw_PipeMatMatchOutputs
|
||||
.GroupBy(item => new { item.PipelineId, item.PipelineCode }) // 按 PipelineId 和 PipelineCode 分组
|
||||
.GroupBy(item => new { item.PipelineId, item.PipelineCode,item.UnitWorkName }) // 按 PipelineId 和 PipelineCode 分组
|
||||
.Select(group => new
|
||||
{
|
||||
PipelineId = group.Key.PipelineId, // 当前组的 PipelineId
|
||||
PipelineCode = group.Key.PipelineCode, // 当前组的 PipelineCode
|
||||
UnitWorkName = group.Key.UnitWorkName, // 当前组的 UnitWorkName
|
||||
AverageMatchRate = group.Average(item => item.MatchRate) // 计算平均 MatchRate
|
||||
})
|
||||
.ToList(); // 转换为 List
|
||||
@@ -287,14 +306,34 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
List<Tw_PipeMatMatchOutput> output = result.Select(r => new Tw_PipeMatMatchOutput
|
||||
{
|
||||
PipelineId = r.PipelineId,
|
||||
PipelineCode = r.PipelineCode,
|
||||
PipelineCode = r.PipelineCode,
|
||||
UnitWorkName = r.UnitWorkName,
|
||||
MatchRate = r.AverageMatchRate,
|
||||
MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%"
|
||||
}).ToList();
|
||||
Grid2.DataSource = output;
|
||||
Grid2.DataBind();
|
||||
Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2);
|
||||
lbRate.Text = "匹配率:" + Rate.ToString() + "%";
|
||||
if (output.Any())
|
||||
{
|
||||
Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2);
|
||||
lbRate.Text = "匹配率:" + Rate.ToString() + "%";
|
||||
}
|
||||
for (int i = 0; i < Grid2.Rows.Count; i++)
|
||||
{
|
||||
var model = Grid2.Rows[i].DataItem as Tw_PipeMatMatchOutput;
|
||||
|
||||
|
||||
|
||||
if (model.MatchRate >=1)
|
||||
{
|
||||
Grid2.Rows[i].RowCssClass = "green";
|
||||
}
|
||||
else
|
||||
{
|
||||
Grid2.Rows[i].RowCssClass = "red";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void BindGrid3()
|
||||
@@ -302,6 +341,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
Grid3.DataSource = dicSeclectPipeLine;
|
||||
Grid3.DataBind();
|
||||
for (int i = 0; i < Grid3.Rows.Count; i++)
|
||||
{
|
||||
var model = Grid3.Rows[i].DataItem ;
|
||||
var model2= JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(model));
|
||||
string pipeid= model2.First().Value;
|
||||
|
||||
var relationModle=TwInoutplandetailRelationService.GetByPipelineId(pipeid,WarehouseCode);
|
||||
if (relationModle!= null)
|
||||
{
|
||||
Grid3.Rows[i].RowCssClass = "yellow";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -371,10 +423,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
#endregion
|
||||
|
||||
#region 按钮事件
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void btnrefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -459,7 +507,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
if (dicSeclectPipeLine.Where(x => x.Key == this.tvControlItem.SelectedNodeID).Count() == 0)
|
||||
{
|
||||
dicSeclectPipeLine.Add(this.tvControlItem.SelectedNodeID, this.tvControlItem.SelectedNode.Text);
|
||||
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制");
|
||||
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode);
|
||||
|
||||
BindGrid3();
|
||||
BindGrid2();
|
||||
@@ -472,31 +520,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
if (Grid3.SelectedRowID != "")
|
||||
{
|
||||
dicSeclectPipeLine.Remove(Grid3.SelectedRowID);
|
||||
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制");
|
||||
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), WarehouseCode);
|
||||
|
||||
BindGrid3();
|
||||
BindGrid2();
|
||||
}
|
||||
}
|
||||
protected void btnGenTask_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Rate<(decimal)85)
|
||||
{ if (Grid2.SelectedRowIDArray.Count() > 0)
|
||||
{
|
||||
ShowNotify(" 匹配率小于85%,请重新匹配!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
SaveTask();
|
||||
Response.Redirect(Request.Url.ToString());
|
||||
ShowNotify("生成任务单成功!", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
SaveTask();
|
||||
Response.Redirect(Request.Url.ToString());
|
||||
else
|
||||
{
|
||||
ShowNotify("请先选择需要发起任单的管线!", MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
}
|
||||
private void SaveTask()
|
||||
{
|
||||
var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x;
|
||||
var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x;
|
||||
var toDoMatterList = (from x in Funs.DB.View_HJGL_NoWeldJointFind
|
||||
where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
|
||||
where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
|
||||
select x).ToList();
|
||||
var selectRowId = (from x in Funs.DB.View_HJGL_NoWeldJointFind
|
||||
where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
|
||||
where Grid2.SelectedRowIDArray.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
|
||||
select x).ToList();
|
||||
foreach (var weldjoint in selectRowId)
|
||||
{
|
||||
|
||||
@@ -158,15 +158,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDeletePipelineMatchMat;
|
||||
|
||||
/// <summary>
|
||||
/// btnGenTask 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnGenTask;
|
||||
|
||||
/// <summary>
|
||||
/// Grid3 控件。
|
||||
/// </summary>
|
||||
@@ -221,6 +212,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbRate;
|
||||
|
||||
/// <summary>
|
||||
/// btnGenTask 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnGenTask;
|
||||
|
||||
/// <summary>
|
||||
/// Grid2 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Model
|
||||
public string MaterialSpec { get; set; }
|
||||
public string MaterialUnit { get; set; }
|
||||
public string MaterialDef { get; set; }
|
||||
public decimal StockNum { get; set; }
|
||||
public decimal NeedNum { get; set; }
|
||||
public decimal RealNum { get; set; }
|
||||
public decimal MatchRate { get; set; }
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Model
|
||||
public string Id { get; set; }
|
||||
public string PipelineId { get; set; }
|
||||
public string PipelineCode { get; set; }
|
||||
public string UnitWorkId { get; set; }
|
||||
public string UnitWorkName { get; set; }
|
||||
public string PrefabricatedComponents { get; set; }
|
||||
public string MaterialCode { get; set; }
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user