From b6f8ef01f1dfbd27c62829729aab3fd250ed4a7c Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Fri, 25 Nov 2022 14:08:03 +0800 Subject: [PATCH] =?UTF-8?q?2022-11-25=20=E7=84=8A=E6=8E=A5=E6=9D=90?= =?UTF-8?q?=E6=96=99=E5=8C=B9=E9=85=8D=E4=BB=BB=E5=8A=A1=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=A0=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin/v17/.wsuo | Bin 24064 -> 22528 bytes DataBase/版本日志/SGGLDB_V2022-11-24.sql | 1 + SGGL/BLL/Common/Funs.cs | 6 ++ .../HJGL/PreDesign/HJGL_MaterialService.cs | 42 ++++++++++-- .../WeldingManage/PipelineComponentService.cs | 4 +- .../PreDesign/PrePipelineQRCodeIn.aspx.cs | 23 ++++--- .../WeldingManage/SelectTaskWeldJoint.aspx | 2 +- .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 62 ++++++++++++++---- .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 4 ++ 9 files changed, 113 insertions(+), 31 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2022-11-24.sql diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index 4775c270179d889c3865ebb41e1e26a62e933298..77417425bd166cb07f0776a6b321055863aaa15a 100644 GIT binary patch delta 1555 zcmcIkUrd`-6#s7jz(@HCV{2{8fI-)lj$QlEGIp z9;UsE&_K8`I>t1^g7xDQj$PMNdt^$~BXSoth&T3>c5xOp)RA1Spc4Rl@oWd6->3qiB|PMT9TY1;1sy$z7ok1}`pK_PYWl?a>Nrn9j$@>cFp-SL#w_ zi#}R^kg*7IN}e4-QAx?7vm#y5N%kai)~o-+vlwl>hwls_b{M%xN*0todb1P7$fhEi zRAzT)sJ5C4kI(ah*1W~KP;?F}qU+9zn8>;cW|{|S4EOit*^s_!dy8q!19G{KxZUBy zit~+K_}iaV#N?JIdWWWN1Yf@;GDYFgU;yHi8|oMENXa8?Ge$WVhiicj1r3 zKAG)gFOlnH)NG<;TKNur6nDm};<@}^)g-ep*3yNqX?5ZpT1`7L^XJ4P6J^SMP z;>^-n_wnp;WJ2x%!qC=N9Itvx({K{L-TPxO-%I z>DAY=FEA=AUNtC0f(hRb_G;rBYcCOn<6N7#gQMvr?o516cpApEA8${_^<281QAhdT D_y|}B delta 1278 zcmcIj%}*0i5ce%D-7dSbwa7;WDO#%qmTcQCT@+&z8-kZ&DHN~$T0L+v*&2x^tufI9 z9%SckVy|A1jW=UR;NnRWFJ4HDe}M<~04CtP&8`rP$i>Od&c~aX_j@z%HCIXVJy~63 zgz(2_ulx4DlE5h>SYjR#4lJg?obuvM%Bf`i`RATgms#QKbB#1ezFj>>-ryQK|nD+EL`=um^G7#?FO7k>SF((je)APE1&;v8D!Ng%Z&^#XYvY|vF z+C57==2G`_VuZ3hZL~W{dOgWF)I$w20v7%isGn=Jr!i#B3%kKv0-;xx-fm~_EAX)Q zF^PfIHN&@~yZ2xTFZ$W0m(Fz#c7i|u8D#Fne2k0e@bUhN$lM*w5tcrfgH8;+Fd{nf zoAtG0JC_}&Dc0;klm3;#G*lpMxmtlMCGi;`1{vyWF z$x|{!-5HF^{xOqJ{E@aqy!1iv=FWtVX+@dVB-6Uew6auz++@bg46l>5DL)fQYL$sZ zrB;?SwJJ-BmR2P-rQxrZNTh4&N>we(rZoM9tY!V4lSkvx?DA?tuBMb^Nh)gzO;Xgd zDwR?-O)AG#wI)}S<7%yBm&XLi%&tRmp$9(9###jenYk_KEM9|G^Y`IF@doO5VPJmB Sd{^usP|1csScpO(miYyn0ocX> diff --git a/DataBase/版本日志/SGGLDB_V2022-11-24.sql b/DataBase/版本日志/SGGLDB_V2022-11-24.sql new file mode 100644 index 00000000..fa97c725 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2022-11-24.sql @@ -0,0 +1 @@ +alter table [dbo].[HJGL_MaterialManage] alter column [SpecificationAndModel] nvarchar(1000) \ No newline at end of file diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index 1316fc53..8e8742d7 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1022,11 +1022,17 @@ namespace BLL T entity = new T(); foreach (PropertyInfo p in pArray) { + if (string.IsNullOrEmpty(row[p.Name].ToString())) + { + p.SetValue(entity, "", null); + continue; + } if (row[p.Name] is Int64) { p.SetValue(entity, Convert.ToInt32(row[p.Name]), null); continue; } + p.SetValue(entity, row[p.Name], null); } list.Add(entity); diff --git a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs index 4cb51e43..3a270e0b 100644 --- a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs +++ b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs @@ -9,6 +9,22 @@ namespace BLL { public class HJGL_MaterialService { + /// + /// 工程预制库存 + /// + public static List materialStockItems_SHOP + { + get; + set; + } + /// + /// 现场安装库存 + /// + public static List materialStockItems_FIELD + { + get; + set; + } /// /// 获取材料信息 /// @@ -96,7 +112,6 @@ namespace BLL mat.MaterialCode, lib.MaterialName, lib.MaterialSpec, - lib.MaterialMade, lib.MaterialUnit, sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum from HJGL_MaterialManage mat @@ -125,7 +140,6 @@ namespace BLL mat.MaterialCode, lib.MaterialName, lib.MaterialSpec, - lib.MaterialMade, lib.MaterialUnit, sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum from Material_Material mat @@ -240,12 +254,30 @@ namespace BLL if (q != null && q.Count() > 0) //判断管线是否有关联材料 { var pipemodel = BLL.PipelineService.GetPipelineByPipelineId(pipelineid); - List list = GetMaterialStockItems(projectid, pipemodel.PipeArea); - if (list != null && list.Count > 0) //判断是否有库存信息 + List materialStockItems = new List(); + if (pipemodel.PipeArea==PipelineService.PipeArea_SHOP) + { + if (HJGL_MaterialService.materialStockItems_SHOP.Count == 0) + { + HJGL_MaterialService.materialStockItems_SHOP = GetMaterialStockItems(projectid, pipemodel.PipeArea); + } + materialStockItems = materialStockItems_SHOP; + } + else if (pipemodel.PipeArea == PipelineService.PipeArea_FIELD) + { + if(HJGL_MaterialService.materialStockItems_FIELD.Count == 0) + { + HJGL_MaterialService.materialStockItems_FIELD = GetMaterialStockItems(projectid, pipemodel.PipeArea); + } + materialStockItems = materialStockItems_FIELD; + } + + //List materialStockItems = GetMaterialStockItems(projectid, pipemodel.PipeArea); + if (materialStockItems != null && materialStockItems.Count > 0) //判断是否有库存信息 { foreach (var item in q) { - var StockMater = list.Where(x => x.MaterialCode == item.MaterialCode).FirstOrDefault(); + var StockMater = materialStockItems.Where(x => x.MaterialCode == item.MaterialCode).FirstOrDefault(); if (StockMater != null) //判断该材料是否存在库存 { var StockNum = StockMater.MaterialNum; diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs index bfd3ef12..6aeb6db9 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs @@ -93,7 +93,7 @@ namespace BLL { model.PipelineId = PipelineId; model.PipelineComponentCode = model_mat.PrefabricatedComponents; - model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')); + model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", ""); model.State = state_0; UpdatePipelineComponent(model); } @@ -103,7 +103,7 @@ namespace BLL model.PipelineComponentId = SQLHelper.GetNewID(); model.PipelineId = PipelineId; model.PipelineComponentCode = model_mat.PrefabricatedComponents; - model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')); + model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", ""); model.State = state_0; AddPipelineComponent(model); } diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs index ab7bea8c..2335491b 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs @@ -150,7 +150,8 @@ namespace FineUIPro.Web.HJGL.PreDesign { Model.ResponeData responeData = new Model.ResponeData(); - string result = string.Empty; + //string result = string.Empty; + List result = new List () ; int ic, ir; ic = pds.Columns.Count; ir = pds.Rows.Count; @@ -175,39 +176,41 @@ namespace FineUIPro.Web.HJGL.PreDesign if (string.IsNullOrEmpty(pipelinecode)) { - result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"; + //result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"; + result.Add("第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!"); } else { pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pipelinecode); if (pipeline == null) { - result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|"; - + //result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|"; + result.Add("不存在此管线号-"+ pipelinecode); continue; } } if (string.IsNullOrEmpty(PipelineComponentCode)) { - result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|"; + //result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|"; + result.Add("第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!"); } else { hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(PipelineComponentCode, pipeline.PipelineId); if (hJGL_Pipeline_Component == null) { - result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |"; - + //result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |"; + result.Add("不存在此预制组件-" + PipelineComponentCode); continue; } } } - if (!string.IsNullOrEmpty(result)) + if (result.Count>0) { PipelineList.Clear(); - result = result.Substring(0, result.LastIndexOf("|")); - errorInfos = result; + // result = result.Substring(0, result.LastIndexOf("|")); + errorInfos = string .Join("|", result.Distinct()) ; //Alert alert = new Alert(); //alert.Message = result; //alert.Target = Target.Self; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx index e7acb6de..84795544 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx @@ -36,7 +36,7 @@ diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index 1a992a7e..c2c287c7 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -94,6 +94,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage { if (!IsPostBack) { + HJGL_MaterialService.materialStockItems_FIELD = new List(); + HJGL_MaterialService.materialStockItems_SHOP = new List(); + this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true); @@ -161,19 +164,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage rootNode1.Text = "工厂预制"; rootNode1.CommandName = "工厂预制"; rootNode1.EnableClickEvent = true; - rootNode1.Selectable = true; + rootNode1.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(rootNode1); + int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP select x).Count(); + if (a > 0) + { + // BindNodes(tn1); + TreeNode newNode = new TreeNode(); + newNode.Text = "加载管线..."; + newNode.NodeID = "加载管线..."; + rootNode1.Nodes.Add(newNode); + } + TreeNode rootNode2 = new TreeNode(); rootNode2.NodeID = BLL.PipelineService.PipeArea_FIELD; rootNode2.Text = "现场安装"; rootNode2.CommandName = "现场安装"; rootNode2.EnableClickEvent = true; - rootNode2.Expanded = true; + rootNode2.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(rootNode2); - AddTreeNode(BLL.PipelineService.PipeArea_SHOP, rootNode1); - AddTreeNode(BLL.PipelineService.PipeArea_FIELD, rootNode2); - + int b = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD select x).Count(); + if (b > 0) + { + // BindNodes(tn1); + TreeNode newNode = new TreeNode(); + newNode.Text = "加载管线..."; + newNode.NodeID = "加载管线..."; + rootNode2.Nodes.Add(newNode); + } //TreeNode rootNode = new TreeNode(); //rootNode.Text = "管线号"; //rootNode.NodeID = "0"; @@ -185,12 +204,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage } void AddTreeNode(string PipeArea , TreeNode node ) { - var iso = (from x in Funs.DB.HJGL_Pipeline where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList(); + var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList(); if (!string.IsNullOrEmpty(this.txtPipelineCode.Text)) { iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList(); } - var joints = from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x; + var joints = from x in WeldJointService.hJGL_WeldJoints select x; foreach (var item in iso) { TreeNode newNode = new TreeNode(); @@ -208,14 +227,31 @@ namespace FineUIPro.Web.HJGL.WeldingManage node.Nodes.Add(newNode); } } + protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) + { + if (e.Node.Nodes[0].NodeID == "加载管线...") + { + e.Node.Nodes.Clear(); + if (e.Node.CommandName == "工厂预制") + { + AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node); - #endregion + } + else if (e.Node.CommandName == "现场安装") + { + AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node); - #region 数据绑定 - /// - /// 数据绑定 - /// - private void BindGrid() + } + } + + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() { string pipelineId = this.tvControlItem.SelectedNodeID; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index 8e666f44..f0b7359d 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -37,6 +37,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (!IsPostBack) { PipeArea = Request.Params["PipeArea"]; + HJGL_MaterialService.materialStockItems_FIELD = new List(); + HJGL_MaterialService.materialStockItems_SHOP = new List(); + this.InitTreeMenu();//加载树 } } @@ -159,6 +162,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { pipeline= pipeline.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim())).ToList(); } + foreach (var item in pipeline) { //var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();