diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index 1e4add15..98c9e3cf 100644 Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_V2023-01-03_001.sql b/DataBase/版本日志/SGGLDB_V2023-01-03_001.sql new file mode 100644 index 00000000..64819a75 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-01-03_001.sql @@ -0,0 +1,31 @@ + + +ALTER VIEW [dbo].[View_HJGL_WeldingTask] +AS +SELECT T.WeldTaskId,T.WeldJointId,T.CoverWelderId,T.BackingWelderId, + cov.WelderCode AS CoverWelderCode,back.WelderCode AS BackingWelderCode, + case when jot.JointAttribute is not null then jot.JointAttribute else T.JointAttribute end as JointAttribute, + T.WeldingMode,T.ProjectId,T.UnitWorkId,T.UnitId,T.TaskDate,T.Tabler,T.TableDate, + jot.WeldJointCode,jot.Dia,jot.DNDia, jot.Thickness,jot.Size,jot.WeldingLocationId, + CASE WHEN jot.WeldingDailyId IS NULL THEN '' ELSE '' END AS IsWelding, + P.PipelineCode,B.WeldTypeCode,M.WeldingMethodCode,L.WeldingLocationCode, + t.CanWelderCode,t.CanWelderId ,rod.ConsumablesName AS WeldingRodCode,T.CanWeldingRodName,T.CanWeldingWireName, + wire.ConsumablesName AS WeldingWireCode,jot.WeldingDailyId,p.PipeArea, + (case when charindex('/',jot.WeldJointCode)>0 +then RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1) +else jot.WeldJointCode end) as WeldJointNum +from HJGL_WeldTask T +left join HJGL_WeldJoint jot on T.WeldJointId=jot.WeldJointId +LEFT JOIN dbo.SitePerson_Person cov ON cov.PersonId=t.CoverWelderId +LEFT JOIN dbo.SitePerson_Person back ON back.PersonId=t.BackingWelderId +LEFT join HJGL_Pipeline P on jot.PipelineId=P.PipelineId +left join Base_WeldType B on jot.WeldTypeId=B.WeldTypeId +LEFT join Base_WeldingMethod M on jot.WeldingMethodId=M.WeldingMethodId +left join Base_WeldingLocation L on jot.WeldingLocationId=L.WeldingLocationId +LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire +LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod + + +GO + + diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index 6ee295b8..9074166b 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -170,7 +170,7 @@ namespace BLL public static List GetView_HJGL_Pipelines(HJGL_Pipeline model) { var db = Funs.DB; - var pipelineList =( from x in hJGL_Pipelines + var pipelineList =( from x in Funs.DB.HJGL_Pipeline where (string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId)) && (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId)) diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs index 029715e1..3936a6a1 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs @@ -1,5 +1,9 @@ -using Model; +using Aspose.Words; +using Model; +using System; using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; using System.Linq; namespace BLL @@ -283,7 +287,64 @@ namespace BLL return list; } + public static Dictionary GetFileOutValueById(string WeldingDailyId) + { + var value = new Dictionary(); + string strSql = @" SELECT + PipelineCode as '管线号', + (case when charindex('/',WeldJointCode)>0 + then RIGHT(WeldJointCode,CHARINDEX('/',REVERSE(WeldJointCode))-1) + else WeldJointCode end) as '焊口序号', + WeldJointCode as '焊口号', + BackingWelderCode as '打底焊工', + CoverWelderCode as '盖面焊工', + Material1Code as '材质1' , + Material2Code as '材质2' , + Dia as '外径' , + DNDia as 'DN公称直径', + Thickness as '壁厚' , + WeldTypeCode as '焊缝类型' , + WeldingMethodCode as '焊接方法' , + WeldingWireCode as '焊丝' , + WeldingMode as '焊口机动化程度' , + WeldingRodCode as '焊条' , + Size as '达因' + FROM dbo.View_HJGL_WeldJoint + WHERE WeldingDailyId=@WeldingDailyId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@WeldingDailyId", WeldingDailyId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + var WeldingDailyCode = (from x in Funs.DB.HJGL_WeldingDaily + where x.WeldingDailyId == WeldingDailyId + select x.WeldingDailyCode).FirstOrDefault(); + if (!string.IsNullOrEmpty(WeldingDailyCode)) + { + value.Add(WeldingDailyCode, tb); + } + return value; + } + public static Dictionary GetFileOutValueByUnitWorkId(string UnitWorkId,string Month) + { + var value = new Dictionary(); + var p = from x in Funs.DB.HJGL_WeldingDaily + where x.UnitWorkId == UnitWorkId + && x.WeldingDate < Convert.ToDateTime(Month + "-01").AddMonths(1) + && x.WeldingDate >= Convert.ToDateTime(Month + "-01") + orderby x.WeldingDailyCode descending + select x; + if (p.Count() > 0) + { + foreach (var item in p) + { + var detail = GetFileOutValueById(item.WeldingDailyId); + value.Add(detail.Keys.First(), detail.Values.First()); + + } + } + return value; + } #region 焊接日报下拉项 /// /// 焊接日报下拉项 diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index 56fdfc57..cbe9122f 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using FastReport.Design; using FineUIPro.Web.HJGL.WeldingManage; using System; using System.Collections.Generic; @@ -88,7 +89,7 @@ namespace FineUIPro.Web.HJGL.DataImport { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -111,7 +112,7 @@ namespace FineUIPro.Web.HJGL.DataImport { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -177,14 +178,15 @@ namespace FineUIPro.Web.HJGL.DataImport e.Node.Nodes.Clear(); if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in PipelineService.hJGL_Pipelines + 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 WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); + 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) diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs index 1058c8da..874ee2fa 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs @@ -147,7 +147,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery { if (q != null) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -171,8 +171,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines - where x.UnitWorkId == q.UnitWorkId + 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(); @@ -283,14 +283,16 @@ namespace FineUIPro.Web.HJGL.InfoQuery e.Node.Nodes.Clear(); if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in PipelineService.hJGL_Pipelines - where x.UnitWorkId == e.Node.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(); + foreach (var item in pipeline) { - var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count(); + var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count(); TreeNode newNode = new TreeNode(); newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; newNode.NodeID = item.PipelineId; diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs index 65c84030..06c4cb2f 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs @@ -98,7 +98,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -112,7 +112,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs index 640bfefa..5e8c3031 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PipelingDivide.aspx.cs @@ -118,7 +118,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -132,7 +132,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs index af3431ea..df7d065f 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs @@ -81,7 +81,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -109,7 +109,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -142,7 +142,7 @@ namespace FineUIPro.Web.HJGL.PreDesign private void BindNodes(TreeNode node) { List pipeline = new List(); - var pipelines = from x in PipelineService.hJGL_Pipelines where x.PipeArea == "1" select x; + var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x; pipeline = (from x in pipelines where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs index 1f405b6c..ee570cef 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs @@ -82,7 +82,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -106,7 +106,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -135,16 +135,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage private void BindNodes(TreeNode node) { List pipeline = new List(); - pipeline = (from x in PipelineService.hJGL_Pipelines - where x.UnitWorkId == node.NodeID + pipeline = (from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.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(); + 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 Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count(); @@ -159,8 +162,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage // newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; //} - var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count(); - var AuditCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count(); + var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count(); + var AuditCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count(); TreeNode newNode = new TreeNode(); if (jotCount == AuditCount) //全部审核 diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs index 9c26b075..acfad345 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs @@ -171,7 +171,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (dv[i]["管线号"] != null && !string.IsNullOrEmpty(dv[i]["管线号"].ToString())) { - var pipeline = from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == unitworkId && x.PipelineCode == dv[i]["管线号"].ToString().Trim() select x; + var pipeline = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitworkId && x.PipelineCode == dv[i]["管线号"].ToString().Trim() select x; if (pipeline.Count() > 0) { item.PipelineId = pipeline.First().PipelineId; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index 3d8aa67c..b35c0e59 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -177,7 +177,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage 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(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP select x).Count(); if (a > 0) { // BindNodes(tn1); @@ -194,7 +194,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage rootNode2.EnableClickEvent = true; rootNode2.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(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(); + int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD select x).Count(); if (b > 0) { // BindNodes(tn1); @@ -215,7 +215,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage void AddTreeNode(string PipeArea , TreeNode node ) { - 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(); + var iso = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && 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(); @@ -235,7 +235,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (pagenum <= Funs.GetEndPageNumber(Count,pageSize)) { iso = iso.Skip(pageSize * (pagenum - 1)).Take(pageSize).ToList(); ; - var joints = from x in WeldJointService.hJGL_WeldJoints select x; + var joints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); foreach (var item in iso) { TreeNode newNode = new TreeNode(); diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs index 2d9662f4..68f39730 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointList.aspx.cs @@ -187,17 +187,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in BLL.PipelineService.hJGL_Pipelines - where x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) + 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 = WeldJointService.hJGL_WeldJoints.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; diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs index f0b7359d..14b84f56 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs @@ -99,7 +99,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -122,7 +122,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea select x).Count(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -154,8 +154,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in PipelineService.hJGL_Pipelines - where x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea + var pipeline = (from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList(); if (!string .IsNullOrEmpty (txtPipelineCode.Text.Trim())) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx index aca8d337..f9852200 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx @@ -78,16 +78,23 @@ + + + + + + @@ -125,6 +132,10 @@ DataField="Dia" FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px"> + + @@ -184,6 +195,9 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs index 47273673..8460014d 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs @@ -1,8 +1,10 @@ using BLL; +using MiniExcelLibs; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; using System.Linq; namespace FineUIPro.Web.HJGL.WeldingManage @@ -81,6 +83,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn1.NodeID = q.UnitWorkId; tn1.Text = q.UnitWorkName; tn1.ToolTip = "施工单位:" + u.UnitName; + tn1.CommandName = "UnitWork"; rootNode1.Nodes.Add(tn1); BindNodes(tn1); } @@ -94,6 +97,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage tn2.NodeID = q.UnitWorkId; tn2.Text = q.UnitWorkName; tn2.ToolTip = "施工单位:" + u.UnitName; + tn2.CommandName = "UnitWork"; rootNode2.Nodes.Add(tn2); BindNodes(tn2); } @@ -122,6 +126,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage newNode.Text = item.WeldingDailyCode; newNode.NodeID = item.WeldingDailyId; newNode.EnableClickEvent = true; + newNode.CommandName = "WeldingDaily"; node.Nodes.Add(newNode); } } @@ -185,7 +190,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { string strSql = @"SELECT WeldingDailyId,WeldJointId,PipelineCode,WeldJointCode, BackingWelderCode,CoverWelderCode,Material1Code,Material2Code, - Dia,Thickness,WeldTypeCode,WeldingMethodCode,WeldingWireCode,WeldingMode, + Dia,DNDia,Thickness,WeldTypeCode,WeldingMethodCode,WeldingWireCode,WeldingMode, WeldingRodCode,Size FROM dbo.View_HJGL_WeldJoint WHERE WeldingDailyId=@WeldingDailyId"; @@ -204,7 +209,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); var SumDia = tb.AsEnumerable().Sum(x => x.Field("Size")); + var WelderCount = tb.AsEnumerable().Select(x => x.Field("CoverWelderCode")).ToList().Distinct().Count(); txtSumSize.Text= SumDia.ToString(); + txtTeam.Text = WelderCount.ToString(); // 2.获取当前分页数据 //var table = this.GetPagedDataTable(Grid1, tb1); Grid1.RecordCount = tb.Rows.Count; @@ -493,5 +500,47 @@ namespace FineUIPro.Web.HJGL.WeldingManage BindGrid(); } #endregion + + protected void btnOut_Click(object sender, EventArgs e) + { + var value = new Dictionary(); + string filename = ""; + switch (this.tvControlItem.SelectedNode.CommandName) + { + case "UnitWork": + value = BLL.WeldingDailyService.GetFileOutValueByUnitWorkId(this.tvControlItem.SelectedNodeID, this.txtMonth.Text.Trim()); + var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID); + filename = "焊接日报-" + unitWork.UnitWorkName+ this.txtMonth.Text.Trim()+ ".xlsx"; + break; + case "WeldingDaily": + value = WeldingDailyService.GetFileOutValueById(this.tvControlItem.SelectedNodeID); + var daily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(tvControlItem.SelectedNodeID); + var unitwork = UnitWorkService.getUnitWorkByUnitWorkId(daily.UnitWorkId); + filename = "焊接日报-" + unitwork.UnitWorkName + daily.WeldingDailyCode + ".xlsx"; + break; + } + string path = Funs.RootPath + @"File\Excel\Temp\焊接日报.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); + if (value.Count>0) + { + MiniExcel.SaveAs(path, value); + + 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.ShowInTop("无数据,无法导出!", MessageBoxIcon.Warning); + + } + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs index 6e035317..5ba2b9a0 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HJGL.WeldingManage { - - - public partial class WeldReport { - +namespace FineUIPro.Web.HJGL.WeldingManage +{ + + + public partial class WeldReport + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// txtMonth 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtMonth; - + /// /// tvControlItem 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// Panel2 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel2; - + /// /// panelCenterRegion 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Grid1 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtUnitName 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtUnitName; - + /// /// txtTabler 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTabler; - + /// /// txtTableDate 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTableDate; - + /// /// txtWeldingDate 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWeldingDate; - + /// /// txtSumSize 控件。 /// @@ -155,7 +157,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtSumSize; - + + /// + /// txtTeam 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtTeam; + /// /// txtRemark 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtRemark; - + /// /// Toolbar3 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar3; - + /// /// txtPipelineCode 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtPipelineCode; - + /// /// txtWelderCode 控件。 /// @@ -191,7 +202,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWelderCode; - + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + /// /// ToolbarSeparator1 控件。 /// @@ -200,7 +220,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -209,7 +229,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -218,7 +238,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -227,7 +247,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -236,7 +256,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuAdd 控件。 /// @@ -245,7 +265,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuAdd; - + /// /// btnMenuEdit 控件。 /// @@ -254,7 +274,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + + /// + /// btnMenuOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuOut; + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx index 54399005..5e42e260 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx @@ -26,7 +26,7 @@ - + - + + @@ -87,9 +90,9 @@ + AllowCellEditing="true" ClicksToEdit="1" DataIDField="WeldTaskId" AllowSorting="true" KeepCurrentSelection="true" AllowColumnLocking="true" + SortField="WeldJointNum" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" CheckBoxSelectOnly="true" + AllowPaging="false" IsDatabasePaging="true" PageSize="10000" EnableTextSelection="True" DisableUnselectableRows="true"> + + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs index 5f867f08..405350de 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.cs @@ -193,7 +193,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage /// private void BindGrid(List weldingDailyItem) { - + var aw = this.Grid1.SelectedRowIDArray; DataTable dt = null; var list = from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == this.CurrUser.LoginProjectId select x; if (weldingDailyItem != null) @@ -247,26 +247,32 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage Grid1.DataSource = table; Grid1.DataBind(); + + //for (int i = 0; i < this.Grid1.Rows.Count; i++) + //{ + // var hotProesssItem = Funs.DB.HJGL_HotProess_TrustItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString()); + // if (hotProesssItem != null) //已生成热处理委托,不能编辑或删除 + // { + // // Grid1.Rows[i].RowSelectable = false; + // } + // var pointBatchItem = Funs.DB.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString() && x.PointState != null); + // if (pointBatchItem != null) //已生成委托,不能编辑或删除 + // { + // // Grid1.Rows[i].RowSelectable = false; + // } + //} if (weldingDailyItem != null) { - var task = from x in Funs.DB.View_HJGL_WeldingTask + var task = (from x in Funs.DB.View_HJGL_WeldingTask where x.WeldingDailyId == this.WeldingDailyId - select x; + select x).ToList(); + if (!string.IsNullOrEmpty(this.txtPipelineCode.Text.Trim())) + { + task = task.Where(x => x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())).ToList(); + } var weldTaskIds = task.Select(x => x.WeldTaskId).ToArray(); this.Grid1.SelectedRowIDArray = weldTaskIds; - } - for (int i = 0; i < this.Grid1.Rows.Count; i++) - { - var hotProesssItem = Funs.DB.HJGL_HotProess_TrustItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString()); - if (hotProesssItem != null) //已生成热处理委托,不能编辑或删除 - { - Grid1.Rows[i].RowSelectable = false; - } - var pointBatchItem = Funs.DB.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString() && x.PointState != null); - if (pointBatchItem != null) //已生成委托,不能编辑或删除 - { - Grid1.Rows[i].RowSelectable = false; - } + var a = this.Grid1.SelectedRowIDArray; } } #endregion @@ -456,6 +462,47 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage BLL.WeldingDailyService.AddWeldingDaily(newWeldingDaily); //BLL.Sys_LogService.AddLog(BLL.Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldReportMenuId, Const.BtnAdd, this.WeldingDailyId); } + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + + string rowId = Grid1.Rows[i].RowID; + if (this.Grid1.SelectedRowIDArray.Contains(rowId)) + { + var t = BLL.WeldTaskService.GetWeldTaskById(rowId); + var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(t.WeldJointId); + + + if (newWeldJoint != null) + { + var coverWelderCode = (from x in Funs.DB.SitePerson_Person + where x.ProjectId == CurrUser.LoginProjectId && x.WelderCode == values.Value("CoverWelderCode") + select x).FirstOrDefault(); + if (coverWelderCode != null) + { + t.CoverWelderId = coverWelderCode.PersonId; + newWeldJoint.CoverWelderId = coverWelderCode.PersonId; + } + var backingWelderCode = (from x in Funs.DB.SitePerson_Person + where x.ProjectId == CurrUser.LoginProjectId && x.WelderCode == values.Value("BackingWelderCode") + select x).FirstOrDefault(); + if (backingWelderCode != null) + { + t.BackingWelderId = backingWelderCode.PersonId; + newWeldJoint.BackingWelderId = backingWelderCode.PersonId; + } + WeldTaskService.UpdateWeldTask(t); + WeldJointService.UpdateWeldJoint(newWeldJoint); + //if (!string.IsNullOrEmpty(values.Value("JointAttribute").ToString())) + //{ + // newWeldJoint.JointAttribute = values.Value("JointAttribute").ToString(); + //} + //BLL.WeldJointService.UpdateWeldJoint(newWeldJoint); + BLL.WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd); + } + } + } // 获取组批条件 var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", CurrUser.LoginProjectId); @@ -573,56 +620,17 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage #endregion //更新焊口属性 - foreach (JObject mergedRow in Grid1.GetMergedData()) - { - JObject values = mergedRow.Value("values"); - int i = mergedRow.Value("index"); - - string rowId = Grid1.Rows[i].RowID; - if (this.Grid1.SelectedRowIDArray.Contains(rowId)) - { - var t = BLL.WeldTaskService.GetWeldTaskById(rowId); - var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(t.WeldJointId); - - - if (newWeldJoint != null) - { - var coverWelderCode = (from x in Funs.DB.SitePerson_Person - where x.ProjectId == CurrUser.LoginProjectId && x.WelderCode == values.Value("CoverWelderCode") - select x).FirstOrDefault(); - if (coverWelderCode != null) - { - t.CoverWelderId = coverWelderCode.PersonId; - newWeldJoint.CoverWelderId = coverWelderCode.PersonId; - } - var backingWelderCode = (from x in Funs.DB.SitePerson_Person - where x.ProjectId == CurrUser.LoginProjectId && x.WelderCode == values.Value("BackingWelderCode") - select x).FirstOrDefault(); - if (backingWelderCode != null) - { - t.BackingWelderId = backingWelderCode.PersonId; - newWeldJoint.BackingWelderId = backingWelderCode.PersonId; - } - WeldTaskService.UpdateWeldTask(t); - WeldJointService.UpdateWeldJoint(newWeldJoint); - //if (!string.IsNullOrEmpty(values.Value("JointAttribute").ToString())) - //{ - // newWeldJoint.JointAttribute = values.Value("JointAttribute").ToString(); - //} - //BLL.WeldJointService.UpdateWeldJoint(newWeldJoint); - BLL.WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd); - } - } - } if (string.IsNullOrEmpty(errlog)) { ShowNotify("保存成功!", MessageBoxIcon.Success); - PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + drpJointAttribute_SelectedIndexChanged(null, null); + //PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } else { // string okj = ActiveWindow.GetWriteBackValueReference(newWeldReportMain.WeldingDailyId) + ActiveWindow.GetHidePostBackReference(); Alert.ShowInTop("保存成功!" + "焊接明细中" + errlog, "提交结果", MessageBoxIcon.Warning); + drpJointAttribute_SelectedIndexChanged(null, null); // ShowAlert("焊接明细中" + errlog, MessageBoxIcon.Warning); } } @@ -637,7 +645,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); return; } + } + + protected void btnAccept_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + + } + #endregion #region 焊工资质判断 @@ -1230,5 +1246,38 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage } } + + protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) + { + DataRowView row = e.DataItem as DataRowView; + var id= row["WeldJointId"].ToString(); + var hotProesssItem = Funs.DB.HJGL_HotProess_TrustItem.FirstOrDefault(x => x.WeldJointId == id); + if (hotProesssItem != null) //已生成热处理委托,不能编辑或删除 + { + e.RowSelectable = false; + // Grid1.DeleteRow(e.RowID); + // Grid1.DeleteRow(e.RowID); + } + var pointBatchItem = Funs.DB.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == id && x.PointState != null); + if (pointBatchItem != null) //已生成委托,不能编辑或删除 + { + e.RowSelectable = false; + // Grid1.DeleteRow(e.RowID); + // Grid1.DeleteRow(e.RowID); + } + //for (int i = 0; i < this.Grid1.Rows.Count; i++) + //{ + // var hotProesssItem = Funs.DB.HJGL_HotProess_TrustItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString()); + // if (hotProesssItem != null) //已生成热处理委托,不能编辑或删除 + // { + // Grid1.Rows[i].RowSelectable = false; + // } + // var pointBatchItem = Funs.DB.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == this.Grid1.Rows[i].DataKeys[1].ToString() && x.PointState != null); + // if (pointBatchItem != null) //已生成委托,不能编辑或删除 + // { + // Grid1.Rows[i].RowSelectable = false; + // } + //} + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.designer.cs index 96d4ccd0..95f10054 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReportEdit.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.WeldingProcess.WeldingManage { - - - public partial class WeldReportEdit { - +namespace FineUIPro.Web.WeldingProcess.WeldingManage +{ + + + public partial class WeldReportEdit + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelCenterRegion 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Toolbar2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// hdItemsString 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdItemsString; - + /// /// hdTablerId 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdTablerId; - + /// /// drpJointAttribute 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpJointAttribute; - + /// /// txtPipelineCode 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtPipelineCode; - + /// /// ToolbarFill1 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -110,7 +112,16 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + + /// + /// btnAccept 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAccept; + /// /// SimpleForm1 控件。 /// @@ -119,7 +130,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// txtWeldingDailyCode 控件。 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWeldingDailyCode; - + /// /// drpUnit 控件。 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpUnit; - + /// /// drpUnitWork 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpUnitWork; - + /// /// txtWeldingDate 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtWeldingDate; - + /// /// txtTabler 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtTabler; - + /// /// txtTableDate 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtTableDate; - + /// /// txtRemark 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtRemark; - + /// /// lbAmount 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbAmount; - + /// /// Grid1 控件。 /// @@ -200,7 +211,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// lbPipeArea 控件。 /// @@ -209,7 +220,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lbPipeArea; - + /// /// drpCoverWelderId 控件。 /// @@ -218,7 +229,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpCoverWelderId; - + /// /// drpBackingWelderId 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs index 9890cd19..e1e8731e 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.cs @@ -71,7 +71,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -94,7 +94,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; @@ -124,14 +124,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage e.Node.Nodes.Clear(); if (e.Node.CommandName == "单位工程") { - var pipeline = (from x in PipelineService.hJGL_Pipelines - where x.UnitWorkId == e.Node.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 WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count(); + 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) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingPlan.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingPlan.aspx.cs index 46960c8f..b71c1534 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingPlan.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingPlan.aspx.cs @@ -83,7 +83,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork1) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn1 = new TreeNode(); tn1.NodeID = q.UnitWorkId; @@ -97,7 +97,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { foreach (var q in unitWork2) { - int a = (from x in PipelineService.hJGL_Pipelines where 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 select x).Count(); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId); TreeNode tn2 = new TreeNode(); tn2.NodeID = q.UnitWorkId; diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index e0863988..e9946239 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -142756,7 +142756,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remarks", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remarks", DbType="NVarChar(2000)")] public string Remarks { get @@ -143456,7 +143456,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PricingBasis", DbType="VarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PricingBasis", DbType="VarChar(200)")] public string PricingBasis { get @@ -143516,7 +143516,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Clause", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Clause", DbType="NVarChar(2000)")] public string Clause { get @@ -223749,6 +223749,8 @@ namespace Model private System.Nullable _Dia; + private string _DNDia; + private System.Nullable _Thickness; private System.Nullable _Size; @@ -224043,6 +224045,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DNDia", DbType="VarChar(50)")] + public string DNDia + { + get + { + return this._DNDia; + } + set + { + if ((this._DNDia != value)) + { + this._DNDia = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Thickness", DbType="Decimal(8,3)")] public System.Nullable Thickness {