diff --git a/DataBase/版本日志/SGGLDB_V2026-05-19-gf.sql b/DataBase/版本日志/SGGLDB_V2026-05-19-gf.sql
index 087bc6ba..2e89698a 100644
--- a/DataBase/版本日志/SGGLDB_V2026-05-19-gf.sql
+++ b/DataBase/版本日志/SGGLDB_V2026-05-19-gf.sql
@@ -4,4 +4,13 @@ GO
insert into Sys_Menu
values('2F027233-22EC-4063-A04F-FB9FE6A91588','ϲֿ',null,'HJGL/BaseInfo/Warehouse.aspx',30,'60F4B988-4D1D-48D6-A959-2EA4BD2978A1','Menu_HJGL',0,1,1)
-GO
\ No newline at end of file
+GO
+ INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES('CFDC5365-2050-49F2-B1E5-8E5B7DA2D5DC','2F027233-22EC-4063-A04F-FB9FE6A91588','',1)
+ INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES('E6303B08-335C-47B5-B1F9-AD2E70068838','2F027233-22EC-4063-A04F-FB9FE6A91588','',2)
+ INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES('F7D6FE99-01C2-465E-8029-CF83BCB1362E','2F027233-22EC-4063-A04F-FB9FE6A91588','ɾ',3)
+ INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES('DE51285D-5F2C-4122-BD80-C8CC2A68D027','2F027233-22EC-4063-A04F-FB9FE6A91588','',4)
+ GO
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2026-05-25-gf-002.sql b/DataBase/版本日志/SGGLDB_V2026-05-25-gf-002.sql
new file mode 100644
index 00000000..37c51ebd
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-05-25-gf-002.sql
@@ -0,0 +1,2 @@
+alter table Tw_InOutPlanDetail add DeliveryDate datetime null
+GO
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2026-05-25-gf.sql b/DataBase/版本日志/SGGLDB_V2026-05-25-gf.sql
new file mode 100644
index 00000000..75d4c4f1
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-05-25-gf.sql
@@ -0,0 +1,3 @@
+alter table HJGL_MaterialCodeLib add BatchNo nvarchar(50) null
+alter table Tw_InOutPlanDetail add BatchNo nvarchar(50) null
+GO
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql
new file mode 100644
index 00000000..d91b7bf3
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-05-25-lpf.sql
@@ -0,0 +1 @@
+UPDATE Sys_Menu set SuperMenu ='0' , SortIndex ='14' where MenuId ='1C6F9CA9-FDAC-4CE5-A19C-5536538851E1';
\ No newline at end of file
diff --git a/DataBase/版本日志/SGGLDB_V2026-05-26-gf.sql b/DataBase/版本日志/SGGLDB_V2026-05-26-gf.sql
new file mode 100644
index 00000000..88e1dc90
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-05-26-gf.sql
@@ -0,0 +1,2 @@
+alter table [dbo].[HJGL_MaterialCodeLib] add Code nvarchar(50) null
+GO
\ No newline at end of file
diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs
index d0831ae5..896701d7 100644
--- a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs
+++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs
@@ -70,6 +70,9 @@ namespace BLL
StockNum = m == null ? 0 : (decimal)m.StockNum,
NeedNum = x == null ? 0 : x.NeedNum,
RealNum = y == null ? 0 : y.RealNum,
+ Code = z == null ? null : z.Code,
+ HeatNo = z == null ? null : z.HeatNo,
+ BatchNo = z == null ? null : z.BatchNo,
MaterialName = z == null ? null : z.MaterialName,
MaterialSpec = z == null ? null : z.MaterialSpec,
MaterialUnit = z == null ? null : z.MaterialUnit,
@@ -213,6 +216,9 @@ var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStoc
PipelineCode = z.PipelineCode,
PrefabricatedComponents = x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
+ Code = y.Code,
+ HeatNo = y.HeatNo,
+ BatchNo = y.BatchNo,
MaterialName = y.MaterialName,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
@@ -240,7 +246,7 @@ var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStoc
///
///
///
- public static List GetPipeMatMatch(string projectId, List pipelineIds, string warehouseCode)
+ public static List GetPipeMatMatch(string projectId, List pipelineIds, string warehouseCode, Dictionary> priorityComponents = null)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
@@ -261,6 +267,9 @@ var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStoc
UnitWorkName = m.UnitWorkName,
PrefabricatedComponents = x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
+ Code = y.Code,
+ HeatNo = y.HeatNo,
+ BatchNo = y.BatchNo,
MaterialName = y.MaterialName,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
@@ -271,7 +280,20 @@ var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStoc
var newRequiredMaterials = new List();
foreach (string id in pipelineIds)
{
- newRequiredMaterials.AddRange(requiredMaterials.Where(x => x.PipelineId == id));
+ var pipelineMaterials = requiredMaterials.Where(x => x.PipelineId == id).ToList();
+ if (priorityComponents != null && priorityComponents.ContainsKey(id) && priorityComponents[id] != null && priorityComponents[id].Any())
+ {
+ var components = priorityComponents[id];
+ newRequiredMaterials.AddRange(pipelineMaterials
+ .Where(x => components.Contains(x.PrefabricatedComponents))
+ .OrderBy(x => components.IndexOf(x.PrefabricatedComponents)));
+ newRequiredMaterials.AddRange(pipelineMaterials
+ .Where(x => !components.Contains(x.PrefabricatedComponents)));
+ }
+ else
+ {
+ newRequiredMaterials.AddRange(pipelineMaterials);
+ }
}
results = GetMatMatchOutput(newRequiredMaterials, warehouseCode, projectId);
return results;
diff --git a/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs b/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs
index f8f618b1..ea011d04 100644
--- a/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs
+++ b/SGGL/BLL/CLGL/TwInOutplandetailRelationService.cs
@@ -66,6 +66,9 @@ namespace BLL
y.PipelineCode,
x.InOutPlanMasterId,
x.MaterialCode,
+ Code = mat.Code,
+ mat.HeatNo,
+ mat.BatchNo,
x.PrefabricatedComponents,
x.Number,
mat.MaterialName,
@@ -219,7 +222,10 @@ namespace BLL
出库单编号 = master.CusBillCode,
管线号 = pipe.PipelineCode,
预制组件号 = x.PrefabricatedComponents,
- 材料编码 = x.MaterialCode,
+ 材料主编码 = x.MaterialCode,
+ 材料编码 = y.Code,
+ 炉号 = y.HeatNo,
+ 批号 = y.BatchNo,
材料名称 = y.MaterialName,
材料描述 = y.MaterialDef,
单位 = y.MaterialUnit,
@@ -228,4 +234,4 @@ namespace BLL
return q;
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/CLGL/TwInOutplandetailService.cs b/SGGL/BLL/CLGL/TwInOutplandetailService.cs
index 077be9c0..aec9d136 100644
--- a/SGGL/BLL/CLGL/TwInOutplandetailService.cs
+++ b/SGGL/BLL/CLGL/TwInOutplandetailService.cs
@@ -43,13 +43,16 @@ namespace BLL
InOutPlanMasterId = x.InOutPlanMasterId,
PipelineComponentId = x.PipelineComponentId,
MaterialCode = x.MaterialCode,
+ Code = mat.Code,
HeatNo = x.HeatNo,
+ BatchNo = x.BatchNo,
PlanNum = x.PlanNum,
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
MaterialName = mat.MaterialName,
MaterialDef = mat.MaterialDef,
StockNum = stock.StockNum ?? 0,
+ DeliveryDate = x.DeliveryDate,
}
;
@@ -117,11 +120,13 @@ namespace BLL
Id = SQLHelper.GetNewID(),
InOutPlanMasterId = inoutPlanMasterId,
PipelineComponentId = item.PipelineComponentId,
- MaterialCode = item.MaterialCode,
+ MaterialCode = item.MaterialCode + "-" + item.HeatNo + "-" + item.BatchNo,
PlanNum = item.PlanNum,
ActNum = item.ActNum,
SortIndex = sortIndex,
- HeatNo = item.HeatNo
+ HeatNo = item.HeatNo,
+ BatchNo = item.BatchNo,
+ DeliveryDate = item.DeliveryDate
};
sortIndex++;
details.Add(table);
@@ -196,4 +201,4 @@ namespace BLL
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs
index 679af536..c7a4032d 100644
--- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs
+++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs
@@ -275,9 +275,9 @@ namespace BLL
{
//if (temeplateDtoIns.Count == 0)
//{
- responeData.code = 0;
- responeData.message = errorWarehouseCode + "仓库不存在!";
- return responeData;
+ responeData.code = 0;
+ responeData.message = errorWarehouseCode + "仓库不存在!";
+ return responeData;
//}
}
var typeString = temeplateDtoIns.Select(x => x.TypeString).Distinct().ToList(); //获取导入文件的类型
@@ -293,7 +293,20 @@ namespace BLL
responeData.message = errorWarehouseCode + "每次只能导入一种类型!";
return responeData;
}
-
+ var dateTypeString = temeplateDtoIns.Select(x => x.DeliveryDate).Distinct().ToList(); //获取导入文件的类型
+ foreach (var item in dateTypeString)
+ {
+ try
+ {
+ DateTime date = Convert.ToDateTime(item);
+ }
+ catch (Exception)
+ {
+ responeData.code = 0;
+ responeData.message = errorWarehouseCode + "到货时间[" + item + "]格式错误!";
+ return responeData;
+ }
+ }
//var materialCodeList = temeplateDtoIns.Select(x => x.MaterialCode).Distinct().ToList(); //获取导入文件的材料编码
//var IsExitMaterialCode =
@@ -707,18 +720,41 @@ namespace BLL
return;
}
var pipelineList = db.View_HJGL_WeldingTask.Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date && e.SerialNumber == serialNumber).OrderBy(x => x.PipeLineSortIndex).Select(x => x.PipelineId).Distinct().ToList();
+ var taskWeldJointIds = db.View_HJGL_WeldingTask
+ .Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date && e.SerialNumber == serialNumber && e.WeldJointId != null)
+ .Select(e => e.WeldJointId)
+ .Distinct()
+ .ToList();
+ var taskComponents = (from relation in db.HJGL_Pipeline_ComponentJoint
+ join component in db.HJGL_Pipeline_Component on relation.PipelineComponentId equals component.PipelineComponentId into componentJoin
+ from componentItem in componentJoin.DefaultIfEmpty()
+ join weldJointItem in db.HJGL_WeldJoint on relation.WeldJointId equals weldJointItem.WeldJointId
+ where taskWeldJointIds.Contains(relation.WeldJointId)
+ && weldJointItem.PipelineId != null
+ && (relation.PipelineComponentCode != null || (componentItem != null && componentItem.PipelineComponentCode != null))
+ select new
+ {
+ PipelineId = weldJointItem.PipelineId,
+ PipelineComponentCode = componentItem != null && componentItem.PipelineComponentCode != null ? componentItem.PipelineComponentCode : relation.PipelineComponentCode
+ }).Distinct().ToList();
//领料出库需要排除散件材料
- var MaterDatial = from x in db.HJGL_PipeLineMat
- join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
- where pipelineList.Contains(x.PipelineId) && x.PrefabricatedComponents != null
- select new
- {
- x.PipelineId,
- x.PrefabricatedComponents,
- x.MaterialCode,
- x.Number,
- y.MaterialUnit,
- };
+ var allMaterDatial = (from x in db.HJGL_PipeLineMat
+ join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
+ where pipelineList.Contains(x.PipelineId) && x.PrefabricatedComponents != null
+ select new
+ {
+ x.PipelineId,
+ x.PrefabricatedComponents,
+ x.MaterialCode,
+ x.Number,
+ y.MaterialUnit,
+ }).ToList();
+ var componentPipelineIds = taskComponents.Select(x => x.PipelineId).Distinct().ToList();
+ var MaterDatial = taskComponents.Any()
+ ? allMaterDatial.Where(mat => !componentPipelineIds.Contains(mat.PipelineId)
+ || taskComponents.Any(component => component.PipelineId == mat.PipelineId
+ && component.PipelineComponentCode == mat.PrefabricatedComponents)).ToList()
+ : allMaterDatial;
//var outMateriaList = from x in db.HJGL_PipeLineMat
// join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
// where pipelineList.Contains(x.PipelineId)
@@ -774,7 +810,7 @@ namespace BLL
};
TwInOutplandetailService.Add(detail);
}
- var twinoutplandetailRelationList = MaterDatial.ToList().Select(x => new Tw_InOutPlanDetail_Relation
+ var twinoutplandetailRelationList = MaterDatial.Select(x => new Tw_InOutPlanDetail_Relation
{
PipelineId = x.PipelineId,
MaterialCode = x.MaterialCode,
@@ -813,7 +849,7 @@ namespace BLL
};
TwInOutplandetailService.Add(detail);
}
- var twinoutplandetailRelationList = MaterDatial.ToList().Select(x => new Tw_InOutPlanDetail_Relation
+ var twinoutplandetailRelationList = MaterDatial.Select(x => new Tw_InOutPlanDetail_Relation
{
PipelineId = x.PipelineId,
MaterialCode = x.MaterialCode,
@@ -828,4 +864,4 @@ namespace BLL
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/CLGL/TwInputdetailBarCodeService.cs b/SGGL/BLL/CLGL/TwInputdetailBarCodeService.cs
index 39b92a64..cec3453e 100644
--- a/SGGL/BLL/CLGL/TwInputdetailBarCodeService.cs
+++ b/SGGL/BLL/CLGL/TwInputdetailBarCodeService.cs
@@ -45,6 +45,9 @@ namespace BLL
InputMasterId = x.InputMasterId,
CusBillCode = master.CusBillCode,
MaterialCode = x.MaterialCode,
+ Code = mat.Code,
+ HeatNo = mat.HeatNo,
+ BatchNo = mat.BatchNo,
MaterialName = mat.MaterialName,
MaterialDef = mat.MaterialDef,
BarCode = x.BarCode
diff --git a/SGGL/BLL/CLGL/TwInputdetailService.cs b/SGGL/BLL/CLGL/TwInputdetailService.cs
index 4ac4a4e3..188ec6cf 100644
--- a/SGGL/BLL/CLGL/TwInputdetailService.cs
+++ b/SGGL/BLL/CLGL/TwInputdetailService.cs
@@ -40,6 +40,9 @@ namespace BLL
InputMasterId = x.InputMasterId,
PipelineComponentId = x.PipelineComponentId,
MaterialCode = x.MaterialCode,
+ Code = mat.Code,
+ HeatNo = mat.HeatNo,
+ BatchNo = mat.BatchNo,
PlanNum = x.PlanNum,
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
@@ -135,7 +138,10 @@ namespace BLL
select new
{
入库单编号 = y.CusBillCode,
- 材料编码 = x.MaterialCode,
+ 材料主编码 = x.MaterialCode,
+ 材料编码 = mat.Code,
+ 炉号 = mat.HeatNo,
+ 批号 = mat.BatchNo,
材料名称 = mat.MaterialName,
材料描述 = mat.MaterialDef,
计划数量 = x.PlanNum,
diff --git a/SGGL/BLL/CLGL/TwMaterialstockService.cs b/SGGL/BLL/CLGL/TwMaterialstockService.cs
index 6d3bcc3e..ac078e0b 100644
--- a/SGGL/BLL/CLGL/TwMaterialstockService.cs
+++ b/SGGL/BLL/CLGL/TwMaterialstockService.cs
@@ -42,6 +42,9 @@ namespace BLL
PipeLineMatCode = x.PipeLineMatCode,
StockNum = x.StockNum,
ProjectId = x.ProjectId,
+ Code = mat.Code,
+ HeatNo = mat.HeatNo,
+ BatchNo = mat.BatchNo,
MaterialName = mat.MaterialName,
MaterialSpec = mat.MaterialSpec,
MaterialUnit = mat.MaterialUnit,
@@ -158,4 +161,4 @@ namespace BLL
}
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/CLGL/TwOutputdetailService..cs b/SGGL/BLL/CLGL/TwOutputdetailService..cs
index 2c082dd1..bbd6db54 100644
--- a/SGGL/BLL/CLGL/TwOutputdetailService..cs
+++ b/SGGL/BLL/CLGL/TwOutputdetailService..cs
@@ -44,6 +44,9 @@ namespace BLL
TypeInt = master.TypeInt,
PipelineComponentId = x.PipelineComponentId,
MaterialCode = x.MaterialCode,
+ Code = mat.Code,
+ HeatNo = mat.HeatNo,
+ BatchNo = mat.BatchNo,
PlanNum = x.PlanNum,
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
@@ -155,7 +158,10 @@ namespace BLL
select new
{
出库单编号 = master.CusBillCode,
- 材料编码 = x.MaterialCode,
+ 材料主编码 = x.MaterialCode,
+ 材料编码 = y.Code,
+ 炉号 = y.HeatNo,
+ 批号 = y.BatchNo,
材料名称 = y.MaterialName,
材料描述 = y.MaterialDef,
计划数量 = x.PlanNum,
@@ -165,4 +171,4 @@ namespace BLL
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs b/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs
index bc61976a..c2ab5c3e 100644
--- a/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs
+++ b/SGGL/BLL/HJGL/BaseInfo/MaterialCodeLibService.cs
@@ -30,13 +30,15 @@
{
MaterialCode = codeLib.MaterialCode,
HeatNo = codeLib.HeatNo,
+ BatchNo = codeLib.BatchNo,
MaterialName = codeLib.MaterialName,
MaterialSpec = codeLib.MaterialSpec,
MaterialMade = codeLib.MaterialMade,
MaterialDef = codeLib.MaterialDef,
PipeGrade = codeLib.PipeGrade,
MaterialUnit = codeLib.MaterialUnit,
- ProjectId = codeLib.ProjectId
+ ProjectId = codeLib.ProjectId,
+ Code = codeLib.Code
};
db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib);
db.SubmitChanges();
@@ -58,12 +60,14 @@
if (newCodeLib != null)
{
newCodeLib.HeatNo = codeLib.HeatNo;
+ newCodeLib.BatchNo = codeLib.BatchNo;
newCodeLib.MaterialName = codeLib.MaterialName;
newCodeLib.MaterialSpec = codeLib.MaterialSpec;
newCodeLib.MaterialMade = codeLib.MaterialMade;
newCodeLib.MaterialDef = codeLib.MaterialDef;
newCodeLib.PipeGrade = codeLib.PipeGrade;
newCodeLib.MaterialUnit = codeLib.MaterialUnit;
+ newCodeLib.Code = codeLib.Code;
db.SubmitChanges();
}
}
@@ -94,20 +98,28 @@
{
var materialCodes = from x in db.HJGL_MaterialCodeLib select x.MaterialCode;
var ls = from x in list
- where !materialCodes.Contains(x.MaterialCode)
+ where !materialCodes.Contains(x.MaterialCode + "-" + x.HeatNo + "-" + x.BatchNo)
select x;
+ List codes = new List();
List details = new List();
foreach (var item in ls)
{
- Model.HJGL_MaterialCodeLib table = new Model.HJGL_MaterialCodeLib
+ if (!codes.Contains(item.MaterialCode + "-" + item.HeatNo + "-" + item.BatchNo))
{
- MaterialCode = item.MaterialCode,
- HeatNo = item.HeatNo,
- MaterialName = item.MaterialName,
- MaterialSpec = item.MaterialSpec,
- MaterialUnit = item.MaterialUnit
- };
- details.Add(table);
+ Model.HJGL_MaterialCodeLib table = new Model.HJGL_MaterialCodeLib
+ {
+ MaterialCode = item.MaterialCode + "-" + item.HeatNo + "-" + item.BatchNo,
+ HeatNo = item.HeatNo,
+ BatchNo = item.BatchNo,
+ MaterialName = item.MaterialName,
+ MaterialSpec = item.MaterialSpec,
+ MaterialUnit = item.MaterialUnit,
+ MaterialDef = item.MaterialDef,
+ Code = item.MaterialCode
+ };
+ details.Add(table);
+ codes.Add(table.MaterialCode);
+ }
}
db.HJGL_MaterialCodeLib.InsertAllOnSubmit(details);
diff --git a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
index 784ed5f9..f46f48e7 100644
--- a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
+++ b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
@@ -108,6 +108,9 @@ namespace BLL
public static DataTable GetSHOPStockDt(string projectid)
{
string strSql = @" SELECT mat.MaterialCode,
+ lib.Code,
+ lib.HeatNo,
+ lib.BatchNo,
lib.MaterialName,
lib.MaterialSpec,
lib.MaterialUnit,
@@ -157,7 +160,7 @@ namespace BLL
GROUP BY stockused.MaterialCode,stockused.MaterialName,stockused.MaterialUnit,stockused.MaterialSpec,stockused.MaterialMade ) AS aa
ON mat.MaterialCode=aa.MaterialCode
WHERE mat.projectid=@projectid
- GROUP BY mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num
+ GROUP BY mat.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num
";
List listStr = new List();
@@ -171,6 +174,9 @@ namespace BLL
{
string strSql = @"
SELECT mat.MaterialCode,
+ lib.Code,
+ lib.HeatNo,
+ lib.BatchNo,
lib.MaterialName,
lib.MaterialSpec,
lib.MaterialUnit,
@@ -223,7 +229,7 @@ namespace BLL
ON mat.MaterialCode=aa.MaterialCode
WHERE mat.projectid=@Projectid
AND Ins.State=@State
- GROUP BY mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num ";
+ GROUP BY mat.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num ";
List listStr = new List();
listStr.Add(new SqlParameter("@Projectid", projectid));
listStr.Add(new SqlParameter("@PipeArea", BLL.PipelineService.PipeArea_SHOP));
diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx
index ef42c711..3e1f0ab4 100644
--- a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx
@@ -61,8 +61,17 @@
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx
index faac25eb..27081c7f 100644
--- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx
@@ -140,7 +140,7 @@
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
@@ -158,21 +158,30 @@
-
+
+
+
+ FieldType="String" HeaderText="炉号" TextAlign="Left" HeaderTextAlign="Center">
+
+
- <%--
- --%>
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx
index 5959a00d..8a8f7a58 100644
--- a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx
@@ -66,8 +66,17 @@
+
+
+
+
+
+
@@ -81,6 +90,9 @@
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
index 8a0923cd..6d157b9a 100644
--- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
@@ -144,8 +144,17 @@
+
+
+
+
+
+
@@ -179,8 +188,17 @@
FieldType="String" HeaderText="入库单编号" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx
index ec77b46a..ecc6a8e7 100644
--- a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx
@@ -65,8 +65,17 @@
FieldType="String" HeaderText="仓库编码" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx
index 3fc1bf06..6e34cb4e 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx
@@ -178,8 +178,17 @@
+
+
+
+
+
+
@@ -211,10 +220,22 @@
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
TextAlign="Left">
-
+
+
+
+
+
+
@@ -262,10 +283,22 @@
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
TextAlign="Left">
-
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx
index 1df44192..f3b0c768 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx
@@ -81,8 +81,17 @@
FieldType="String" HeaderText="管线号" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
@@ -118,8 +127,17 @@
FieldType="String" HeaderText="管线号" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterOut.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterOut.aspx
index e066e76b..75914890 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterOut.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterOut.aspx
@@ -61,8 +61,17 @@
FieldType="String" HeaderText="预制组件号" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx
index fee957db..0d2499e0 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx
@@ -87,8 +87,17 @@
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs
index af52b468..a8e0e2b4 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelect.aspx.cs
@@ -233,6 +233,9 @@ namespace FineUIPro.Web.CLGL
x.PipeLineMatId,
x.PipelineId,
x.MaterialCode,
+ lib.Code,
+ lib.HeatNo,
+ lib.BatchNo,
lib.MaterialName,
lib.MaterialSpec,
lib.MaterialUnit,
@@ -358,4 +361,4 @@ namespace FineUIPro.Web.CLGL
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx
index 68676741..2bdd6a00 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterSelectStock.aspx
@@ -64,8 +64,17 @@
FieldType="String" HeaderText="仓库编码" TextAlign="Left" HeaderTextAlign="Center">
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx
index bc301bee..8640e859 100644
--- a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx
@@ -177,8 +177,17 @@
FieldType="String" HeaderText="预制组件号" TextAlign="Left" HeaderTextAlign="Center">
--%>
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/PipelineMat.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/PipelineMat.xlsx
index 736e3a0f..d21e1b9b 100644
Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/PipelineMat.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataIn/PipelineMat.xlsx differ
diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx
index d8da1ea3..cb9dff80 100644
Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx differ
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/材料入库单.frx b/SGGL/FineUIPro.Web/File/Fastreport/材料入库单.frx
index d18c601f..4b64d246 100644
--- a/SGGL/FineUIPro.Web/File/Fastreport/材料入库单.frx
+++ b/SGGL/FineUIPro.Web/File/Fastreport/材料入库单.frx
@@ -1,5 +1,5 @@
-
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -84,7 +84,7 @@ namespace FastReport
}
-
+
@@ -137,7 +137,7 @@ namespace FastReport
-
+
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx
index 6892e540..8bdea399 100644
--- a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx
+++ b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx
@@ -1,5 +1,5 @@
-
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -99,7 +99,7 @@ namespace FastReport
}
-
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index f626f6b8..d4f3e8a1 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1637,6 +1637,7 @@
+
@@ -10975,6 +10976,13 @@
PrePipelineQRCodeIn.aspx
+
+ PrePipelineComponentJointIn.aspx
+ ASPXCodeBehind
+
+
+ PrePipelineComponentJointIn.aspx
+
ProductionSchedulingPlan.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx
index 6fe9ff9b..4c64fc73 100644
--- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx
@@ -22,7 +22,7 @@
-
@@ -44,14 +44,18 @@
-
+ TextAlign="Left" SortField="Code">
+
+
@@ -93,7 +97,7 @@
+ IsModal="true" Width="700px" Height="450px">
listStr = new List();
- if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim()))
+ if (!string.IsNullOrEmpty(this.txtCode.Text.Trim()))
{
- strSql += " AND MaterialCode LIKE @MaterialCode";
- listStr.Add(new SqlParameter("@MaterialCode", "%" + this.txtMaterialCode.Text.Trim() + "%"));
+ strSql += " AND Code LIKE @Code";
+ listStr.Add(new SqlParameter("@Code", "%" + this.txtCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtMaterialName.Text.Trim()))
{
diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx.designer.cs
index 99ff4773..845d8d21 100644
--- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx.designer.cs
@@ -58,13 +58,13 @@ namespace FineUIPro.Web.HJGL.BaseInfo {
protected global::FineUIPro.Toolbar Toolbar2;
///
- /// txtMaterialCode 控件。
+ /// txtCode 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.TextBox txtMaterialCode;
+ protected global::FineUIPro.TextBox txtCode;
///
/// txtMaterialName 控件。
diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx
index 5582470e..be3c6836 100644
--- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx
@@ -15,14 +15,21 @@
-
-
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.cs
index ebb12754..52dda9b8 100644
--- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.cs
@@ -23,18 +23,19 @@ namespace FineUIPro.Web.HJGL.BaseInfo
Model.HJGL_MaterialCodeLib lib = BLL.MaterialCodeLibService.GetMaterialCodeLib(materialCode);
if (lib != null)
{
- this.txtMaterialCode.Text = materialCode;
+ this.txtCode.Text = lib.Code;
this.txtMaterialMade.Text = lib.MaterialMade;
this.txtHeatNo.Text = lib.HeatNo;
+ this.txtBatchNo.Text = lib.BatchNo;
this.txtMaterialName.Text = lib.MaterialName;
txtMaterialSpec.Text = lib.MaterialSpec;
txtMaterialDef.Text = lib.MaterialDef;
txtMaterialUnit.Text = lib.MaterialUnit;
- txtMaterialCode.Enabled = false;
+ //txtMaterialCode.Enabled = false;
}
else
{
- txtMaterialCode.Enabled = true;
+ //txtMaterialCode.Enabled = true;
}
}
}
@@ -52,23 +53,25 @@ namespace FineUIPro.Web.HJGL.BaseInfo
string materialCode = Request.Params["MaterialCode"];
if (string.IsNullOrEmpty(materialCode))
{
- var q = Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(x => x.MaterialCode == this.txtMaterialCode.Text.Trim());
+ var q = Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(x => x.MaterialCode == materialCode);
if (q != null)
{
- Alert.ShowInTop("此材料编码已存在!", MessageBoxIcon.Warning);
+ Alert.ShowInTop("此材料编码、炉号、批号已存在!", MessageBoxIcon.Warning);
return;
}
}
Model.HJGL_MaterialCodeLib newLib = new Model.HJGL_MaterialCodeLib
{
- MaterialCode = this.txtMaterialCode.Text.Trim(),
+ MaterialCode = this.txtCode.Text.Trim() + "-" + this.txtHeatNo.Text.Trim() + "-" + this.txtBatchNo.Text.Trim(),
HeatNo = this.txtHeatNo.Text.Trim(),
+ BatchNo = this.txtBatchNo.Text.Trim(),
MaterialName = this.txtMaterialName.Text.Trim(),
MaterialSpec = this.txtMaterialSpec.Text.Trim(),
MaterialMade = this.txtMaterialMade.Text.Trim(),
MaterialDef = this.txtMaterialDef.Text.Trim(),
- MaterialUnit = txtMaterialUnit.Text.Trim()
+ MaterialUnit = txtMaterialUnit.Text.Trim(),
+ Code = this.txtCode.Text.Trim()
};
if (!string.IsNullOrEmpty(materialCode))
diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.designer.cs
index 18d88801..13ad643c 100644
--- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibEdit.aspx.designer.cs
@@ -40,13 +40,13 @@ namespace FineUIPro.Web.HJGL.BaseInfo {
protected global::FineUIPro.Form SimpleForm1;
///
- /// txtMaterialCode 控件。
+ /// txtCode 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.TextBox txtMaterialCode;
+ protected global::FineUIPro.TextBox txtCode;
///
/// txtHeatNo 控件。
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.HJGL.BaseInfo {
///
protected global::FineUIPro.TextBox txtHeatNo;
+ ///
+ /// txtBatchNo 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtBatchNo;
+
///
/// txtMaterialName 控件。
///
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
index 053453af..ff4b0ce8 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx
@@ -119,9 +119,21 @@
FieldType="String" HeaderText="预制组件" HeaderTextAlign="Center"
TextAlign="Left">
-
+ TextAlign="Left" Width="150px">
+
+
+
+
+
+
-
+
+
+
+
+
+
@@ -211,10 +235,22 @@
-
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
index a4f68d43..36f6deb8 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs
@@ -90,26 +90,7 @@ namespace FineUIPro.Web.HJGL.DataImport
{
foreach (var q in unitWork1)
{
- string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
- strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
- List listStr = new List();
- listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
-
- if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
- {
- strSql += " and [t1].[MaterialCode] like @MaterialCode";
- listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
-
- }
- if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
- {
- strSql += " and [t0].[PipelineCode] like @PipelineCode";
- listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
-
- }
- SqlParameter[] parameter = listStr.ToArray();
- DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
- var a = dt.Rows.Count;
+ var a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
//int a = (from x in DBpipeline
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
@@ -121,16 +102,13 @@ namespace FineUIPro.Web.HJGL.DataImport
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn1.CommandName = "单位工程";
tn1.EnableExpandEvent = true;
+ tn1.EnableClickEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn1.Nodes.Add(newNode);
+ BindTestPackageNodes(tn1);
}
}
}
@@ -139,27 +117,7 @@ namespace FineUIPro.Web.HJGL.DataImport
foreach (var q in unitWork2)
{
- string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
- strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
- List listStr = new List();
- listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
-
- if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
- {
- strSql += " and [t1].[MaterialCode] like @MaterialCode";
- listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
-
- }
- if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
- {
- strSql += " and [t0].[PipelineCode] like @PipelineCode";
- listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
-
- }
- SqlParameter[] parameter = listStr.ToArray();
- DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
-
- var a = dt.Rows.Count;
+ var a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
//var b = (from x in Funs.DB.HJGL_Pipeline
// join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId
@@ -184,18 +142,14 @@ namespace FineUIPro.Web.HJGL.DataImport
// tn2.Expanded = true;
//}
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn2.CommandName = "单位工程";
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
- // BindNodes(tn2);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn2.Nodes.Add(newNode);
+ BindTestPackageNodes(tn2);
}
}
}
@@ -205,10 +159,99 @@ namespace FineUIPro.Web.HJGL.DataImport
#region 暂不有
private void BindNodes(TreeNode node)
{
- BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), txtMaterialCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
+ var pipeline = GetTestPackagePipelineList(node.NodeID);
+ var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
+ int pageindex = int.Parse(node.CommandName.Split('|')[0]);
+ int pageCount = int.Parse(node.CommandName.Split('|')[1]);
+ if (pageindex <= pageCount)
+ {
+ pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
+ foreach (var item in pipeline)
+ {
+ var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId select x).Count();
+ TreeNode newNode = new TreeNode();
+ newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
+ newNode.NodeID = item.PipelineId;
+ newNode.CommandName = "管线";
+ newNode.EnableClickEvent = true;
+ node.Nodes.Add(newNode);
+ }
+ if (pageindex < pageCount)
+ {
+ TreeNode newNode = new TreeNode();
+ newNode.Text = "加载";
+ newNode.NodeID = SQLHelper.GetNewID();
+ newNode.CommandName = "加载";
+ newNode.Icon = Icon.ArrowDown;
+ newNode.EnableClickEvent = true;
+ node.Nodes.Add(newNode);
+ }
+ }
}
#endregion
+ private int GetUnitWorkTestPackagePipelineCount(string unitWorkId)
+ {
+ return (from x in Funs.DB.HJGL_Pipeline
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ join z in Funs.DB.PTP_TestPackage on y.PTP_ID equals z.PTP_ID
+ join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim()))
+ on x.PipelineId equals m.PipelineId into temp
+ from m in temp.DefaultIfEmpty()
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkId
+ && z.UnitWorkId == unitWorkId
+ && x.PipelineCode.Contains(tvPipeCode.Text.Trim())
+ && (string.IsNullOrEmpty(txtMaterialCode.Text.Trim()) || m != null)
+ select x.PipelineId).Distinct().Count();
+ }
+
+ private void BindTestPackageNodes(TreeNode unitWorkNode)
+ {
+ var testPackages = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkNode.NodeID
+ orderby x.TestPackageNo
+ select x).ToList();
+
+ foreach (var item in testPackages)
+ {
+ int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count();
+ if (pipelineCount == 0)
+ {
+ continue;
+ }
+
+ TreeNode newNode = new TreeNode();
+ newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线";
+ newNode.NodeID = item.PTP_ID;
+ newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize);
+ newNode.EnableClickEvent = true;
+ newNode.EnableExpandEvent = true;
+ unitWorkNode.Nodes.Add(newNode);
+
+ TreeNode loadNode = new TreeNode();
+ loadNode.Text = "加载管线...";
+ loadNode.NodeID = "加载管线...";
+ newNode.Nodes.Add(loadNode);
+ }
+ }
+
+ private List GetTestPackagePipelineList(string ptpId)
+ {
+ return (from x in Funs.DB.HJGL_Pipeline
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ join m in Funs.DB.HJGL_PipeLineMat.Where(e => e.MaterialCode.Contains(txtMaterialCode.Text.Trim()))
+ on x.PipelineId equals m.PipelineId into temp
+ from m in temp.DefaultIfEmpty()
+ where y.PTP_ID == ptpId
+ && x.ProjectId == this.CurrUser.LoginProjectId
+ && x.PipelineCode.Contains(tvPipeCode.Text.Trim())
+ && (string.IsNullOrEmpty(txtMaterialCode.Text.Trim()) || m != null)
+ orderby x.PipelineCode
+ select x).Distinct().ToList();
+ }
+
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
if (e.Node.Nodes[0].NodeID == "加载管线...")
@@ -246,7 +289,7 @@ namespace FineUIPro.Web.HJGL.DataImport
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
@@ -277,7 +320,7 @@ namespace FineUIPro.Web.HJGL.DataImport
///
private void BindGrid1(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
+ string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number,pipe.PrefabricatedComponents
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
@@ -312,7 +355,7 @@ namespace FineUIPro.Web.HJGL.DataImport
}
private void BindGrid2(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
+ string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
@@ -343,7 +386,7 @@ namespace FineUIPro.Web.HJGL.DataImport
private void BindGrid3(string pipelineId, string unitworkid)
{
- string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
+ string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.Code,lib.HeatNo,lib.BatchNo,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number,pipe.PrefabricatedComponents
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
@@ -696,7 +739,7 @@ namespace FineUIPro.Web.HJGL.DataImport
protected void TabStrip1_TabIndexChanged(object sender, EventArgs e)
{
string pipelineid = "";
- if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName != "单位工程")
+ if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName == "管线")
{
pipelineid = this.tvControlItem.SelectedNodeID;
}
@@ -1021,4 +1064,4 @@ namespace FineUIPro.Web.HJGL.DataImport
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialStock.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialStock.aspx
index f0010b3a..a5e57063 100644
--- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialStock.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialStock.aspx
@@ -34,9 +34,21 @@
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx
index e3aa99d9..27e2552c 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx
@@ -88,6 +88,8 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs
index 416882b3..c672b73c 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs
@@ -89,23 +89,19 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork1)
{
- int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count();
+ int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn1.CommandName = "单位工程";
tn1.EnableClickEvent = true;
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn1.Nodes.Add(newNode);
+ BindTestPackageNodes(tn1);
}
//if (a > 0)
//{
@@ -117,7 +113,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork2)
{
- int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count();
+ int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
@@ -127,17 +123,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
tn2.Expanded = true;
}
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn2.CommandName = "单位工程";
tn2.EnableClickEvent = true;
tn2.EnableExpandEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn2.Nodes.Add(newNode);
+ BindTestPackageNodes(tn2);
}
//if (a > 0)
//{
@@ -152,10 +144,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
List pipeline = new List();
var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x;
pipeline = (from x in pipelines
- where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ where y.PTP_ID == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode
- select x).ToList();
+ select x).Distinct().ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
if (pageindex <= pageCount)
@@ -187,6 +180,61 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
+
+ private int GetUnitWorkTestPackagePipelineCount(string unitWorkId)
+ {
+ return (from x in Funs.DB.HJGL_Pipeline
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ join z in Funs.DB.PTP_TestPackage on y.PTP_ID equals z.PTP_ID
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkId
+ && z.UnitWorkId == unitWorkId
+ && x.PipeArea == "1"
+ && x.PipelineCode.Contains(txtPipelineCode.Text.Trim())
+ select x.PipelineId).Distinct().Count();
+ }
+
+ private void BindTestPackageNodes(TreeNode unitWorkNode)
+ {
+ var testPackages = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkNode.NodeID
+ orderby x.TestPackageNo
+ select x).ToList();
+
+ foreach (var item in testPackages)
+ {
+ int pipelineCount = GetTestPackagePipelineCount(item.PTP_ID);
+ if (pipelineCount == 0)
+ {
+ continue;
+ }
+
+ TreeNode newNode = new TreeNode();
+ newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线";
+ newNode.NodeID = item.PTP_ID;
+ newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize);
+ newNode.EnableClickEvent = true;
+ newNode.EnableExpandEvent = true;
+ unitWorkNode.Nodes.Add(newNode);
+
+ TreeNode loadNode = new TreeNode();
+ loadNode.Text = "加载管线...";
+ loadNode.NodeID = "加载管线...";
+ newNode.Nodes.Add(loadNode);
+ }
+ }
+
+ private int GetTestPackagePipelineCount(string ptpId)
+ {
+ return (from x in Funs.DB.HJGL_Pipeline
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ where y.PTP_ID == ptpId
+ && x.ProjectId == this.CurrUser.LoginProjectId
+ && x.PipeArea == "1"
+ && x.PipelineCode.Contains(txtPipelineCode.Text.Trim())
+ select x.PipelineId).Distinct().Count();
+ }
#endregion
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
@@ -205,20 +253,26 @@ namespace FineUIPro.Web.HJGL.PreDesign
///
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
- if (e.CommandName.Split('|').Length == 2)
+ if (e.CommandName == "单位工程")
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
WeldingDailyService.InitDownListByUnitWortId(drpWeldingDailyCode, true, this.tvControlItem.SelectedNodeID);
}
+ else if (e.CommandName.Split('|').Length == 2)
+ {
+ this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+
+ WeldingDailyService.InitDownListByUnitWortId(drpWeldingDailyCode, true, this.hdUnitWorkId.Text);
+ }
else if (e.CommandName == "管线")
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
}
}
else if (e.CommandName == "加载")
@@ -255,12 +309,17 @@ namespace FineUIPro.Web.HJGL.PreDesign
List listStr = new List();
- if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
+ if (tvControlItem.SelectedNode.CommandName == "单位工程")
{
strSql += " and pipe.UnitWorkId =@UnitWorkId";
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
}
+ else if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
+ {
+ strSql += " and exists(select 1 from PTP_PipelineList ptpPipe where ptpPipe.PipelineId = pipe.PipelineId and ptpPipe.PTP_ID = @PTP_ID)";
+ listStr.Add(new SqlParameter("@PTP_ID", this.tvControlItem.SelectedNodeID));
+ }
else if (tvControlItem.SelectedNode.CommandName == "管线")
{
strSql += " and com.PipelineId = @PipelineId ";
@@ -594,6 +653,12 @@ if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.
{
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("PrePipelineQRCodeIn.aspx?", "导入 - ")));
+ }
+
+ protected void btnImportComponentJoint_Click(object sender, EventArgs e)
+ {
+ PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("PrePipelineComponentJointIn.aspx?", "导入 - ")));
+
}
protected void btnSinglePreview_Click(object sender, EventArgs e)
{
@@ -708,4 +773,4 @@ if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.designer.cs
index a464984d..60a019fc 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.designer.cs
@@ -239,6 +239,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
///
protected global::FineUIPro.Button btnImportQRCode;
+ ///
+ /// btnImportComponentJoint 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnImportComponentJoint;
+
///
/// btnBatchAdd 控件。
///
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx
new file mode 100644
index 00000000..e139b05c
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx
@@ -0,0 +1,89 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrePipelineComponentJointIn.aspx.cs" Inherits="FineUIPro.Web.HJGL.PreDesign.PrePipelineComponentJointIn" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.cs
new file mode 100644
index 00000000..e02ce59f
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.cs
@@ -0,0 +1,336 @@
+using BLL;
+using MiniExcelLibs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+
+namespace FineUIPro.Web.HJGL.PreDesign
+{
+ public partial class PrePipelineComponentJointIn : PageBase
+ {
+ private string initPath = Const.ExcelUrl;
+
+ public static List ComponentJointList = new List();
+
+ public static string errorInfos = string.Empty;
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ this.hdFileName.Text = string.Empty;
+ if (ComponentJointList != null)
+ {
+ ComponentJointList.Clear();
+ }
+ errorInfos = string.Empty;
+ }
+ }
+
+ protected void btnAudit_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (this.fuAttachUrl.HasFile == false)
+ {
+ ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning);
+ return;
+ }
+ string isXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
+ if (isXls != ".xlsx")
+ {
+ ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
+ return;
+ }
+ ComponentJointList.Clear();
+ errorInfos = string.Empty;
+
+ string rootPath = Server.MapPath("~/");
+ string initFullPath = rootPath + initPath;
+ if (!Directory.Exists(initFullPath))
+ {
+ Directory.CreateDirectory(initFullPath);
+ }
+
+ this.hdFileName.Text = BLL.Funs.GetNewFileName() + isXls;
+ string filePath = initFullPath + this.hdFileName.Text;
+ this.fuAttachUrl.PostedFile.SaveAs(filePath);
+ ImportXlsToData(filePath);
+ }
+ catch (Exception ex)
+ {
+ Alert alert = new Alert
+ {
+ Message = "'" + ex.Message + "'",
+ Target = Target.Self
+ };
+ alert.Show();
+ }
+ }
+
+ private void ImportXlsToData(string fileName)
+ {
+ var rows = MiniExcel.QueryAsDataTable(fileName, useHeaderRow: true);
+ Model.ResponeData responeData = AddDatasetToSQL(rows, 3);
+ if (responeData.code == 1)
+ {
+ ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
+ }
+ else
+ {
+ Alert alert = new Alert
+ {
+ Message = responeData.message,
+ Target = Target.Self
+ };
+ alert.Show();
+ }
+ }
+
+ private Model.ResponeData AddDatasetToSQL(DataTable pds, int cols)
+ {
+ Model.ResponeData responeData = new Model.ResponeData();
+ List result = new List();
+ if (pds == null)
+ {
+ responeData.code = 0;
+ responeData.message = "导入数据为空!";
+ return responeData;
+ }
+
+ int ic = pds.Columns.Count;
+ int ir = pds.Rows.Count;
+ if (ic < cols || !pds.Columns.Contains("管线号") || !pds.Columns.Contains("预制组件") || !pds.Columns.Contains("焊口号"))
+ {
+ responeData.code = 0;
+ responeData.message = "导入Excel格式错误!模板列必须包含:管线号、预制组件、焊口号";
+ return responeData;
+ }
+ if (ir == 0)
+ {
+ responeData.code = 0;
+ responeData.message = "导入数据为空!";
+ return responeData;
+ }
+
+ var getPipeline = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId select x;
+ List importItems = new List();
+
+ for (int i = 0; i < ir; i++)
+ {
+ string pipelineCode = GetCellValue(pds.Rows[i], "管线号");
+ string pipelineComponentCode = GetCellValue(pds.Rows[i], "预制组件");
+ string weldJointCode = GetCellValue(pds.Rows[i], "焊口号");
+
+ if (string.IsNullOrEmpty(pipelineCode) && string.IsNullOrEmpty(pipelineComponentCode) && string.IsNullOrEmpty(weldJointCode))
+ {
+ continue;
+ }
+
+ if (string.IsNullOrEmpty(pipelineCode))
+ {
+ result.Add("第" + (i + 2).ToString() + "行,管线号,此项为必填项!");
+ continue;
+ }
+ if (string.IsNullOrEmpty(pipelineComponentCode))
+ {
+ result.Add("第" + (i + 2).ToString() + "行,预制组件,此项为必填项!");
+ continue;
+ }
+ if (string.IsNullOrEmpty(weldJointCode))
+ {
+ result.Add("第" + (i + 2).ToString() + "行,焊口号,此项为必填项!");
+ continue;
+ }
+
+ var pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode);
+ if (pipeline == null)
+ {
+ result.Add("第" + (i + 2).ToString() + "行,不存在此管线号-" + pipelineCode);
+ continue;
+ }
+
+ var pipelineComponent = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(pipelineComponentCode, pipeline.PipelineId);
+ if (pipelineComponent == null)
+ {
+ result.Add("第" + (i + 2).ToString() + "行,不存在此预制组件-" + pipelineComponentCode);
+ continue;
+ }
+
+ var weldJoint = WeldJointService.GetWeldJointsByWeldJointCode(pipeline.PipelineId, weldJointCode);
+ if (weldJoint == null)
+ {
+ result.Add("第" + (i + 2).ToString() + "行,不存在此焊口号-" + weldJointCode);
+ continue;
+ }
+
+ importItems.Add(new ComponentJointImportItem
+ {
+ PipelineId = pipeline.PipelineId,
+ PipelineCode = pipeline.PipelineCode,
+ PipelineComponentId = pipelineComponent.PipelineComponentId,
+ PipelineComponentCode = pipelineComponent.PipelineComponentCode,
+ WeldJointId = weldJoint.WeldJointId,
+ WeldJointCode = weldJoint.WeldJointCode
+ });
+ }
+
+ var conflictWeldJoints = importItems
+ .GroupBy(x => x.WeldJointId)
+ .Where(x => x.Select(y => y.PipelineComponentId).Distinct().Count() > 1)
+ .Select(x => x.First().PipelineCode + "-" + x.First().WeldJointCode)
+ .ToList();
+ if (conflictWeldJoints.Count > 0)
+ {
+ result.Add("同一焊口不能导入到多个组件:" + string.Join("、", conflictWeldJoints));
+ }
+
+ if (result.Count > 0)
+ {
+ ComponentJointList.Clear();
+ errorInfos = string.Join("|", result.Distinct());
+ responeData.code = 0;
+ responeData.message = errorInfos;
+ return responeData;
+ }
+
+ ComponentJointList = importItems
+ .GroupBy(x => new { x.PipelineComponentId, x.WeldJointId })
+ .Select(x => x.First())
+ .ToList();
+ errorInfos = string.Empty;
+ responeData.code = ComponentJointList.Count > 0 ? 1 : 0;
+ responeData.message = ComponentJointList.Count > 0 ? string.Empty : "导入数据为空!";
+ return responeData;
+ }
+
+ protected void btnImport_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(errorInfos))
+ {
+ if (!string.IsNullOrEmpty(this.hdFileName.Text))
+ {
+ if (ComponentJointList.Count > 0)
+ {
+ this.Grid1.Hidden = false;
+ this.Grid1.DataIDField = "WeldJointId";
+ this.Grid1.DataSource = ComponentJointList;
+ this.Grid1.DataBind();
+ Grid1.RecordCount = ComponentJointList.Count;
+ }
+ }
+ else
+ {
+ ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
+ }
+ }
+ else
+ {
+ ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
+ }
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ if (!string.IsNullOrEmpty(errorInfos))
+ {
+ ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ if (ComponentJointList.Count > 0)
+ {
+ foreach (var item in ComponentJointList)
+ {
+ var componentJoint = BLL.HJGL_PipelineComponentjointService.GetHJGL_Pipeline_ComponentJointByWeldJointId(item.WeldJointId);
+ if (componentJoint != null)
+ {
+ componentJoint.PipelineComponentCode = item.PipelineComponentCode;
+ componentJoint.PipelineComponentId = item.PipelineComponentId;
+ componentJoint.WeldJointCode = item.WeldJointCode;
+ componentJoint.WeldJointId = item.WeldJointId;
+ HJGL_PipelineComponentjointService.UpdateHJGL_Pipeline_ComponentJoint(componentJoint);
+ }
+ else
+ {
+ Model.HJGL_Pipeline_ComponentJoint newComponentJoint = new Model.HJGL_Pipeline_ComponentJoint();
+ newComponentJoint.Id = SQLHelper.GetNewID();
+ newComponentJoint.PipelineComponentCode = item.PipelineComponentCode;
+ newComponentJoint.PipelineComponentId = item.PipelineComponentId;
+ newComponentJoint.WeldJointCode = item.WeldJointCode;
+ newComponentJoint.WeldJointId = item.WeldJointId;
+ newComponentJoint.State = 0;
+ HJGL_PipelineComponentjointService.AddHJGL_Pipeline_ComponentJoint(newComponentJoint);
+ }
+ }
+ }
+
+ string rootPath = Server.MapPath("~/");
+ string filePath = rootPath + initPath + this.hdFileName.Text;
+ if (filePath != string.Empty && System.IO.File.Exists(filePath))
+ {
+ System.IO.File.Delete(filePath);
+ }
+ ShowNotify("导入成功!", MessageBoxIcon.Success);
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+
+ protected void btnDownLoad_Click(object sender, EventArgs e)
+ {
+ string rootPath = Server.MapPath("~/");
+ string tempDirectory = rootPath + @"File\Excel\Temp\";
+ if (!Directory.Exists(tempDirectory))
+ {
+ Directory.CreateDirectory(tempDirectory);
+ }
+ string tempPath = tempDirectory + "组件焊口信息导入模板" + string.Format("{0:yyyyMMddHHmmss}", DateTime.Now) + ".xlsx";
+ DataTable template = new DataTable();
+ template.Columns.Add("管线号");
+ template.Columns.Add("预制组件");
+ template.Columns.Add("焊口号");
+ MiniExcel.SaveAs(tempPath, template);
+
+ FileInfo info = new FileInfo(tempPath);
+ long fileSize = info.Length;
+ Response.ClearContent();
+ Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode("组件焊口信息导入模板.xlsx", System.Text.Encoding.UTF8));
+ Response.ContentType = "excel/plain";
+ Response.ContentEncoding = System.Text.Encoding.UTF8;
+ Response.AddHeader("Content-Length", fileSize.ToString().Trim());
+ Response.TransmitFile(tempPath, 0, fileSize);
+ Response.Flush();
+ Response.Close();
+ File.Delete(tempPath);
+ }
+
+ protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
+ this.Grid1.DataSource = ComponentJointList;
+ this.Grid1.DataBind();
+ Grid1.RecordCount = ComponentJointList.Count;
+ }
+
+ private string GetCellValue(DataRow row, string columnName)
+ {
+ return Convert.ToString(row[columnName]).Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "").Trim();
+ }
+
+ public class ComponentJointImportItem
+ {
+ public string PipelineId { get; set; }
+
+ public string PipelineCode { get; set; }
+
+ public string PipelineComponentId { get; set; }
+
+ public string PipelineComponentCode { get; set; }
+
+ public string WeldJointId { get; set; }
+
+ public string WeldJointCode { get; set; }
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.designer.cs
new file mode 100644
index 00000000..f94bc931
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineComponentJointIn.aspx.designer.cs
@@ -0,0 +1,143 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.HJGL.PreDesign
+{
+
+
+ public partial class PrePipelineComponentJointIn
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// hdFileName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.HiddenField hdFileName;
+
+ ///
+ /// btnDownLoad 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnDownLoad;
+
+ ///
+ /// btnAudit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnAudit;
+
+ ///
+ /// btnImport 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnImport;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// fuAttachUrl 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.FileUpload fuAttachUrl;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlPageSize;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs
index ccae6c1a..fbfcbb9a 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/JotTwoDesign.aspx.cs
@@ -86,31 +86,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage
int a = 0;
if (cbAllPipeline.Checked)
{
- 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();
+ a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
}
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())
- && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0
- select x).Count();
+ a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
}
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn1.CommandName = "单位工程";
tn1.EnableClickEvent = true;
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn1.Nodes.Add(newNode);
+ BindTestPackageNodes(tn1);
}
}
}
@@ -121,14 +114,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
int a = 0;
if (cbAllPipeline.Checked)
{
- 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();
+ a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
}
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())
- && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0
- select x).Count();
+ a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
}
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
@@ -139,17 +129,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn2.Expanded = true;
}
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn2.CommandName = "单位工程";
tn2.EnableClickEvent = true;
tn2.EnableExpandEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn2.Nodes.Add(newNode);
+ BindTestPackageNodes(tn2);
}
}
}
@@ -158,27 +144,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
private void BindNodes(TreeNode node)
{
List pipeline = new List();
- pipeline = (from x in Funs.DB.HJGL_Pipeline
- where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
- && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
- orderby x.PipelineCode
- select x).ToList();
if (cbAllPipeline.Checked)
{
- pipeline = (from x in Funs.DB.HJGL_Pipeline
- where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
- && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
- orderby x.PipelineCode
- select x).ToList();
+ pipeline = GetTestPackagePipelineList(node.NodeID);
}
else
{
- pipeline = (from x in Funs.DB.HJGL_Pipeline
- where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
- && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
- && (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0
- orderby x.PipelineCode
- select x).ToList();
+ pipeline = GetTestPackagePipelineList(node.NodeID);
}
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
@@ -224,6 +196,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.ToolTip = "管线号【焊口数】";
newNode.NodeID = item.PipelineId;
+ newNode.CommandName = "管线";
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
@@ -240,6 +213,65 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
+ private int GetUnitWorkTestPackagePipelineCount(string unitWorkId)
+ {
+ var testPackages = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkId
+ select x.PTP_ID).ToList();
+
+ return testPackages.Select(x => GetTestPackagePipelineList(x).Count()).Sum();
+ }
+
+ private void BindTestPackageNodes(TreeNode unitWorkNode)
+ {
+ var testPackages = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkNode.NodeID
+ orderby x.TestPackageNo
+ select x).ToList();
+
+ foreach (var item in testPackages)
+ {
+ int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count();
+ if (pipelineCount == 0)
+ {
+ continue;
+ }
+
+ TreeNode newNode = new TreeNode();
+ newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线";
+ newNode.NodeID = item.PTP_ID;
+ newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize);
+ newNode.EnableClickEvent = true;
+ newNode.EnableExpandEvent = true;
+ unitWorkNode.Nodes.Add(newNode);
+
+ TreeNode loadNode = new TreeNode();
+ loadNode.Text = "加载管线...";
+ loadNode.NodeID = "加载管线...";
+ newNode.Nodes.Add(loadNode);
+ }
+ }
+
+ private List GetTestPackagePipelineList(string ptpId)
+ {
+ var pipeline = (from x in Funs.DB.HJGL_Pipeline
+ join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
+ where y.PTP_ID == ptpId
+ && x.ProjectId == this.CurrUser.LoginProjectId
+ && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
+ orderby x.PipelineCode
+ select x).Distinct().ToList();
+
+ if (!cbAllPipeline.Checked)
+ {
+ pipeline = pipeline.Where(x => (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0).ToList();
+ }
+
+ return pipeline;
+ }
+
#region 点击TreeView
///
/// 点击TreeView
@@ -263,12 +295,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid();
}
else
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
+ this.hdUnitWorkId.Text = e.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID;
NoAuditBindGrid();
}
@@ -362,8 +394,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage
WHERE IsTwoJoint = 1";
List listStr = new List { };
- strSql += " AND UnitWorkId =@UnitWorkId";
- listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
+ if (this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
+ {
+ strSql += " AND EXISTS(SELECT 1 FROM PTP_PipelineList ptpPipe WHERE ptpPipe.PipelineId = View_HJGL_WeldJoint.PipelineId AND ptpPipe.PTP_ID = @PTP_ID)";
+ listStr.Add(new SqlParameter("@PTP_ID", this.tvControlItem.SelectedNodeID));
+ }
+ else
+ {
+ strSql += " AND UnitWorkId =@UnitWorkId";
+ listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
+ }
if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
{
@@ -417,12 +457,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid();
}
else
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
+ this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID;
NoAuditBindGrid();
}
@@ -1228,12 +1268,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid();
}
else
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
+ this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID;
NoAuditBindGrid();
}
}
@@ -1244,14 +1284,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid();
}
else
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
+ this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.CommandName.Split('|').Length == 2 ? this.tvControlItem.SelectedNode.ParentNode.NodeID : this.tvControlItem.SelectedNodeID;
NoAuditBindGrid();
}
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
index c97666d8..719ec24c 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineMatIn.aspx.cs
@@ -133,207 +133,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
#endregion
#region 将Dataset的数据导入数据库
- ///
- /// 将Dataset的数据导入数据库
- ///
- /// 数据集
- /// 数据集行数
- ///
- private Model.ResponeData AddDatasetToSQL(DataTable pds, int Cols)
- {
- Model.ResponeData responeData = new Model.ResponeData();
- List result = new List();
-
- int ic, ir;
- ic = pds.Columns.Count;
- ir = pds.Rows.Count;
- if (ic < Cols)
- {
- responeData.code = 0;
- responeData.message = "导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列";
- return responeData;
- }
- // DataRow[] dv = pds.Select("主项编号 <>'' and 管线号 <>'' and 材料编码 <>'' and 数量 <>''and 管线划分<>'' ");
- DataRow[] dv = pds.Select(" 管线号 <>'' and 材料编码 <>'' and 数量 <>'' ");
-
- //导入数据库
- if (dv.Length > 0)
- {
- for (int i = 0; i < dv.Length; i++)
- {
- HJGL_PipeLineMat item = new HJGL_PipeLineMat();
-
- #region 数据验证和赋值
-
-
- string unitworkId = string.Empty;
- unitworkId = Request.Params["UnitWorkId"];
- string PipeArea = string.Empty;//管线划分 1工厂预制 2现场施工
-
- if (dv[i]["管线号"] != null && !string.IsNullOrEmpty(dv[i]["管线号"].ToString()))
- {
- var pipeline = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitworkId && x.PipelineCode == dv[i]["管线号"].ToString().Trim() select x;
- if (pipeline.Count() > 0)
- {
- item.PipelineId = pipeline.First().PipelineId;
- PipeArea = pipeline.First().PipeArea;
- }
- else
- {
- // errorInfos += (i + 2) + "Line,"+ dv[i]["管线号"].ToString() + " [管线号] 不存在";
- result.Add("不存在此管线号-" + dv[i]["管线号"].ToString());
-
-
- }
-
- }
- else
- {
- //errorInfos += (i + 2) + "Line, [管线号] 不能为空";
- result.Add((i + 2) + "Line, [管线号] 不能为空");
- }
- //if (dv[i]["管线划分"] != null && !string.IsNullOrEmpty(dv[i]["管线划分"].ToString()))
- //{
- // string txtPipeArea = "";
- // switch (PipeArea)
- // {
- // case "1":
- // txtPipeArea = "工厂预制";
- // break;
- // case "2":
- // txtPipeArea = "现场施工";
- // break;
- // default:
- // txtPipeArea = "无";
- // break;
- // }
- // if (!Equals(txtPipeArea, dv[i]["管线划分"].ToString().Trim()))
- // {
- // errorInfos += (i + 2) + "Line, [管线划分] 不匹配";
-
- // }
- //}
- //else
- //{
- // errorInfos += (i + 2) + "Line, [管线划分] 不能为空";
-
- //}
-
-
- if (dv[i]["材料编码"] != null && !string.IsNullOrEmpty(dv[i]["材料编码"].ToString()))
- {
- var lib = from x in Funs.DB.HJGL_MaterialCodeLib where x.MaterialCode == dv[i]["材料编码"].ToString() select x;
- if (lib.Count() > 0)
- {
- item.MaterialCode = dv[i]["材料编码"].ToString();
- }
- else
- {
- //errorInfos += (i + 2) + "Line," + dv[i]["材料编码"].ToString() + " [材料编码] 不存在";
- result.Add("不存在此材料编码-" + dv[i]["材料编码"].ToString());
-
- }
-
- }
- else
- {
- //errorInfos += (i + 2) + "Line, [材料编码] 不能为空";
- result.Add((i + 2) + "Line, [材料编码] 不能为空");
- }
-
- if (dv[i]["数量"] != null && !string.IsNullOrEmpty(dv[i]["数量"].ToString()))
- {
- try
- {
- var number = Funs.GetNewDecimal(dv[i]["数量"].ToString());
- item.Number = number;
- }
- catch (Exception)
- {
- //errorInfos += "第" + (i + 2).ToString() + "行," + "数量格式输入有误";
- result.Add("第" + (i + 2).ToString() + "行," + "数量格式输入有误");
- }
-
- }
- else
- {
- //errorInfos += (i + 2) + "Line, [数量] 不能为空";
- result.Add((i + 2) + "Line, [数量] 不能为空");
- }
-
- if (PipeArea == "1")
- {
- if (dv[i]["预制组件"] != null && !string.IsNullOrEmpty(dv[i]["预制组件"].ToString()))
- {
- item.PrefabricatedComponents = dv[i]["预制组件"].ToString();
-
- }
- else
- {
- result.Add((i + 2) + "Line, [预制组件] 不能为空");
- }
- }
- var model = matList.Where(x => x.PipelineId == item.PipelineId && x.MaterialCode == item.MaterialCode && x.PrefabricatedComponents == item.PrefabricatedComponents);
- if (model.Count() == 0)
- {
- matList.Add(item);
-
- }
- //if (PipeArea == "1")//工厂预制
- //{
-
- // var model= matList.Where(x => x.PrefabricatedComponents == item.PrefabricatedComponents && x.MaterialCode == item.MaterialCode);
- // if (model.Count()==0)
- // {
- // matList.Add(item);
-
- // }
-
- //} else if (PipeArea == "2")//现场施工
- //{
- // var model = matList.Where(x => x.PipelineId == item.PipelineId && x.MaterialCode == item.MaterialCode);
- // if (model.Count() == 0)
- // {
- // matList.Add(item);
-
- // }
- //}
- //item.PipeLineMatId= SQLHelper.GetNewID(typeof(Model.HJGL_PipeLineMat));
- //if (!matList.Select(x => x.MaterialCode).Contains(item.MaterialCode))
- //{
- // matList.Add(item);
- //}
-
- #endregion
- }
-
- }
- else
- {
- responeData.code = 0;
- responeData.message = "没有数据";
-
- }
- if (result.Count > 0)
- {
- // result = result.Substring(0, result.LastIndexOf("|"));
- errorInfos = string.Join("|", result.Distinct());
- //Alert alert = new Alert();
- //alert.Message = result;
- //alert.Target = Target.Self;
- //alert.Show();
- responeData.code = 0;
- responeData.message = errorInfos;
- }
-
- return responeData;
- }
private Model.ResponeData AddDatasetToSQL(List pds, int count)
{
Model.ResponeData responeData = new Model.ResponeData();
List result = new List();
- if (count < 4)
+ if (count < 6)
{
responeData.code = 0;
responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列";
@@ -377,16 +182,30 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (pds[i].C != null && !string.IsNullOrEmpty(pds[i].C.ToString()))
{
- string materialCode = pds[i].C.ToString();
- var lib = from x in Funs.DB.HJGL_MaterialCodeLib where x.MaterialCode == materialCode select x;
- if (lib.Count() > 0)
+ string materialCode = pds[i].C.ToString().Trim();
+ string furnaceNo = pds[i].D == null ? string.Empty : pds[i].D.ToString().Trim();
+ string batchNo = pds[i].E == null ? string.Empty : pds[i].E.ToString().Trim();
+ if (pds[i].D == null || string.IsNullOrEmpty(pds[i].D.ToString()))
{
- item.MaterialCode = pds[i].C.ToString();
+ result.Add((i + 2) + "Line, [炉号] 不能为空");
}
- else
+ if (pds[i].E == null || string.IsNullOrEmpty(pds[i].E.ToString()))
{
- result.Add("不存在此材料编码-" + pds[i].C.ToString());
+ result.Add((i + 2) + "Line, [批号] 不能为空");
+ }
+ if (!string.IsNullOrEmpty(materialCode) && !string.IsNullOrEmpty(furnaceNo) && !string.IsNullOrEmpty(batchNo))
+ {
+ string fullMaterialCode = materialCode + "-" + furnaceNo + "-" + batchNo;
+ var lib = from x in Funs.DB.HJGL_MaterialCodeLib where x.MaterialCode == fullMaterialCode select x;
+ if (lib.Count() > 0)
+ {
+ item.MaterialCode = fullMaterialCode;
+ }
+ else
+ {
+ result.Add("不存在此材料:" + fullMaterialCode);
+ }
}
}
@@ -395,11 +214,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
result.Add((i + 2) + "Line, [材料编码] 不能为空");
}
- if (pds[i].D != null && !string.IsNullOrEmpty(pds[i].D.ToString()))
+ if (pds[i].F != null && !string.IsNullOrEmpty(pds[i].F.ToString()))
{
try
{
- var number = Funs.GetNewDecimal(pds[i].D.ToString());
+ var number = Funs.GetNewDecimal(pds[i].F.ToString());
item.Number = number;
}
catch (Exception)
@@ -674,4 +493,4 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
index 08f8d3d3..e49f353f 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx
@@ -34,6 +34,11 @@
background-color: green;
}
+ .f-grid-row.priority {
+ background-color: #1e88e5;
+ color: #fff;
+ }
+
.f-grid-row {
font-size: smaller;
}
@@ -138,7 +143,9 @@
-
+
+
+
@@ -174,9 +181,9 @@
+ SortField="Id" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true">
> priorityComponents
+ {
+ get
+ {
+ var value = ViewState["priorityComponents"] as Dictionary>;
+ if (value == null)
+ {
+ value = new Dictionary>();
+ ViewState["priorityComponents"] = value;
+ }
+ return value;
+ }
+ set
+ {
+ ViewState["priorityComponents"] = value;
+ }
+ }
+
protected void Page_Load(object sender, EventArgs e)
{
@@ -86,6 +104,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
; HJGL_MaterialService.materialStockItems_FIELD = new List();
HJGL_MaterialService.materialStockItems_SHOP = new List();
dicSeclectPipeLine = new Dictionary();
+ priorityComponents = new Dictionary>();
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId
select x.FlowingSection).Distinct().ToList();
@@ -155,22 +174,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
foreach (var q in unitWork1)
{
- int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea && x.WarehouseId == WarehouseId select x).Count();
+ int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn1.CommandName = "单位工程";
tn1.EnableExpandEvent = true;
+ tn1.EnableClickEvent = true;
+ tn1.EnableCheckBox = false;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
- // BindNodes(tn1);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn1.Nodes.Add(newNode);
+ BindTestPackageNodes(tn1);
}
}
}
@@ -178,7 +195,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
foreach (var q in unitWork2)
{
- int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == PipeArea && x.WarehouseId == WarehouseId select x).Count();
+ int a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
// var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(q.UnitWorkId);
//int a = NowComPipelineCode.Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
@@ -190,7 +207,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn2.Expanded = true;
}
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
- tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
+ tn2.CommandName = "单位工程";
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent = true;
tn2.EnableCheckBox = false;
@@ -198,11 +215,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
- // BindNodes(tn2);
- TreeNode newNode = new TreeNode();
- newNode.Text = "加载管线...";
- newNode.NodeID = "加载管线...";
- tn2.Nodes.Add(newNode);
+ BindTestPackageNodes(tn2);
}
}
}
@@ -215,22 +228,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// node.Text += "|" + NowComPipelineCode.Count();
//}
- var CompleteInOutPlanDetail_RelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation
- join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id
- where y.State == (int)TwConst.State.已完成 && y.WarehouseCode == drpWarehouse.SelectedValue
- select x;
-
- var pipeline = (from x in Funs.DB.HJGL_Pipeline
- join y in CompleteInOutPlanDetail_RelationList on x.PipelineId equals y.PipelineId into temp
- from y in temp.DefaultIfEmpty()
- where y == null && x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
- && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.WarehouseId==WarehouseId
- orderby x.PipelineCode
- select x).ToList();
- if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null)
- {
- pipeline = pipeline.Where(x => x.FlowingSection == drpFlowingSection.SelectedValue).ToList();
- }
+ var pipeline = GetTestPackagePipelineList(node.NodeID);
//pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList();
if (!node.Text.Contains("|"))
{
@@ -268,6 +266,74 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
+ private int GetUnitWorkTestPackagePipelineCount(string unitWorkId)
+ {
+ var testPackageIds = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitWorkId
+ select x.PTP_ID).ToList();
+
+ return testPackageIds.Select(x => GetTestPackagePipelineList(x).Count()).Sum();
+ }
+
+ private void BindTestPackageNodes(TreeNode unitWorkNode)
+ {
+ var testPackages = (from x in Funs.DB.PTP_TestPackage
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.UnitWorkId == unitWorkNode.NodeID
+ orderby x.TestPackageNo
+ select x).ToList();
+
+ foreach (var item in testPackages)
+ {
+ int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count();
+ if (pipelineCount == 0)
+ {
+ continue;
+ }
+
+ TreeNode newNode = new TreeNode();
+ newNode.Text = (string.IsNullOrEmpty(item.TestPackageNo) ? "未知" : item.TestPackageNo) + "【" + pipelineCount.ToString() + "】管线";
+ newNode.NodeID = item.PTP_ID;
+ newNode.CommandName = 1 + "|" + Funs.GetEndPageNumber(pipelineCount, pageSize);
+ newNode.EnableClickEvent = true;
+ newNode.EnableExpandEvent = true;
+ newNode.EnableCheckBox = false;
+ unitWorkNode.Nodes.Add(newNode);
+
+ TreeNode loadNode = new TreeNode();
+ loadNode.Text = "加载管线...";
+ loadNode.NodeID = "加载管线...";
+ loadNode.EnableCheckBox = false;
+ newNode.Nodes.Add(loadNode);
+ }
+ }
+
+ private List GetTestPackagePipelineList(string ptpId)
+ {
+ var completeInOutPlanDetailRelationList = from x in Funs.DB.Tw_InOutPlanDetail_Relation
+ join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id
+ where y.State == (int)TwConst.State.已完成 && y.WarehouseCode == drpWarehouse.SelectedValue
+ select x;
+
+ var pipeline = (from x in Funs.DB.HJGL_Pipeline
+ join p in Funs.DB.PTP_PipelineList on x.PipelineId equals p.PipelineId
+ join y in completeInOutPlanDetailRelationList on x.PipelineId equals y.PipelineId into temp
+ from y in temp.DefaultIfEmpty()
+ where y == null
+ && p.PTP_ID == ptpId
+ && x.ProjectId == this.CurrUser.LoginProjectId
+ && x.PipeArea == PipeArea
+ && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
+ && x.WarehouseId == WarehouseId
+ orderby x.PipelineCode
+ select x).ToList();
+ if (!string.IsNullOrEmpty(drpFlowingSection.SelectedValue) && drpFlowingSection.SelectedValue != Const._Null)
+ {
+ pipeline = pipeline.Where(x => x.FlowingSection == drpFlowingSection.SelectedValue).ToList();
+ }
+ return pipeline.Distinct().ToList();
+ }
+
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
if (e.Node.Nodes[0].NodeID == "加载管线...")
@@ -417,23 +483,66 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}*/
}
- protected void Grid2_RowClick(object sender, GridRowClickEventArgs e)
+
+ private void BindMaterialDetail(string pipelineId)
{
- var tb = tw_PipeMatMatchOutputs.Where(x => x.PipelineId == Grid2.SelectedRowID).ToList();
+ var tb = tw_PipeMatMatchOutputs.Where(x => x.PipelineId == pipelineId).ToList();
Grid1.DataSource = tb;
Grid1.DataBind();
+
+ var selectList = new List();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
var model = Grid1.Rows[i].DataItem as Tw_PipeMatMatchOutput;
-
- if (model?.MatchRate < 1 || model?.MatchRate == null)
+ if (model == null)
{
- Grid1.Rows[i].RowCssClass = "red";
-
+ continue;
}
+ if (IsPriorityComponent(model.PipelineId, model.PrefabricatedComponents))
+ {
+ Grid1.Rows[i].RowCssClass = "priority";
+ selectList.Add(model.Id);
+ }
+ else if (model.MatchRate < 1 || model.MatchRate == null)
+ {
+ Grid1.Rows[i].RowCssClass = "red";
+ }
}
+ Grid1.SelectedRowIDArray = selectList.ToArray();
+ }
+
+ private bool IsPriorityComponent(string pipelineId, string prefabricatedComponents)
+ {
+ return !string.IsNullOrEmpty(pipelineId)
+ && !string.IsNullOrEmpty(prefabricatedComponents)
+ && priorityComponents.ContainsKey(pipelineId)
+ && priorityComponents[pipelineId].Contains(prefabricatedComponents);
+ }
+
+ private Dictionary> GetPriorityComponentList()
+ {
+ return priorityComponents
+ .Where(x => x.Value != null && x.Value.Any())
+ .ToDictionary(x => x.Key, x => x.Value.ToList());
+ }
+
+ private void RefreshMatchResult()
+ {
+ tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(
+ this.CurrUser.LoginProjectId,
+ dicSeclectPipeLine.Keys.ToList(),
+ drpWarehouse.SelectedValue,
+ GetPriorityComponentList());
+ BindGrid3();
+ BindGrid2();
+ }
+
+ protected void Grid2_RowClick(object sender, GridRowClickEventArgs e)
+ {
+ BindMaterialDetail(Grid2.SelectedRowID);
+
}
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
@@ -473,7 +582,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
- BindGrid();
+ if (!string.IsNullOrEmpty(Grid2.SelectedRowID) && tw_PipeMatMatchOutputs != null && tw_PipeMatMatchOutputs.Any())
+ {
+ BindMaterialDetail(Grid2.SelectedRowID);
+ }
+ else
+ {
+ BindGrid();
+ }
}
#endregion
@@ -491,7 +607,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
parameter3D.TagNum = "";
parameter3D.ButtonType = "3";
- if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
+ if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
var pipeline = (from x in Funs.DB.HJGL_Pipeline
@@ -517,7 +633,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
- this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
+ this.hdUnitWorkId.Text = pipeline.UnitWorkId;
this.BindGrid();
}
@@ -566,10 +682,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
dicSeclectPipeLine.Add(node.NodeID, node.Text);
}
}
- tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), drpWarehouse.SelectedValue);
-
- BindGrid3();
- BindGrid2();
+ RefreshMatchResult();
}
protected void btnDeletePipelineMatchMat_Click(object sender, EventArgs e)
@@ -579,6 +692,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
foreach (string rowId in Grid3.SelectedRowIDArray)
{
dicSeclectPipeLine.Remove(rowId);
+ priorityComponents.Remove(rowId);
var node = tvControlItem.FindNode(rowId);
if (node != null)
{
@@ -586,25 +700,63 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
- tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), drpWarehouse.SelectedValue);
-
- BindGrid3();
- BindGrid2();
+ RefreshMatchResult();
}
}
+
+ protected void btnPriorityComponents_Click(object sender, EventArgs e)
+ {
+ string selectedPipelineId = Grid2.SelectedRowID;
+ if (string.IsNullOrEmpty(selectedPipelineId))
+ {
+ ShowNotify("请先在材料匹配列表选择管线!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var selectedComponents = new HashSet();
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ if (Grid1.DataKeys[rowIndex].Length < 3)
+ {
+ continue;
+ }
+
+ string pipelineId = Grid1.DataKeys[rowIndex][1]?.ToString();
+ string componentCode = Grid1.DataKeys[rowIndex][2]?.ToString();
+ if (pipelineId == selectedPipelineId && !string.IsNullOrEmpty(componentCode))
+ {
+ selectedComponents.Add(componentCode);
+ }
+ }
+
+ if (selectedComponents.Any())
+ {
+ priorityComponents[selectedPipelineId] = selectedComponents;
+ }
+ else
+ {
+ priorityComponents.Remove(selectedPipelineId);
+ }
+
+ RefreshMatchResult();
+ BindMaterialDetail(selectedPipelineId);
+ }
+
protected void btnGenTask_Click(object sender, EventArgs e)
{
if (Grid2.SelectedRowIDArray.Count() > 0)
{
- SaveTask();
- ShowNotify("生成任务单成功!", MessageBoxIcon.Warning);
- // Alert.Show("生成任务单成功!", MessageBoxIcon.Warning);
- Grid1.DataSource = null;
- Grid1.DataBind();
- Grid2.DataSource = null;
- Grid2.DataBind();
- Grid3.DataSource = null;
- Grid3.DataBind();
+ if (SaveTask())
+ {
+ ShowNotify("生成任务单成功!", MessageBoxIcon.Warning);
+ // Alert.Show("生成任务单成功!", MessageBoxIcon.Warning);
+ Grid1.DataSource = null;
+ Grid1.DataBind();
+ Grid2.DataSource = null;
+ Grid2.DataBind();
+ Grid3.DataSource = null;
+ Grid3.DataBind();
+ }
}
else
{
@@ -612,7 +764,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
- private void SaveTask()
+ private bool SaveTask()
{
var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x;
var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x;
@@ -632,6 +784,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
selectRowId = selectRowId.Where(x => x.JointAttribute == "预制口").ToList();
}
+ var priorityWeldJointIds = GetPriorityWeldJointIds(Grid2.SelectedRowIDArray.ToList());
+ if (priorityWeldJointIds.Any())
+ {
+ if (priorityWeldJointIds.Any(x => !x.Value.Any()))
+ {
+ ShowNotify("选中组件未找到关联焊口,无法按组件生成任务单!", MessageBoxIcon.Warning);
+ return false;
+ }
+ selectRowId = selectRowId.Where(x => !priorityWeldJointIds.ContainsKey(x.PipelineId) || priorityWeldJointIds[x.PipelineId].Contains(x.WeldJointId)).ToList();
+ }
+ if (!selectRowId.Any())
+ {
+ ShowNotify("未找到可生成任务单的焊口!", MessageBoxIcon.Warning);
+ return false;
+ }
foreach (var weldjoint in selectRowId)
{
string canWeldingRodName = string.Empty;
@@ -666,7 +833,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (oldWeldTask != null)
{
ShowNotify("所选焊口已存在任务单,无法保存!", MessageBoxIcon.Warning);
- return;
+ return false;
}
Model.HJGL_WeldJoint weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(NewTask.WeldJointId);
if (weldJoint != null)
@@ -739,7 +906,36 @@ namespace FineUIPro.Web.HJGL.WeldingManage
BLL.WeldTaskService.AddWeldTask(NewTask);
}
+ return true;
}
+
+ private Dictionary> GetPriorityWeldJointIds(List selectedPipelineIds)
+ {
+ var result = new Dictionary>();
+ var selectedPriority = priorityComponents
+ .Where(x => selectedPipelineIds.Contains(x.Key) && x.Value != null && x.Value.Any())
+ .ToList();
+
+ foreach (var item in selectedPriority)
+ {
+ string pipelineId = item.Key;
+ var componentCodes = item.Value.ToList();
+ var weldJointIds = (from joint in Funs.DB.HJGL_Pipeline_ComponentJoint
+ join weldJoint in Funs.DB.HJGL_WeldJoint on joint.WeldJointId equals weldJoint.WeldJointId
+ join component in Funs.DB.HJGL_Pipeline_Component on joint.PipelineComponentId equals component.PipelineComponentId into componentJoin
+ from componentItem in componentJoin.DefaultIfEmpty()
+ where joint.WeldJointId != null
+ && weldJoint.PipelineId == pipelineId
+ && ((componentItem != null && componentCodes.Contains(componentItem.PipelineComponentCode))
+ || componentCodes.Contains(joint.PipelineComponentCode))
+ select joint.WeldJointId).Distinct().ToList();
+
+ result[pipelineId] = new HashSet(weldJointIds);
+ }
+
+ return result;
+ }
+
private bool IsCoverClass(string wpsClass, string matClass)
{
bool isCover = false;
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
index 943a5341..1095bf1c 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.designer.cs
@@ -257,6 +257,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
///
protected global::FineUIPro.Label lbNote;
+ ///
+ /// btnPriorityComponents 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnPriorityComponents;
+
///
/// btnGenTask 控件。
///
diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml
index b532a9bb..bb7a7a34 100644
--- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml
@@ -1,9 +1,51 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -16,12 +58,15 @@
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml
index 562f836f..b5ac8281 100644
--- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml
@@ -12,14 +12,15 @@
+
+
-
-
-
+
+
@@ -28,7 +29,7 @@
-
+
@@ -62,8 +63,7 @@
-
-
+
diff --git a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml
index 95eeab91..129ab5fd 100644
--- a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml
index 8d4aa005..fd6a0762 100644
--- a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml
@@ -1,7 +1,11 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml
index 56efca63..53b0bd32 100644
--- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml
@@ -4,10 +4,10 @@
-
+
diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
index 33fbfbf6..bd506a52 100644
--- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml
@@ -58,51 +58,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs b/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs
index 697f8620..2ba8370e 100644
--- a/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs
+++ b/SGGL/Model/CLGL/Tw_ArrivalStatisticsOutPut.cs
@@ -9,6 +9,9 @@ namespace Model
public class Tw_ArrivalStatisticsOutPut
{
public string MaterialCode { get; set; }
+ public string Code { get; set; }
+ public string HeatNo { get; set; }
+ public string BatchNo { get; set; }
public string MaterialName { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
diff --git a/SGGL/Model/CLGL/Tw_InOutDetailOutput.cs b/SGGL/Model/CLGL/Tw_InOutDetailOutput.cs
index ee7545c5..838cefec 100644
--- a/SGGL/Model/CLGL/Tw_InOutDetailOutput.cs
+++ b/SGGL/Model/CLGL/Tw_InOutDetailOutput.cs
@@ -17,6 +17,10 @@ namespace Model
///
public string HeatNo { get; set; }
///
+ /// 材料编码
+ ///
+ public string Code { get; set; }
+ ///
/// 材料名称
///
public string MaterialName { get; set; }
diff --git a/SGGL/Model/CLGL/Tw_InputDataIn.cs b/SGGL/Model/CLGL/Tw_InputDataIn.cs
index 36dd80e4..c681a0b7 100644
--- a/SGGL/Model/CLGL/Tw_InputDataIn.cs
+++ b/SGGL/Model/CLGL/Tw_InputDataIn.cs
@@ -17,29 +17,41 @@ namespace Model
///
[ExcelColumnIndex("B")] public string MaterialCode { get; set; }
///
- /// 炉批号
+ /// 炉号
///
[ExcelColumnIndex("C")] public string HeatNo { get; set; }
///
+ /// 批号
+ ///
+ [ExcelColumnIndex("D")] public string BatchNo { get; set; }
+ ///
/// 类型
///
- [ExcelColumnIndex("D")] public string MaterialName { get; set; }
+ [ExcelColumnIndex("E")] public string MaterialName { get; set; }
///
/// 规格
///
- [ExcelColumnIndex("E")] public string MaterialSpec { get; set; }
+ [ExcelColumnIndex("F")] public string MaterialSpec { get; set; }
+ ///
+ /// 材料描述
+ ///
+ [ExcelColumnIndex("G")] public string MaterialDef { get; set; }
///
/// 单位
///
- [ExcelColumnIndex("F")] public string MaterialUnit { get; set; }
+ [ExcelColumnIndex("H")] public string MaterialUnit { get; set; }
///
/// 数量
///
- [ExcelColumnIndex("G")] public string PlanNum { get; set; }
+ [ExcelColumnIndex("I")] public string PlanNum { get; set; }
///
/// 类型
///
- [ExcelColumnIndex("H")] public string TypeString { get; set; }
+ [ExcelColumnIndex("J")] public string TypeString { get; set; }
+ ///
+ /// 到货时间
+ ///
+ [ExcelColumnIndex("K")] public string DeliveryDate { get; set; }
}
}
\ No newline at end of file
diff --git a/SGGL/Model/CLGL/Tw_InputDetailBarCodeOutput.cs b/SGGL/Model/CLGL/Tw_InputDetailBarCodeOutput.cs
index e1477f3b..c432dfac 100644
--- a/SGGL/Model/CLGL/Tw_InputDetailBarCodeOutput.cs
+++ b/SGGL/Model/CLGL/Tw_InputDetailBarCodeOutput.cs
@@ -7,6 +7,9 @@ namespace Model
public string InputMasterId { get; set; }
public string CusBillCode { get; set; }
public string MaterialCode { get; set; }
+ public string Code { get; set; }
+ public string HeatNo { get; set; }
+ public string BatchNo { get; set; }
public string MaterialName { get; set; }
public string MaterialDef { get; set; }
public string BarCode { get; set; }
diff --git a/SGGL/Model/CLGL/Tw_MaterialStockOutput.cs b/SGGL/Model/CLGL/Tw_MaterialStockOutput.cs
index 85daa9d9..49b83c4b 100644
--- a/SGGL/Model/CLGL/Tw_MaterialStockOutput.cs
+++ b/SGGL/Model/CLGL/Tw_MaterialStockOutput.cs
@@ -2,9 +2,12 @@
{
public class Tw_MaterialStockOutput: Tw_MaterialStock
{
+ public string Code { get; set; }
+ public string HeatNo { get; set; }
+ public string BatchNo { get; set; }
public string MaterialName { get; set; }
public string MaterialDef { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
index 72534643..eb058fda 100644
--- a/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
+++ b/SGGL/Model/CLGL/Tw_PipeMatMatchOutput.cs
@@ -17,6 +17,9 @@ namespace Model
public string UnitWorkName { get; set; }
public string PrefabricatedComponents { get; set; }
public string MaterialCode { get; set; }
+ public string Code { get; set; }
+ public string HeatNo { get; set; }
+ public string BatchNo { get; set; }
public string MaterialName { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
diff --git a/SGGL/Model/HJGL/PreDesign/Material/MaterialStockItem.cs b/SGGL/Model/HJGL/PreDesign/Material/MaterialStockItem.cs
index 488a19c7..92f82e61 100644
--- a/SGGL/Model/HJGL/PreDesign/Material/MaterialStockItem.cs
+++ b/SGGL/Model/HJGL/PreDesign/Material/MaterialStockItem.cs
@@ -9,10 +9,22 @@ namespace Model
public class MaterialStockItem
{
///
- /// 材料编码
+ /// 材料主编码
///
public string MaterialCode { get; set; }
///
+ /// 材料编码
+ ///
+ public string Code { get; set; }
+ ///
+ /// 炉号
+ ///
+ public string HeatNo { get; set; }
+ ///
+ /// 批号
+ ///
+ public string BatchNo { get; set; }
+ ///
/// 材料名称
///
public string MaterialName { get; set; }
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index 3cd275e2..a757b5cc 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -100586,6 +100586,10 @@ namespace Model
private string _HeatNo;
+ private string _BatchNo;
+
+ private string _Code;
+
private EntityRef _Base_Project;
private EntitySet _HJGL_PipeLineMat;
@@ -100612,6 +100616,10 @@ namespace Model
partial void OnMaterialUnitChanged();
partial void OnHeatNoChanging(string value);
partial void OnHeatNoChanged();
+ partial void OnBatchNoChanging(string value);
+ partial void OnBatchNoChanged();
+ partial void OnCodeChanging(string value);
+ partial void OnCodeChanged();
#endregion
public HJGL_MaterialCodeLib()
@@ -100805,6 +100813,46 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchNo", DbType="NVarChar(50)")]
+ public string BatchNo
+ {
+ get
+ {
+ return this._BatchNo;
+ }
+ set
+ {
+ if ((this._BatchNo != value))
+ {
+ this.OnBatchNoChanging(value);
+ this.SendPropertyChanging();
+ this._BatchNo = value;
+ this.SendPropertyChanged("BatchNo");
+ this.OnBatchNoChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NVarChar(50)")]
+ public string Code
+ {
+ get
+ {
+ return this._Code;
+ }
+ set
+ {
+ if ((this._Code != value))
+ {
+ this.OnCodeChanging(value);
+ this.SendPropertyChanging();
+ this._Code = value;
+ this.SendPropertyChanged("Code");
+ this.OnCodeChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_MaterialCodeLib_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
@@ -275610,6 +275658,10 @@ namespace Model
private string _HeatNo;
+ private string _BatchNo;
+
+ private System.Nullable _DeliveryDate;
+
#region 可扩展性方法定义
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@@ -275630,6 +275682,10 @@ namespace Model
partial void OnSortIndexChanged();
partial void OnHeatNoChanging(string value);
partial void OnHeatNoChanged();
+ partial void OnBatchNoChanging(string value);
+ partial void OnBatchNoChanged();
+ partial void OnDeliveryDateChanging(System.Nullable value);
+ partial void OnDeliveryDateChanged();
#endregion
public Tw_InOutPlanDetail()
@@ -275797,6 +275853,46 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BatchNo", DbType="NVarChar(50)")]
+ public string BatchNo
+ {
+ get
+ {
+ return this._BatchNo;
+ }
+ set
+ {
+ if ((this._BatchNo != value))
+ {
+ this.OnBatchNoChanging(value);
+ this.SendPropertyChanging();
+ this._BatchNo = value;
+ this.SendPropertyChanged("BatchNo");
+ this.OnBatchNoChanged();
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DeliveryDate", DbType="DateTime")]
+ public System.Nullable DeliveryDate
+ {
+ get
+ {
+ return this._DeliveryDate;
+ }
+ set
+ {
+ if ((this._DeliveryDate != value))
+ {
+ this.OnDeliveryDateChanging(value);
+ this.SendPropertyChanging();
+ this._DeliveryDate = value;
+ this.SendPropertyChanged("DeliveryDate");
+ this.OnDeliveryDateChanged();
+ }
+ }
+ }
+
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;