2022-10-21 焊接二次设计wbs树颜色,和焊口数量统计

This commit is contained in:
李鹏飞 2022-10-21 10:17:44 +08:00
parent 00616b7fa0
commit a74043952e
5 changed files with 99 additions and 8 deletions

View File

@ -0,0 +1,63 @@
ALTER VIEW [dbo].[View_HJGL_Pipeline]
AS
/*************¹ÜÏßÊÓͼ*****************/
SELECT pipeline.PipelineId,
pipeline.ProjectId,
pipeline.UnitId,
pipeline.UnitWorkId,
pipeline.PipelineCode,
pipeline.SingleName,
pipeline.SingleNumber,
pipeline.PipingClassId,
pipeline.MediumId,
pipingClass.PipingClassCode,
pipeline.DetectionRateId,
rate.DetectionRateCode,
pipeline.DetectionType,
pipeline.TestPressure,
pipeline.TestMedium,
pipeline.PressurePipingClassId,
pc.PressurePipingClassCode,
pipeline.PipeLenth,
pipeline.DesignPress,
pipeline.DesignTemperature,
pipeline.Remark,
pipeline.LeakPressure,
pipeline.LeakMedium,
pipeline.VacuumPressure,
pipeline.PCMedium ,
pipeline.PCtype,
pipeline.MaterialId,
pipeline.PipeArea,
mat.MaterialCode,
lea.MediumName AS LeakMediumName,
pur.PurgeMethodName AS PCMediumName,
CAST((SELECT SUM(ISNULL(Size,0)) FROM dbo.HJGL_WeldJoint WHERE PipelineId=pipeline.PipelineId) AS DECIMAL(8,3)) AS TotalDin,
CAST((SELECT ISNULL(SUM(ISNULL(jot.Size,0)),0) FROM dbo.HJGL_WeldJoint jot WHERE jot.PipelineId=pipeline.PipelineId AND jot.WeldingDailyId IS NOT NULL) AS DECIMAL(8,3)) AS FinishSize,
(SELECT COUNT(WeldJointId) FROM dbo.HJGL_WeldJoint WHERE PipelineId=pipeline.PipelineId and IsTwoJoint is null) AS JointCount,
unit.UnitName,
workArea.UnitWorkCode,
medium.MediumCode,
medium.MediumName AS MediumName,
testMedium.MediumCode AS TestMediumCode,
pipeline.ActEndDate AS FinishedDate,
pipeline.IsFinished
FROM dbo.HJGL_Pipeline AS pipeline
LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=pipeline.PipingClassId
LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=pipeline.UnitId
LEFT JOIN WBS_UnitWork AS workArea ON workArea.UnitWorkId=pipeline.UnitWorkId
LEFT JOIN Base_Medium AS medium ON medium.MediumId=pipeline.MediumId
LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId=pipeline.TestMedium
LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = pipeline.DetectionRateId
LEFT JOIN dbo.Base_PressurePipingClass pc ON pc.PressurePipingClassId = pipeline.PressurePipingClassId
LEFT JOIN dbo.Base_TestMedium AS lea ON lea.TestMediumId=pipeline.LeakMedium
LEFT JOIN dbo.Base_PurgeMethod AS pur ON pur.PurgeMethodId=pipeline.PCMedium
LEFT JOIN dbo.Base_Material AS mat ON mat.MaterialId=pipeline.MaterialId
GO

View File

@ -545,7 +545,7 @@ namespace BLL
{ {
var getPersons = from x in db.Person_Persons var getPersons = from x in db.Person_Persons
where x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId where x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId
&& (x.IsPost == true || !x.IsPost.HasValue) && x.RoleIds != null && (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
select x; select x;
if (listUnitIds.Count() > 0) if (listUnitIds.Count() > 0)
{ {

View File

@ -254,7 +254,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
select x).ToList(); select x).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 == null select x).Count(); var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count();
//var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count(); //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)

View File

@ -127,17 +127,45 @@ namespace FineUIPro.Web.HJGL.WeldingManage
select x).ToList(); select x).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 weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.WeldingDailyId != null select x).Count();
//TreeNode newNode = new TreeNode();
//if (jotCount > weldJotCount)
//{
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//}
//else
//{
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
//}
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();
var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.WeldingDailyId != null select x).Count(); var AuditCount= (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate !=null select x).Count();
TreeNode newNode = new TreeNode(); TreeNode newNode = new TreeNode();
if (jotCount > weldJotCount)
if (jotCount== AuditCount) //全部审核
{ {
newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>"; newNode.Text = "<font color='##00FF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
} }
else else if ( AuditCount==0) //全部未审核
{ {
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; newNode.Text = "<font color='##FF0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
} }
else //部分审核
{
newNode.Text = "<font color='##FFFF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
}
//if (jotCount > weldJotCount)
//{
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//}
//else
//{
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
//}
newNode.ToolTip = "管线号【焊口数】"; newNode.ToolTip = "管线号【焊口数】";
newNode.NodeID = item.PipelineId; newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true; newNode.EnableClickEvent = true;

View File

@ -919,7 +919,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
weldJoint.WeldTypeId = PipelineList[i].WeldTypeId; weldJoint.WeldTypeId = PipelineList[i].WeldTypeId;
weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId; weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId;
weldJoint.JointAttribute = PipelineList[i].JointAttribute; weldJoint.JointAttribute = PipelineList[i].JointAttribute;
weldJoint.ProjectId= this.CurrUser.LoginProjectId;
var isExistJot = Funs.DB.HJGL_WeldJoint.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode); var isExistJot = Funs.DB.HJGL_WeldJoint.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode);
if (isExistJot != null) // 更新焊口 if (isExistJot != null) // 更新焊口
{ {