材料管理修改
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user