diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo
index c9ebe860..60ab5882 100644
Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ
diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json
index 526a4537..d8a6cc55 100644
--- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json
+++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.backup.json
@@ -11,10 +11,6 @@
"DockedWidth": 386,
"SelectedChildIndex": -1,
"Children": [
- {
- "$type": "Bookmark",
- "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
- },
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json
index 526a4537..d8a6cc55 100644
--- a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json
+++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json
@@ -11,10 +11,6 @@
"DockedWidth": 386,
"SelectedChildIndex": -1,
"Children": [
- {
- "$type": "Bookmark",
- "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
- },
{
"$type": "Bookmark",
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
diff --git a/DataBase/版本日志/SGGLDB_V2025-04-18-001.sql b/DataBase/版本日志/SGGLDB_V2025-04-18-001.sql
new file mode 100644
index 00000000..506a5ea3
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-04-18-001.sql
@@ -0,0 +1,101 @@
+
+
+ALTER VIEW [dbo].[View_Batch_BatchTrustItem]
+AS
+/********无损委托********/
+SELECT
+ROW_NUMBER() OVER(ORDER BY WeldJointCode) AS Number,
+BatchTrustItem.TrustBatchItemId,
+BatchTrustItem.TrustBatchId,
+BatchTrustItem.PointBatchItemId,
+BatchTrustItem.WeldJointId,
+BatchTrustItem.CreateDate,
+BatchTrustItem.TrustNum,
+BatchTrust.TrustType,
+BatchTrustItem.RepairNum,
+BatchTrust.TrustBatchCode, --委托单号
+BatchTrust.ProjectId,
+UnitWork.UnitWorkCode, --单位工程
+pipe.PipelineCode, --管线号
+pipingClass.PipingClassCode, --管线等级
+jot.WeldJointCode+isnull((select top 1 RepairMark from [dbo].[HJGL_RepairRecord] where [WeldJointId]=BatchTrustItem.WeldJointId and RepairRecordId=BatchTrustItem.RepairRecordId),'')+(case when PointBatchItem.PointState='2' then 'K' else '' end) as WeldJointCode, --焊口号
+mat.MaterialCode, --材质
+jot.JointArea, --焊接区域
+welder.WelderCode AS WelderCode, --焊工号
+weldType.WeldTypeCode, --焊缝类型
+jot.Dia, --外径
+jot.Size, --寸径
+jot.Thickness, --壁厚
+method.WeldingMethodCode, --焊接方法
+rate.DetectionRateCode,
+null as CheckDefects,
+PointBatchItem.PointDate --点口日期
+
+
+FROM dbo.HJGL_Batch_BatchTrustItem AS BatchTrustItem
+LEFT JOIN dbo.HJGL_Batch_BatchTrust AS BatchTrust ON BatchTrust.TrustBatchId=BatchTrustItem.TrustBatchId
+LEFT JOIN dbo.HJGL_Batch_PointBatchItem AS PointBatchItem ON PointBatchItem.PointBatchItemId=BatchTrustItem.PointBatchItemId
+LEFT JOIN dbo.HJGL_Batch_PointBatch point ON point.PointBatchId = PointBatchItem.PointBatchId
+LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = point.DetectionRateId
+LEFT JOIN dbo.HJGL_WeldJoint jot ON jot.WeldJointId = BatchTrustItem.WeldJointId
+LEFT JOIN dbo.HJGL_Pipeline pipe ON pipe.PipelineId = jot.PipelineId
+LEFT JOIN Base_PipingClass AS pipingClass ON PipingClass.PipingClassId=pipe.PipingClassId
+LEFT JOIN dbo.WBS_UnitWork UnitWork ON UnitWork.UnitWorkId = BatchTrust.UnitWorkId
+LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = jot.WeldTypeId
+LEFT JOIN dbo.SitePerson_Person welder ON welder.PersonId = jot.BackingWelderId and welder.ProjectId=BatchTrust.ProjectId
+LEFT JOIN dbo.Base_Material mat ON mat.MaterialId = jot.Material1Id
+LEFT JOIN dbo.Base_WeldingMethod method ON method.WeldingMethodId = jot.WeldingMethodId
+
+
+
+
+
+
+
+
+
+GO
+
+
+
+
+ALTER VIEW [dbo].[View_GenerateTrustItem]
+AS
+SELECT point.ProjectId,point.UnitWorkId ,point.UnitId,point.DetectionTypeId,point.DetectionRateId,
+ --上面是条件
+ pipe.PipelineCode, --管线号
+pipingClass.PipingClassCode, --管线等级
+jot.WeldJointCode+isnull((select RepairMark from [dbo].[HJGL_RepairRecord] where [WeldJointId]=trustItem.WeldJointId),'')+(case when pointItem.PointState='2' then 'K' else '' end) as WeldJointCode, --焊口号
+mat.MaterialCode, --材质
+jot.JointArea, --焊接区域
+welder.WelderCode AS WelderCode, --焊工号
+weldType.WeldTypeCode, --焊缝类型
+jot.Dia, --外径
+jot.Size, --寸径
+jot.Thickness, --壁厚
+method.WeldingMethodCode, --焊接方法
+rate.DetectionRateCode,
+pointItem.PointDate, --点口日期
+ pointItem.PointBatchItemId,pointItem.PointBatchId,pointItem.WeldJointId
+FROM dbo.HJGL_Batch_PointBatchItem pointItem
+LEFT JOIN dbo.HJGL_Batch_PointBatch point ON point.PointBatchId = pointItem.PointBatchId
+LEFT JOIN dbo.HJGL_WeldJoint jot ON jot.WeldJointId = pointItem.WeldJointId
+LEFT JOIN dbo.HJGL_Pipeline pipe ON pipe.PipelineId = jot.PipelineId
+LEFT JOIN Base_PipingClass AS pipingClass ON PipingClass.PipingClassId=pipe.PipingClassId
+LEFT JOIN dbo.HJGL_Batch_BatchTrustItem trustItem ON trustItem.PointBatchItemId = pointItem.PointBatchItemId
+LEFT JOIN dbo.Base_Material mat ON mat.MaterialId = jot.Material1Id
+LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = jot.WeldTypeId
+LEFT JOIN dbo.SitePerson_Person welder ON welder.PersonId = jot.BackingWelderId and welder.ProjectId=point.ProjectId
+LEFT JOIN dbo.Base_WeldingMethod method ON method.WeldingMethodId = jot.WeldingMethodId
+LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = point.DetectionRateId
+WHERE pointItem.PointState IS NOT NULL AND pointItem.CutDate IS NULL
+ AND trustItem.TrustBatchItemId IS NULL
+
+
+
+
+GO
+
+
+
+
diff --git a/DataBase/版本日志/SGGLDB_V2025-05-08-001.sql b/DataBase/版本日志/SGGLDB_V2025-05-08-001.sql
new file mode 100644
index 00000000..753b191e
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-05-08-001.sql
@@ -0,0 +1,96 @@
+ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+ VALUES('EEC0D060-C15E-4D25-B015-C2B91F735DAC','车次管理','HJGL/PreDesign/TrainNumberManager.aspx',40,'1E36EA73-D536-4215-BFB9-A8771937BD89','Menu_HJGL',0,1,1)
+ GO
+ /*'车次管理*/
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('75ED227C-3DB8-4F6D-8AC3-B0B3FD8D21AC','EEC0D060-C15E-4D25-B015-C2B91F735DAC','增加',1)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('B4295318-92C4-4072-9F30-6E50CB2E007D','EEC0D060-C15E-4D25-B015-C2B91F735DAC','修改',2)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('35D1601D-ED59-4C0B-8069-178B2780310E','EEC0D060-C15E-4D25-B015-C2B91F735DAC','保存',3)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('99A2A6C8-A679-4FAF-942C-B663BFE9B9D9','EEC0D060-C15E-4D25-B015-C2B91F735DAC','查看',4)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('DC684D40-EE08-4689-A2D1-73AC4EB04B60','EEC0D060-C15E-4D25-B015-C2B91F735DAC','删除',5)
+ GO
+
+ alter table dbo.HJGL_PackagingManage
+ add TypeInt int
+ go
+
+
+ create table dbo.HJGL_PackagingManageDetail
+ (
+ Id nvarchar(50) not null
+ constraint HJGL_PackagingManageDetail_pk
+ primary key,
+ PackagingManageId nvarchar(50),
+ PipelineId nvarchar(50),
+ PipelineComponentId nvarchar(50),
+ MaterialCode nvarchar(50),
+ Number decimal(9, 2),
+ CreateTime datetime,
+ CreateUser nvarchar(50),
+
+ )
+create table dbo.HJGL_TrainNumberManage
+(
+ Id nvarchar(50) not null
+ constraint PK_HJGL_TrainNumberManage
+ primary key,
+ TrainNumber nvarchar(50),
+ ProjectId nvarchar(50),
+ State int,
+ DriverName nvarchar(50),
+ DriverPhone nvarchar(50),
+ LicensePlateNumber nvarchar(50),
+ ContactName nvarchar(50),
+ ContactPhone nvarchar(50),
+ Remark nvarchar(800),
+)
+go
+
+exec sp_addextendedproperty 'MS_Description', N'主键', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'Id'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'驾驶员姓名', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'DriverName'
+go
+exec sp_addextendedproperty 'MS_Description', N'驾驶员电话', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'DriverPhone'
+go
+exec sp_addextendedproperty 'MS_Description', N'车牌号', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'LicensePlateNumber'
+go
+exec sp_addextendedproperty 'MS_Description', N'联系人姓名', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'ContactName'
+go
+exec sp_addextendedproperty 'MS_Description', N'联系人电话', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'ContactPhone'
+go
+exec sp_addextendedproperty 'MS_Description', N'车次', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'TrainNumber'
+go
+exec sp_addextendedproperty 'MS_Description', N'项目id', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'ProjectId'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'状态', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'State'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'备注', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage', 'COLUMN',
+ 'Remark'
+go
+
+exec sp_addextendedproperty 'MS_Description', N'车次管理表', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_TrainNumberManage'
+go
+
+alter table dbo.HJGL_PackagingManage
+ add TrainNumberId varchar(50)
+go
+alter table dbo.HJGL_PackagingManage
+ add TypeInt int
+go
+exec sp_addextendedproperty 'MS_Description', N'车次管理主键id', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_PackagingManage',
+ 'COLUMN', 'TrainNumberId'
+go
+exec sp_addextendedproperty 'MS_Description', N'包装类别', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_PackagingManage',
+ 'COLUMN', 'TypeInt'
+go
\ No newline at end of file
diff --git a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql
index 1d2fb0b4..f205aa29 100644
--- a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql
+++ b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql
@@ -128,6 +128,16 @@ GO
INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('41655145-E541-42A6-B975-4CF2B19DA31D','F18CFC0E-47E0-477A-9AB3-72B88D438299','鿴',4)
INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('5D69F8CE-44D4-44D7-9C52-4A379B894D38','F18CFC0E-47E0-477A-9AB3-72B88D438299','ɾ',5)
GO
+ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+ VALUES('EEC0D060-C15E-4D25-B015-C2B91F735DAC','ι','HJGL/PreDesign/TrainNumberManager.aspx',40,'1E36EA73-D536-4215-BFB9-A8771937BD89','Menu_HJGL',0,1,1)
+ GO
+ /*'װ*/
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('75ED227C-3DB8-4F6D-8AC3-B0B3FD8D21AC','EEC0D060-C15E-4D25-B015-C2B91F735DAC','',1)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('B4295318-92C4-4072-9F30-6E50CB2E007D','EEC0D060-C15E-4D25-B015-C2B91F735DAC','',2)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('35D1601D-ED59-4C0B-8069-178B2780310E','EEC0D060-C15E-4D25-B015-C2B91F735DAC','',3)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('99A2A6C8-A679-4FAF-942C-B663BFE9B9D9','EEC0D060-C15E-4D25-B015-C2B91F735DAC','鿴',4)
+ INSERT INTO Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('DC684D40-EE08-4689-A2D1-73AC4EB04B60','EEC0D060-C15E-4D25-B015-C2B91F735DAC','ɾ',5)
+ GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('25DED954-10C9-47CC-99F2-C44FDE9E0A81','װ','HJGL/PreDesign/PackagingManage.aspx',40,'1E36EA73-D536-4215-BFB9-A8771937BD89','Menu_HJGL',0,1,1)
GO
diff --git a/SGGL/.vscode/settings.json b/SGGL/.vscode/settings.json
new file mode 100644
index 00000000..013007bb
--- /dev/null
+++ b/SGGL/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "dotnet.preferCSharpExtension": true
+}
\ No newline at end of file
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 5e1398c9..1cf2f498 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -405,7 +405,9 @@
+
+
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 153ce344..5a9981a1 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -2952,6 +2952,10 @@ namespace BLL
/// 包装管理
///
public const string HJGL_PackagingManageMenuId = "25DED954-10C9-47CC-99F2-C44FDE9E0A81";
+ ///
+ /// 车次管理
+ ///
+ public const string HJGL_TrainNumberManageMenuId = "EEC0D060-C15E-4D25-B015-C2B91F735DAC";
#endregion
#region 数据导入
diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs
index 9e8d18c3..63a82ecb 100644
--- a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs
+++ b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs
@@ -21,6 +21,9 @@ namespace BLL
public string PackagingCode { get; set; }
public string ProjectId { get; set; }
public string ProjectName { get; set; }
+ public string DriverName { get; set; }
+ public string DriverPhone { get; set; }
+ public string LicensePlateNumber { get; set; }
public string ContactName { get; set; }
public string ContactPhone { get; set; }
public string StackingPosition { get; set; }
@@ -32,6 +35,7 @@ namespace BLL
public string Code { get; set; }
public string TrainNumber { get; set; }
+ public string TrainNumberOld { get; set; }
}
@@ -56,56 +60,19 @@ namespace BLL
list[2] = new ListItem("已到场", state_2.ToString());
return list;
}
- #region 获取列表
- ///
- /// 记录数
- ///
- public static int count
- {
- get;
- set;
- }
- /// 获取分页列表
- ///
- /// 页码
- /// 每页数量
- ///
- public static IEnumerable getListData(string name, Grid Grid1)
+ public enum TypeInt : int
{
- var db1 = Funs.DB;
- IQueryable q1 = (from x in db1.HJGL_PackagingManage
- join y in db1.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId
- join z in db1.HJGL_Pipeline on y.PipelineId equals z.PipelineId
- select x
- );
- if (!string.IsNullOrEmpty(name))
- {
- q1 = q1.Where(e => e.PackagingManageId.Contains(name));
- }
- count = q1.Count();
- if (count == 0)
- {
- return null;
- }
- q1 = SortConditionHelper.SortingAndPaging(q1, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
- return from x in q1
- select new
- {
- x.PackagingManageId,
- x.PackagingCode,
- x.ProjectId,
- x.PipelineComponentId,
- x.StackingPosition,
- x.State,
- x.ContactName,
- x.ContactPhone,
- x.Remark,
- x.TrainNumber
- };
+ 预制组件 = 10,
+ 预制散件 = 20,
+ 其他材料 = 30,
}
- #endregion
-
+ public static Dictionary TypeIntMap = new Dictionary
+ {
+ { "预制组件" ,(int)TypeInt.预制组件},
+ { "预制散件" ,(int)TypeInt.预制散件},
+ { "其他材料" ,(int)TypeInt.其他材料},
+ };
public static Model.HJGL_PackagingManage GetHJGL_PackagingManageById(string PackagingManageId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
@@ -128,37 +95,52 @@ namespace BLL
}
return PlanStartDate;
}
- public static List GetPackagingManageList(string projectId, string PackagingCode, int pageIndex, int pageSize)
+ public static (List Data, int Total) GetPackagingManageList(string projectId, string PackagingCode, int pageIndex = 0, int pageSize = 20)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- var q = (from x in db.HJGL_PackagingManage
+ var baseQuery = (from x in db.HJGL_PackagingManage
join n in db.Base_Project on x.ProjectId equals n.ProjectId
- join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
+ join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
from t in tt.DefaultIfEmpty()
- where x.ProjectId == projectId
+ join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains
+ from train in trains.DefaultIfEmpty()
+ where x.ProjectId == projectId
&& (string.IsNullOrEmpty(PackagingCode) || x.PackagingCode.Contains(PackagingCode))
select new PackagingManageItem
{
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
- ContactName = x.ContactName,
- ContactPhone = x.ContactPhone,
+ ContactName = train.ContactName,
+ ContactPhone = train.ContactPhone,
+ DriverName = train.DriverName,
+ DriverPhone = train.DriverPhone,
+ LicensePlateNumber = train.LicensePlateNumber,
StackingPosition = x.StackingPosition,
State = x.State,
ReceiveMan = t.PersonName,
ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "",
PlanStartDate = GetMinPlanStartDate(x.PackagingManageId),
- TrainNumber = x.TrainNumber,
+ TrainNumberOld = x.TrainNumber,
+ TrainNumber = train.TrainNumber,
Code = x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).Substring(x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).LastIndexOf("-") + 1),
}).Distinct();
- return q.OrderByDescending(x => x.Code).Skip(pageIndex * pageSize).Take(pageSize).ToList();
+
+ var pagedData = baseQuery
+ .OrderByDescending(x => x.Code)
+ .Skip((pageIndex) * pageSize)
+ .Take(pageSize)
+ .ToList();
+
+ // 获取总记录数(延迟计数优化)
+ var totalCount = baseQuery.Count();
+ return (pagedData, totalCount);
}
- }
+ }
///
/// 形成出库单
///
@@ -233,7 +215,9 @@ namespace BLL
Remark = newtable.Remark,
ReceiveDate = newtable.ReceiveDate,
ReceiveMan = newtable.ReceiveMan,
- TrainNumber = newtable.TrainNumber
+ TrainNumber = newtable.TrainNumber,
+ TrainNumberId = newtable.TrainNumberId,
+ TypeInt = newtable.TypeInt,
};
var db1 = Funs.DB;
db1.HJGL_PackagingManage.InsertOnSubmit(table);
@@ -259,6 +243,8 @@ namespace BLL
table.ReceiveMan = newtable.ReceiveMan;
table.ReceiveDate = newtable.ReceiveDate;
table.TrainNumber = newtable.TrainNumber;
+ table.TrainNumberId = newtable.TrainNumberId;
+ table.TypeInt = newtable.TypeInt;
db1.SubmitChanges();
}
diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingmanagedetailService.cs b/SGGL/BLL/HJGL/PreDesign/PackagingmanagedetailService.cs
new file mode 100644
index 00000000..57ccb6d5
--- /dev/null
+++ b/SGGL/BLL/HJGL/PreDesign/PackagingmanagedetailService.cs
@@ -0,0 +1,201 @@
+using FineUIPro;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+
+namespace BLL
+{
+
+ public static class PackagingmanagedetailService
+ {
+
+
+
+ #region 获取列表
+ ///
+ /// 记录数
+ ///
+ public static int Count
+ {
+ get;
+ set;
+ }
+ private static IQueryable GetByQueryModle(Model.HJGL_PackagingManageDetail table)
+ {
+ var q = from x in Funs.DB.HJGL_PackagingManageDetail select x;
+ if (table == null)
+ {
+ return q;
+ }
+ if (!string.IsNullOrEmpty(table.Id))
+ {
+ q = q.Where(x => x.Id.Contains(table.Id));
+ }
+ if (!string.IsNullOrEmpty(table.PackagingManageId))
+ {
+ q = q.Where(x => x.PackagingManageId.Contains(table.PackagingManageId));
+ }
+ if (!string.IsNullOrEmpty(table.PipelineId))
+ {
+ q = q.Where(x => x.PipelineId.Contains(table.PipelineId));
+ }
+ if (!string.IsNullOrEmpty(table.PipelineComponentId))
+ {
+ q = q.Where(x => x.PipelineComponentId.Contains(table.PipelineComponentId));
+ }
+ if (!string.IsNullOrEmpty(table.MaterialCode))
+ {
+ q = q.Where(x => x.MaterialCode.Contains(table.MaterialCode));
+ }
+ if (table.Number != null)
+ {
+ q = q.Where(x => x.Number == table.Number);
+ }
+ if (table.CreateTime != null)
+ {
+ q = q.Where(x => x.CreateTime == table.CreateTime);
+ }
+ if (!string.IsNullOrEmpty(table.CreateUser))
+ {
+ q = q.Where(x => x.CreateUser.Contains(table.CreateUser));
+ }
+ ;
+
+ return q;
+ }
+ public static List GetListByQueryModle(Model.HJGL_PackagingManageDetail table)
+ {
+ return GetByQueryModle(table).ToList();
+
+ }
+ public static (List Data, int Total) GetListByQueryModle(Model.HJGL_PackagingManageDetail table, int pageIndex = 0, int pageSize = 20)
+ {
+ var baseQuery = GetByQueryModle(table);
+ var pagedData = baseQuery
+ .Skip((pageIndex) * pageSize)
+ .Take(pageSize)
+ .ToList();
+
+ // 获取总记录数(延迟计数优化)
+ var totalCount = baseQuery.Count();
+
+ return (pagedData, totalCount);
+
+ }
+ ///
+ /// 获取分页列表
+ ///
+ ///
+ ///
+ ///
+ public static IEnumerable GetListData(Model.HJGL_PackagingManageDetail table, Grid grid1)
+ {
+ var q = GetByQueryModle(table);
+ Count = q.Count();
+ if (Count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.Id,
+ x.PackagingManageId,
+ x.PipelineId,
+ x.PipelineComponentId,
+ x.MaterialCode,
+ x.Number,
+ x.CreateTime,
+ x.CreateUser,
+
+ };
+ }
+
+ #endregion
+
+ public static Model.HJGL_PackagingManageDetail GetModelById(string Id)
+ {
+ return Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
+ }
+ public static IEnumerable GetPackagingData(string PackagingManageId)
+ {
+ var q = from detail in Funs.DB.HJGL_PackagingManageDetail
+ join lib in Funs.DB.HJGL_MaterialCodeLib on detail.MaterialCode equals lib.MaterialCode into libJoin
+ from libItem in libJoin.DefaultIfEmpty()
+ join line in Funs.DB.HJGL_Pipeline on detail.PipelineId equals line.PipelineId into lineJoin
+ from lineItem in lineJoin.DefaultIfEmpty()
+ where detail.PackagingManageId == PackagingManageId
+ select new
+ {
+ detail.Id,
+ libItem.MaterialCode,
+ libItem.MaterialName,
+ libItem.MaterialUnit,
+ libItem.MaterialSpec,
+ libItem.MaterialMade,
+ libItem.MaterialDef,
+ detail.Number,
+ lineItem.PipelineId,
+ lineItem.PipelineCode,
+
+ };
+ return q;
+ }
+
+
+ public static void Add(Model.HJGL_PackagingManageDetail newtable)
+ {
+
+ Model.HJGL_PackagingManageDetail table = new Model.HJGL_PackagingManageDetail
+ {
+ Id = newtable.Id,
+ PackagingManageId = newtable.PackagingManageId,
+ PipelineId = newtable.PipelineId,
+ PipelineComponentId = newtable.PipelineComponentId,
+ MaterialCode = newtable.MaterialCode,
+ Number = newtable.Number,
+ CreateTime = newtable.CreateTime,
+ CreateUser = newtable.CreateUser,
+ };
+ Funs.DB.HJGL_PackagingManageDetail.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+
+ public static void Update(Model.HJGL_PackagingManageDetail newtable)
+ {
+
+ Model.HJGL_PackagingManageDetail table = Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == newtable.Id);
+ if (table != null)
+ {
+ table.Id = newtable.Id;
+ table.PackagingManageId = newtable.PackagingManageId;
+ table.PipelineId = newtable.PipelineId;
+ table.PipelineComponentId = newtable.PipelineComponentId;
+ table.MaterialCode = newtable.MaterialCode;
+ table.Number = newtable.Number;
+ table.CreateTime = newtable.CreateTime;
+ table.CreateUser = newtable.CreateUser;
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+ public static void DeleteById(string Id)
+ {
+
+ Model.HJGL_PackagingManageDetail table = Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
+ if (table != null)
+ {
+ Funs.DB.HJGL_PackagingManageDetail.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/SGGL/BLL/HJGL/PreDesign/TrainNumberManageService.cs b/SGGL/BLL/HJGL/PreDesign/TrainNumberManageService.cs
new file mode 100644
index 00000000..acb3a45f
--- /dev/null
+++ b/SGGL/BLL/HJGL/PreDesign/TrainNumberManageService.cs
@@ -0,0 +1,202 @@
+using FineUIPro;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BLL
+{
+ public static class TrainNumberManageService
+ {
+ ///
+ /// 记录数
+ ///
+ public static int Count
+ {
+ get;
+ set;
+ }
+
+ private static IQueryable GetByQueryModle(Model.HJGL_TrainNumberManage table)
+ {
+ var q = from x in Funs.DB.HJGL_TrainNumberManage select x;
+ if (table == null)
+ {
+ return q;
+ }
+ if (!string.IsNullOrEmpty(table.Id))
+ {
+ q = q.Where(x => x.Id.Contains(table.Id));
+ }
+ if (!string.IsNullOrEmpty(table.TrainNumber))
+ {
+ q = q.Where(x => x.TrainNumber.Contains(table.TrainNumber));
+ }
+ if (!string.IsNullOrEmpty(table.ProjectId))
+ {
+ q = q.Where(x => x.ProjectId.Contains(table.ProjectId));
+ }
+ if (table.State != null)
+ {
+ q = q.Where(x => x.State == table.State);
+ }
+ if (!string.IsNullOrEmpty(table.DriverName))
+ {
+ q = q.Where(x => x.DriverName.Contains(table.DriverName));
+ }
+ if (!string.IsNullOrEmpty(table.DriverPhone))
+ {
+ q = q.Where(x => x.DriverPhone.Contains(table.DriverPhone));
+ }
+ if (!string.IsNullOrEmpty(table.LicensePlateNumber))
+ {
+ q = q.Where(x => x.LicensePlateNumber.Contains(table.LicensePlateNumber));
+ }
+ if (!string.IsNullOrEmpty(table.ContactName))
+ {
+ q = q.Where(x => x.ContactName.Contains(table.ContactName));
+ }
+ if (!string.IsNullOrEmpty(table.ContactPhone))
+ {
+ q = q.Where(x => x.ContactPhone.Contains(table.ContactPhone));
+ }
+ if (!string.IsNullOrEmpty(table.Remark))
+ {
+ q = q.Where(x => x.Remark.Contains(table.Remark));
+ }
+ q = q.OrderByDescending(x => x.TrainNumber);
+
+ return q;
+ }
+
+ public static List GetListByQueryModle(Model.HJGL_TrainNumberManage table)
+ {
+ return GetByQueryModle(table).ToList();
+ }
+
+ public static (List Data, int Total) GetListByQueryModle(Model.HJGL_TrainNumberManage table, int pageIndex = 0, int pageSize = 20)
+ {
+ var baseQuery = GetByQueryModle(table);
+ var pagedData = baseQuery
+ .Skip((pageIndex) * pageSize)
+ .Take(pageSize)
+ .ToList();
+
+ // 获取总记录数(延迟计数优化)
+ var totalCount = baseQuery.Count();
+
+ return (pagedData, totalCount);
+ }
+
+ ///
+ /// 获取分页列表
+ ///
+ ///
+ ///
+ ///
+ public static IEnumerable GetListData(Model.HJGL_TrainNumberManage table, Grid grid1)
+ {
+ var q = GetByQueryModle(table);
+ Count = q.Count();
+ if (Count == 0)
+ {
+ return null;
+ }
+ q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
+ // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
+ return from x in q
+ select new
+ {
+ x.Id,
+ x.TrainNumber,
+ x.ProjectId,
+ x.State,
+ x.DriverName,
+ x.DriverPhone,
+ x.LicensePlateNumber,
+ x.ContactName,
+ x.ContactPhone,
+ x.Remark,
+ };
+ }
+
+ public static Model.HJGL_TrainNumberManage GetModelById(string Id)
+ {
+ return Funs.DB.HJGL_TrainNumberManage.FirstOrDefault(x => x.Id == Id);
+ }
+
+ //根据projectid 获取最新车次号
+ public static string GetNewTrainNumber(string ProjectId)
+ {
+ var q = from x in Funs.DB.HJGL_TrainNumberManage
+ where x.ProjectId == ProjectId
+ select x.TrainNumber;
+ var max = q.Count();
+ var NewTrainNumber=(max+1).ToString().PadLeft(2, '0');
+ return NewTrainNumber;
+
+ }
+
+ public static void Add(Model.HJGL_TrainNumberManage newtable)
+ {
+ Model.HJGL_TrainNumberManage table = new Model.HJGL_TrainNumberManage
+ {
+ Id = newtable.Id,
+ TrainNumber = newtable.TrainNumber,
+ ProjectId = newtable.ProjectId,
+ State = newtable.State,
+ DriverName = newtable.DriverName,
+ DriverPhone = newtable.DriverPhone,
+ LicensePlateNumber = newtable.LicensePlateNumber,
+ ContactName = newtable.ContactName,
+ ContactPhone = newtable.ContactPhone,
+ Remark = newtable.Remark,
+ };
+ Funs.DB.HJGL_TrainNumberManage.InsertOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+
+ public static void Update(Model.HJGL_TrainNumberManage newtable)
+ {
+ Model.HJGL_TrainNumberManage table = Funs.DB.HJGL_TrainNumberManage.FirstOrDefault(x => x.Id == newtable.Id);
+ if (table != null)
+ {
+ table.Id = newtable.Id;
+ table.TrainNumber = newtable.TrainNumber;
+ table.ProjectId = newtable.ProjectId;
+ table.State = newtable.State;
+ table.DriverName = newtable.DriverName;
+ table.DriverPhone = newtable.DriverPhone;
+ table.LicensePlateNumber = newtable.LicensePlateNumber;
+ table.ContactName = newtable.ContactName;
+ table.ContactPhone = newtable.ContactPhone;
+ table.Remark = newtable.Remark;
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ public static void DeleteById(string Id)
+ {
+ Model.HJGL_TrainNumberManage table = Funs.DB.HJGL_TrainNumberManage.FirstOrDefault(x => x.Id == Id);
+ if (table != null)
+ {
+ Funs.DB.HJGL_TrainNumberManage.DeleteOnSubmit(table);
+ Funs.DB.SubmitChanges();
+ }
+ }
+
+ public static void InitDownListOfTrainNumber(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
+ {
+ Model.HJGL_TrainNumberManage table = new Model.HJGL_TrainNumberManage();
+ table.ProjectId = projectId;
+
+ dropName.DataValueField = "Id";
+ dropName.DataTextField = "TrainNumber";
+ dropName.DataSource = GetListByQueryModle(table);
+ dropName.DataBind();
+ if (isShowPlease)
+ {
+ Funs.FineUIPleaseSelect(dropName);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 884338d2..41f14550 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1553,8 +1553,12 @@
+
+
+
+
@@ -10544,6 +10548,20 @@
PackagingManageEdit.aspx
+
+ PackagingManageSelect.aspx
+ ASPXCodeBehind
+
+
+ PackagingManageSelect.aspx
+
+
+ PackagingManageSelectStock.aspx
+ ASPXCodeBehind
+
+
+ PackagingManageSelectStock.aspx
+
PackagingManageView.aspx
ASPXCodeBehind
@@ -10558,6 +10576,20 @@
PrePipelineQRCodeIn.aspx
+
+ TrainNumberManager.aspx
+ ASPXCodeBehind
+
+
+ TrainNumberManager.aspx
+
+
+ TrainNumberManageEdit.aspx
+ ASPXCodeBehind
+
+
+ TrainNumberManageEdit.aspx
+
YardPlanning.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx
index f323f9e1..7c753271 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx
@@ -49,7 +49,10 @@
--%>
-
+
+
+
@@ -59,6 +62,15 @@
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx.cs
index 1e440eb3..562bbcdb 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManage.aspx.cs
@@ -66,10 +66,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
//var table = this.GetPagedDataTable(Grid1, tb);
//Grid1.DataSource = table;
//Grid1.DataBind();
- var list2 = BLL.HJGL_PackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), 0, 10000);
var list = BLL.HJGL_PackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), this.Grid1.PageIndex, this.Grid1.PageSize);
- Grid1.RecordCount = list2.Count;
- Grid1.DataSource = list;
+ Grid1.RecordCount = list.Total;
+ Grid1.DataSource = list.Data;
Grid1.DataBind();
}
#endregion
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManageEdit.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManageEdit.aspx
index b0e9b881..147a8c7e 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManageEdit.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PackagingManageEdit.aspx
@@ -14,19 +14,23 @@
- <%--
- --%>
-
-
-
+
+
+
+
+
+
+
+
+
+ ShowBorder="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true"
+ DataKeyNames="PipelineComponentId"
+ AllowSorting="true" SortField="PipelineComponentCode" SortDirection="ASC">
+
+ LabelWidth="180px">
-
-
-
+
+
+
+ EnablePostBack="true" OnClick="btnFind_Click1" runat="server">
@@ -58,35 +63,65 @@
- <%--
- --%>
-
-
-
-
- <%--
- --%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ <%--
+ --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -100,6 +135,11 @@
+
+