diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs index 67bd6034..52585cf1 100644 --- a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -12,7 +12,7 @@ namespace BLL { public class TwArrivalStatisticsService { - public static List GetStatistics(string projectid,string materialCode) + public static List GetStatistics(string projectid,string materialCode,string WarehouseCode) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { @@ -39,14 +39,16 @@ namespace BLL g.Key, RealNum = g.Sum(x => x.ActNum) ?? 0, }; - + var tw_MaterialStock=from x in db.Tw_MaterialStock + where x.WarehouseCode==WarehouseCode + select x; var StatisticsList =(from x in NeedOutMateriaList join y in RealInMateriaList on x.Key equals y.Key into gg 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() + join m in tw_MaterialStock on x.Key equals m.PipeLineMatCode into mm + from m in mm.DefaultIfEmpty() select new Tw_ArrivalStatisticsOutPut { MaterialCode = x.Key, @@ -80,7 +82,7 @@ namespace BLL 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) + where z.ProjectId == projectid && pipelineIds.Contains(z.PipelineId) && x.PrefabricatedComponents!= "" //x.PrefabricatedComponents!="" 用于筛选非散件材料 select new Tw_PipeMatMatchOutput { Id= Guid.NewGuid().ToString(), diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs index 4703223d..993dbf03 100644 --- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -520,7 +520,7 @@ namespace BLL { //生成规则是20240919-unitcode-AP-GR01 - string cusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + unitcode + "-AP-GR"; + string cusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + "-"+unitcode + "-AP-GR"; var queryAll = new Tw_InOutMasterOutput() { ProjectId = projectid, diff --git a/SGGL/BLL/CLGL/TwMaterialstockService.cs b/SGGL/BLL/CLGL/TwMaterialstockService.cs index 5e0322d3..465a89be 100644 --- a/SGGL/BLL/CLGL/TwMaterialstockService.cs +++ b/SGGL/BLL/CLGL/TwMaterialstockService.cs @@ -32,6 +32,7 @@ namespace BLL (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && (string.IsNullOrEmpty(table.PipeLineMatCode) || x.PipeLineMatCode.Contains(table.PipeLineMatCode)) && + (string.IsNullOrEmpty(table.MaterialUnit) || mat.MaterialUnit.Contains(table.MaterialUnit)) && (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) select new Model.Tw_MaterialStockOutput { diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx index 8f9f240a..8e3d08b4 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx @@ -37,6 +37,9 @@ + + @@ -68,19 +71,19 @@ - - - - - diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs index 54b4b056..6ddedc2e 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -16,6 +16,10 @@ namespace FineUIPro.Web.CLGL { if (!IsPostBack) { + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); // 绑定表格 this.BindGrid(); @@ -28,7 +32,7 @@ namespace FineUIPro.Web.CLGL /// private void BindGrid() { - var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim()); + var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim(), drpWarehouse.SelectedValue); lbRate.Text="总体匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%"; //tb = GetFilteredTable(Grid1.FilteredData, tb); diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs index 6c5fd013..6aab4b8a 100644 --- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs @@ -59,6 +59,15 @@ namespace FineUIPro.Web.CLGL /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + /// /// txtMaterialCode 控件。 /// diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx index 5d28b348..d4f9a48f 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -192,8 +192,8 @@ + ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" ExpandAllRowGroups="false" + SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000" RowGroupRendererFunction="onGrid3RowGroupRenderer"> + @@ -275,6 +279,30 @@ function reloadGrid() { __doPostBack(null, 'reloadGrid'); } + function onGrid3RowGroupRenderer(groupValue, rowData) { + var Total = 0, + Len = rowData.children.length; + for (var i = 0; i < Len; i++) { + var childData = rowData.children[i]; + var genderValue = childData.values['MatchRate']; + + console.log(genderValue); + + // 确保值存在再进行累加 + if (genderValue !== undefined) { + genderValue = parseFloat(genderValue); // 确保是数字 + genderValue = genderValue > 0 ? genderValue : 0; + Total += genderValue; + } + } + + // 检查 Len 是否大于零,以防止除以零 + var TotalRate = Len > 0 ? ((Total * 100) / Len).toFixed(2) + "%" : "0%"; + + return F.formatString('{0},匹配率:{1}', groupValue, TotalRate); + } + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs index cf2cfa05..e0f89528 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs @@ -112,19 +112,18 @@ namespace FineUIPro.Web.CLGL var tb = BLL.TwArrivalStatisticsService.GetMatMatchByOutPlanMasterId(inOutPlanMasterId); Grid3.DataSource = tb; Grid3.DataBind(); + //if (tb!= null && tb.Count > 0) + //{ + // string Rate = Math.Round((decimal)tb.Average(item => item.MatchRate) * 100, 2).ToString() + "%"; - if (tb!= null && tb.Count > 0) - { - string Rate = Math.Round((decimal)tb.Average(item => item.MatchRate) * 100, 2).ToString() + "%"; + // JObject summary = new JObject(); + // //summary.Add("Major", "全部合计"); + // summary.Add("MatchRateString", Rate); - JObject summary = new JObject(); - //summary.Add("Major", "全部合计"); - summary.Add("MatchRateString", Rate); + // Grid3.SummaryData = summary; + //} - Grid3.SummaryData = summary; - } - } #endregion @@ -480,16 +479,17 @@ namespace FineUIPro.Web.CLGL } string planId = Grid1.SelectedRowID; var planMaster = BLL.TwInOutplanmasterService.GetById(planId); - if (planMaster.State != (int)TwConst.State.待提交 || planMaster.TypeInt != (int)TwConst.TypeInt.散件出库) - { - Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); - return; - } - else + if (planMaster.State == (int)TwConst.State.待提交 &&( planMaster.TypeInt == (int)TwConst.TypeInt.散件出库 || planMaster.TypeInt == (int)TwConst.TypeInt.其他出库)) { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?UnitWorkId={0}&Id={1} ", tvControlItem.SelectedNodeID, planId, "新增 - "))); } + else + { + + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } } protected void btnPassMaster_OnClick(object sender, EventArgs e) diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx index 851b470d..9f5bcfc6 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx @@ -6,12 +6,10 @@ - + +
@@ -66,9 +64,9 @@ + runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ForceFit="true" + DataIDField="Id" OnRowCommand="Grid1_RowCommand" AllowPaging="true" IsDatabasePaging="true" + EnableTextSelection="True" PageSize="100"> @@ -104,8 +102,8 @@ + DataIDField="Id" EnableColumnLines="true" OnRowCommand="Grid2_RowCommand" + EnableTextSelection="True" PageSize="100"> diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs index 5801fae6..af3476b4 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs @@ -85,7 +85,7 @@ namespace FineUIPro.Web.CLGL txtCreateMan.Text = this.CurrUser.PersonName; txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); drpReqUnit.SelectedValue = this.CurrUser.UnitId; - txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, this.CurrUser.UnitId); + txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, UnitService.GetUnitByUnitId(this.CurrUser.UnitId)?.UnitCode); } drpTypeInt_SelectedIndexChanged(null, null); diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx index fb1034b8..68676741 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx @@ -38,7 +38,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index b84d5f5e..31374bbf 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -77,7 +77,7 @@ @@ -116,8 +116,11 @@ + + + @@ -153,15 +156,15 @@ EnableColumnLines="true" DataIDField="Id" AllowSorting="true" OnRowDataBound="Grid1_RowDataBound" SortField="Id" SortDirection="ASC" OnSort="Grid1_Sort"> - - - @@ -169,23 +172,23 @@ FieldType="String" HeaderText="材料名称" HeaderTextAlign="Center" TextAlign="Left"> - - - - - diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index 1b51bc4d..5f4bba52 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -318,6 +318,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2); lbRate.Text = "匹配率:" + Rate.ToString() + "%"; } + var selectList = new List() ; for (int i = 0; i < Grid2.Rows.Count; i++) { var model = Grid2.Rows[i].DataItem as Tw_PipeMatMatchOutput; @@ -327,6 +328,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (model.MatchRate >=1) { Grid2.Rows[i].RowCssClass = "green"; + selectList.Add(model.PipelineId); + } else { @@ -334,6 +337,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } + if (cbSelectCom.Checked) + { + Grid2.SelectedRowIDArray= selectList.ToArray(); + } } void BindGrid3() diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs index 1fd97a43..da778253 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs @@ -212,6 +212,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.Label lbRate; + /// + /// lbNote 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbNote; + /// /// btnGenTask 控件。 /// @@ -221,6 +230,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.Button btnGenTask; + /// + /// cbSelectCom 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox cbSelectCom; + /// /// Grid2 控件。 ///