This commit is contained in:
2023-01-04 15:27:35 +08:00
23 changed files with 451 additions and 172 deletions
Binary file not shown.
@@ -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
@@ -170,7 +170,7 @@ namespace BLL
public static List<HJGL_Pipeline> GetView_HJGL_Pipelines(HJGL_Pipeline model) public static List<HJGL_Pipeline> GetView_HJGL_Pipelines(HJGL_Pipeline model)
{ {
var db = Funs.DB; var db = Funs.DB;
var pipelineList =( from x in hJGL_Pipelines var pipelineList =( from x in Funs.DB.HJGL_Pipeline
where where
(string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId)) (string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId))
&& (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId)) && (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId))
@@ -1,5 +1,9 @@
using Model; using Aspose.Words;
using Model;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq; using System.Linq;
namespace BLL namespace BLL
@@ -283,7 +287,64 @@ namespace BLL
return list; return list;
} }
public static Dictionary<string, object> GetFileOutValueById(string WeldingDailyId)
{
var value = new Dictionary<string, object>();
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<SqlParameter> listStr = new List<SqlParameter>();
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<string, object> GetFileOutValueByUnitWorkId(string UnitWorkId,string Month)
{
var value = new Dictionary<string, object>();
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 #region
/// <summary> /// <summary>
/// 焊接日报下拉项 /// 焊接日报下拉项
@@ -1,4 +1,5 @@
using BLL; using BLL;
using FastReport.Design;
using FineUIPro.Web.HJGL.WeldingManage; using FineUIPro.Web.HJGL.WeldingManage;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -88,7 +89,7 @@ namespace FineUIPro.Web.HJGL.DataImport
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -111,7 +112,7 @@ namespace FineUIPro.Web.HJGL.DataImport
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -177,14 +178,15 @@ namespace FineUIPro.Web.HJGL.DataImport
e.Node.Nodes.Clear(); e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程") 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 where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); 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) 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(); //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(); TreeNode newNode = new TreeNode();
//if (jotCount > weldJotCount) //if (jotCount > weldJotCount)
@@ -147,7 +147,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{ {
if (q != null) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -171,8 +171,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{ {
foreach (var q in unitWork2) foreach (var q in unitWork2)
{ {
int a = (from x in PipelineService.hJGL_Pipelines int a = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == q.UnitWorkId where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
select x).Count(); select x).Count();
@@ -283,14 +283,16 @@ namespace FineUIPro.Web.HJGL.InfoQuery
e.Node.Nodes.Clear(); e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程") if (e.Node.CommandName == "单位工程")
{ {
var pipeline = (from x in PipelineService.hJGL_Pipelines var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == e.Node.NodeID where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); 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) 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(); TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId; newNode.NodeID = item.PipelineId;
@@ -98,7 +98,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -112,7 +112,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -118,7 +118,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -132,7 +132,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -81,7 +81,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -109,7 +109,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -142,7 +142,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BindNodes(TreeNode node) private void BindNodes(TreeNode node)
{ {
List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>(); List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
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 pipeline = (from x in pipelines
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
@@ -82,7 +82,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -106,7 +106,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -135,16 +135,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage
private void BindNodes(TreeNode node) private void BindNodes(TreeNode node)
{ {
List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>(); List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
pipeline = (from x in PipelineService.hJGL_Pipelines pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == node.NodeID where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); 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 pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]); int pageCount = int.Parse(node.CommandName.Split('|')[1]);
if (pageindex <= pageCount) if (pageindex <= pageCount)
{ {
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
foreach (var item in pipeline) 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(); //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() + " " + "焊口" + "】"; // 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 jotCount = (from x in 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 AuditCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count();
TreeNode newNode = new TreeNode(); TreeNode newNode = new TreeNode();
if (jotCount == AuditCount) //全部审核 if (jotCount == AuditCount) //全部审核
@@ -171,7 +171,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (dv[i]["管线号"] != null && !string.IsNullOrEmpty(dv[i]["管线号"].ToString())) 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) if (pipeline.Count() > 0)
{ {
item.PipelineId = pipeline.First().PipelineId; item.PipelineId = pipeline.First().PipelineId;
@@ -177,7 +177,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
rootNode1.EnableExpandEvent = true; rootNode1.EnableExpandEvent = true;
this.tvControlItem.Nodes.Add(rootNode1); 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) if (a > 0)
{ {
// BindNodes(tn1); // BindNodes(tn1);
@@ -194,7 +194,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
rootNode2.EnableClickEvent = true; rootNode2.EnableClickEvent = true;
rootNode2.EnableExpandEvent = true; rootNode2.EnableExpandEvent = true;
this.tvControlItem.Nodes.Add(rootNode2); 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) if (b > 0)
{ {
// BindNodes(tn1); // BindNodes(tn1);
@@ -215,7 +215,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
void AddTreeNode(string PipeArea , TreeNode node ) 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)) 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(); 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)) if (pagenum <= Funs.GetEndPageNumber(Count,pageSize))
{ {
iso = iso.Skip(pageSize * (pagenum - 1)).Take(pageSize).ToList(); ; 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) foreach (var item in iso)
{ {
TreeNode newNode = new TreeNode(); TreeNode newNode = new TreeNode();
@@ -187,17 +187,18 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (e.Node.CommandName == "单位工程") if (e.Node.CommandName == "单位工程")
{ {
var pipeline = (from x in BLL.PipelineService.hJGL_Pipelines var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim()) where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); 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(); // 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) foreach (var item in pipeline)
{ {
//var jotCount = WeldJointlist.Where(x => x.PipelineId == item.PipelineId).Count(); //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(); TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId; newNode.NodeID = item.PipelineId;
@@ -99,7 +99,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -122,7 +122,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -154,8 +154,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (e.Node.CommandName == "单位工程") if (e.Node.CommandName == "单位工程")
{ {
var pipeline = (from x in PipelineService.hJGL_Pipelines var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); select x).ToList();
if (!string .IsNullOrEmpty (txtPipelineCode.Text.Trim())) if (!string .IsNullOrEmpty (txtPipelineCode.Text.Trim()))
@@ -78,16 +78,23 @@
</f:Label> </f:Label>
<f:Label ID="txtSumSize" Label="总达因" runat="server" <f:Label ID="txtSumSize" Label="总达因" runat="server"
LabelWidth="90px" LabelAlign="Right"> LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtTeam" Label="班组数" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label> </f:Label>
<f:Label ID="txtRemark" Label="备注" runat="server" <f:Label ID="txtRemark" Label="备注" runat="server"
LabelWidth="90px" LabelAlign="Right"> LabelWidth="90px" LabelAlign="Right">
</f:Label> </f:Label>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
<f:Toolbar ID="Toolbar3" runat="server"> <f:Toolbar ID="Toolbar3" runat="server">
<Items> <Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线号" EmptyText="输入查询条件" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtTextBox_TextChanged"></f:TextBox> <f:TextBox ID="txtPipelineCode" runat="server" Label="管线号" EmptyText="输入查询条件" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtTextBox_TextChanged"></f:TextBox>
<f:TextBox ID="txtWelderCode" runat="server" Label="焊工号" EmptyText="输入查询条件" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtTextBox_TextChanged"></f:TextBox> <f:TextBox ID="txtWelderCode" runat="server" Label="焊工号" EmptyText="输入查询条件" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtTextBox_TextChanged"></f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@@ -125,6 +132,10 @@
DataField="Dia" FieldType="String" HeaderTextAlign="Center" DataField="Dia" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="80px"> TextAlign="Center" Width="80px">
</f:RenderField> </f:RenderField>
<f:RenderField HeaderText="DN公称直径" ColumnID="DNDia"
DataField="DNDia" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="达因" ColumnID="Size" <f:RenderField HeaderText="达因" ColumnID="Size"
DataField="Size" FieldType="String" HeaderTextAlign="Center" DataField="Size" FieldType="String" HeaderTextAlign="Center"
TextAlign="Center" Width="80px"> TextAlign="Center" Width="80px">
@@ -184,6 +195,9 @@
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="BulletEdit" EnablePostBack="true" <f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="BulletEdit" EnablePostBack="true"
runat="server" Text="编辑"> runat="server" Text="编辑">
</f:MenuButton> </f:MenuButton>
<f:MenuButton ID="btnMenuOut" OnClick="btnOut_Click" Icon="FolderUp" EnableAjax="false" DisableControlBeforePostBack="false"
runat="server" Text="导出">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" <f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Top" Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Top"
runat="server" Text="删除"> runat="server" Text="删除">
@@ -1,8 +1,10 @@
using BLL; using BLL;
using MiniExcelLibs;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.IO;
using System.Linq; using System.Linq;
namespace FineUIPro.Web.HJGL.WeldingManage namespace FineUIPro.Web.HJGL.WeldingManage
@@ -81,6 +83,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName; tn1.Text = q.UnitWorkName;
tn1.ToolTip = "施工单位:" + u.UnitName; tn1.ToolTip = "施工单位:" + u.UnitName;
tn1.CommandName = "UnitWork";
rootNode1.Nodes.Add(tn1); rootNode1.Nodes.Add(tn1);
BindNodes(tn1); BindNodes(tn1);
} }
@@ -94,6 +97,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName; tn2.Text = q.UnitWorkName;
tn2.ToolTip = "施工单位:" + u.UnitName; tn2.ToolTip = "施工单位:" + u.UnitName;
tn2.CommandName = "UnitWork";
rootNode2.Nodes.Add(tn2); rootNode2.Nodes.Add(tn2);
BindNodes(tn2); BindNodes(tn2);
} }
@@ -122,6 +126,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
newNode.Text = item.WeldingDailyCode; newNode.Text = item.WeldingDailyCode;
newNode.NodeID = item.WeldingDailyId; newNode.NodeID = item.WeldingDailyId;
newNode.EnableClickEvent = true; newNode.EnableClickEvent = true;
newNode.CommandName = "WeldingDaily";
node.Nodes.Add(newNode); node.Nodes.Add(newNode);
} }
} }
@@ -185,7 +190,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
string strSql = @"SELECT WeldingDailyId,WeldJointId,PipelineCode,WeldJointCode, string strSql = @"SELECT WeldingDailyId,WeldJointId,PipelineCode,WeldJointCode,
BackingWelderCode,CoverWelderCode,Material1Code,Material2Code, BackingWelderCode,CoverWelderCode,Material1Code,Material2Code,
Dia,Thickness,WeldTypeCode,WeldingMethodCode,WeldingWireCode,WeldingMode, Dia,DNDia,Thickness,WeldTypeCode,WeldingMethodCode,WeldingWireCode,WeldingMode,
WeldingRodCode,Size WeldingRodCode,Size
FROM dbo.View_HJGL_WeldJoint FROM dbo.View_HJGL_WeldJoint
WHERE WeldingDailyId=@WeldingDailyId"; WHERE WeldingDailyId=@WeldingDailyId";
@@ -204,7 +209,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var SumDia = tb.AsEnumerable().Sum(x => x.Field<decimal>("Size")); var SumDia = tb.AsEnumerable().Sum(x => x.Field<decimal>("Size"));
var WelderCount = tb.AsEnumerable().Select(x => x.Field<string>("CoverWelderCode")).ToList().Distinct().Count();
txtSumSize.Text= SumDia.ToString(); txtSumSize.Text= SumDia.ToString();
txtTeam.Text = WelderCount.ToString();
// 2.获取当前分页数据 // 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1); //var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.RecordCount = tb.Rows.Count; Grid1.RecordCount = tb.Rows.Count;
@@ -493,5 +500,47 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BindGrid(); BindGrid();
} }
#endregion #endregion
protected void btnOut_Click(object sender, EventArgs e)
{
var value = new Dictionary<string, object>();
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);
}
}
} }
} }
@@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.WeldingManage { namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldReport { public partial class WeldReport
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -156,6 +158,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.Label txtSumSize; protected global::FineUIPro.Label txtSumSize;
/// <summary>
/// txtTeam 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTeam;
/// <summary> /// <summary>
/// txtRemark 控件。 /// txtRemark 控件。
/// </summary> /// </summary>
@@ -192,6 +203,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtWelderCode; protected global::FineUIPro.TextBox txtWelderCode;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>
@@ -255,6 +275,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit; protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuOut;
/// <summary> /// <summary>
/// btnMenuDelete 控件。 /// btnMenuDelete 控件。
/// </summary> /// </summary>
@@ -35,9 +35,12 @@
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线号" AutoPostBack="true" LabelAlign="Right" OnTextChanged="drpJointAttribute_SelectedIndexChanged"></f:TextBox> <f:TextBox ID="txtPipelineCode" runat="server" Label="管线号" AutoPostBack="true" LabelAlign="Right" OnTextChanged="drpJointAttribute_SelectedIndexChanged"></f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server"> <f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill> </f:ToolbarFill>
<f:Button ID="btnSave" ToolTip="保存" Icon="SystemSave" runat="server" <f:Button ID="btnSave" ToolTip="保存" Text ="保存" Icon="SystemSave" runat="server"
OnClick="btnSave_Click"> OnClick="btnSave_Click">
</f:Button> </f:Button>
<f:Button ID="btnAccept" Icon="Accept" runat="server" ToolTip="提交" Text="提交"
OnClick="btnAccept_Click">
</f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@@ -87,9 +90,9 @@
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊接日报" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="焊接日报"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="WeldTaskId,WeldJointId" EnableColumnLines="true" ForceFit="true" EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="WeldTaskId,WeldJointId" EnableColumnLines="true" ForceFit="true"
AllowCellEditing="true" ClicksToEdit="1" DataIDField="WeldTaskId" AllowSorting="true" KeepCurrentSelection="true" AllowCellEditing="true" ClicksToEdit="1" DataIDField="WeldTaskId" AllowSorting="true" KeepCurrentSelection="true" AllowColumnLocking="true"
SortField="WeldJointNum" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" SortField="WeldJointNum" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" CheckBoxSelectOnly="true"
AllowPaging="false" IsDatabasePaging="true" PageSize="10000" EnableTextSelection="True"> AllowPaging="false" IsDatabasePaging="true" PageSize="10000" EnableTextSelection="True" DisableUnselectableRows="true">
<Columns> <Columns>
<f:RenderField HeaderText="焊口序号" ColumnID="WeldJointNum" <f:RenderField HeaderText="焊口序号" ColumnID="WeldJointNum"
@@ -159,6 +162,10 @@
DataField="Dia" SortField="Dia" FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" DataField="Dia" SortField="Dia" FieldType="Double" HeaderTextAlign="Center" TextAlign="Left"
Width="70px"> Width="70px">
</f:RenderField> </f:RenderField>
<f:RenderField HeaderText="DN公称直径" ColumnID="DNDia"
DataField="DNDia" SortField="DNDia" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="70px">
</f:RenderField>
<f:RenderField HeaderText="壁厚" ColumnID="Thickness" <f:RenderField HeaderText="壁厚" ColumnID="Thickness"
DataField="Thickness" SortField="Thickness" FieldType="Double" HeaderTextAlign="Center" DataField="Thickness" SortField="Thickness" FieldType="Double" HeaderTextAlign="Center"
TextAlign="Left" Width="70px"> TextAlign="Left" Width="70px">
@@ -193,7 +193,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
/// </summary> /// </summary>
private void BindGrid(List<Model.SpWeldingDailyItem> weldingDailyItem) private void BindGrid(List<Model.SpWeldingDailyItem> weldingDailyItem)
{ {
var aw = this.Grid1.SelectedRowIDArray;
DataTable dt = null; DataTable dt = null;
var list = from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == this.CurrUser.LoginProjectId select x; var list = from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == this.CurrUser.LoginProjectId select x;
if (weldingDailyItem != null) if (weldingDailyItem != null)
@@ -247,26 +247,32 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
Grid1.DataSource = table; Grid1.DataSource = table;
Grid1.DataBind(); 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) 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 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(); var weldTaskIds = task.Select(x => x.WeldTaskId).ToArray();
this.Grid1.SelectedRowIDArray = weldTaskIds; this.Grid1.SelectedRowIDArray = weldTaskIds;
} var a = this.Grid1.SelectedRowIDArray;
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;
}
} }
} }
#endregion #endregion
@@ -456,6 +462,47 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
BLL.WeldingDailyService.AddWeldingDaily(newWeldingDaily); 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); //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<JObject>("values");
int i = mergedRow.Value<int>("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<string>("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<string>("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<string>("JointAttribute").ToString()))
//{
// newWeldJoint.JointAttribute = values.Value<string>("JointAttribute").ToString();
//}
//BLL.WeldJointService.UpdateWeldJoint(newWeldJoint);
BLL.WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd);
}
}
}
// 获取组批条件 // 获取组批条件
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", CurrUser.LoginProjectId); var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", CurrUser.LoginProjectId);
@@ -573,56 +620,17 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
#endregion #endregion
//更新焊口属性 //更新焊口属性
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("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<string>("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<string>("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<string>("JointAttribute").ToString()))
//{
// newWeldJoint.JointAttribute = values.Value<string>("JointAttribute").ToString();
//}
//BLL.WeldJointService.UpdateWeldJoint(newWeldJoint);
BLL.WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd);
}
}
}
if (string.IsNullOrEmpty(errlog)) if (string.IsNullOrEmpty(errlog))
{ {
ShowNotify("保存成功!", MessageBoxIcon.Success); ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); drpJointAttribute_SelectedIndexChanged(null, null);
//PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
} }
else else
{ {
// string okj = ActiveWindow.GetWriteBackValueReference(newWeldReportMain.WeldingDailyId) + ActiveWindow.GetHidePostBackReference(); // string okj = ActiveWindow.GetWriteBackValueReference(newWeldReportMain.WeldingDailyId) + ActiveWindow.GetHidePostBackReference();
Alert.ShowInTop("保存成功!" + "焊接明细中" + errlog, "提交结果", MessageBoxIcon.Warning); Alert.ShowInTop("保存成功!" + "焊接明细中" + errlog, "提交结果", MessageBoxIcon.Warning);
drpJointAttribute_SelectedIndexChanged(null, null);
// ShowAlert("焊接明细中" + errlog, MessageBoxIcon.Warning); // ShowAlert("焊接明细中" + errlog, MessageBoxIcon.Warning);
} }
} }
@@ -637,7 +645,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return; return;
} }
} }
protected void btnAccept_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#endregion #endregion
#region #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;
// }
//}
}
} }
} }
@@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.WeldingManage { namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
public partial class WeldReportEdit { public partial class WeldReportEdit
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@@ -111,6 +113,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnSave; protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAccept;
/// <summary> /// <summary>
/// SimpleForm1 控件。 /// SimpleForm1 控件。
/// </summary> /// </summary>
@@ -71,7 +71,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -94,7 +94,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -124,14 +124,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage
e.Node.Nodes.Clear(); e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程") if (e.Node.CommandName == "单位工程")
{ {
var pipeline = (from x in PipelineService.hJGL_Pipelines var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.UnitWorkId == e.Node.NodeID where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) && x.PipelineCode.Contains(txtPipelineCode.Text.Trim())
orderby x.PipelineCode orderby x.PipelineCode
select x).ToList(); 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) 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(); //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) //if (jotCount > weldJotCount)
@@ -83,7 +83,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork1) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -97,7 +97,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork2) 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); var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
+21 -3
View File
@@ -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 public string Remarks
{ {
get 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 public string PricingBasis
{ {
get 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 public string Clause
{ {
get get
@@ -223749,6 +223749,8 @@ namespace Model
private System.Nullable<decimal> _Dia; private System.Nullable<decimal> _Dia;
private string _DNDia;
private System.Nullable<decimal> _Thickness; private System.Nullable<decimal> _Thickness;
private System.Nullable<decimal> _Size; private System.Nullable<decimal> _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)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Thickness", DbType="Decimal(8,3)")]
public System.Nullable<decimal> Thickness public System.Nullable<decimal> Thickness
{ {