diff --git a/DataBase/版本日志/SGGLDB_V2023-11-22.sql b/DataBase/版本日志/SGGLDB_V2023-11-22.sql
new file mode 100644
index 00000000..a031201e
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-11-22.sql
@@ -0,0 +1,172 @@
+
+ALTER VIEW [dbo].[View_HJGL_WeldJoint]
+AS
+SELECT jot.[ProjectId] --ĿId
+ ,pipe.[UnitWorkId] --λId
+ ,uw.UnitWorkName --λ
+ ,pipe.[UnitId] --λId
+ ,unit.UnitName --λ
+ ,jot.[PipelineCode] --ߺ
+ ,pipe.[SingleNumber] --ͼ
+ ,pipe.[SingleName] --ͼֽ
+ ,pipe.[MediumId] --Id
+ ,medium.MediumCode
+ ,medium.MediumName --
+ ,pipe.[PipingClassId] --ܵȼId
+ ,pipingClass.PipingClassCode --ܵȼ
+ ,pipe.[DetectionRateId] --̽˱Id
+ ,dr.DetectionRateCode --̽˱51020
+ ,pipe.DetectionType --̽Id(ܶм|ָ)
+ ,STUFF((SELECT ',' + DetectionTypeCode FROM Base_DetectionType
+ WHERE CHARINDEX('|'+LTRIM(DetectionTypeId)+'|','|'+ pipe.DetectionType + '|') > 0 FOR XML PATH('') ), 1, 1, '') AS DetectionTypeStr --̽ͣܶм,ָ
+ ,pipe.DesignTemperature --¶ȡ
+ ,pipe.DesignPress --ѹMpa(g)
+ ,pipe.TestMedium --ѹId
+ ,tm.MediumName AS TestMediumName --ѹ
+ ,pipe.TestPressure --ѹѹMpa(g)
+ ,pipe.PressurePipingClassId --ѹܵId
+ ,ppc.PressurePipingClassCode --ѹܵ
+ ,pipe.PipeLenth --߳(m)
+ ,pipe.LeakMedium --й¶Id
+ ,tm2.MediumName AS LeakMediumName --й¶
+ ,pipe.LeakPressure --й¶ѹMpa(g)
+ ,pipe.PCMedium --ϴҪId
+ ,pm.PurgeMethodCode --ϴҪ
+ ,pipe.VacuumPressure --ѹKpa(a)
+ ,pipe.MaterialId --Id
+ ,mat.MaterialCode AS PipeMaterialCode --
+ ,pipe.Remark AS PipeRemark --ע
+ ,pipe.FlowingSection as FlowingSection --ˮ
+ ,jot.[WeldJointId] --Id
+ ,jot.[WeldJointCode] --ں
+ ,jot.[Material1Id] --1Id
+ ,mat1.MaterialCode AS Material1Code --1
+ ,jot.[Material2Id] --2Id
+ ,mat2.MaterialCode AS Material2Code --2
+ ,jot.[Dia] --⾶
+ ,jot.DNDia --DNֱ
+ ,jot.[Size] --
+ ,jot.[Thickness] --ں
+ ,jot.[Specification] --
+ ,jot.[WeldTypeId] --Id
+ ,WeldType.WeldTypeCode --
+ ,jot.[DetectionTypeId] --Id
+ ,ndt.DetectionTypeCode --
+ ,jot.[Components1Id] --1Id
+ ,com1.ComponentsCode AS ComponentsCode1 --1
+ ,jot.[Components2Id] --2Id
+ ,com2.ComponentsCode AS ComponentsCode2 --2
+ ,jot.DesignIsHotProess --Ƿȴ
+ ,CASE jot.DesignIsHotProess WHEN 1 THEN '' ELSE '' END AS DesignIsHotProessStr --Ƿȴ
+ ,jot.[WeldingMethodId] --ӷId
+ ,WeldingMethod.WeldingMethodCode --ӷ
+ ,jot.WPQId --WPSId
+ ,wps.WPQCode --WPS
+ ,jot.[GrooveTypeId] --¿Id
+ ,GrooveType.GrooveTypeCode --¿
+ ,jot.[WeldingRod] --Id
+ ,rod.ConsumablesCode AS WeldingRodCode --
+ ,jot.[WeldingWire] --˿Id
+ ,wire.ConsumablesCode AS WeldingWireCode --˿
+ ,jot.PreTemperature --Ԥ¶
+ ,jot.[JointAttribute] --
+ ,jot.TwoJointType --κ
+ ,pipe.PipeArea --Ԥ/ֳװ
+ ,daily.WeldingDate as WeldingDateD
+ ,CONVERT(VARCHAR(100), daily.WeldingDate, 23) AS WeldingDate --
+ ,BackingWelder.WelderCode AS BackingWelderCode --
+ ,CoverWelder.WelderCode AS CoverWelderCode --溸
+ ,(CASE (SELECT COUNT(*) FROM [dbo].[HJGL_HotProess_TrustItem] hpti
+ WHERE hpti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(ReportNo,'') FROM [dbo].[HJGL_HotProess_Trust] hpt
+ LEFT JOIN [dbo].[HJGL_HotProess_TrustItem] hpti ON hpti.HotProessTrustId=hpt.HotProessTrustId
+ WHERE hpti.WeldJointId=jot.WeldJointId) END) AS HotProessReportNo --ȴ
+ ,(CASE (SELECT TOP 1 IsCompleted FROM [dbo].[HJGL_HotProess_TrustItem] hpti
+ WHERE hpti.WeldJointId=jot.WeldJointId) WHEN 1 THEN '' WHEN 0 THEN 'δ' ELSE 'δȴ' END) AS HotProessResult --ȴ
+ ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Hard_TrustItem hti
+ WHERE hti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(InspectionNum,'') FROM [dbo].HJGL_Hard_Trust ht
+ LEFT JOIN [dbo].HJGL_Hard_TrustItem hti ON hti.HardTrustID=ht.HardTrustID
+ WHERE hti.WeldJointId=jot.WeldJointId) END) AS HardReportNo --Ӳȱ
+ ,(CASE (SELECT TOP 1 IsPass FROM [dbo].HJGL_Hard_TrustItem hti
+ WHERE hti.WeldJointId=jot.WeldJointId) WHEN 1 THEN 'ϸ' WHEN 0 THEN 'ϸ' ELSE '' END) AS HardResult --Ӳȼ
+ ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Batch_BatchTrustItem bti
+ WHERE bti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 TrustBatchCode FROM [dbo].HJGL_Batch_BatchTrust bt
+ LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchId=bt.TrustBatchId
+ WHERE bti.WeldJointId=jot.WeldJointId) END) AS TrustBatchCode --ίе
+ ,(CASE (SELECT COUNT(*) FROM [dbo].HJGL_Batch_NDEItem ndei
+ LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId
+ WHERE bti.WeldJointId=jot.WeldJointId) WHEN 0 THEN '' ELSE (SELECT TOP 1 ISNULL(NDECode,'') FROM [dbo].HJGL_Batch_NDE nde
+ LEFT JOIN [dbo].HJGL_Batch_NDEItem ndei ON ndei.NDEID=nde.NDEID
+ LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId
+ WHERE bti.WeldJointId=jot.WeldJointId) END) AS NDECode --ⵥ
+ ,(CASE (SELECT TOP 1 CheckResult FROM [dbo].HJGL_Batch_NDEItem ndei
+ LEFT JOIN [dbo].HJGL_Batch_BatchTrustItem bti ON bti.TrustBatchItemId=ndei.TrustBatchItemId
+ WHERE bti.WeldJointId=jot.WeldJointId) WHEN '1' THEN 'ϸ' WHEN '2' THEN 'ϸ' ELSE '' END) AS CheckResult --
+ ,jot.PipelineId
+ ,jot.[JointArea]
+ ,jot.[WeldingLocationId]
+ ,jot.[HeartNo1]
+ ,jot.[HeartNo2]
+ ,jot.[IsHotProess]
+ ,jot.[WeldingDailyId]
+ ,jot.[BackingWelderId]
+ ,jot.[CoverWelderId]
+ ,jot.WeldingMode
+ ,jot.Remark
+ ,jot.IsTwoJoint
+ ,jot.SubmitMan
+ ,jot.AuditMan
+ ,jot.AuditMan2
+ ,jot.AuditDate
+ ,jot.AuditDate2
+ ,WeldingLocation.WeldingLocationCode
+ ,CASE WHEN jot.WeldingDailyId IS NULL THEN '' ELSE '' END AS IsWelding
+ ,CASE WHEN jot.IsHotProess=1 THEN '' ELSE '' END AS IsHotProessStr,
+ BackingWelder.PersonName AS BackingWelderName,
+ CoverWelder.PersonName AS CoverWelderName,
+ (CASE WHEN CoverWelder.WelderCode IS NOT NULL AND BackingWelder.WelderCode IS NOT NULL
+ THEN CoverWelder.WelderCode + '/' + BackingWelder.WelderCode
+ ELSE (ISNULL(CoverWelder.WelderCode,'') + ISNULL(BackingWelder.WelderCode,'')) END) AS WelderCode, --
+ (CASE WHEN mat1.MaterialCode IS NOT NULL AND mat2.MaterialCode IS NOT NULL
+ THEN mat1.MaterialCode + '/' + mat2.MaterialCode
+ ELSE (ISNULL(mat1.MaterialCode,'') + ISNULL(mat2.MaterialCode,'')) END) AS MaterialCode, --
+
+ daily.WeldingDailyCode,
+ pointItem.PointBatchId,
+ point.PointBatchCode,
+ (CASE WHEN pointItem.PointState='1' THEN 'ѵ' WHEN pointItem.PointState='2' THEN '' ELSE '' END) AS IsPoint
+ FROM [dbo].[HJGL_WeldJoint] jot
+LEFT JOIN dbo.HJGL_Pipeline pipe ON pipe.PipelineId=jot.PipelineId
+LEFT JOIN dbo.WBS_UnitWork uw ON uw.UnitWorkId=pipe.UnitWorkId
+LEFT JOIN dbo.Base_Unit unit ON unit.UnitId=pipe.UnitId
+LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=jot.WeldTypeId
+LEFT JOIN dbo.Base_DetectionRate dr ON dr.DetectionRateId = pipe.DetectionRateId
+LEFT JOIN Base_TestMedium tm ON tm.TestMediumId=pipe.TestMedium
+LEFT JOIN Base_TestMedium tm2 ON tm2.TestMediumId=pipe.LeakMedium
+LEFT JOIN Base_PurgeMethod pm ON pm.PurgeMethodId=pipe.PCMedium
+LEFT JOIN Base_PressurePipingClass ppc ON ppc.PressurePipingClassId=pipe.PressurePipingClassId
+LEFT JOIN Base_Material AS mat ON mat.MaterialId = pipe.MaterialId
+LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = jot.Material1Id
+LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = jot.Material2Id
+LEFT JOIN Base_WeldingMethod AS WeldingMethod ON WeldingMethod.WeldingMethodId=jot.WeldingMethodId
+LEFT JOIN Base_WeldingLocation AS WeldingLocation ON WeldingLocation.WeldingLocationId=jot.WeldingLocationId
+LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire
+LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod
+LEFT JOIN Base_GrooveType AS GrooveType ON GrooveType.GrooveTypeId=jot.GrooveTypeId
+LEFT JOIN Base_Components AS com1 ON com1.ComponentsId = jot.Components1Id
+LEFT JOIN Base_Components AS com2 ON com2.ComponentsId = jot.Components2Id
+LEFT JOIN SitePerson_Person AS BackingWelder ON BackingWelder.PersonId=jot.BackingWelderId and BackingWelder.ProjectId=jot.ProjectId
+LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=jot.CoverWelderId and CoverWelder.ProjectId=jot.ProjectId
+LEFT JOIN dbo.HJGL_WeldingDaily AS daily ON daily.WeldingDailyId=jot.WeldingDailyId
+LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId=pipe.PipingClassId
+LEFT JOIN dbo.Base_Medium medium ON medium.MediumId = pipe.MediumId
+LEFT JOIN dbo.Base_DetectionType ndt ON ndt.DetectionTypeId = jot.DetectionTypeId
+LEFT JOIN dbo.WPQ_WPQList wps ON wps.WPQId = jot.WPQId
+LEFT JOIN dbo.HJGL_Batch_PointBatchItem pointItem ON pointItem.WeldJointId = jot.WeldJointId
+LEFT JOIN dbo.HJGL_Batch_PointBatch point ON point.PointBatchId = pointItem.PointBatchId
+
+
+
+
+GO
+
+
diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs
index 8ec4b3db..96d64f9a 100644
--- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs
+++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs
@@ -20,24 +20,24 @@ namespace BLL
///
/// 工厂预制
///
- public const string PipeArea_SHOP="1";
+ public const string PipeArea_SHOP = "1";
///
/// 现场安装
///
- public const string PipeArea_FIELD = "2";
+ public const string PipeArea_FIELD = "2";
public const int pageSize = 20;
public static List hJGL_Pipelines
{
-
- get;
- set;
-
+
+ get;
+ set;
+
}
///
/// 实际日期类型
///
- public enum ActDateType
+ public enum ActDateType
{
///
/// 实际开始日期(预制)
@@ -46,16 +46,16 @@ namespace BLL
///
/// 实际完成日期(预制)
///
- ActDateEnd_Shop ,
+ ActDateEnd_Shop,
///
/// 实际开始日期(安装)
///
- ActDateStart_FIELD ,
+ ActDateStart_FIELD,
///
/// 实际完成日期(安装)
///
- ActDateEnd_FIELD ,
- }
+ ActDateEnd_FIELD,
+ }
///
/// 管线划分
///
@@ -67,7 +67,7 @@ namespace BLL
list[1] = new ListItem("现场安装", PipeArea_FIELD);
return list;
}
- public static void RestPipelineAndJoints(string projectid )
+ public static void RestPipelineAndJoints(string projectid)
{
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid);
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid);
@@ -92,7 +92,7 @@ namespace BLL
var PlanEndDate = mdoel.PlanEndDate;
var ActStartDate = new DateTime?();
var ActEndDate = new DateTime?();
- if (!string .IsNullOrEmpty(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD)))
+ if (!string.IsNullOrEmpty(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD)))
{
ActStartDate = Convert.ToDateTime(GetDateByPipelineId(pipelineId, ActDateType.ActDateStart_FIELD));
}
@@ -100,22 +100,22 @@ namespace BLL
{
ActEndDate = Convert.ToDateTime(GetDateByPipelineId(pipelineId, ActDateType.ActDateEnd_FIELD));
}
- if (PlanStartDate==null|| PlanEndDate==null)
+ if (PlanStartDate == null || PlanEndDate == null)
{
mdoel.State = 0;
UpdatePipeline(mdoel);
return;
}
- if (ActStartDate==null&&DateTime.Compare(DateTime.Now,PlanStartDate.Value)<0)
+ if (ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) < 0)
{
mdoel.State = 0;
}
- else if(ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) > 0)
+ else if (ActStartDate == null && DateTime.Compare(DateTime.Now, PlanStartDate.Value) > 0)
{
mdoel.State = 1;
}
- else if (ActStartDate!=null && DateTime.Compare(ActStartDate.Value, PlanStartDate.Value)<0 && ActEndDate==null)
+ else if (ActStartDate != null && DateTime.Compare(ActStartDate.Value, PlanStartDate.Value) < 0 && ActEndDate == null)
{
mdoel.State = 2;
}
@@ -138,7 +138,7 @@ namespace BLL
///
public static string GetDateByPipelineId(object pipelineId, ActDateType actDateType)
{
- string result ="";
+ string result = "";
string _pipelineId = pipelineId.ToString();
string ActDateStart_Shop = "";
string ActDateEnd_Shop = "";
@@ -149,15 +149,16 @@ namespace BLL
var joints = BLL.WeldJointService.GetWeldJointsByPipelineId(_pipelineId);
int joint_Shop_count = joints.Where(x => x.JointAttribute == "预制口").Count();
int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count();
- var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode && x.WeldingDailyId!=null
- select x).ToList();
+ var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask
+ where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode && x.WeldingDailyId != null
+ select x).ToList();
var TaskJoints_Shop = TaskJoints.Where(x => x.JointAttribute == "预制口").ToList();
- var TaskJoints_Field= TaskJoints.Where(x => x.JointAttribute == "安装口").ToList();
- if (TaskJoints_Shop.Count>0)
+ var TaskJoints_Field = TaskJoints.Where(x => x.JointAttribute == "安装口").ToList();
+ if (TaskJoints_Shop.Count > 0)
{
ActDateStart_Shop = TaskJoints_Shop.OrderBy(x => x.TaskDate).First().TaskDate.Value.ToShortDateString();
}
- if (joint_Shop_count== TaskJoints_Shop.Count&& joint_Shop_count>0)
+ if (joint_Shop_count == TaskJoints_Shop.Count && joint_Shop_count > 0)
{
ActDateEnd_Shop = TaskJoints_Shop.OrderByDescending(x => x.TaskDate).First().TaskDate.Value.Date.ToShortDateString();
}
@@ -194,14 +195,14 @@ namespace BLL
///
public static void UpdataDateByWeldJointId(string WeldJointId)
{
-
- DateTime ? ActDateStart_FIELD = new DateTime();
- DateTime ? ActDateEnd_FIELD = new DateTime();
+
+ DateTime? ActDateStart_FIELD = new DateTime();
+ DateTime? ActDateEnd_FIELD = new DateTime();
string JointAttribute = "";
- var model_joint=BLL.WeldJointService.GetWeldJointByWeldJointId(WeldJointId);
- if (model_joint!=null)
+ var model_joint = BLL.WeldJointService.GetWeldJointByWeldJointId(WeldJointId);
+ if (model_joint != null)
{
JointAttribute = model_joint.JointAttribute;
var model_pipeline = GetPipelineByPipelineId(model_joint.PipelineId);
@@ -211,7 +212,7 @@ namespace BLL
select x).ToList();
switch (JointAttribute)
{
-
+
case "安装口":
int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count();
var TaskJoints_Field = TaskJoints.Where(x => x.JointAttribute == "安装口").ToList();
@@ -231,8 +232,8 @@ namespace BLL
break;
}
- }
-
+ }
+
}
///
/// 根据管线code获取管线信息
@@ -251,8 +252,8 @@ namespace BLL
public static List GetHJGL_PipelineList(HJGL_Pipeline model)
{
var db = Funs.DB;
- var pipelineList =( from x in Funs.DB.HJGL_Pipeline
- where
+ 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))
&& (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode))
@@ -260,15 +261,15 @@ namespace BLL
&& (string.IsNullOrEmpty(model.DesignPress) || x.DesignPress.Contains(model.DesignPress))
/* && (string.IsNullOrEmpty(model.MaterialCode) || x.MaterialCode.Contains(model.MaterialCode))*/
select x).ToList();
- if (model.IsFinished!=null)
+ if (model.IsFinished != null)
{
- if (model.IsFinished==true)
+ if (model.IsFinished == true)
{
- pipelineList= pipelineList.Where(x => x.IsFinished == true).ToList();
+ pipelineList = pipelineList.Where(x => x.IsFinished == true).ToList();
}
else
{
- pipelineList = pipelineList.Where(x => x.IsFinished == false||x.IsFinished==null).ToList();
+ pipelineList = pipelineList.Where(x => x.IsFinished == false || x.IsFinished == null).ToList();
}
@@ -338,16 +339,17 @@ namespace BLL
///
///
///
- public static List GetNoComPipelinesByUnitWordId(string unitworkId)
+ public static List GetNoComPipelinesByUnitWordId(string unitworkId)
{
var q = (from x in Funs.DB.View_HJGL_WeldJoint
- where x.UnitWorkId == unitworkId
- select new {
- PipelineId=x.PipelineId,
- WeldingDate=x.WeldingDate,
- PipelineCode=x.PipelineCode
+ where x.UnitWorkId == unitworkId
+ select new
+ {
+ PipelineId = x.PipelineId,
+ WeldingDate = x.WeldingDate,
+ PipelineCode = x.PipelineCode
}).Distinct();
- if (q.Count()==0)
+ if (q.Count() == 0)
{
return new List();
}
@@ -359,10 +361,10 @@ namespace BLL
Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(),
};
var NowComPipelineCode = (from x in q
- join y in noCompipeline on x.PipelineId equals y.PipelineId
- where y.Count == 0
- select x.PipelineCode
- ).Distinct(). ToList();
+ join y in noCompipeline on x.PipelineId equals y.PipelineId
+ where y.Count == 0
+ select x.PipelineCode
+ ).Distinct().ToList();
return NowComPipelineCode;
}
///
@@ -370,7 +372,7 @@ namespace BLL
///
///
///
- public static void DownPipeArea_SHOPFile(string projectid,string unitworkid)
+ public static void DownPipeArea_SHOPFile(string projectid, string unitworkid)
{
string templatePath = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut_SHOP.xlsx";
string path = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut_SHOP.xlsx";
@@ -442,7 +444,7 @@ namespace BLL
["Data"] = tb,
};
MiniExcel.SaveAsByTemplate(path, templatePath, value);
- HJGL_DataImportService.DownFile(path.Replace(Funs.RootPath,"") , "焊接施工计划(预制).xlsx");
+ HJGL_DataImportService.DownFile(path.Replace(Funs.RootPath, ""), "焊接施工计划(预制).xlsx");
File.Delete(path);
}
///
@@ -451,7 +453,7 @@ namespace BLL
///
///
public static void DownPipeArea_FIELDFile(string projectid, string unitworkid)
- {
+ {
string templatePath = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut2.xlsx";
string path = Funs.RootPath + @"File\Excel\DataOut\WeldingPlanDataOut2.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
@@ -555,10 +557,10 @@ namespace BLL
q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId);
return q;
}
- ///
- /// 添加管线信息
- ///
- ///
+ ///
+ /// 添加管线信息
+ ///
+ ///
public static void AddPipeline(Model.HJGL_Pipeline pipeline)
{
Model.SGGLDB db = Funs.DB;
@@ -589,7 +591,7 @@ namespace BLL
newPipeline.PCtype = pipeline.PCtype;
newPipeline.MaterialId = pipeline.MaterialId;
newPipeline.State = pipeline.State;
- newPipeline.FlowingSection=pipeline.FlowingSection;
+ newPipeline.FlowingSection = pipeline.FlowingSection;
db.HJGL_Pipeline.InsertOnSubmit(newPipeline);
db.SubmitChanges();
}
@@ -755,7 +757,7 @@ namespace BLL
}
}
- public static void BindTreeNodes(FineUIPro.TreeNode node,string pipecode,string ProjectId,int pageSize)
+ public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode, string ProjectId, int pageSize)
{
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID
@@ -798,7 +800,7 @@ namespace BLL
///
///
///
- public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode,string MaterialCode, string ProjectId, int pageSize)
+ public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode, string MaterialCode, string ProjectId, int pageSize)
{
//var pipeline = (from x in Funs.DB.HJGL_Pipeline
// where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID
@@ -806,8 +808,8 @@ namespace BLL
// orderby x.PipelineCode
// select x).ToList();
var pipeline = (from x in Funs.DB.HJGL_Pipeline
- join y in Funs.DB.HJGL_PipeLineMat.Where(m => m.MaterialCode.Contains(MaterialCode)) on x.PipelineId equals y.PipelineId
- where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(pipecode)
+ join y in Funs.DB.HJGL_PipeLineMat.Where(m => m.MaterialCode.Contains(MaterialCode)) on x.PipelineId equals y.PipelineId
+ where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(pipecode)
select x).Distinct().ToList();
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
@@ -837,23 +839,28 @@ namespace BLL
}
}
}
- public static void BindTreeNodes(FineUIPro.TreeNode node,bool isExitWPQId, string pipecode, string ProjectId, int pageSize)
+ public static void BindTreeNodes(FineUIPro.TreeNode node, bool isExitWPQId, string pipecode, string ProjectId, int pageSize, string pipeArea)
{
+ string pipeAreasql = string.Empty;
+ if (pipeArea != BLL.Const._Null)
+ {
+ pipeAreasql += " AND PipeArea='" + pipeArea + "'";
+ }
if (isExitWPQId)
{
- string strSql = "SELECT distinct PipelineId, PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL order by PipelineCode";
+ string strSql = "SELECT distinct PipelineId, PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql + " order by PipelineCode";
List listStr = new List();
listStr.Add(new SqlParameter("@UnitWorkId", node.NodeID));
- if (!string .IsNullOrEmpty(pipecode))
+ if (!string.IsNullOrEmpty(pipecode))
{
strSql += " and PipelineCode=@PipelineCode ";
- listStr.Add(new SqlParameter("@PipelineCode", ""+ pipecode + ""));
+ listStr.Add(new SqlParameter("@PipelineCode", "" + pipecode + ""));
}
SqlParameter[] parameter = listStr.ToArray();
System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
var pipeline = Funs.TableToEntity(dt);
-
+
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
@@ -890,6 +897,10 @@ namespace BLL
&& x.PipelineCode.Contains(pipecode)
orderby x.PipelineCode
select x).ToList();
+ if (pipeArea != BLL.Const._Null)
+ {
+ pipeline = pipeline.Where(x => x.PipeArea == pipeArea).ToList();
+ }
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId select x).ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx
index cac234bf..ec4922f8 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx
@@ -37,6 +37,10 @@
+
+
0)
{
foreach (var q in unitWork1)
@@ -83,7 +93,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
int a = 0;
if (ckNOEdit.Checked)
{
- string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL";
+ string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql;
List listStr = new List();
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
SqlParameter[] parameter = listStr.ToArray();
@@ -93,7 +103,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
- a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
+ if (this.drpPipeArea.SelectedValue == BLL.Const._Null)
+ {
+ a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
+ }
+ else
+ {
+ a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == this.drpPipeArea.SelectedValue select x).Count();
+ }
}
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
@@ -122,7 +139,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
int a = 0;
if (ckNOEdit.Checked)
{
- string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL";
+ string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql;
List listStr = new List();
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
SqlParameter[] parameter = listStr.ToArray();
@@ -132,11 +149,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
- a = (from x in Funs.DB.HJGL_Pipeline
+ if (this.drpPipeArea.SelectedValue == BLL.Const._Null)
+ {
+ a = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
select x).Count();
-
+ }
+ else
+ {
+ a = (from x in Funs.DB.HJGL_Pipeline
+ where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
+ && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.PipeArea == this.drpPipeArea.SelectedValue
+ select x).Count();
+ }
}
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
@@ -170,11 +196,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
e.Node.Nodes.Clear();
BindNodes(e.Node);
}
-
+
}
private void BindNodes(TreeNode node)
{
- BLL.PipelineService.BindTreeNodes(node, ckNOEdit.Checked, this.txtPipelineCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
+ BLL.PipelineService.BindTreeNodes(node, ckNOEdit.Checked, this.txtPipelineCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize, this.drpPipeArea.SelectedValue);
}
#endregion
@@ -203,7 +229,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
-
+
if (tvControlItem.SelectedNode.CommandName == "管线")
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
@@ -221,7 +247,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
-
+
}
#endregion
@@ -375,16 +401,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
- var jotList = from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == tvControlItem.SelectedNodeID &&x.JointAttribute==drpJointAttribute.SelectedValue select x;
+ var jotList = from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == tvControlItem.SelectedNodeID && x.JointAttribute == drpJointAttribute.SelectedValue select x;
if (jotList.Count() > 0)
{
foreach (var jot in jotList)
{
- List wpqList =BLL.WPQListServiceService.GetMatchWPQ(jot,this.CurrUser.LoginProjectId, drpUnit.SelectedValue);
+ List wpqList = BLL.WPQListServiceService.GetMatchWPQ(jot, this.CurrUser.LoginProjectId, drpUnit.SelectedValue);
Model.HJGL_WeldJoint newJot = new Model.HJGL_WeldJoint();
if (wpqList != null)
{
-
+
Model.WPQ_WPQList wps = BLL.WPQListServiceService.GetWPQById(wpqList.First().WPQId);
newJot.WPQId = wps.WPQId;
@@ -397,7 +423,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
newJot.IsHotProess = wps.IsHotProess;
newJot.MatchableWPQ = string.Join(",", wpqList.Select(x => x.WPQCode));
-
+
}
else
{
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.designer.cs
index 831d6804..b9d45417 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldingConDate.aspx.designer.cs
@@ -7,13 +7,11 @@
// 自动生成>
//------------------------------------------------------------------------------
-namespace FineUIPro.Web.HJGL.WeldingManage
-{
-
-
- public partial class WeldingConDate
- {
-
+namespace FineUIPro.Web.HJGL.WeldingManage {
+
+
+ public partial class WeldingConDate {
+
///
/// form1 控件。
///
@@ -22,7 +20,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// PageManager1 控件。
///
@@ -31,7 +29,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.PageManager PageManager1;
-
+
///
/// Panel1 控件。
///
@@ -40,7 +38,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel Panel1;
-
+
///
/// panelLeftRegion 控件。
///
@@ -49,7 +47,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel panelLeftRegion;
-
+
///
/// Toolbar1 控件。
///
@@ -58,7 +56,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar1;
-
+
///
/// txtPipelineCode 控件。
///
@@ -67,7 +65,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtPipelineCode;
-
+
///
/// ckNOEdit 控件。
///
@@ -76,7 +74,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.CheckBox ckNOEdit;
-
+
+ ///
+ /// drpPipeArea 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpPipeArea;
+
///
/// hdUnitWorkId 控件。
///
@@ -85,7 +92,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.HiddenField hdUnitWorkId;
-
+
///
/// btnTreeFind 控件。
///
@@ -94,7 +101,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnTreeFind;
-
+
///
/// tvControlItem 控件。
///
@@ -103,7 +110,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Tree tvControlItem;
-
+
///
/// panelCenterRegion 控件。
///
@@ -112,7 +119,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Panel panelCenterRegion;
-
+
///
/// Toolbar3 控件。
///
@@ -121,7 +128,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Toolbar Toolbar3;
-
+
///
/// txtWeldJointCode 控件。
///
@@ -130,7 +137,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.TextBox txtWeldJointCode;
-
+
///
/// rbInput 控件。
///
@@ -139,7 +146,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.RadioButtonList rbInput;
-
+
///
/// drpUnit 控件。
///
@@ -148,7 +155,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpUnit;
-
+
///
/// drpJointAttribute 控件。
///
@@ -157,7 +164,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList drpJointAttribute;
-
+
///
/// ToolbarFill1 控件。
///
@@ -166,7 +173,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarFill ToolbarFill1;
-
+
///
/// btnAutoInput 控件。
///
@@ -175,7 +182,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnAutoInput;
-
+
///
/// btnEdit 控件。
///
@@ -184,7 +191,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnEdit;
-
+
///
/// Grid1 控件。
///
@@ -193,7 +200,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Grid Grid1;
-
+
///
/// ToolbarSeparator1 控件。
///
@@ -202,7 +209,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
-
+
///
/// ToolbarText1 控件。
///
@@ -211,7 +218,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.ToolbarText ToolbarText1;
-
+
///
/// ddlPageSize 控件。
///
@@ -220,7 +227,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.DropDownList ddlPageSize;
-
+
///
/// Window1 控件。
///
@@ -229,7 +236,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Window Window1;
-
+
///
/// Window2 控件。
///
@@ -238,7 +245,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Window Window2;
-
+
///
/// Window3 控件。
///
@@ -247,7 +254,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Window Window3;
-
+
///
/// Menu 控件。
///
@@ -256,7 +263,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Menu Menu;
-
+
///
/// btnMenuEdit 控件。
///
@@ -265,7 +272,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.MenuButton btnMenuEdit;
-
+
///
/// btnView 控件。
///
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index d5755eb8..348bf7fd 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -273628,6 +273628,8 @@ namespace Model
private string _TwoJointType;
+ private string _PipeArea;
+
private System.Nullable _WeldingDateD;
private string _WeldingDate;
@@ -274814,6 +274816,22 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipeArea", DbType="NChar(1)")]
+ public string PipeArea
+ {
+ get
+ {
+ return this._PipeArea;
+ }
+ set
+ {
+ if ((this._PipeArea != value))
+ {
+ this._PipeArea = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingDateD", DbType="DateTime")]
public System.Nullable WeldingDateD
{
@@ -293173,7 +293191,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(200)")]
public string Name
{
get
@@ -293734,7 +293752,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")]
public string PackageContent
{
get
@@ -293925,7 +293943,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")]
public string PackageContent
{
get
@@ -299184,7 +299202,7 @@ namespace Model
}
}
- [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")]
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")]
public string PackageContent
{
get