diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index cfab5f93..8e04b264 100644 Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ diff --git a/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs b/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs index e7d358b4..69ae292d 100644 --- a/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs +++ b/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs @@ -57,13 +57,33 @@ namespace BLL person.Message += item.UserCode + "--工号信息不能为空|"; continue; } + if (item.IdentityCard == null || item.IdentityCard == "") + { - var getPerson = Person_PersonsService.GetPerson_PersonsByJobNum(item.UserCode); + PersonDataItem personDataItem = new PersonDataItem + { + UserCode = item.UserCode, + UserName = item.UserName, + IdentityCard = item.IdentityCard, + Image = item.Image + }; + person.data.Add(personDataItem); + person.Message += item.UserCode + "--身份信息不能为空|"; + continue; + } + Person_Persons getPerson = new Person_Persons(); + getPerson = Person_PersonsService.GetPerson_PersonsByIdCard(item.IdentityCard); + if (getPerson==null) + { + getPerson = Person_PersonsService.GetPerson_PersonsByJobNum(item.UserCode); + + } if (getPerson != null) { getPerson.JobNum = item.UserCode; getPerson.PersonName = item.UserName; getPerson.DataFrom = "API"; + getPerson.IdentityCard = item.IdentityCard; if (item.Image != "") { // Image bb = Image.FromFile("C:\\Users\\1420031550\\Desktop\\签名.jpg"); diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index 9074166b..beecb30d 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -24,6 +24,8 @@ namespace BLL /// 现场安装 /// public const string PipeArea_FIELD = "2"; + + public const int pageSize = 20; public static List hJGL_Pipelines { @@ -615,5 +617,42 @@ namespace BLL Funs.FineUIPleaseSelect(dropName); } } + + public static void BindTreeNodes(FineUIPro.TreeNode node,string pipecode,string ProjectId,int pageSize) + { + var pipeline = (from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID + && x.PipelineCode.Contains(pipecode) + orderby x.PipelineCode + select x).ToList(); + var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList(); + int pageindex = int.Parse(node.CommandName.Split('|')[0]); + int pageCount = int.Parse(node.CommandName.Split('|')[1]); + if (pageindex <= pageCount) + { + pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); + foreach (var item in pipeline) + { + var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count(); + FineUIPro.TreeNode newNode = new FineUIPro.TreeNode(); + newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; + newNode.NodeID = item.PipelineId; + newNode.CommandName = "管线"; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + } + if (pageindex < pageCount) + { + FineUIPro.TreeNode newNode = new FineUIPro.TreeNode(); + newNode.Text = "加载"; + newNode.NodeID = SQLHelper.GetNewID(); + newNode.CommandName = "加载"; + newNode.Icon = FineUIPro.Icon.ArrowDown; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + } + } + } + } } diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs index 62805c45..10038a26 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldJointService.cs @@ -433,7 +433,7 @@ namespace BLL && (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId)) && (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode)) && (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode)) - orderby x.WeldJointCode select x).ToList(); + orderby x.WeldJointCode select x).AsParallel().ToList(); return q; } /// diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs index ea888618..0aff0f0e 100644 --- a/SGGL/BLL/SysManage/UnitService.cs +++ b/SGGL/BLL/SysManage/UnitService.cs @@ -268,7 +268,17 @@ namespace BLL return q; } } - + public static List GetAllUnit() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = (from x in db.Base_Unit + + orderby x.UnitCode + select x).Distinct().ToList(); + return q; + } + } /// /// 根据项目Id获取单位名称下拉选择项 /// @@ -558,7 +568,17 @@ namespace BLL Funs.FineUIPleaseSelect(dropName); } } - + public static void GetALLUnit(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "UnitId"; + dropName.DataTextField = "UnitName"; + dropName.DataSource = GetAllUnit(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } /// /// 单位表下拉框 /// diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/CheckerManage.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/CheckerManage.aspx.cs index 42d06f2e..29fd23e5 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/CheckerManage.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/CheckerManage.aspx.cs @@ -117,11 +117,11 @@ namespace FineUIPro.Web.CQMS.PersonManage tn.NodeID = sitem.PersonId; if (sitem.States != Const.State_1) { - tn.Text = "" + sitem.PersonName + ""; + tn.Text = "" + sitem.PersonName + "【" + sitem.WelderCode + "】" + ""; } else { - tn.Text = sitem.PersonName; + tn.Text = sitem.PersonName + "【" + sitem.WelderCode + "】"; } tn.EnableClickEvent = true; rootNode.Nodes.Add(tn); diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx index 56516c16..4e5ea0af 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx @@ -29,7 +29,7 @@ diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs index 70eb16ac..6d57a41c 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx.cs @@ -198,11 +198,11 @@ namespace FineUIPro.Web.CQMS.PersonManage tn.NodeID = sitem.PersonId; if (sitem.States != Const.State_1) { - tn.Text = "" + sitem.PersonName + ""; + tn.Text = "" + sitem.PersonName + "【" + sitem.WelderCode + "】" + ""; } else { - tn.Text = sitem.PersonName; + tn.Text = sitem.PersonName+"【" + sitem.WelderCode + "】"; } tn.EnableClickEvent = true; rootNode.Nodes.Add(tn); diff --git a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx index f62a5cc5..eee6758f 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -99,7 +99,7 @@ namespace FastReport } - + @@ -170,7 +170,7 @@ namespace FastReport - + diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx index f1a988dc..2e0c91bb 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx @@ -56,15 +56,13 @@ EmptyText="输入查询条件" Width="240px" LabelWidth="100px" LabelAlign="Right"> - - --%> + --%> <%-- --%> @@ -73,6 +71,9 @@ runat="server" OnClick="btnSelectColumn_Click" Hidden="true"> --%> + diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index cbe9122f..665e7939 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -13,6 +13,8 @@ namespace FineUIPro.Web.HJGL.DataImport { public partial class MaterialInformation : PageBase { + public int pageSize = PipelineService.pageSize; + protected void Page_Load(object sender, EventArgs e) { @@ -95,7 +97,7 @@ namespace FineUIPro.Web.HJGL.DataImport tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + u.UnitName; - tn1.CommandName = "单位工程"; + tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn1.EnableExpandEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) @@ -117,12 +119,12 @@ namespace FineUIPro.Web.HJGL.DataImport TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; - if (q.UnitWorkId == this.hdUnitWorkId.Text) - { - tn2.Expanded = true; - } + //if (q.UnitWorkId == this.hdUnitWorkId.Text) + //{ + // tn2.Expanded = true; + //} tn2.ToolTip = "施工单位:" + u.UnitName; - tn2.CommandName = "单位工程"; + tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn2.EnableExpandEvent = true; tn2.EnableClickEvent = true; @@ -143,31 +145,7 @@ namespace FineUIPro.Web.HJGL.DataImport #region 暂不有 private void BindNodes(TreeNode node) { - //List pipeline = new List(); - //var pipelines = from x in Funs.DB.HJGL_Pipeline select x; - //pipeline = (from x in pipelines - // where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - // && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - // orderby x.PipelineCode - // select x).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(); - // var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); - // TreeNode newNode = new TreeNode(); - // if (jotCount > weldJotCount) - // { - // newNode.Text = "" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + ""; - // } - // else - // { - // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - // } - // newNode.ToolTip = "管线号【焊口数】"; - // newNode.NodeID = item.PipelineId; - // newNode.EnableClickEvent = true; - // node.Nodes.Add(newNode); - //} + BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize); } #endregion @@ -176,35 +154,9 @@ namespace FineUIPro.Web.HJGL.DataImport if (e.Node.Nodes[0].NodeID == "加载管线...") { e.Node.Nodes.Clear(); - if (e.Node.CommandName == "单位工程") - { - var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID - && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) - orderby x.PipelineCode - select x).ToList(); - var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x ).ToList(); - foreach (var item in pipeline) - { - var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); - //var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); - TreeNode newNode = new TreeNode(); - //if (jotCount > weldJotCount) - //{ - // newNode.Text = "" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + ""; - //} - //else - //{ - // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - //} - newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - newNode.NodeID = item.PipelineId; - newNode.EnableClickEvent = true; - e.Node.Nodes.Add(newNode); - } - } - + BindNodes(e.Node); } + } @@ -217,23 +169,25 @@ namespace FineUIPro.Web.HJGL.DataImport /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (e.CommandName == "加载") { - if (tvControlItem.SelectedNode.CommandName== "单位工程") - { - this.hdUnitWorkId.Text=tvControlItem.SelectedNode.NodeID.ToString(); - //this.BindGrid1("", this.hdUnitWorkId.Text); - //this.BindGrid2("", this.hdUnitWorkId.Text); - - } - else + string CommandName = e.Node.ParentNode.CommandName; + e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]); + TreeNode treeNode = e.Node.ParentNode; + treeNode.Nodes.Remove(e.Node); + BindNodes(e.Node.ParentNode); + } + else + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { + Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); this.hdUnitWorkId.Text = string.Empty; if (pipeline != null) { this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; - + this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); if (pipeline.PipeArea == PipelineService.PipeArea_SHOP) @@ -241,14 +195,16 @@ namespace FineUIPro.Web.HJGL.DataImport TabStrip1.ActiveTabIndex = 0; } - else + else { TabStrip1.ActiveTabIndex = 1; } - } + } + + } - + } } @@ -267,12 +223,18 @@ namespace FineUIPro.Web.HJGL.DataImport LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' "; List listStr = new List(); + if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim())) + { + strSql += " and lib.MaterialCode like @MaterialCode "; + listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%")); + } if (!string.IsNullOrEmpty(pipelineId)) { - strSql += " and pipe.PipelineId=@PipelineId order by PrefabricatedComponents"; + strSql += " and pipe.PipelineId=@PipelineId order by PrefabricatedComponents "; listStr.Add(new SqlParameter("@PipelineId", pipelineId)); } + listStr.Add(new SqlParameter("@UnitWorkId", unitworkid)); SqlParameter[] parameter = listStr.ToArray(); DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -296,6 +258,11 @@ namespace FineUIPro.Web.HJGL.DataImport listStr.Add(new SqlParameter("@PipelineId", pipelineId)); } + if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim())) + { + strSql += " and lib.MaterialCode like @MaterialCode "; + listStr.Add(new SqlParameter("@MaterialCode", "%"+txtMaterialCode.Text.Trim() + "%")); + } listStr.Add(new SqlParameter("@UnitWorkId", unitworkid)); SqlParameter[] parameter = listStr.ToArray(); DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -574,13 +541,6 @@ namespace FineUIPro.Web.HJGL.DataImport //this.BindGrid3(this.tvControlItem.SelectedNodeID); } - - - protected void txtMaterialCode_TextChanged(object sender, EventArgs e) - { - this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); - } - #endregion #region 选项卡改变事件 @@ -769,6 +729,17 @@ namespace FineUIPro.Web.HJGL.DataImport } #endregion + /// + /// 查询 + /// + /// + /// + protected void btnQuery_Click(object sender, EventArgs e) + { + this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); + this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text); + } + #region 导入 /// /// 导入按钮 diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.designer.cs index c9e129f5..58c5a512 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.designer.cs @@ -149,6 +149,15 @@ namespace FineUIPro.Web.HJGL.DataImport /// protected global::FineUIPro.Button btnNew; + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + /// /// btnPrint 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx index 0a39b2ea..9a669f87 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx @@ -9,7 +9,7 @@
- + - + + @@ -64,11 +66,10 @@ EnableCollapse="true" runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="WeldJointId" ClicksToEdit="2" DataIDField="WeldJointId" AllowSorting="true" EnableCheckBoxSelect="true" SortField="WeldJointCode" OnSort="Grid1_Sort" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true" - AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" - EnableTextSelection="True"> + OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True" AllowPaging="true" IsDatabasePaging="true" PageSize="15" > - + @@ -79,7 +80,11 @@ runat="server" OnClick="BtnAnalyse_Click"> + Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="true" EnablePostBack="true"> + + + @@ -231,5 +236,29 @@ Width="800px" Height="600px"> + + diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs index a0ea877f..c6ab6e2b 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs @@ -1,10 +1,14 @@ using BLL; using FineUIPro.Web.HJGL.WeldingManage; +using MiniExcelLibs; using Model; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.Drawing; +using System.IO; using System.Linq; using System.Text; using AspNet = System.Web.UI.WebControls; @@ -225,41 +229,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery else { this.BindGrid(); - Model.Parameter3D parameter3D = new Model.Parameter3D(); - Model.ColorModel colorModel = new Model.ColorModel(); - colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId); - parameter3D.ColorModel = colorModel; - parameter3D.TagNum = ""; - parameter3D.ButtonType = "2.1"; - parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID); - if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) - { - parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID); - parameter3D.Crater_data = "0"; - parameter3D.Completed_weldedjunction = Completed_weldedjunction; - parameter3D.Incomplete_weldjunction = Incomplete_weldjunction; - - } - else if (this.tvControlItem.SelectedNode.CommandName == "管线") - { - var model = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID); - if (model != null && !string.IsNullOrEmpty(model.UnitWorkId)) - { - parameter3D.Crater_data = "1"; - parameter3D.TagNum = "/" + model.PipelineCode; - parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(model.UnitWorkId); - - } - - } - parameter3D.Transparency = colorModel.PipelineComplete; - parameter3D.Finished_color = colorModel.JointCompleteColor; - parameter3D.Incomplete_color = colorModel.JointNOCompleteColor; - - ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName; - ctlAuditFlow.data = parameter3D; - ctlAuditFlow.BindData(); } @@ -313,32 +283,6 @@ namespace FineUIPro.Web.HJGL.InfoQuery private void BindGrid() { - //string strSql = @"SELECT * FROM dbo.View_HJGL_JointInfoQuery - // WHERE ProjectId= @ProjectId"; - //List listStr = new List(); - //listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId)); - //if (this.tvControlItem.SelectedNode.CommandName == "单位工程") - //{ - // strSql += " AND UnitWorkId =@UnitWorkId"; - // listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID)); - - //} - //else if (this.tvControlItem.SelectedNode.CommandName == "管线") - //{ - // strSql += " AND PipelineId = @PipelineId"; - // listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID)); - //} - //if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim())) - //{ - // strSql += " AND WeldJointCode LIKE @WeldJointCode"; - // listStr.Add(new SqlParameter("@WeldJointCode", this.txtWeldJointCode.Text.Trim())); - //} - //SqlParameter[] parameter = listStr.ToArray(); - //DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - //var q = tb.AsEnumerable().Where(x => x["WeldingDate"].ToString() != ""); - //var q2 = tb.AsEnumerable().Where(x => x["JointAttribute"].ToString() == "预制口"); - //var sumcount = tb.Rows.Count; - //this.Grid1.RecordCount = tb.Rows.Count; Model.View_HJGL_WeldJoint model =new Model.View_HJGL_WeldJoint(); model.ProjectId = this.CurrUser.LoginProjectId; if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2 ) @@ -352,24 +296,12 @@ namespace FineUIPro.Web.HJGL.InfoQuery } model.WeldJointCode = this.txtWeldJointCode.Text; var list= BLL.WeldJointService.GetViewWeldJointsBymodel(model); - if (!string.IsNullOrEmpty(ctlAuditFlow.Url)) - { - get3DParmeter_weldjoint(list);//获取三维所需焊口参数 - var q = list.Where(x => !string.IsNullOrEmpty(x.WeldingDate)); - var q2 = list.Where(x => x.JointAttribute == "预制口"); - var sumcount = list.Count; - this.Grid1.RecordCount = list.Count; - - this.JointComplete = q.Count(); - this.JointNoComplete = sumcount - JointComplete; - this.JointPre = q2.Count(); - this.JointNoPre = sumcount - JointPre; - } - - var table = this.GetPagedDataTable(Grid1, list); - Grid1.DataSource = table; Grid1.RecordCount = list.Count; + // var table = this.GetPagedDataTable(Grid1, list); + var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex - 1)).Take(Grid1.PageSize).ToList(); + Grid1.DataSource = table; Grid1.DataBind(); + } private void get3DParmeter_weldjoint(List model) @@ -451,6 +383,71 @@ namespace FineUIPro.Web.HJGL.InfoQuery this.InitTreeMenu(); //this.BindGrid3(this.tvControlItem.SelectedNodeID); } + protected void btnrefresh_Click(object sender, EventArgs e) + { + Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint(); + model.ProjectId = this.CurrUser.LoginProjectId; + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + { + model.UnitWorkId = this.tvControlItem.SelectedNodeID; + + } + else if (this.tvControlItem.SelectedNode.CommandName == "管线") + { + model.PipelineId = this.tvControlItem.SelectedNodeID; + } + model.WeldJointCode = this.txtWeldJointCode.Text; + var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); + if (!string.IsNullOrEmpty(ctlAuditFlow.Url)) + { + get3DParmeter_weldjoint(list);//获取三维所需焊口参数 + var q = list.Where(x => !string.IsNullOrEmpty(x.WeldingDate)); + var q2 = list.Where(x => x.JointAttribute == "预制口"); + var sumcount = list.Count; + this.Grid1.RecordCount = list.Count; + + this.JointComplete = q.Count(); + this.JointNoComplete = sumcount - JointComplete; + this.JointPre = q2.Count(); + this.JointNoPre = sumcount - JointPre; + } + Model.Parameter3D parameter3D = new Model.Parameter3D(); + Model.ColorModel colorModel = new Model.ColorModel(); + colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId); + parameter3D.ColorModel = colorModel; + parameter3D.TagNum = ""; + parameter3D.ButtonType = "2.1"; + parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID); + + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + { + parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID); + parameter3D.Crater_data = "0"; + parameter3D.Completed_weldedjunction = Completed_weldedjunction; + parameter3D.Incomplete_weldjunction = Incomplete_weldjunction; + + } + else if (this.tvControlItem.SelectedNode.CommandName == "管线") + { + var modelpipeline = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID); + if (modelpipeline != null && !string.IsNullOrEmpty(modelpipeline.UnitWorkId)) + { + parameter3D.Crater_data = "1"; + parameter3D.TagNum = "/" + modelpipeline.PipelineCode; + parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(modelpipeline.UnitWorkId); + + } + + } + parameter3D.Transparency = colorModel.PipelineComplete; + parameter3D.Finished_color = colorModel.JointCompleteColor; + parameter3D.Incomplete_color = colorModel.JointNOCompleteColor; + + ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName; + ctlAuditFlow.data = parameter3D; + ctlAuditFlow.BindData(); + + } /// /// 查询 /// @@ -476,19 +473,19 @@ namespace FineUIPro.Web.HJGL.InfoQuery /// protected void btnOut_Click(object sender, EventArgs e) { - Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint(); - model.ProjectId = this.CurrUser.LoginProjectId; - if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) - { - model.UnitWorkId = this.tvControlItem.SelectedNodeID; + //Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint(); + //model.ProjectId = this.CurrUser.LoginProjectId; + //if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + //{ + // model.UnitWorkId = this.tvControlItem.SelectedNodeID; - } - else if (this.tvControlItem.SelectedNode.CommandName == "管线") - { - model.PipelineId = this.tvControlItem.SelectedNodeID; - } - model.WeldJointCode = this.txtWeldJointCode.Text; - var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); + //} + //else if (this.tvControlItem.SelectedNode.CommandName == "管线") + //{ + // model.PipelineId = this.tvControlItem.SelectedNodeID; + //} + //model.WeldJointCode = this.txtWeldJointCode.Text; + //var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model); Response.ClearContent(); @@ -499,7 +496,55 @@ namespace FineUIPro.Web.HJGL.InfoQuery Response.Write(GetGridTableHtml(Grid1)); Response.End(); } + protected void btnOutNOComPipeline_Click(object sender, EventArgs e) + { + if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2) + { + var q = (from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.tvControlItem.SelectedNodeID + select new { + PipelineId=x.PipelineId, + WeldingDate=x.WeldingDate, + WeldJointCode=x.WeldJointCode, + PipelineCode=x.PipelineCode, + Size=x.Size, + }); + var noCompipeline = from x in q + group x by x.PipelineId into g + select new + { + PipelineId = g.Key, + Count = (from x2 in g where x2.WeldingDate!=null && x2.WeldingDate!="" select x2).Count(), + }; + var Noweldjoint =( from x in q + join y in noCompipeline on x.PipelineId equals y.PipelineId + where y.Count == 0 + select new { 焊口号=x.WeldJointCode , + 管线号=x.PipelineCode, + 达因=x.Size}).ToList(); + string path = Funs.RootPath + @"File\Excel\Temp\NoCompleteWeldjoint.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); + + MiniExcel.SaveAs(path, Noweldjoint); + + string fileName = "未完成管线焊口.xlsx"; + FileInfo info = new FileInfo(path); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(path); + } + else + { + Alert.Show("请选择主项"); + } + + } /// /// 导出方法 /// @@ -508,7 +553,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery private string GetGridTableHtml(Grid grid) { StringBuilder sb = new StringBuilder(); - grid.PageSize = 10000; + grid.PageSize = 100000; BindGrid(); sb.Append(""); sb.Append(""); @@ -583,5 +628,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery ctlAuditFlow.data = parameter3D; ctlAuditFlow.BindData(); } + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.designer.cs index 9bbfc01c..e2dfbd4d 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.designer.cs @@ -86,6 +86,15 @@ namespace FineUIPro.Web.HJGL.InfoQuery /// protected global::FineUIPro.Button btnTreeFind; + /// + /// btnrefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnrefresh; + /// /// tvControlItem 控件。 /// @@ -194,6 +203,15 @@ namespace FineUIPro.Web.HJGL.InfoQuery /// protected global::FineUIPro.Button btnOut; + /// + /// btnOutNoComPipeline 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOutNoComPipeline; + /// /// btnGetChart 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/PersonManage/CheckerManage.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PersonManage/CheckerManage.aspx.cs index b75da9c1..7fd84605 100644 --- a/SGGL/FineUIPro.Web/HJGL/PersonManage/CheckerManage.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PersonManage/CheckerManage.aspx.cs @@ -117,11 +117,11 @@ namespace FineUIPro.Web.HJGL.PersonManage tn.NodeID = sitem.PersonId; if (sitem.States != Const.State_1) { - tn.Text = "" + sitem.PersonName + ""; + tn.Text = "" + sitem.PersonName + "【" + sitem.WelderCode + "】" + ""; } else { - tn.Text = sitem.PersonName; + tn.Text = sitem.PersonName + "【" + sitem.WelderCode + "】"; } tn.EnableClickEvent = true; rootNode.Nodes.Add(tn); diff --git a/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx b/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx index f0f806c3..7a8875e1 100644 --- a/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx @@ -29,7 +29,7 @@ diff --git a/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx.cs index 0dd7a032..d986d6c5 100644 --- a/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PersonManage/WelderManage.aspx.cs @@ -198,11 +198,11 @@ namespace FineUIPro.Web.HJGL.PersonManage tn.NodeID = sitem.PersonId; if (sitem.States != Const.State_1) { - tn.Text = "" + sitem.PersonName + ""; + tn.Text = "" + sitem.PersonName + "【" + sitem.WelderCode + "】" + ""; } else { - tn.Text = sitem.PersonName; + tn.Text = sitem.PersonName+"【"+ sitem.WelderCode + "】"; } tn.EnableClickEvent = true; rootNode.Nodes.Add(tn); diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/MaterialManage.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/MaterialManage.aspx index 249abec3..8650ccd6 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/MaterialManage.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/MaterialManage.aspx @@ -29,8 +29,8 @@ - - + + 焊口信息 +
@@ -67,7 +73,9 @@ EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="txtMaterialCode_TextChanged" Width="240px" LabelWidth="80px" LabelAlign="Right">
- + + + <%-- WeldJointlist = new List(); - + /// + /// 预制口总达因 + /// + public static string ShopSumSize = "0"; + /// + /// 安装口总达因 + /// + public static string FieldSumSize = "0"; protected void Page_Load(object sender, EventArgs e) { @@ -107,8 +116,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + u.UnitName; - tn1.CommandName = "单位工程"; + tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn1.EnableExpandEvent = true; + tn1.EnableClickEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) { @@ -124,18 +134,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId + && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) + select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; - if (q.UnitWorkId == this.hdUnitWorkId.Text) - { - tn2.Expanded = true; - } + //if (q.UnitWorkId == this.hdUnitWorkId.Text) + //{ + // tn2.Expanded = true; + //} tn2.ToolTip = "施工单位:" + u.UnitName; - tn2.CommandName = "单位工程"; + tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn2.EnableExpandEvent = true; + tn2.EnableClickEvent= true; rootNode2.Nodes.Add(tn2); if (a > 0) { @@ -150,65 +163,46 @@ namespace FineUIPro.Web.HJGL.WeldingManage } #endregion - #region 暂不有 + #region private void BindNodes(TreeNode node) { - //List pipeline = new List(); - //var pipelines = from x in Funs.DB.HJGL_Pipeline select x; - //pipeline = (from x in pipelines - // where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID - // && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) - // orderby x.PipelineCode - // select x).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(); - // var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); - // TreeNode newNode = new TreeNode(); - // if (jotCount > weldJotCount) - // { - // newNode.Text = "" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + ""; - // } - // else - // { - // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - // } - // newNode.ToolTip = "管线号【焊口数】"; - // newNode.NodeID = item.PipelineId; - // newNode.EnableClickEvent = true; - // node.Nodes.Add(newNode); - //} + BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId,pageSize); } #endregion - + protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { - - e.Node.Nodes.Clear(); - - if (e.Node.CommandName == "单位工程") + if (e.Node.Nodes[0].NodeID == "加载管线...") { - var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) - orderby x.PipelineCode - select x).ToList(); - var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); - - // var WeldJointlist = (from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == e.Node.NodeID && x.IsTwoJoint == null select x).ToList(); - - foreach (var item in pipeline) - { - //var jotCount = WeldJointlist.Where(x => x.PipelineId == item.PipelineId).Count(); - var jotCount = hJGL_WeldJoints.Where(x => x.PipelineId == item.PipelineId).Count(); - TreeNode newNode = new TreeNode(); - newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - newNode.NodeID = item.PipelineId; - newNode.EnableClickEvent = true; - e.Node.Nodes.Add(newNode); - - } - + e.Node.Nodes.Clear(); + BindNodes(e.Node); } + + //e.Node.Nodes.Clear(); + + //if (e.Node.CommandName == "单位工程") + //{ + // var pipeline = (from x in Funs.DB.HJGL_Pipeline + // where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) + // orderby x.PipelineCode + // select x).ToList(); + // var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + + // // var WeldJointlist = (from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == e.Node.NodeID && x.IsTwoJoint == null select x).ToList(); + + // foreach (var item in pipeline) + // { + // //var jotCount = WeldJointlist.Where(x => x.PipelineId == item.PipelineId).Count(); + // var jotCount = hJGL_WeldJoints.Where(x => x.PipelineId == item.PipelineId).Count(); + // TreeNode newNode = new TreeNode(); + // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; + // newNode.NodeID = item.PipelineId; + // newNode.EnableClickEvent = true; + // e.Node.Nodes.Add(newNode); + + // } + + //} } @@ -220,23 +214,40 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (e.CommandName == "加载") { - Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); - this.hdUnitWorkId.Text = string.Empty; - if (pipeline != null) - { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; - this.BindGrid1(this.tvControlItem.SelectedNodeID); - this.BindGrid2(this.tvControlItem.SelectedNodeID); - this.BindGrid3(this.tvControlItem.SelectedNodeID); - } - else - { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; - } - + string CommandName = e.Node.ParentNode.CommandName; + e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]); + TreeNode treeNode = e.Node.ParentNode; + treeNode.Nodes.Remove(e.Node); + BindNodes(e.Node.ParentNode); } + else + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); + this.hdUnitWorkId.Text = string.Empty; + if (pipeline != null) + { + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid1(this.tvControlItem.SelectedNodeID); + this.BindGrid2(this.tvControlItem.SelectedNodeID); + this.BindGrid3(this.tvControlItem.SelectedNodeID); + this.lbSinglePreRate.Text = GetRateByPipelineid(this.tvControlItem.SelectedNodeID); + + } + else + { + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; + this.lbSinglePreRate.Text = GetRateByUnitWork(this.tvControlItem.SelectedNodeID); + + } + this.lbShopSize.Text = ShopSumSize; + this.lbFiledSize.Text = FieldSumSize; + } + } + } #endregion @@ -379,11 +390,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage //} #endregion #endregion + #region 预制率计算 private string GetRateByUnitWork(string unitworkid) { var db = Funs.DB; var q=from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x ; + string rate = ""; + ShopSumSize = "0"; + FieldSumSize = "0"; if (q!=null&&q.Count()>0) { var proSum = (from x in q @@ -393,32 +408,78 @@ namespace FineUIPro.Web.HJGL.WeldingManage { SizeSum = g.Sum(x => x.Size) }).FirstOrDefault().SizeSum; - + var FieldSum = (from x in q + where x.JointAttribute == "安装口" + group x by x.UnitWorkId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault().SizeSum; var AllSum = (from x in q group x by x.UnitWorkId into g select new { SizeSum = g.Sum(x => x.Size) }).FirstOrDefault().SizeSum; - var a = (decimal)100 * proSum / AllSum; - var rate = Math.Round((decimal)a, 1); - return rate.ToString()+"%"; + proSum = (proSum != null) ? proSum : 0; + FieldSum = (FieldSum != null) ? FieldSum : 0; + ShopSumSize = proSum.ToString() ; + FieldSumSize = FieldSum.ToString() ; + if (AllSum>0) + { + var a = (decimal)100 * proSum / AllSum; + rate = Math.Round((decimal)a, 1).ToString()+"%"; + } + + return rate; } - return ""; + return "0%"; } - void GetRateByPipelineid(string pipelineid) + private string GetRateByPipelineid(string pipelineid) { + string rate = ""; + ShopSumSize = "0"; + FieldSumSize = "0"; var db = Funs.DB; - var q = (from x in db.View_HJGL_WeldJoint - group x by x.PipelineId into g - where g.Key == pipelineid - select new - { - SizeSum = g.Sum(x => x.Size) - }).FirstOrDefault().SizeSum; - + var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x; + if (q != null && q.Count() > 0) + { + var proSum = (from x in q + where x.JointAttribute == "预制口" + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault().SizeSum; + var FieldSum = (from x in q + where x.JointAttribute == "安装口" + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault().SizeSum; + var AllSum = (from x in q + group x by x.PipelineId into g + select new + { + SizeSum = g.Sum(x => x.Size) + }).FirstOrDefault().SizeSum; + proSum = (proSum != null) ? proSum : 0; + FieldSum = (FieldSum != null) ? FieldSum : 0; + ShopSumSize = proSum.ToString(); + FieldSumSize = FieldSum.ToString(); + if (AllSum > 0) + { + var a = (decimal)100 * proSum / AllSum; + rate = Math.Round((decimal)a, 1).ToString() + "%"; + } + + return rate; + } + return "0%"; } #endregion + #region 焊口信息 维护事件 /// /// Grid双击事件 diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs index 31092418..3a761706 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.designer.cs @@ -149,6 +149,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected global::FineUIPro.Label lbSinglePreRate; + /// + /// lbShopSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbShopSize; + + /// + /// lbFiledSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbFiledSize; + /// /// ToolbarFill1 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx index 980f1888..2db11ad2 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx @@ -105,6 +105,10 @@ DataField="Dia" SortField="Dia" FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" Width="90px"> + + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs index e1e8731e..d3bde5c8 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs @@ -9,6 +9,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage { public partial class WeldingConDate : PageBase { + public int pageSize = PipelineService.pageSize; + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -77,8 +79,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; tn1.ToolTip = "施工单位:" + u.UnitName; - tn1.CommandName = "单位工程"; + tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn1.EnableExpandEvent = true; + tn1.EnableClickEvent = true; rootNode1.Nodes.Add(tn1); if (a > 0) { @@ -94,18 +97,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId + && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; - if (q.UnitWorkId == this.hdUnitWorkId.Text) - { - tn2.Expanded = true; - } + //if (q.UnitWorkId == this.hdUnitWorkId.Text) + //{ + // tn2.Expanded = true; + //} tn2.ToolTip = "施工单位:" + u.UnitName; - tn2.CommandName = "单位工程"; + tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); tn2.EnableExpandEvent = true; + tn2.EnableClickEvent = true; rootNode2.Nodes.Add(tn2); if (a > 0) { @@ -121,40 +126,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { - e.Node.Nodes.Clear(); - if (e.Node.CommandName == "单位工程") + if (e.Node.Nodes[0].NodeID == "加载管线...") { - var pipeline = (from x in Funs.DB.HJGL_Pipeline - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID - && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) - orderby x.PipelineCode - select x).ToList(); - var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); - - foreach (var item in pipeline) - { - var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); - //var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); - - //if (jotCount > weldJotCount) - //{ - // newNode.Text = "" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + ""; - //} - //else - //{ - // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - //} - - TreeNode newNode = new TreeNode(); - newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; - - newNode.NodeID = item.PipelineId; - newNode.EnableClickEvent = true; - e.Node.Nodes.Add(newNode); - } + e.Node.Nodes.Clear(); + BindNodes(e.Node); } + + } + private void BindNodes(TreeNode node) + { + BLL.PipelineService.BindTreeNodes(node, this.txtPipelineCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize); } - #endregion protected void btnTreeFind_Click(object sender, EventArgs e) @@ -170,16 +152,28 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (e.CommandName == "加载") { - Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); - this.hdUnitWorkId.Text = string.Empty; - if (pipeline != null) + string CommandName = e.Node.ParentNode.CommandName; + e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]); + TreeNode treeNode = e.Node.ParentNode; + treeNode.Nodes.Remove(e.Node); + BindNodes(e.Node.ParentNode); + } + else + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; - this.BindGrid(); + Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); + this.hdUnitWorkId.Text = string.Empty; + if (pipeline != null) + { + this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID; + this.BindGrid(); + } } } + } #endregion @@ -188,7 +182,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { string strSql = @"SELECT WeldJointId,WeldJointCode,PipelineId,PipelineCode,JointAttribute, IsWelding,IsHotProessStr,Material1Code,Material2Code,WeldTypeCode, - Specification,HeartNo1,HeartNo2,Size,Dia,Thickness,GrooveTypeCode, + Specification,HeartNo1,HeartNo2,Size,Dia,DNDia,Thickness,GrooveTypeCode, WeldingMethodCode,WeldingWireCode,WeldingRodCode,WeldingDate,WeldingDailyCode, BackingWelderCode,CoverWelderCode,MediumCode ,PreTemperature,JointArea,WPQCode,Remark FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL "; diff --git a/SGGL/WebAPI/Controllers/HTGL/HTGLPersonController.cs b/SGGL/WebAPI/Controllers/HTGL/HTGLPersonController.cs index de3f5ad2..de6a021b 100644 --- a/SGGL/WebAPI/Controllers/HTGL/HTGLPersonController.cs +++ b/SGGL/WebAPI/Controllers/HTGL/HTGLPersonController.cs @@ -57,14 +57,14 @@ namespace WebAPI.Controllers try { - var Data = APIHTGLPersonService.SavePro_Person(PersonjsonData); - responeData.data = Data.data; - if (Data.Message != "" && Data.Message != null) - { - responeData.code = 0; - responeData.message = Data.Message; - ErrLogInfo.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(responeData)); - } + //var Data = APIHTGLPersonService.SavePro_Person(PersonjsonData); + //responeData.data = Data.data; + //if (Data.Message != "" && Data.Message != null) + //{ + // responeData.code = 0; + // responeData.message = Data.Message; + // ErrLogInfo.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(responeData)); + //} } catch (Exception ex) diff --git a/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile4.pubxml b/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile4.pubxml new file mode 100644 index 00000000..7c5e7db1 --- /dev/null +++ b/SGGL/WebAPI/Properties/PublishProfiles/FolderProfile4.pubxml @@ -0,0 +1,18 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\app.publish\ + FileSystem + <_TargetId>Folder + + + \ No newline at end of file