diff --git a/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_建表脚本).sql b/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_建表脚本).sql
new file mode 100644
index 00000000..f1dcc466
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_建表脚本).sql
@@ -0,0 +1,119 @@
+/*
+防腐委托单建表脚本
+执行后请手动重新生成 LINQ to SQL 模型。
+*/
+
+IF OBJECT_ID(N'dbo.Tw_AntiCorrosionTrust', N'U') IS NULL
+BEGIN
+ CREATE TABLE dbo.Tw_AntiCorrosionTrust
+ (
+ Id NVARCHAR(50) NOT NULL CONSTRAINT PK_Tw_AntiCorrosionTrust PRIMARY KEY,
+ ProjectId NVARCHAR(50) NOT NULL,
+ UnitWorkId NVARCHAR(50) NOT NULL,
+ ConstructionPart NVARCHAR(200) NULL,
+ ConstructionProfessional NVARCHAR(100) NULL,
+ TrustCode NVARCHAR(200) NOT NULL,
+ OutputMasterId NVARCHAR(50) NOT NULL,
+ DemandDate DATETIME NULL,
+ CompleteDate DATETIME NULL,
+ CreateMan NVARCHAR(50) NULL,
+ CreateDate DATETIME NULL,
+ Remark NVARCHAR(500) NULL
+ );
+END;
+GO
+
+IF OBJECT_ID(N'dbo.Tw_AntiCorrosionTrustDetail', N'U') IS NULL
+BEGIN
+ CREATE TABLE dbo.Tw_AntiCorrosionTrustDetail
+ (
+ Id NVARCHAR(50) NOT NULL CONSTRAINT PK_Tw_AntiCorrosionTrustDetail PRIMARY KEY,
+ TrustId NVARCHAR(50) NOT NULL,
+ SortIndex INT NULL,
+ MaterialCode NVARCHAR(50) NOT NULL,
+ Quantity DECIMAL(18, 4) NULL,
+ PaintCode NVARCHAR(50) NULL,
+ Primer NVARCHAR(300) NULL,
+ IntermediatePaint NVARCHAR(300) NULL,
+ Topcoat NVARCHAR(300) NULL,
+ ColorCode NVARCHAR(100) NULL,
+ Remark NVARCHAR(500) NULL
+ );
+END;
+GO
+
+IF OBJECT_ID(N'dbo.Tw_PaintCodeDict', N'U') IS NULL
+BEGIN
+ CREATE TABLE dbo.Tw_PaintCodeDict
+ (
+ Id NVARCHAR(50) NOT NULL CONSTRAINT PK_Tw_PaintCodeDict PRIMARY KEY,
+ PaintCode NVARCHAR(50) NOT NULL,
+ Primer NVARCHAR(300) NULL,
+ IntermediatePaint NVARCHAR(300) NULL,
+ Topcoat NVARCHAR(300) NULL,
+ ColorCode NVARCHAR(100) NULL,
+ SortIndex INT NULL,
+ IsUsed BIT NOT NULL CONSTRAINT DF_Tw_PaintCodeDict_IsUsed DEFAULT(1)
+ );
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'UX_Tw_AntiCorrosionTrust_Project_TrustCode' AND object_id = OBJECT_ID(N'dbo.Tw_AntiCorrosionTrust'))
+BEGIN
+ CREATE UNIQUE INDEX UX_Tw_AntiCorrosionTrust_Project_TrustCode
+ ON dbo.Tw_AntiCorrosionTrust(ProjectId, TrustCode);
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'UX_Tw_AntiCorrosionTrust_OutputMasterId' AND object_id = OBJECT_ID(N'dbo.Tw_AntiCorrosionTrust'))
+BEGIN
+ CREATE UNIQUE INDEX UX_Tw_AntiCorrosionTrust_OutputMasterId
+ ON dbo.Tw_AntiCorrosionTrust(OutputMasterId);
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'IX_Tw_AntiCorrosionTrust_Project_UnitWork' AND object_id = OBJECT_ID(N'dbo.Tw_AntiCorrosionTrust'))
+BEGIN
+ CREATE INDEX IX_Tw_AntiCorrosionTrust_Project_UnitWork
+ ON dbo.Tw_AntiCorrosionTrust(ProjectId, UnitWorkId);
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'IX_Tw_AntiCorrosionTrustDetail_TrustId' AND object_id = OBJECT_ID(N'dbo.Tw_AntiCorrosionTrustDetail'))
+BEGIN
+ CREATE INDEX IX_Tw_AntiCorrosionTrustDetail_TrustId
+ ON dbo.Tw_AntiCorrosionTrustDetail(TrustId, SortIndex);
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'UX_Tw_PaintCodeDict_PaintCode' AND object_id = OBJECT_ID(N'dbo.Tw_PaintCodeDict'))
+BEGIN
+ CREATE UNIQUE INDEX UX_Tw_PaintCodeDict_PaintCode
+ ON dbo.Tw_PaintCodeDict(PaintCode);
+END;
+GO
+
+IF NOT EXISTS (SELECT 1 FROM dbo.Tw_PaintCodeDict WHERE PaintCode = N'A.1')
+BEGIN
+ INSERT INTO dbo.Tw_PaintCodeDict (Id, PaintCode, Primer, IntermediatePaint, Topcoat, ColorCode, SortIndex)
+ VALUES (CONVERT(NVARCHAR(50), NEWID()), N'A.1', N'无机富锌硅酸盐涂层(60μm)', N'聚酰胺环氧树脂涂层(125μm)', N'/', N'无', 1);
+END;
+
+IF NOT EXISTS (SELECT 1 FROM dbo.Tw_PaintCodeDict WHERE PaintCode = N'A.2')
+BEGIN
+ INSERT INTO dbo.Tw_PaintCodeDict (Id, PaintCode, Primer, IntermediatePaint, Topcoat, ColorCode, SortIndex)
+ VALUES (CONVERT(NVARCHAR(50), NEWID()), N'A.2', N'环氧酚醛树脂涂层(100μm)', N'/', N'/', N'无', 2);
+END;
+
+IF NOT EXISTS (SELECT 1 FROM dbo.Tw_PaintCodeDict WHERE PaintCode = N'B.1')
+BEGIN
+ INSERT INTO dbo.Tw_PaintCodeDict (Id, PaintCode, Primer, IntermediatePaint, Topcoat, ColorCode, SortIndex)
+ VALUES (CONVERT(NVARCHAR(50), NEWID()), N'B.1', N'无机富锌硅酸盐涂层(60μm)', N'铝硅涂层(25μm)', N'/', N'无', 3);
+END;
+
+IF NOT EXISTS (SELECT 1 FROM dbo.Tw_PaintCodeDict WHERE PaintCode = N'B.2')
+BEGIN
+ INSERT INTO dbo.Tw_PaintCodeDict (Id, PaintCode, Primer, IntermediatePaint, Topcoat, ColorCode, SortIndex)
+ VALUES (CONVERT(NVARCHAR(50), NEWID()), N'B.2', N'无机富锌硅酸盐涂层(60μm)', N'铝硅涂层(25μm)', N'/', N'无', 4);
+END;
+GO
diff --git a/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_菜单脚本).sql b/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_菜单脚本).sql
new file mode 100644
index 00000000..3c275c9f
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2026-06-15-lpf(防腐委托单_菜单脚本).sql
@@ -0,0 +1,23 @@
+INSERT INTO Sys_Menu (MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+VALUES (N'4E88A676-89E3-44EC-BF50-37BE5F09D903',N'防腐管理',N'tag_blue',NULL,40,N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8',N'Menu_HJGL',0,0,1);
+GO
+INSERT INTO Sys_Menu (MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+VALUES (N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'防腐委托单',N'table',N'CLGL/AntiCorrosionTrust.aspx',10,N'4E88A676-89E3-44EC-BF50-37BE5F09D903',N'Menu_HJGL',0,1,1);
+GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'1BCEDE3D-2618-490E-8DA6-68922AB3201F',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'增加',2);
+ GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'47F9ADA6-22D2-42B6-8038-80C3CA5EEB2D',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'保存',6);
+ GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'715440E4-0C8D-4A2F-8456-06544FA7812B',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'查询',1);
+ GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'B846AA33-2767-40E5-B227-FE5B8B5ECCC4',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'删除',4);
+ GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'B937C073-8161-4996-A223-A7A4851791B0',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'修改',3);
+ GO
+ INSERT INTO Sys_ButtonToMenu (ButtonToMenuId,MenuId,ButtonName,SortIndex)
+ VALUES (N'E7CA37AF-341A-4D3C-BCF4-65670E699962',N'0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2',N'打印',5);
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 39f14b23..e4612de1 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -299,6 +299,7 @@
+
@@ -938,4 +939,4 @@
-->
-
\ No newline at end of file
+
diff --git a/SGGL/BLL/CLGL/TwAntiCorrosionTrustService.cs b/SGGL/BLL/CLGL/TwAntiCorrosionTrustService.cs
new file mode 100644
index 00000000..4cc318ec
--- /dev/null
+++ b/SGGL/BLL/CLGL/TwAntiCorrosionTrustService.cs
@@ -0,0 +1,455 @@
+using FineUIPro;
+using Model;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+
+namespace BLL
+{
+ ///
+ /// 防腐委托单服务。
+ ///
+ public static class TwAntiCorrosionTrustService
+ {
+ public static int Count { get; set; }
+
+ public static List GetListData(AntiCorrosionTrustOutput filter)
+ {
+ var query = from t in Funs.DB.Tw_AntiCorrosionTrust
+ join uw in Funs.DB.WBS_UnitWork on t.UnitWorkId equals uw.UnitWorkId into uwJoin
+ from uw in uwJoin.DefaultIfEmpty()
+ join om in Funs.DB.Tw_OutputMaster on t.OutputMasterId equals om.Id into omJoin
+ from om in omJoin.DefaultIfEmpty()
+ join p in Funs.DB.Person_Persons on t.CreateMan equals p.PersonId into pJoin
+ from p in pJoin.DefaultIfEmpty()
+ where (string.IsNullOrEmpty(filter.Id) || t.Id == filter.Id)
+ && (string.IsNullOrEmpty(filter.ProjectId) || t.ProjectId == filter.ProjectId)
+ && (string.IsNullOrEmpty(filter.UnitWorkId) || t.UnitWorkId == filter.UnitWorkId)
+ && (string.IsNullOrEmpty(filter.TrustCode) || t.TrustCode.Contains(filter.TrustCode))
+ && (string.IsNullOrEmpty(filter.OutputMasterCode) || om.CusBillCode.Contains(filter.OutputMasterCode))
+ orderby t.CreateDate descending, t.TrustCode descending
+ select new AntiCorrosionTrustOutput
+ {
+ Id = t.Id,
+ ProjectId = t.ProjectId,
+ UnitWorkId = t.UnitWorkId,
+ UnitWorkName = uw.UnitWorkName,
+ ConstructionPart = t.ConstructionPart,
+ ConstructionProfessional = t.ConstructionProfessional,
+ TrustCode = t.TrustCode,
+ OutputMasterId = t.OutputMasterId,
+ OutputMasterCode = om.CusBillCode,
+ DemandDate = t.DemandDate,
+ CompleteDate = t.CompleteDate,
+ CreateMan = t.CreateMan,
+ CreateManName = p.PersonName,
+ CreateDate = t.CreateDate,
+ Remark = t.Remark
+ };
+ return query.ToList();
+ }
+
+ public static IEnumerable GetListData(AntiCorrosionTrustOutput filter, Grid grid)
+ {
+ var list = GetListData(filter);
+ Count = list.Count;
+ return list.Skip(grid.PageIndex * grid.PageSize).Take(grid.PageSize).ToList();
+ }
+
+ public static AntiCorrosionTrustOutput GetById(string id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return null;
+ }
+
+ return GetListData(new AntiCorrosionTrustOutput { Id = id })
+ .FirstOrDefault(x => x.Id == id);
+ }
+
+ public static bool IsExistTrustCode(string trustCode, string id, string projectId)
+ {
+ return Funs.DB.Tw_AntiCorrosionTrust.Any(x => x.TrustCode == trustCode
+ && x.ProjectId == projectId
+ && (string.IsNullOrEmpty(id) || x.Id != id));
+ }
+
+ public static string GenerateTrustCode(string unitWorkId)
+ {
+ var unitWork = UnitWorkService.GetUnitWorkByUnitWorkId(unitWorkId);
+ if (unitWork == null)
+ {
+ return string.Empty;
+ }
+
+ var prefix = "SXHJ-ECFF-" + unitWork.UnitWorkName + "-";
+ var maxSerial = Funs.DB.Tw_AntiCorrosionTrust
+ .Where(x => x.UnitWorkId == unitWorkId && x.TrustCode.StartsWith(prefix))
+ .Select(x => x.TrustCode)
+ .ToList()
+ .Select(x => GetTrustCodeSerial(x))
+ .DefaultIfEmpty(0)
+ .Max();
+
+ return prefix + (maxSerial + 1).ToString("000");
+ }
+
+ public static List GetAvailableOutputMasters(string projectId, string unitWorkId, string currentTrustId)
+ {
+ var usedOutputIds = Funs.DB.Tw_AntiCorrosionTrust
+ .Where(x => x.ProjectId == projectId && (string.IsNullOrEmpty(currentTrustId) || x.Id != currentTrustId))
+ .Select(x => x.OutputMasterId)
+ .ToList();
+
+ var query = from om in Funs.DB.Tw_OutputMaster
+ join plan in Funs.DB.Tw_InOutPlanMaster on om.InOutPlanMasterId equals plan.Id into planJoin
+ from plan in planJoin.DefaultIfEmpty()
+ join createPerson in Funs.DB.Person_Persons on om.CreateMan equals createPerson.PersonId into createJoin
+ from createPerson in createJoin.DefaultIfEmpty()
+ join reqUnit in Funs.DB.Base_Unit on om.ReqUnitId equals reqUnit.UnitId into unitJoin
+ from reqUnit in unitJoin.DefaultIfEmpty()
+ where om.ProjectId == projectId
+ && !usedOutputIds.Contains(om.Id)
+ && (string.IsNullOrEmpty(unitWorkId) || (plan.WeldTaskId != null && plan.WeldTaskId.Contains(unitWorkId)))
+ orderby om.CreateDate descending, om.CusBillCode descending
+ select new Tw_InOutMasterOutput
+ {
+ Id = om.Id,
+ ProjectId = om.ProjectId,
+ CusBillCode = om.CusBillCode,
+ InOutPlanMasterId = om.InOutPlanMasterId,
+ WarehouseCode = om.WarehouseCode,
+ Source = om.Source,
+ TypeInt = om.TypeInt,
+ State = om.State,
+ CreateMan = om.CreateMan,
+ CreateManName = createPerson.PersonName,
+ CreateDate = om.CreateDate,
+ ReqUnitId = om.ReqUnitId,
+ ReqUnitName = reqUnit.UnitName,
+ Category = om.Category,
+ AuditMan = om.AuditMan,
+ AuditDate = om.AuditDate,
+ AuditMan2 = om.AuditMan2,
+ AuditDate2 = om.AuditDate2,
+ WarehouseMan = om.WarehouseMan,
+ WarehouseDate = om.WarehouseDate,
+ WeldTaskId = plan.WeldTaskId,
+ Remark = plan.Remark
+ };
+ return query.ToList();
+ }
+
+ public static Tw_InOutMasterOutput GetOutputMasterById(string id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return null;
+ }
+
+ var query = from om in Funs.DB.Tw_OutputMaster
+ join plan in Funs.DB.Tw_InOutPlanMaster on om.InOutPlanMasterId equals plan.Id into planJoin
+ from plan in planJoin.DefaultIfEmpty()
+ join reqUnit in Funs.DB.Base_Unit on om.ReqUnitId equals reqUnit.UnitId into unitJoin
+ from reqUnit in unitJoin.DefaultIfEmpty()
+ where om.Id == id
+ select new Tw_InOutMasterOutput
+ {
+ Id = om.Id,
+ ProjectId = om.ProjectId,
+ CusBillCode = om.CusBillCode,
+ InOutPlanMasterId = om.InOutPlanMasterId,
+ WarehouseCode = om.WarehouseCode,
+ Source = om.Source,
+ TypeInt = om.TypeInt,
+ State = om.State,
+ CreateMan = om.CreateMan,
+ CreateDate = om.CreateDate,
+ ReqUnitId = om.ReqUnitId,
+ ReqUnitName = reqUnit.UnitName,
+ Category = om.Category,
+ AuditMan = om.AuditMan,
+ AuditDate = om.AuditDate,
+ AuditMan2 = om.AuditMan2,
+ AuditDate2 = om.AuditDate2,
+ WarehouseMan = om.WarehouseMan,
+ WarehouseDate = om.WarehouseDate,
+ WeldTaskId = plan.WeldTaskId,
+ Remark = plan.Remark
+ };
+ return query.FirstOrDefault();
+ }
+
+ public static List GetDetailList(string trustId)
+ {
+ var query = from d in Funs.DB.Tw_AntiCorrosionTrustDetail
+ join m in Funs.DB.HJGL_MaterialCodeLib on d.MaterialCode equals m.MaterialCode into materialJoin
+ from m in materialJoin.DefaultIfEmpty()
+ where d.TrustId == trustId
+ orderby d.SortIndex
+ select new AntiCorrosionTrustDetailOutput
+ {
+ Id = d.Id,
+ TrustId = d.TrustId,
+ SortIndex = d.SortIndex,
+ MaterialCode = d.MaterialCode,
+ Code = m.Code,
+ MaterialName = m.MaterialName,
+ MaterialSpec = m.MaterialSpec,
+ MaterialDef = m.MaterialDef,
+ MaterialUnit = m.MaterialUnit,
+ Quantity = d.Quantity,
+ PaintCode = d.PaintCode,
+ Primer = d.Primer,
+ IntermediatePaint = d.IntermediatePaint,
+ Topcoat = d.Topcoat,
+ ColorCode = d.ColorCode,
+ Remark = d.Remark
+ };
+ return query.ToList();
+ }
+
+ public static List GetDetailsByOutputMasterId(string outputMasterId)
+ {
+ var outputDetails = Funs.DB.Tw_OutputDetail
+ .Where(x => x.OutputMasterId == outputMasterId)
+ .OrderBy(x => x.Id)
+ .ToList();
+ var materialCodes = outputDetails.Select(x => x.MaterialCode).Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
+ var materials = Funs.DB.HJGL_MaterialCodeLib
+ .Where(x => materialCodes.Contains(x.MaterialCode))
+ .ToDictionary(x => x.MaterialCode, x => x);
+
+ var index = 0;
+ var result = new List();
+ foreach (var detail in outputDetails)
+ {
+ index++;
+ HJGL_MaterialCodeLib material = null;
+ if (!string.IsNullOrEmpty(detail.MaterialCode) && materials.ContainsKey(detail.MaterialCode))
+ {
+ material = materials[detail.MaterialCode];
+ }
+
+ // 防腐明细只保存材料主编码和数量,展示字段统一由材料编码库补齐。
+ result.Add(new AntiCorrosionTrustDetailOutput
+ {
+ Id = SQLHelper.GetNewID(),
+ SortIndex = index,
+ MaterialCode = detail.MaterialCode,
+ Code = material == null ? string.Empty : material.Code,
+ MaterialName = material == null ? string.Empty : material.MaterialName,
+ MaterialSpec = material == null ? string.Empty : material.MaterialSpec,
+ MaterialDef = material == null ? string.Empty : material.MaterialDef,
+ MaterialUnit = material == null ? string.Empty : material.MaterialUnit,
+ Quantity = detail.ActNum ?? detail.PlanNum
+ });
+ }
+ return result;
+ }
+
+ public static List GetPaintCodeList()
+ {
+ return Funs.DB.Tw_PaintCodeDict
+ .Where(x => x.IsUsed)
+ .OrderBy(x => x.SortIndex)
+ .ThenBy(x => x.PaintCode)
+ .Select(x => new PaintCodeDictOutput
+ {
+ Id = x.Id,
+ PaintCode = x.PaintCode,
+ Primer = x.Primer,
+ IntermediatePaint = x.IntermediatePaint,
+ Topcoat = x.Topcoat,
+ ColorCode = x.ColorCode,
+ SortIndex = x.SortIndex
+ })
+ .ToList();
+ }
+
+ public static void Save(AntiCorrosionTrustOutput trust, List details)
+ {
+ var isNew = string.IsNullOrEmpty(trust.Id);
+ Tw_AntiCorrosionTrust entity;
+ if (isNew)
+ {
+ entity = new Tw_AntiCorrosionTrust
+ {
+ Id = SQLHelper.GetNewID(),
+ ProjectId = trust.ProjectId,
+ CreateMan = trust.CreateMan,
+ CreateDate = DateTime.Now
+ };
+ Funs.DB.Tw_AntiCorrosionTrust.InsertOnSubmit(entity);
+ }
+ else
+ {
+ entity = Funs.DB.Tw_AntiCorrosionTrust.FirstOrDefault(x => x.Id == trust.Id);
+ if (entity == null)
+ {
+ throw new Exception("防腐委托单不存在或已删除!");
+ }
+ }
+
+ entity.UnitWorkId = trust.UnitWorkId;
+ entity.ConstructionPart = trust.ConstructionPart;
+ entity.ConstructionProfessional = trust.ConstructionProfessional;
+ entity.TrustCode = trust.TrustCode;
+ entity.OutputMasterId = trust.OutputMasterId;
+ entity.DemandDate = trust.DemandDate;
+ entity.CompleteDate = trust.CompleteDate;
+ entity.Remark = trust.Remark;
+
+ var oldDetails = Funs.DB.Tw_AntiCorrosionTrustDetail.Where(x => x.TrustId == entity.Id).ToList();
+ Funs.DB.Tw_AntiCorrosionTrustDetail.DeleteAllOnSubmit(oldDetails);
+
+ var paintMap = GetPaintCodeList().ToDictionary(x => x.PaintCode ?? string.Empty, x => x);
+ var index = 0;
+ foreach (var detail in details.Where(x => !string.IsNullOrEmpty(x.MaterialCode)))
+ {
+ index++;
+ if (!string.IsNullOrEmpty(detail.PaintCode) && paintMap.ContainsKey(detail.PaintCode))
+ {
+ var paint = paintMap[detail.PaintCode];
+ detail.Primer = paint.Primer;
+ detail.IntermediatePaint = paint.IntermediatePaint;
+ detail.Topcoat = paint.Topcoat;
+ detail.ColorCode = paint.ColorCode;
+ }
+
+ // 涂漆代码保存时按字典补齐,避免前端联动遗漏造成打印字段为空。
+ Funs.DB.Tw_AntiCorrosionTrustDetail.InsertOnSubmit(new Tw_AntiCorrosionTrustDetail
+ {
+ Id = SQLHelper.GetNewID(),
+ TrustId = entity.Id,
+ SortIndex = detail.SortIndex ?? index,
+ MaterialCode = detail.MaterialCode,
+ Quantity = detail.Quantity,
+ PaintCode = detail.PaintCode,
+ Primer = detail.Primer,
+ IntermediatePaint = detail.IntermediatePaint,
+ Topcoat = detail.Topcoat,
+ ColorCode = detail.ColorCode,
+ Remark = detail.Remark
+ });
+ }
+
+ Funs.DB.SubmitChanges();
+ trust.Id = entity.Id;
+ }
+
+ public static void DeleteById(string id)
+ {
+ var details = Funs.DB.Tw_AntiCorrosionTrustDetail.Where(x => x.TrustId == id).ToList();
+ Funs.DB.Tw_AntiCorrosionTrustDetail.DeleteAllOnSubmit(details);
+ var trust = Funs.DB.Tw_AntiCorrosionTrust.FirstOrDefault(x => x.Id == id);
+ if (trust != null)
+ {
+ Funs.DB.Tw_AntiCorrosionTrust.DeleteOnSubmit(trust);
+ }
+ Funs.DB.SubmitChanges();
+ }
+
+ public static DataTable GetPrintMasterTable(string id)
+ {
+ var query = (from t in Funs.DB.Tw_AntiCorrosionTrust
+ join p in Funs.DB.Base_Project on t.ProjectId equals p.ProjectId into projectJoin
+ from p in projectJoin.DefaultIfEmpty()
+ join uw in Funs.DB.WBS_UnitWork on t.UnitWorkId equals uw.UnitWorkId into uwJoin
+ from uw in uwJoin.DefaultIfEmpty()
+ join om in Funs.DB.Tw_OutputMaster on t.OutputMasterId equals om.Id into omJoin
+ from om in omJoin.DefaultIfEmpty()
+ join createPerson in Funs.DB.Person_Persons on t.CreateMan equals createPerson.PersonId into personJoin
+ from createPerson in personJoin.DefaultIfEmpty()
+ where t.Id == id
+ select new
+ {
+ p.ProjectName,
+ uw.UnitWorkName,
+ uw.UnitWorkCode,
+ t.ConstructionPart,
+ t.ConstructionProfessional,
+ t.TrustCode,
+ OutputMasterCode = om.CusBillCode,
+ t.DemandDate,
+ t.CompleteDate,
+ CreateManName = createPerson.PersonName
+ })
+ .ToList()
+ .Select(x => new
+ {
+ x.ProjectName,
+ x.UnitWorkName,
+ x.UnitWorkCode,
+ x.ConstructionPart,
+ x.ConstructionProfessional,
+ x.TrustCode,
+ x.OutputMasterCode,
+ DemandDate = x.DemandDate.HasValue ? x.DemandDate.Value.ToString("yyyy-MM-dd") : string.Empty,
+ CompleteDate = x.CompleteDate.HasValue ? x.CompleteDate.Value.ToString("yyyy-MM-dd") : string.Empty,
+ x.CreateManName
+ });
+ return ToDataTable(query, "Table1");
+ }
+
+ public static DataTable GetPrintDetailTable(string id)
+ {
+ var query = from d in Funs.DB.Tw_AntiCorrosionTrustDetail
+ join m in Funs.DB.HJGL_MaterialCodeLib on d.MaterialCode equals m.MaterialCode into materialJoin
+ from m in materialJoin.DefaultIfEmpty()
+ where d.TrustId == id
+ orderby d.SortIndex
+ select new
+ {
+ d.SortIndex,
+ m.MaterialName,
+ m.Code,
+ m.MaterialSpec,
+ m.MaterialDef,
+ m.MaterialUnit,
+ d.Quantity,
+ d.PaintCode,
+ d.Primer,
+ d.IntermediatePaint,
+ d.Topcoat,
+ d.ColorCode,
+ d.Remark
+ };
+ return ToDataTable(query.ToList(), "Data");
+ }
+
+ private static int GetTrustCodeSerial(string trustCode)
+ {
+ if (string.IsNullOrEmpty(trustCode) || trustCode.Length < 3)
+ {
+ return 0;
+ }
+
+ int serial;
+ return int.TryParse(trustCode.Substring(trustCode.Length - 3), out serial) ? serial : 0;
+ }
+
+ private static DataTable ToDataTable(IEnumerable data, string tableName)
+ {
+ var table = new DataTable(tableName);
+ var properties = typeof(T).GetProperties();
+ foreach (var property in properties)
+ {
+ var propertyType = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType;
+ table.Columns.Add(property.Name, propertyType);
+ }
+
+ foreach (var item in data)
+ {
+ var row = table.NewRow();
+ foreach (var property in properties)
+ {
+ row[property.Name] = property.GetValue(item, null) ?? DBNull.Value;
+ }
+ table.Rows.Add(row);
+ }
+ return table;
+ }
+ }
+}
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 89f90d62..cd0cb11a 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -4938,6 +4938,10 @@ namespace BLL
///
public const string Tw_OutputMasterMenuId = "BCCA4D81-410C-4746-B1E4-F882BC3A25F4";
///
+ /// 防腐委托单
+ ///
+ public const string Tw_AntiCorrosionTrustMenuId = "0BDA0F5D-BB5B-4F25-8C67-42C654A8A6A2";
+ ///
/// 库存管理
///
public const string Tw_MaterialStockMenuId = "803F9828-52FA-4EF7-99C7-ADA99DADE9FB";
@@ -5369,4 +5373,4 @@ namespace BLL
///
public const string EntryEducationTrainTypeId = "8920c9cc-fa92-49b2-9493-775a55da27bb";
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx
new file mode 100644
index 00000000..7af47213
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx
@@ -0,0 +1,139 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AntiCorrosionTrust.aspx.cs" Inherits="FineUIPro.Web.CLGL.AntiCorrosionTrust" %>
+
+
+
+
+
+ 防腐委托单
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs
new file mode 100644
index 00000000..315a656f
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs
@@ -0,0 +1,259 @@
+using BLL;
+using MiniExcelLibs;
+using Model;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+
+namespace FineUIPro.Web.CLGL
+{
+ public partial class AntiCorrosionTrust : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ GetButtonPower();
+ InitTreeMenu();
+ BindGrid();
+ }
+ }
+
+ private void BindGrid()
+ {
+ var filter = new AntiCorrosionTrustOutput
+ {
+ ProjectId = this.CurrUser.LoginProjectId,
+ UnitWorkId = tvControlItem.SelectedNodeID,
+ TrustCode = txtTrustCode.Text.Trim(),
+ OutputMasterCode = txtOutputMasterCode.Text.Trim()
+ };
+ Grid1.DataSource = TwAntiCorrosionTrustService.GetListData(filter, Grid1);
+ Grid1.RecordCount = TwAntiCorrosionTrustService.Count;
+ Grid1.DataBind();
+ }
+
+ private void InitTreeMenu()
+ {
+ this.tvControlItem.Nodes.Clear();
+
+ TreeNode rootNode1 = new TreeNode();
+ rootNode1.NodeID = "1";
+ rootNode1.Text = "建筑工程";
+ rootNode1.CommandName = "建筑工程";
+ rootNode1.Selectable = false;
+ this.tvControlItem.Nodes.Add(rootNode1);
+
+ TreeNode rootNode2 = new TreeNode();
+ rootNode2.NodeID = "2";
+ rootNode2.Text = "安装工程";
+ rootNode2.CommandName = "安装工程";
+ rootNode2.Expanded = true;
+ rootNode2.Selectable = false;
+ this.tvControlItem.Nodes.Add(rootNode2);
+
+ var keyword = txtTreeSearch.Text.Trim();
+ var unitWorkList = (from x in Funs.DB.WBS_UnitWork
+ where x.ProjectId == this.CurrUser.LoginProjectId
+ && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
+ && (string.IsNullOrEmpty(keyword) || x.UnitWorkName.Contains(keyword) || x.UnitWorkCode.Contains(keyword))
+ select x).ToList();
+
+ foreach (var q in unitWorkList.Where(x => x.ProjectType == "1"))
+ {
+ TreeNode tn = BuildUnitWorkNode(q);
+ rootNode1.Nodes.Add(tn);
+ }
+ foreach (var q in unitWorkList.Where(x => x.ProjectType == "2"))
+ {
+ TreeNode tn = BuildUnitWorkNode(q);
+ rootNode2.Nodes.Add(tn);
+ }
+ }
+
+ private TreeNode BuildUnitWorkNode(Model.WBS_UnitWork unitWork)
+ {
+ var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(unitWork.UnitId);
+ TreeNode node = new TreeNode();
+ node.NodeID = unitWork.UnitWorkId;
+ node.Text = unitWork.UnitWorkName;
+ node.ToolTip = "施工单位:" + unitNamesUnitIds;
+ node.EnableClickEvent = true;
+ return node;
+ }
+
+ protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
+ {
+ BindGrid();
+ }
+
+ protected void btnTreeFind_Click(object sender, EventArgs e)
+ {
+ InitTreeMenu();
+ }
+
+ protected void btnSearch_Click(object sender, EventArgs e)
+ {
+ BindGrid();
+ }
+
+ protected void btnNew_Click(object sender, EventArgs e)
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_AntiCorrosionTrustMenuId, Const.BtnAdd))
+ {
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (string.IsNullOrEmpty(tvControlItem.SelectedNodeID) || tvControlItem.SelectedNodeID == "1" || tvControlItem.SelectedNodeID == "2")
+ {
+ Alert.ShowInTop("请选择单位工程!", MessageBoxIcon.Warning);
+ return;
+ }
+ PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("AntiCorrosionTrustEdit.aspx?UnitWorkId={0}", tvControlItem.SelectedNodeID)));
+ }
+
+ protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
+ {
+ EditSelected();
+ }
+
+ protected void btnMenuEdit_Click(object sender, EventArgs e)
+ {
+ EditSelected();
+ }
+
+ private void EditSelected()
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_AntiCorrosionTrustMenuId, Const.BtnModify))
+ {
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (string.IsNullOrEmpty(Grid1.SelectedRowID))
+ {
+ Alert.ShowInTop("请选择要编辑的项", MessageBoxIcon.Warning);
+ return;
+ }
+ PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("AntiCorrosionTrustEdit.aspx?Id={0}", Grid1.SelectedRowID)));
+ }
+
+ protected void btnMenuDelete_Click(object sender, EventArgs e)
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_AntiCorrosionTrustMenuId, Const.BtnDelete))
+ {
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
+ return;
+ }
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
+ return;
+ }
+ foreach (int rowIndex in Grid1.SelectedRowIndexArray)
+ {
+ string rowID = Grid1.DataKeys[rowIndex][0].ToString();
+ TwAntiCorrosionTrustService.DeleteById(rowID);
+ }
+ BindGrid();
+ ShowNotify("删除成功!", MessageBoxIcon.Success);
+ }
+
+ protected void btnPrint_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(Grid1.SelectedRowID))
+ {
+ ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
+ return;
+ }
+ BLL.FastReportService.ResetData();
+ DataTable master = TwAntiCorrosionTrustService.GetPrintMasterTable(Grid1.SelectedRowID);
+ DataTable detail = TwAntiCorrosionTrustService.GetPrintDetailTable(Grid1.SelectedRowID);
+ BLL.FastReportService.AddFastreportTable(master);
+ BLL.FastReportService.AddFastreportTable(detail);
+
+ string rootPath = Server.MapPath("~/");
+ string initTemplatePath = "File\\Fastreport\\防腐委托单.frx";
+ if (File.Exists(rootPath + initTemplatePath))
+ {
+ PageContext.RegisterStartupScript(Window3.GetShowReference(string.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
+ }
+ else
+ {
+ ShowNotify("打印模板不存在!", MessageBoxIcon.Warning);
+ }
+ }
+
+ protected void btnExportTrust_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(Grid1.SelectedRowID))
+ {
+ ShowNotify("请选择要导出的项", MessageBoxIcon.Warning);
+ return;
+ }
+
+ string templatePath = Funs.RootPath + @"File\Excel\DataOut\防腐委托单.xlsx";
+ if (!File.Exists(templatePath))
+ {
+ ShowNotify("导出模板不存在!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ DataTable master = TwAntiCorrosionTrustService.GetPrintMasterTable(Grid1.SelectedRowID);
+ DataTable detail = TwAntiCorrosionTrustService.GetPrintDetailTable(Grid1.SelectedRowID);
+ if (master.Rows.Count == 0)
+ {
+ ShowNotify("未找到防腐委托单数据!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var value = GetExportValue(master.Rows[0], detail);
+ string tempPath = Funs.RootPath + @"File\Excel\Temp\防腐委托单.xlsx";
+ tempPath = tempPath.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm-ss}", DateTime.Now) + ".xlsx");
+ Directory.CreateDirectory(Path.GetDirectoryName(tempPath));
+ MiniExcel.SaveAsByTemplate(tempPath, templatePath, value);
+
+ string trustCode = Convert.ToString(master.Rows[0]["TrustCode"]);
+ string fileName = string.IsNullOrEmpty(trustCode) ? "防腐委托单.xlsx" : trustCode + ".xlsx";
+ FileInfo info = new FileInfo(tempPath);
+ long fileSize = info.Length;
+ System.Web.HttpContext.Current.Response.Clear();
+ System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
+ System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
+ System.Web.HttpContext.Current.Response.TransmitFile(tempPath, 0, fileSize);
+ System.Web.HttpContext.Current.Response.Flush();
+ File.Delete(tempPath);
+ System.Web.HttpContext.Current.Response.End();
+ }
+
+ private Dictionary GetExportValue(DataRow master, DataTable detail)
+ {
+ var value = new Dictionary();
+ foreach (DataColumn column in master.Table.Columns)
+ {
+ value[column.ColumnName] = master[column] == DBNull.Value ? string.Empty : master[column];
+ }
+ value["Data"] = detail;
+ return value;
+ }
+
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindGrid();
+ }
+
+ private void GetButtonPower()
+ {
+ var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_AntiCorrosionTrustMenuId);
+ if (buttonList.Count > 0)
+ {
+ btnNew.Hidden = !buttonList.Contains(BLL.Const.BtnAdd);
+ btnMenuEdit.Hidden = !buttonList.Contains(BLL.Const.BtnModify);
+ btnMenuDelete.Hidden = !buttonList.Contains(BLL.Const.BtnDelete);
+ btnExportTrust.Hidden = !buttonList.Contains(BLL.Const.BtnPrint);
+ }
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.designer.cs
new file mode 100644
index 00000000..1177f5a6
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.designer.cs
@@ -0,0 +1,242 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.CLGL
+{
+
+
+ public partial class AntiCorrosionTrust
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel1;
+
+ ///
+ /// panelLeftRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelLeftRegion;
+
+ ///
+ /// Toolbar1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar1;
+
+ ///
+ /// txtTreeSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtTreeSearch;
+
+ ///
+ /// btnTreeFind 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnTreeFind;
+
+ ///
+ /// tvControlItem 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Tree tvControlItem;
+
+ ///
+ /// Panel2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel2;
+
+ ///
+ /// panelCenterRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelCenterRegion;
+
+ ///
+ /// Toolbar3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar3;
+
+ ///
+ /// txtTrustCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtTrustCode;
+
+ ///
+ /// txtOutputMasterCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtOutputMasterCode;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSearch;
+
+ ///
+ /// btnNew 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnNew;
+
+ ///
+ /// btnPrint 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnPrint;
+
+ ///
+ /// btnExportTrust 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnExportTrust;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// lblNumber 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.WebControls.Label lblNumber;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window1;
+
+ ///
+ /// Window3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Window Window3;
+
+ ///
+ /// Menu1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Menu Menu1;
+
+ ///
+ /// btnMenuEdit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuEdit;
+
+ ///
+ /// btnMenuDelete 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnMenuDelete;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx
new file mode 100644
index 00000000..485d3464
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx
@@ -0,0 +1,166 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AntiCorrosionTrustEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.AntiCorrosionTrustEdit" %>
+
+
+
+
+
+ 防腐委托单编辑
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.cs
new file mode 100644
index 00000000..89f75728
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.cs
@@ -0,0 +1,223 @@
+using BLL;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace FineUIPro.Web.CLGL
+{
+ public partial class AntiCorrosionTrustEdit : PageBase
+ {
+ public string TrustId
+ {
+ get { return (string)ViewState["TrustId"]; }
+ set { ViewState["TrustId"] = value; }
+ }
+
+ public string UnitWorkId
+ {
+ get { return (string)ViewState["UnitWorkId"]; }
+ set { ViewState["UnitWorkId"] = value; }
+ }
+
+ public string PaintCodeJson
+ {
+ get
+ {
+ var list = TwAntiCorrosionTrustService.GetPaintCodeList();
+ return JsonConvert.SerializeObject(list);
+ }
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ TrustId = Request.Params["Id"];
+ InitPaintCodeEditor();
+ PageInfoLoad();
+ }
+ }
+
+ private void PageInfoLoad()
+ {
+ var trust = TwAntiCorrosionTrustService.GetById(TrustId);
+ if (trust != null)
+ {
+ UnitWorkId = trust.UnitWorkId;
+ txtUnitWorkName.Text = trust.UnitWorkName;
+ txtConstructionPart.Text = trust.ConstructionPart;
+ txtConstructionProfessional.Text = trust.ConstructionProfessional;
+ txtTrustCode.Text = trust.TrustCode;
+ txtDemandDate.Text = string.Format("{0:yyyy-MM-dd}", trust.DemandDate);
+ txtCompleteDate.Text = string.Format("{0:yyyy-MM-dd}", trust.CompleteDate);
+ txtRemark.Text = trust.Remark;
+ InitOutputMasterDropDown(trust.OutputMasterId);
+ BindGrid(TwAntiCorrosionTrustService.GetDetailList(TrustId));
+ }
+ else
+ {
+ UnitWorkId = Request.Params["UnitWorkId"];
+ var unitWork = UnitWorkService.GetUnitWorkByUnitWorkId(UnitWorkId);
+ if (unitWork != null)
+ {
+ txtUnitWorkName.Text = unitWork.UnitWorkName;
+ }
+ txtTrustCode.Text = TwAntiCorrosionTrustService.GenerateTrustCode(UnitWorkId);
+ InitOutputMasterDropDown(null);
+ BindGrid(new List());
+ }
+ }
+
+ private void InitOutputMasterDropDown(string selectedOutputMasterId)
+ {
+ drpOutputMaster.DataTextField = "CusBillCode";
+ drpOutputMaster.DataValueField = "Id";
+ var list = TwAntiCorrosionTrustService.GetAvailableOutputMasters(this.CurrUser.LoginProjectId, UnitWorkId, TrustId);
+ if (!string.IsNullOrEmpty(selectedOutputMasterId) && list.All(x => x.Id != selectedOutputMasterId))
+ {
+ var current = TwAntiCorrosionTrustService.GetOutputMasterById(selectedOutputMasterId);
+ if (current != null)
+ {
+ list.Insert(0, current);
+ }
+ }
+ drpOutputMaster.DataSource = list;
+ drpOutputMaster.DataBind();
+ Funs.FineUIPleaseSelect(drpOutputMaster);
+ if (!string.IsNullOrEmpty(selectedOutputMasterId))
+ {
+ drpOutputMaster.SelectedValue = selectedOutputMasterId;
+ }
+ }
+
+ private void InitPaintCodeEditor()
+ {
+ drpPaintCodeEditor.DataTextField = "PaintCode";
+ drpPaintCodeEditor.DataValueField = "PaintCode";
+ drpPaintCodeEditor.DataSource = TwAntiCorrosionTrustService.GetPaintCodeList();
+ drpPaintCodeEditor.DataBind();
+ Funs.FineUIPleaseSelect(drpPaintCodeEditor);
+ }
+
+ private void BindGrid(List list)
+ {
+ Grid1.DataSource = list;
+ Grid1.DataBind();
+ }
+
+ protected void drpOutputMaster_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (drpOutputMaster.SelectedValue != Const._Null)
+ {
+ BindGrid(TwAntiCorrosionTrustService.GetDetailsByOutputMasterId(drpOutputMaster.SelectedValue));
+ }
+ else
+ {
+ BindGrid(new List());
+ }
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ var trust = SaveTrust();
+ if (trust == null)
+ {
+ return;
+ }
+
+ TrustId = trust.Id;
+ ShowNotify("保存成功!", MessageBoxIcon.Success);
+ }
+
+ protected void btnSubmit_Click(object sender, EventArgs e)
+ {
+ var trust = SaveTrust();
+ if (trust == null)
+ {
+ return;
+ }
+
+ TrustId = trust.Id;
+ PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
+ }
+
+ private AntiCorrosionTrustOutput SaveTrust()
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_AntiCorrosionTrustMenuId, Const.BtnSave))
+ {
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
+ return null;
+ }
+ if (drpOutputMaster.SelectedValue == Const._Null)
+ {
+ ShowNotify("请选择出库单编号!", MessageBoxIcon.Warning);
+ return null;
+ }
+ if (TwAntiCorrosionTrustService.IsExistTrustCode(txtTrustCode.Text.Trim(), TrustId, this.CurrUser.LoginProjectId))
+ {
+ ShowNotify("委托单编号已存在,请重新生成!", MessageBoxIcon.Warning);
+ return null;
+ }
+
+ var trust = new AntiCorrosionTrustOutput
+ {
+ Id = TrustId,
+ ProjectId = this.CurrUser.LoginProjectId,
+ UnitWorkId = UnitWorkId,
+ ConstructionPart = txtConstructionPart.Text.Trim(),
+ ConstructionProfessional = txtConstructionProfessional.Text.Trim(),
+ TrustCode = txtTrustCode.Text.Trim(),
+ OutputMasterId = drpOutputMaster.SelectedValue,
+ DemandDate = Funs.GetNewDateTime(txtDemandDate.Text.Trim()),
+ CompleteDate = Funs.GetNewDateTime(txtCompleteDate.Text.Trim()),
+ CreateMan = this.CurrUser.PersonId,
+ Remark = txtRemark.Text.Trim()
+ };
+
+ var details = CollectGridDetailInfo();
+ if (details.Count == 0)
+ {
+ ShowNotify("防腐委托单明细不能为空!", MessageBoxIcon.Warning);
+ return null;
+ }
+
+ TwAntiCorrosionTrustService.Save(trust, details);
+ return trust;
+ }
+
+ private List CollectGridDetailInfo()
+ {
+ var result = new List();
+ int sortIndex = 0;
+ JArray mergedData = Grid1.GetMergedData();
+ foreach (JObject mergedRow in mergedData)
+ {
+ JObject values = mergedRow.Value("values");
+ sortIndex++;
+ result.Add(new AntiCorrosionTrustDetailOutput
+ {
+ Id = values.Value("Id"),
+ SortIndex = sortIndex,
+ MaterialCode = values.Value("MaterialCode"),
+ Quantity = GetDecimal(values.Value("Quantity")),
+ PaintCode = values.Value("PaintCode"),
+ Remark = values.Value("Remark")
+ });
+ }
+ return result;
+ }
+
+ private decimal? GetDecimal(string value)
+ {
+ decimal result;
+ if (decimal.TryParse(value, out result))
+ {
+ return result;
+ }
+ return null;
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.designer.cs
new file mode 100644
index 00000000..42ee4c40
--- /dev/null
+++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrustEdit.aspx.designer.cs
@@ -0,0 +1,206 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace FineUIPro.Web.CLGL
+{
+
+
+ public partial class AntiCorrosionTrustEdit
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PageManager1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.PageManager PageManager1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel Panel1;
+
+ ///
+ /// panelCenterRegion 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Panel panelCenterRegion;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Toolbar Toolbar2;
+
+ ///
+ /// ToolbarFill1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.ToolbarFill ToolbarFill1;
+
+ ///
+ /// btnSave 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSave;
+
+ ///
+ /// btnSubmit 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnSubmit;
+
+ ///
+ /// SimpleForm1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Form SimpleForm1;
+
+ ///
+ /// txtUnitWorkName 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtUnitWorkName;
+
+ ///
+ /// txtConstructionPart 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtConstructionPart;
+
+ ///
+ /// txtConstructionProfessional 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtConstructionProfessional;
+
+ ///
+ /// txtTrustCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtTrustCode;
+
+ ///
+ /// drpOutputMaster 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpOutputMaster;
+
+ ///
+ /// txtDemandDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtDemandDate;
+
+ ///
+ /// txtCompleteDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DatePicker txtCompleteDate;
+
+ ///
+ /// txtRemark 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtRemark;
+
+ ///
+ /// lblBlank 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label lblBlank;
+
+ ///
+ /// Grid1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Grid Grid1;
+
+ ///
+ /// drpPaintCodeEditor 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpPaintCodeEditor;
+
+ ///
+ /// txtDetailRemarkEditor 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtDetailRemarkEditor;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/File/Excel/DataOut/防腐委托单.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataOut/防腐委托单.xlsx
new file mode 100644
index 00000000..853830fe
Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataOut/防腐委托单.xlsx differ
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印_80x42.frx b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印_80x42.frx
index 4a4a3452..e180c4ca 100644
--- a/SGGL/FineUIPro.Web/File/Fastreport/焊口打印_80x42.frx
+++ b/SGGL/FineUIPro.Web/File/Fastreport/焊口打印_80x42.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/File/Fastreport/管道焊口返修委托单NoPic.frx b/SGGL/FineUIPro.Web/File/Fastreport/管道焊口返修委托单NoPic.frx
index 539d7f15..ba33c882 100644
--- a/SGGL/FineUIPro.Web/File/Fastreport/管道焊口返修委托单NoPic.frx
+++ b/SGGL/FineUIPro.Web/File/Fastreport/管道焊口返修委托单NoPic.frx
@@ -1,5 +1,5 @@
-
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -89,7 +89,7 @@ namespace FastReport
}
-
+
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx b/SGGL/FineUIPro.Web/File/Fastreport/管道焊接任务单.frx
index ac0ae869..d901b971 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;
@@ -59,7 +59,7 @@ namespace FastReport
}
-
+
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/防腐委托单.frx b/SGGL/FineUIPro.Web/File/Fastreport/防腐委托单.frx
new file mode 100644
index 00000000..ff65d144
--- /dev/null
+++ b/SGGL/FineUIPro.Web/File/Fastreport/防腐委托单.frx
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 29e8444e..3aa70c7b 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -365,6 +365,10 @@
+
+
+
+
@@ -8310,6 +8314,20 @@
OutputMasterEdit.aspx
+
+ AntiCorrosionTrust.aspx
+ ASPXCodeBehind
+
+
+ AntiCorrosionTrust.aspx
+
+
+ AntiCorrosionTrustEdit.aspx
+ ASPXCodeBehind
+
+
+ AntiCorrosionTrustEdit.aspx
+
main2.aspx
ASPXCodeBehind
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs
index 2e70d43c..bca9532f 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs
@@ -1525,7 +1525,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
keyValuePairs.Add("Code", weldTask?.TaskCode ?? weldTask_CreateName?.TaskCode ?? string.Empty);
keyValuePairs.Add("TaskDate", string.Format("{0:yyyy-MM-dd}", taskTime.Value));
keyValuePairs.Add("UnitName", UnitService.GetUnitNameByUnitId(tvControlItem.SelectedNodeID.Split('|')[1]));
- keyValuePairs.Add("UnitWorkName", UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]).UnitWorkName);
+ var unitWorkModel = UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]);
+ keyValuePairs.Add("UnitWorkName", unitWorkModel?.UnitWorkName ?? string.Empty);
// 创建一个新的DataTable
DataTable dataTable = new DataTable();
dataTable.TableName = "Data";
@@ -1541,13 +1542,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
DataRow dr = dataTable.NewRow();
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipeline);
- List list = new List { pipeline };
+ if (pipelineModel == null)
+ {
+ continue;
+ }
dr["PipelineCode"] = pipelineModel.PipelineCode;
dr["FlowingSection"] = pipelineModel.FlowingSection;
- dr["MaterialCode"] = Base_MaterialService.GetMaterialByMaterialId(pipelineModel.MaterialId).MaterialCode;
+ // 管线基础资料可能未维护材质,打印时保留空值,避免整张任务单打印失败。
+ var materialModel = string.IsNullOrEmpty(pipelineModel.MaterialId) ? null : Base_MaterialService.GetMaterialByMaterialId(pipelineModel.MaterialId);
+ dr["MaterialCode"] = materialModel?.MaterialCode ?? string.Empty;
dr["MaterialSpec"] = string.Join(",", weldTaskList.Select(x => x.Specification).Distinct().ToList());
- dr["MatchRate"] = Math.Round((decimal)TwArrivalStatisticsService.GetPipeMatch(pipeline) * 100, 2).ToString() + "%";
+ // 匹配率计算依赖管线仓库,未维护仓库时按0显示,避免基础资料缺项阻断打印。
+ var warehouseModel = string.IsNullOrEmpty(pipelineModel.WarehouseId) ? null : Base_WarehouseService.GetWarehouseByWarehouseId(pipelineModel.WarehouseId);
+ var matchRate = warehouseModel == null ? 0 : TwArrivalStatisticsService.GetPipeMatch(pipeline) ?? 0;
+ dr["MatchRate"] = Math.Round(matchRate * 100, 2).ToString() + "%";
dr["Dia"] = weldTaskList.Where(x => x.PipelineId == pipeline).Sum(x => x.Size ?? 0)
.ToString();
dataTable.Rows.Add(dr);
diff --git a/SGGL/FineUIPro.Web/common/3.xml b/SGGL/FineUIPro.Web/common/3.xml
new file mode 100644
index 00000000..91d9fd84
--- /dev/null
+++ b/SGGL/FineUIPro.Web/common/3.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
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 a01be0df..7b7f8d23 100644
--- a/SGGL/FineUIPro.Web/common/Menu_HJGL.xml
+++ b/SGGL/FineUIPro.Web/common/Menu_HJGL.xml
@@ -27,13 +27,15 @@
+
+
-
+
-
+
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/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx
index 9d020e4b..6ec61307 100644
--- a/SGGL/FineUIPro.Web/indexProject.aspx
+++ b/SGGL/FineUIPro.Web/indexProject.aspx
@@ -232,42 +232,42 @@