diff --git a/SGGL/BLL/API/HJGL/APINDETrustService.cs b/SGGL/BLL/API/HJGL/APINDETrustService.cs
index 62a2c56f..1157b58c 100644
--- a/SGGL/BLL/API/HJGL/APINDETrustService.cs
+++ b/SGGL/BLL/API/HJGL/APINDETrustService.cs
@@ -881,8 +881,8 @@ namespace BLL
join z in db.HJGL_Batch_PointBatch on x.PointBatchId equals z.PointBatchId
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
join d in db.HJGL_WeldingDaily on y.WeldingDailyId equals d.WeldingDailyId
- where z.DetectionTypeId == record.DetectionTypeId
- && !x.PointDate.HasValue || (x.PointDate.HasValue && x.RepairRecordId == repairRecordId)
+ where z.ProjectId == record.ProjectId && z.DetectionTypeId == record.DetectionTypeId
+ && (!x.PointDate.HasValue || x.RepairRecordId == repairRecordId)
orderby y.WeldJointCode
select new
{
@@ -894,6 +894,7 @@ namespace BLL
y.PipelineCode,
y.JointArea,
y.BackingWelderId,
+ y.CoverWelderId,
y.Material1Id,
y.Specification,
d.WeldingDate
@@ -901,7 +902,9 @@ namespace BLL
if (welder)
{
- repairExp = repairExp.Where(x => x.BackingWelderId == jot.BackingWelderId);
+ var welderIds = new[] { jot.BackingWelderId, jot.CoverWelderId }
+ .Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
+ repairExp = repairExp.Where(x => welderIds.Contains(x.BackingWelderId) || welderIds.Contains(x.CoverWelderId));
}
if (batch)
{
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 38e722ac..dea4de8d 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -993,6 +993,8 @@ namespace BLL
public const string HJGL_NDTBatchMenuId = "CDECC461-1897-4D88-BD13-0824E540F565";
+ public const string HJGL_RepairExpandMenuId = "6D215BF6-7002-46B3-B2EA-A57CD849F0F1";
+
public const string HJGL_RepairTrustMenuId = "E5053406-1A22-42F1-846E-721ACA2253D6";
///
diff --git a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs
index 56fc3fb9..d91d1322 100644
--- a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs
+++ b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Data;
using System.Linq;
namespace BLL
@@ -8,6 +10,135 @@ namespace BLL
///
public static class Batch_BatchTrustItemService
{
+ ///
+ /// 获取当前委托焊口及同检验批可补入的点口。
+ ///
+ public static DataTable GetTrustAdjustmentItems(string projectId, string trustBatchId)
+ {
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var trusts = db.HJGL_Batch_BatchTrust.Where(x => x.ProjectId == projectId
+ && x.TrustBatchId == trustBatchId && x.PointBatchId != null
+ && (x.TrustType == null || x.TrustType != "R"));
+ var currentItems = from trust in trusts
+ join item in db.HJGL_Batch_BatchTrustItem on trust.TrustBatchId equals item.TrustBatchId
+ join detail in db.View_Batch_BatchTrustItem on item.TrustBatchItemId equals detail.TrustBatchItemId
+ select new
+ {
+ detail.PointBatchItemId,
+ detail.PipelineCode,
+ detail.WeldJointCode,
+ detail.JointArea,
+ detail.PointDate,
+ item.TrustBatchItemId,
+ ItemState = "当前委托",
+ AdjustmentState = db.HJGL_Batch_NDEItem.Any(x => x.TrustBatchItemId == item.TrustBatchItemId)
+ ? "已有检测记录,必须保留" : "可调整"
+ };
+ var candidates = from trust in trusts
+ join detail in db.View_GenerateTrustItem on trust.PointBatchId equals detail.PointBatchId
+ where detail.ProjectId == projectId
+ select new
+ {
+ detail.PointBatchItemId,
+ detail.PipelineCode,
+ detail.WeldJointCode,
+ detail.JointArea,
+ detail.PointDate,
+ TrustBatchItemId = (string)null,
+ ItemState = "新增点口",
+ AdjustmentState = "可补入"
+ };
+ var items = currentItems.Concat(candidates).OrderByDescending(x => x.TrustBatchItemId != null)
+ .ThenBy(x => x.PipelineCode).ThenBy(x => x.WeldJointCode).ToList();
+ return Funs.LINQToDataTable(items);
+ }
+ }
+
+ ///
+ /// 差量调整委托焊口,保留原委托表头及未变动明细。
+ ///
+ /// 成功返回空字符串,校验未通过返回提示信息。
+ public static string SaveAdjustedTrustItems(string projectId, string trustBatchId,
+ string[] selectedPointBatchItemIds, string[] originalTrustBatchItemIds)
+ {
+ var selectedIds = new HashSet(selectedPointBatchItemIds);
+ if (selectedIds.Count == 0)
+ {
+ return "委托单至少需要保留一个焊口!";
+ }
+
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ db.Connection.Open();
+ using (var transaction = db.Connection.BeginTransaction(IsolationLevel.Serializable))
+ {
+ db.Transaction = transaction;
+ var trust = db.HJGL_Batch_BatchTrust.FirstOrDefault(x =>
+ x.TrustBatchId == trustBatchId && x.ProjectId == projectId);
+ if (trust == null)
+ {
+ return "请选择当前项目的委托单!";
+ }
+ if (trust.PointBatchId == null || trust.TrustType == "R")
+ {
+ return "焊口调整仅适用于检验批委托单,返修委托请使用返修扩透流程!";
+ }
+
+ var currentItems = db.HJGL_Batch_BatchTrustItem.Where(x => x.TrustBatchId == trustBatchId).ToList();
+ if (!new HashSet(currentItems.Select(x => x.TrustBatchItemId)).SetEquals(originalTrustBatchItemIds))
+ {
+ return "委托焊口已发生变化,请重新打开焊口调整!";
+ }
+
+ var candidates = db.View_GenerateTrustItem.Where(x => x.PointBatchId == trust.PointBatchId
+ && x.ProjectId == projectId).ToList();
+ var availableIds = new HashSet(currentItems.Select(x => x.PointBatchItemId));
+ availableIds.UnionWith(candidates.Select(x => x.PointBatchItemId));
+ if (!selectedIds.IsSubsetOf(availableIds))
+ {
+ return "所选点口已取消或已进入其他委托,请重新打开焊口调整!";
+ }
+
+ var removedItems = currentItems.Where(x => !selectedIds.Contains(x.PointBatchItemId)).ToList();
+ var removedIds = removedItems.Select(x => x.TrustBatchItemId).ToList();
+ if (removedIds.Count > 0 && db.HJGL_Batch_NDEItem.Any(x => removedIds.Contains(x.TrustBatchItemId)))
+ {
+ return "已有检测记录的焊口不能移出委托单!";
+ }
+
+ var currentPointIds = new HashSet(currentItems.Select(x => x.PointBatchItemId));
+ var addedItems = candidates.Where(x => selectedIds.Contains(x.PointBatchItemId)
+ && !currentPointIds.Contains(x.PointBatchItemId)).ToList();
+ foreach (var item in addedItems)
+ {
+ db.HJGL_Batch_BatchTrustItem.InsertOnSubmit(new Model.HJGL_Batch_BatchTrustItem
+ {
+ TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_BatchTrustItem)),
+ TrustBatchId = trustBatchId,
+ PointBatchItemId = item.PointBatchItemId,
+ WeldJointId = item.WeldJointId,
+ CreateDate = DateTime.Now,
+ TrustNum = 1
+ });
+ var pointItem = db.HJGL_Batch_PointBatchItem.First(x => x.PointBatchItemId == item.PointBatchItemId);
+ pointItem.IsBuildTrust = true;
+ }
+ var removedPointIds = removedItems.Select(x => x.PointBatchItemId).ToList();
+ var releasedPoints = db.HJGL_Batch_PointBatchItem.Where(x => removedPointIds.Contains(x.PointBatchItemId)
+ && !db.HJGL_Batch_BatchTrustItem.Any(y => y.PointBatchItemId == x.PointBatchItemId && y.TrustBatchId != trustBatchId));
+ foreach (var pointItem in releasedPoints)
+ {
+ pointItem.IsBuildTrust = null;
+ }
+ db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(removedItems);
+ db.SubmitChanges();
+ transaction.Commit();
+ }
+ }
+ return string.Empty;
+ }
+
///
/// 根据主键获取无损委托明细
///
diff --git a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs
index 931f8ca8..b7351a6d 100644
--- a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs
+++ b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs
@@ -1,4 +1,6 @@
-using System.Linq;
+using System;
+using System.Data;
+using System.Linq;
namespace BLL
{
@@ -57,6 +59,97 @@ namespace BLL
return db.View_Batch_BatchTrust.FirstOrDefault(e => e.TrustBatchId == trustBatchId);
}
+ ///
+ /// 整单退回。普通委托保留检测数据,返修委托可随单清理尚未产生后续返修的检测数据。
+ ///
+ public static string ReturnTrust(string projectId, string trustBatchId, string personId, bool isRepairTrust)
+ {
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ db.Connection.Open();
+ using (var transaction = db.Connection.BeginTransaction(IsolationLevel.Serializable))
+ {
+ db.Transaction = transaction;
+ var trust = db.HJGL_Batch_BatchTrust.FirstOrDefault(x => x.TrustBatchId == trustBatchId && x.ProjectId == projectId);
+ if (trust == null || (isRepairTrust ? trust.TrustType != "R" : trust.TrustType == "R" || trust.PointBatchId == null))
+ {
+ return "请选择当前项目对应类型的委托单!";
+ }
+
+ var batchItems = db.HJGL_Batch_BatchTrustItem.Where(x => x.TrustBatchId == trustBatchId);
+ var ndeBatches = db.HJGL_Batch_NDE.Where(x => x.TrustBatchId == trustBatchId);
+ var ndeItems = db.HJGL_Batch_NDEItem.Where(x =>
+ batchItems.Any(y => y.TrustBatchItemId == x.TrustBatchItemId)
+ || ndeBatches.Any(y => y.NDEID == x.NDEID));
+ if (isRepairTrust)
+ {
+ if (db.HJGL_RepairRecord.Any(x => ndeItems.Any(y => y.NDEItemID == x.NDEItemID)))
+ {
+ return "本单检测记录已生成后续返修通知单,请先处理后续返修/扩透流程后再退回!";
+ }
+ var repairRecords = db.HJGL_RepairRecord.Where(x => x.ProjectId == projectId
+ && batchItems.Any(y => y.RepairRecordId == x.RepairRecordId)
+ && !db.HJGL_Batch_BatchTrustItem.Any(y => y.RepairRecordId == x.RepairRecordId
+ && y.TrustBatchId != trustBatchId));
+ foreach (var repairRecord in repairRecords)
+ {
+ repairRecord.AuditDate = null;
+ }
+ db.HJGL_Batch_NDEItem.DeleteAllOnSubmit(ndeItems);
+ db.HJGL_Batch_NDE.DeleteAllOnSubmit(ndeBatches);
+ }
+ else if (ndeBatches.Any() || ndeItems.Any())
+ {
+ return "该委托单已有检测记录,不能退回!";
+ }
+
+ // 其他委托仍引用的点口不能重置。
+ var pointItems = db.HJGL_Batch_PointBatchItem.Where(x =>
+ batchItems.Any(y => y.PointBatchItemId == x.PointBatchItemId)
+ && !db.HJGL_Batch_BatchTrustItem.Any(y => y.PointBatchItemId == x.PointBatchItemId
+ && y.TrustBatchId != trustBatchId));
+ foreach (var pointItem in pointItems)
+ {
+ pointItem.IsBuildTrust = null;
+ pointItem.PointState = null;
+ pointItem.PointDate = null;
+ if (isRepairTrust)
+ {
+ pointItem.RepairRecordId = null;
+ }
+ }
+
+ if (!isRepairTrust && !db.HJGL_Batch_BatchTrust.Any(x => x.PointBatchId == trust.PointBatchId
+ && x.TrustBatchId != trustBatchId))
+ {
+ var pointBatch = db.HJGL_Batch_PointBatch.Single(x => x.PointBatchId == trust.PointBatchId);
+ pointBatch.IsClosed = null;
+ }
+
+ db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(batchItems);
+ db.HJGL_Batch_BatchTrust.DeleteOnSubmit(trust);
+ if (isRepairTrust)
+ {
+ db.Sys_Log.InsertOnSubmit(new Model.Sys_Log
+ {
+ LogId = SQLHelper.GetNewID(),
+ OperationTime = DateTime.Now,
+ UserId = personId,
+ ProjectId = projectId,
+ MenuId = Const.HJGL_RepairTrustMenuId,
+ OperationName = "退回",
+ OperationLog = "退回返修/扩透委托单(含本单检测单及检测明细):" + trust.TrustBatchCode,
+ DataId = trustBatchId,
+ LogSource = 1
+ });
+ }
+ db.SubmitChanges();
+ transaction.Commit();
+ return string.Empty;
+ }
+ }
+ }
+
#region 更新委托单 检测状态
///
/// 更新委托单 检测状态
diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx
index f9c6edf2..8c026425 100644
--- a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx
+++ b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx
@@ -15228,7 +15228,7 @@
Special Review Status
- World Location Drawing
+ World map
The two organizations are identical. No merge is required.
@@ -15255,7 +15255,7 @@
Resume
- in Country Location Drawing
+ China map
Intermediate Coat
@@ -16163,6 +16163,12 @@
Delete the selected rows?
+
+ Delete the selected welding task details? The list will refresh and unsaved changes will be lost.
+
+
+ Deleted: {0}. Not deleted: {1}. Check that each row is still in the current list, its weld joint exists, and no welding daily report has been created.
+
True / False
@@ -26083,4 +26089,229 @@
Enable multiple languages
+
+ Company dashboard title
+
+
+ Leave blank to use the default title
+
+
+ Menu settings
+
+
+ Menu name
+
+
+ Menu address
+
+
+ Move
+
+
+ Edit menu
+
+
+ Move menu
+
+
+ Destination menu type
+
+
+ Move the selected menu and its submenus?
+
+
+ Menu root
+
+
+ Company
+
+
+ Project
+
+
+ Disabled
+
+
+ Enter a single-line title of up to 50 characters.
+
+
+ Select a menu to manage.
+
+
+ Enter a valid menu name and an integer sort order.
+
+
+ Enter a relative address on this site, up to 200 characters.
+
+
+ This menu has changed. Select it again.
+
+
+ Select the destination menu type and folder.
+
+
+ Select a valid folder outside the selected menu and its submenus.
+
+
+ Saved. Refresh the home page to see the changes.
+
+
+ Adjust weld joints
+
+
+ Select the weld joints to keep or add. Only weld joints without inspection records can be removed.
+
+
+ Request status
+
+
+ Adjustment status
+
+
+ On this request
+
+
+ Available weld joint
+
+
+ Has inspection records; must be kept
+
+
+ Can be removed
+
+
+ Can be added
+
+
+ Returning this request deletes it and all its details and makes its weld joints available for selection again. Continue?
+
+
+ Returning this request deletes it, all its details, and its inspection records. Continue?
+
+
+ Manual inspection expansion
+
+
+ For a first repair of a weld joint that was not added through inspection expansion, select all candidates on the current page if there are at most two; otherwise, select two at random. In other cases, select all candidates on the current page. If there are no candidates and the original weld joint is 20 diameter inches or more, you can confirm and generate a request for that joint alone.
+
+
+ Select an inspection request to adjust.
+
+
+ You do not have permission to adjust weld joints on this request.
+
+
+ You can adjust weld joints only on requests linked to an inspection batch. Use the repair and expansion workflow for repair requests.
+
+
+ Could not load the weld joints: {0}
+
+
+ Could not save the weld joint changes: {0}
+
+
+ The request must contain at least one weld joint.
+
+
+ Select a request in the current project.
+
+
+ The request details have changed. Reopen the weld joint adjustment dialog.
+
+
+ A selected weld joint is no longer available. Reopen the weld joint adjustment dialog.
+
+
+ Weld joints with inspection records cannot be removed.
+
+
+ Select a request of the correct type in the current project.
+
+
+ These inspection records have a follow-up repair notice. Handle the follow-up repair and expansion before returning the request.
+
+
+ This request has inspection records and cannot be returned.
+
+
+ Select a repair record in the current project.
+
+
+ There are no candidate weld joints for inspection expansion.
+
+
+ Select the weld joints for inspection expansion first.
+
+
+ Total weld dia-inches
+
+
+ Weld dia-inches completed this month
+
+
+ Weld dia-inches completed to date
+
+
+ Projects under construction
+
+
+ First-pass film acceptance this month
+
+
+ First-pass film acceptance to date
+
+
+ Active welders
+
+
+ Welding volume
+
+
+ Quality and workforce
+
+
+ Project location
+
+
+ Welding progress
+
+
+ Remaining
+
+
+ Unit: dia-inches
+
+
+ Project / cumulative volume
+
+
+ This month
+
+
+ No projects under construction
+
+
+ Active project locations
+
+
+ Six-month welding trend
+
+
+ As of {0}
+
+
+ Project welding acceptance
+
+
+ Company first-pass rate this month
+
+
+ Passed films / total films
+
+
+ No tests
+
+
+ Welded volume (10,000 dia-in)
+
diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx
index a6c8e574..84106606 100644
--- a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx
+++ b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx
@@ -16163,6 +16163,12 @@
删除选中行?
+
+ 删除选中的焊接任务明细?列表将刷新,未保存的修改会丢失。
+
+
+ 已删除 {0} 条,未删除 {1} 条。请核对记录是否仍在当前列表、关联焊口是否存在及是否已生成焊接日报。
+
判断题
@@ -26083,4 +26089,229 @@
是否加载多语言
+
+ 公司级看板标题
+
+
+ 留空使用默认标题
+
+
+ 菜单设置
+
+
+ 菜单名称
+
+
+ 菜单地址
+
+
+ 迁移
+
+
+ 编辑菜单
+
+
+ 迁移菜单
+
+
+ 目标菜单类型
+
+
+ 确认迁移所选菜单及其子菜单?
+
+
+ 菜单根目录
+
+
+ 公司级
+
+
+ 项目级
+
+
+ 停用
+
+
+ 请输入不超过 50 个字符的单行标题。
+
+
+ 请选择要维护的菜单。
+
+
+ 请填写有效的菜单名称和整数排序。
+
+
+ 菜单地址须为站内相对地址,且不超过 200 个字符。
+
+
+ 菜单已变更,请重新选择。
+
+
+ 请选择目标菜单类型和目录。
+
+
+ 目标目录无效,或位于所选菜单及其子菜单内。
+
+
+ 保存成功!刷新首页后生效。
+
+
+ 焊口调整
+
+
+ 勾选要保留或补入的焊口。仅可移出没有检测记录的焊口。
+
+
+ 委托状态
+
+
+ 调整状态
+
+
+ 当前委托
+
+
+ 新增点口
+
+
+ 已有检测记录,必须保留
+
+
+ 可调整
+
+
+ 可补入
+
+
+ 退回将删除该委托单及全部明细,并将相关焊口恢复为未点口。确定要退回吗?
+
+
+ 退回将删除该委托单、全部明细及本单检测记录。确定要退回吗?
+
+
+ 手动扩透
+
+
+ 首次返修且原焊口不是扩透口时,当前页候选不超过两个则全部选中,超过两个则随机选两个;其余情况选中当前页全部候选。没有候选且原焊口达因大于等于 20 时,可以确认后生成仅含原返修口的委托。
+
+
+ 请选择要调整焊口的委托单!
+
+
+ 您没有调整委托焊口的权限!
+
+
+ 焊口调整仅适用于检验批委托单,返修委托请使用返修扩透流程!
+
+
+ 加载焊口调整失败:{0}
+
+
+ 保存焊口调整失败:{0}
+
+
+ 委托单至少需要保留一个焊口!
+
+
+ 请选择当前项目的委托单!
+
+
+ 委托焊口已发生变化,请重新打开焊口调整!
+
+
+ 所选点口已取消或已进入其他委托,请重新打开焊口调整!
+
+
+ 已有检测记录的焊口不能移出委托单!
+
+
+ 请选择当前项目对应类型的委托单!
+
+
+ 本单检测记录已生成后续返修通知单,请先处理后续返修/扩透流程后再退回!
+
+
+ 该委托单已有检测记录,不能退回!
+
+
+ 请选择当前项目的返修记录!
+
+
+ 当前没有可扩透的候选焊口!
+
+
+ 请先勾选需要扩透的焊口!
+
+
+ 总焊接达因数
+
+
+ 当月完成焊接达因数
+
+
+ 累计完成焊接达因数
+
+
+ 在建项目数量
+
+
+ 当月一次焊接合格率
+
+
+ 累计一次焊接合格率
+
+
+ 焊工人数
+
+
+ 焊接工作量
+
+
+ 焊接质量与人员
+
+
+ 项目位置
+
+
+ 焊接进度
+
+
+ 剩余
+
+
+ 单位:达因
+
+
+ 项目 / 累计工作量
+
+
+ 本月完成
+
+
+ 暂无在建项目
+
+
+ 在建项目分布
+
+
+ 近六月焊接趋势
+
+
+ 截至{0}
+
+
+ 项目焊接合格率
+
+
+ 公司当月一次合格率
+
+
+ 合格片数/总片数
+
+
+ 暂无检测
+
+
+ 完成焊接量(万达因)
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 5ceaa284..6d6ba746 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -644,6 +644,7 @@
+
@@ -1041,6 +1042,7 @@
+
@@ -1098,6 +1100,7 @@
+
@@ -7190,6 +7193,13 @@
TrustBatch.aspx
ASPXCodeBehind
+
+ TrustWeldJointAdjust.aspx
+ ASPXCodeBehind
+
+
+ TrustWeldJointAdjust.aspx
+
TrustBatch.aspx
@@ -9308,4 +9318,4 @@
-->
-
\ No newline at end of file
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx
index aad04f82..41bf366d 100644
--- a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx
@@ -73,9 +73,6 @@
<%--
--%>
-
-
@@ -88,7 +85,7 @@
-
-
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs
index 3e626462..f25697c3 100644
--- a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs
@@ -279,11 +279,13 @@ namespace FineUIPro.Web.HJGL.PointTrust
this.txtTrustDate.Text = string.Empty;
this.txtDetectionTypeCode.Text = string.Empty;
this.lbNDEUnit.Text = string.Empty;
+ this.lbIsAudit.Text = string.Empty;
+ this.lbIsTrust.Text = string.Empty;
Model.View_Batch_BatchTrust trust = BLL.Batch_BatchTrustService.GetBatchTrustViewById(this.tvControlItem.SelectedNodeID);
- Model.HJGL_Batch_PointBatch batch = BLL.PointBatchService.GetPointBatchById(trust.PointBatchId);
if (trust != null)
{
- if (batch.IsClosed == true)
+ Model.HJGL_Batch_PointBatch batch = BLL.PointBatchService.GetPointBatchById(trust.PointBatchId);
+ if (batch != null && batch.IsClosed == true)
{
lbIsTrust.Text = "无需委托";
}
@@ -314,13 +316,6 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
}
}
- else
- {
- if (batch != null)
- {
- lbIsTrust.Text = "未委托";
- }
- }
}
protected void btnEdit_Click(object sender, EventArgs e)
@@ -428,48 +423,25 @@ namespace FineUIPro.Web.HJGL.PointTrust
///
private void BindGrid()
{
- if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
+ string trustBatchId = this.tvControlItem.SelectedNodeID;
+ if (string.IsNullOrEmpty(trustBatchId))
{
- Model.View_Batch_BatchTrust trust = BLL.Batch_BatchTrustService.GetBatchTrustViewById(this.tvControlItem.SelectedNodeID);
- if (trust == null) //未生成委托
- {
- string strSql = @"SELECT * FROM dbo.View_GenerateTrustItem d WHERE PointBatchId=@PointBatchId ";
- List listStr = new List
- {
-
- };
- listStr.Add(new SqlParameter("@PointBatchId", trust.PointBatchId));
- SqlParameter[] parameter = listStr.ToArray();
- DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
-
- // 2.获取当前分页数据
- //var table = this.GetPagedDataTable(Grid1, tb1);
- Grid1.RecordCount = tb.Rows.Count;
- tb = GetFilteredTable(Grid1.FilteredData, tb);
- var table = this.GetPagedDataTable(Grid1, tb);
- Grid1.DataSource = table;
- Grid1.DataBind();
- }
- else
- {
- string strSql = @"SELECT * FROM dbo.View_Batch_BatchTrustItem d WHERE TrustBatchId=@TrustBatchId ";
- List listStr = new List
- {
-
- };
- listStr.Add(new SqlParameter("@TrustBatchId", trust.TrustBatchId));
- SqlParameter[] parameter = listStr.ToArray();
- DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
-
- // 2.获取当前分页数据
- //var table = this.GetPagedDataTable(Grid1, tb1);
- Grid1.RecordCount = tb.Rows.Count;
- tb = GetFilteredTable(Grid1.FilteredData, tb);
- var table = this.GetPagedDataTable(Grid1, tb);
- Grid1.DataSource = table;
- Grid1.DataBind();
- }
+ Grid1.RecordCount = 0;
+ Grid1.DataSource = null;
+ Grid1.DataBind();
+ return;
}
+
+ const string sql = "SELECT * FROM dbo.View_Batch_BatchTrustItem WHERE TrustBatchId=@TrustBatchId AND ProjectId=@ProjectId";
+ DataTable tb = SQLHelper.GetDataTableRunText(sql, new[]
+ {
+ new SqlParameter("@TrustBatchId", trustBatchId),
+ new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)
+ });
+ tb = GetFilteredTable(Grid1.FilteredData, tb);
+ Grid1.RecordCount = tb.Rows.Count;
+ Grid1.DataSource = GetPagedDataTable(Grid1, tb);
+ Grid1.DataBind();
}
#endregion
@@ -520,8 +492,17 @@ namespace FineUIPro.Web.HJGL.PointTrust
///
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
- this.InitTreeMenu();//加载树
- this.BindGrid();
+ if ((bool?)ViewState["AdjustingTrust"] == true)
+ {
+ ViewState.Remove("AdjustingTrust");
+ Grid1.PageIndex = 0;
+ PageInfo();
+ }
+ else
+ {
+ InitTreeMenu();
+ }
+ BindGrid();
}
///
@@ -570,58 +551,6 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
}
- protected void btnDelete_Click(object sender, EventArgs e)
- {
- if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_TrustBatchMenuId, Const.BtnDelete))
- {
- Model.SGGLDB db = Funs.DB;
- if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
- {
- string trustBatchId = this.tvControlItem.SelectedNodeID.Split(',')[1];
- string trustBatchCode = this.tvControlItem.SelectedNode.Text;
- var trust = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
-
- if (trust.IsAudit == true)
- {
- ShowNotify("该委托单已审核,不能删除!", MessageBoxIcon.Warning);
- return;
- }
- else
- {
- var batchItem = from y in db.HJGL_Batch_BatchTrustItem where y.TrustBatchId == trustBatchId select y;
- foreach (var item in batchItem)
- {
- Model.HJGL_Batch_PointBatchItem pointBatchItem = null;
- if (item.PointBatchItemId != null)
- {
- pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchItemId == item.PointBatchItemId);
- }
- else
- {
- pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.RepairRecordId == item.RepairRecordId);
- }
- if (pointBatchItem != null)
- {
- pointBatchItem.IsBuildTrust = null;
- }
- }
-
- db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(batchItem);
- db.HJGL_Batch_BatchTrust.DeleteOnSubmit(trust);
- db.SubmitChanges();
- this.InitTreeMenu();
- this.BindGrid();
- ShowNotify("已删除委托单:" + trustBatchCode, MessageBoxIcon.Success);
- }
- }
- }
- else
- {
- ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
- return;
- }
- }
-
protected void btnPrint1_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_TrustBatchMenuId, Const.BtnPrint))
@@ -1211,69 +1140,51 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
#endregion
- ///
- /// 退回
- ///
- ///
- ///
- protected void btnBack_Click(object sender, EventArgs e)
+ protected void btnAdjustWeldJoint_Click(object sender, EventArgs e)
{
- Model.SGGLDB db = Funs.DB;
- //string trustBatchId = string.Empty;
- var lists = this.Grid1.SelectedRowIDArray;
- if (lists.Count() > 0)
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId,
+ Const.HJGL_TrustBatchMenuId, Const.BtnGenerate))
{
- if (lbIsTrust.Text == "未委托")
- {
- Alert.ShowInTop(BLL.UiText.Message("未委托,无需退回!"), MessageBoxIcon.Warning);
- return;
- }
- foreach (var pointBatchItemId in lists)
- {
- //删除选中委托单明细
- var batchTrustItem = (from x in db.HJGL_Batch_BatchTrustItem where x.PointBatchItemId == pointBatchItemId select x).FirstOrDefault();
- if (batchTrustItem != null)
- {
- //trustBatchId = batchTrustItem.TrustBatchId;
- BLL.Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchId(batchTrustItem.TrustBatchId);
- BLL.Batch_BatchTrustService.DeleteBatchTrustById(batchTrustItem.TrustBatchId);
- //BLL.Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchItemId(batchTrustItem.TrustBatchItemId);
- }
-
- //修改点口中的委托状态
- var pointBatchItem = (from x in db.HJGL_Batch_PointBatchItem where x.PointBatchItemId == pointBatchItemId select x).FirstOrDefault();
- if (pointBatchItem != null)
- {
- if (pointBatchItem.IsBuildTrust != null)
- {
- pointBatchItem.IsBuildTrust = null;//是否委托
- pointBatchItem.PointState = null;//点口类型
- pointBatchItem.PointDate = null;//点口时间
- db.SubmitChanges();
- }
- var pointBatch = BLL.PointBatchService.GetPointBatchById(pointBatchItem.PointBatchId);
- if (pointBatch != null)
- {
- pointBatch.IsClosed = null;
- db.SubmitChanges();
- }
- }
- }
-
- //var trustItemList = BLL.Batch_BatchTrustItemService.GetBatchTrustItemByTrustBatchId(trustBatchId);
- //if (trustItemList.Count == 0)
- //{
- // BLL.Batch_BatchTrustService.DeleteBatchTrustById(trustBatchId);
- //}
- PageInfo();
- BindGrid();
- ShowNotify("退回成功!", MessageBoxIcon.Success);
- }
- else
- {
- Alert.ShowInTop(BLL.UiText.Message("请至少选择一条记录"), MessageBoxIcon.Warning);
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
+
+ string trustBatchId = this.tvControlItem.SelectedNodeID;
+ if (string.IsNullOrEmpty(trustBatchId))
+ {
+ ShowNotify("请选择要调整焊口的委托单!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ ViewState["AdjustingTrust"] = true;
+ PageContext.RegisterStartupScript(Window1.GetShowReference(
+ "TrustWeldJointAdjust.aspx?TrustBatchId=" + HttpUtility.UrlEncode(trustBatchId),
+ UiText.Get("T_焊口调整")));
+ }
+
+ protected void btnBack_Click(object sender, EventArgs e)
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId,
+ Const.HJGL_TrustBatchMenuId, Const.BtnDelete))
+ {
+ ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ string message = Batch_BatchTrustService.ReturnTrust(this.CurrUser.LoginProjectId,
+ this.tvControlItem.SelectedNodeID, this.CurrUser.PersonId, false);
+ if (!string.IsNullOrEmpty(message))
+ {
+ ShowNotify(message, MessageBoxIcon.Warning);
+ return;
+ }
+
+ InitTreeMenu();
+ this.tvControlItem.SelectedNodeID = string.Empty;
+ Grid1.PageIndex = 0;
+ PageInfo();
+ BindGrid();
+ ShowNotify("退回成功!", MessageBoxIcon.Success);
}
}
}
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.designer.cs
index 0c048edf..01eba26a 100644
--- a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.designer.cs
@@ -149,15 +149,6 @@ namespace FineUIPro.Web.HJGL.PointTrust
///
protected global::FineUIPro.Button btnAudit;
- ///
- /// btnDelete 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.Button btnDelete;
-
///
/// btnPrint 控件。
///
@@ -239,6 +230,11 @@ namespace FineUIPro.Web.HJGL.PointTrust
///
protected global::FineUIPro.Button btnBack;
+ ///
+ /// 焊口调整按钮。
+ ///
+ protected global::FineUIPro.Button btnAdjustWeldJoint;
+
protected global::FineUIPro.Button btnEdit;
///
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx
new file mode 100644
index 00000000..4898e98e
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx
@@ -0,0 +1,39 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrustWeldJointAdjust.aspx.cs"
+ Inherits="FineUIPro.Web.HJGL.PointTrust.TrustWeldJointAdjust" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.cs
new file mode 100644
index 00000000..16a4f7ed
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.cs
@@ -0,0 +1,93 @@
+using BLL;
+using System;
+using System.Data;
+using System.Linq;
+
+namespace FineUIPro.Web.HJGL.PointTrust
+{
+ public partial class TrustWeldJointAdjust : PageBase
+ {
+ private string TrustBatchId
+ {
+ get { return (string)ViewState["TrustBatchId"]; }
+ set { ViewState["TrustBatchId"] = value; }
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Title = UiText.Get("T_焊口调整");
+ try
+ {
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId,
+ Const.HJGL_TrustBatchMenuId, Const.BtnGenerate))
+ {
+ btnSave.Enabled = false;
+ Alert.ShowInTop(UiText.Message("您没有调整委托焊口的权限!"), MessageBoxIcon.Warning);
+ return;
+ }
+ if (!IsPostBack)
+ {
+ TrustBatchId = Request.QueryString["TrustBatchId"];
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var trust = db.HJGL_Batch_BatchTrust.FirstOrDefault(x =>
+ x.TrustBatchId == TrustBatchId && x.ProjectId == this.CurrUser.LoginProjectId);
+ if (trust == null)
+ {
+ btnSave.Enabled = false;
+ Alert.ShowInTop(UiText.Message("委托单不存在或不属于当前项目!"), MessageBoxIcon.Warning);
+ return;
+ }
+ if (trust.PointBatchId == null || trust.TrustType == "R")
+ {
+ btnSave.Enabled = false;
+ Alert.ShowInTop(UiText.Message("焊口调整仅适用于检验批委托单,返修委托请使用返修扩透流程!"), MessageBoxIcon.Warning);
+ return;
+ }
+ txtTrustBatchCode.Text = trust.TrustBatchCode;
+ }
+ DataTable items = Batch_BatchTrustItemService.GetTrustAdjustmentItems(this.CurrUser.LoginProjectId, TrustBatchId);
+ var currentItems = items.AsEnumerable().Where(x => !x.IsNull("TrustBatchItemId")).ToList();
+ ViewState["OriginalTrustBatchItemIds"] = currentItems.Select(x => x.Field("TrustBatchItemId")).ToArray();
+ foreach (DataRow item in items.Rows)
+ {
+ item["ItemState"] = UiText.Message(item.Field("ItemState"));
+ item["AdjustmentState"] = UiText.Message(item.Field("AdjustmentState"));
+ }
+ Grid1.RecordCount = items.Rows.Count;
+ Grid1.DataSource = items;
+ Grid1.DataBind();
+ Grid1.SelectedRowIDArray = currentItems.Select(x => x.Field("PointBatchItemId")).ToArray();
+ }
+ }
+ catch (Exception ex)
+ {
+ btnSave.Enabled = false;
+ Alert.ShowInTop(UiText.Message("加载焊口调整失败:" + ex.Message), MessageBoxIcon.Warning);
+ }
+ }
+
+ protected void btnSave_Click(object sender, EventArgs e)
+ {
+ if (!btnSave.Enabled)
+ {
+ return;
+ }
+ try
+ {
+ string message = Batch_BatchTrustItemService.SaveAdjustedTrustItems(this.CurrUser.LoginProjectId, TrustBatchId,
+ Grid1.SelectedRowIDArray, (string[])ViewState["OriginalTrustBatchItemIds"]);
+ if (!string.IsNullOrEmpty(message))
+ {
+ Alert.ShowInTop(UiText.Message(message), MessageBoxIcon.Warning);
+ return;
+ }
+ PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
+ }
+ catch (Exception ex)
+ {
+ Alert.ShowInTop(UiText.Message("保存焊口调整失败:" + ex.Message), MessageBoxIcon.Warning);
+ }
+ }
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.designer.cs
new file mode 100644
index 00000000..67dddfb8
--- /dev/null
+++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustWeldJointAdjust.aspx.designer.cs
@@ -0,0 +1,14 @@
+namespace FineUIPro.Web.HJGL.PointTrust
+{
+ public partial class TrustWeldJointAdjust
+ {
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+ protected global::FineUIPro.PageManager PageManager1;
+ protected global::FineUIPro.Panel Panel1;
+ protected global::FineUIPro.Label txtTrustBatchCode;
+ protected global::FineUIPro.Label lblHelp;
+ protected global::FineUIPro.Grid Grid1;
+ protected global::FineUIPro.Toolbar Toolbar1;
+ protected global::FineUIPro.Button btnSave;
+ }
+}
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx
index d931f8bd..6131677a 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx
@@ -72,6 +72,10 @@
+
+
+
+
@@ -134,7 +138,7 @@
AllowSorting="true" SortField="PipelineCode,WeldJointCode" SortDirection="ASC"
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="100"
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
- KeepCurrentSelection="true"
+ EnableCheckBoxSelect="true" CheckBoxSelectOnly="true" EnableMultiSelect="true" KeepCurrentSelection="true"
>
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.cs b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.cs
index f448dde0..89b73ce4 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.cs
@@ -32,7 +32,7 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
{
this.txtPipeCode.Text = jot.PipelineCode;
txtWeldJointCode.Text = jot.WeldJointCode;
- txtWelder.Text = jot.BackingWelderCode;
+ txtWelder.Text = string.Join(",", new[] { jot.BackingWelderCode, jot.CoverWelderCode }.Where(x => !string.IsNullOrEmpty(x)).Distinct());
txtRepairLocation.Text = repairRecord.RepairLocation;
txtJudgeGrade.Text = ndeItem.JudgeGrade;
txtCheckDefects.Text = repairRecord.CheckDefects;
@@ -348,8 +348,9 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
if (ckbWelder.Checked)
{
- strSql += " AND WelderId =@WelderId";
- listStr.Add(new SqlParameter("@WelderId", jot.BackingWelderId));
+ strSql += " AND (BackingWelderId IN (@BackingWelderId, @CoverWelderId) OR CoverWelderId IN (@BackingWelderId, @CoverWelderId))";
+ listStr.Add(new SqlParameter("@BackingWelderId", string.IsNullOrEmpty(jot.BackingWelderId) ? (object)DBNull.Value : jot.BackingWelderId));
+ listStr.Add(new SqlParameter("@CoverWelderId", string.IsNullOrEmpty(jot.CoverWelderId) ? (object)DBNull.Value : jot.CoverWelderId));
}
if (ckbBatch.Checked)
{
@@ -397,7 +398,7 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
(case when PCoverWelderId is null then CoverWelderId else PCoverWelderId end) CoverWelderId
FROM dbo.View_HJGL_Batch_PointBatchItem
WHERE ProjectId=@ProjectId AND DetectionTypeId=@DetectionTypeId
- AND WelderId =@WelderId ";
+ AND (BackingWelderId IN (@BackingWelderId, @CoverWelderId) OR CoverWelderId IN (@BackingWelderId, @CoverWelderId)) ";
//AND PointBatchId=@PointBatchId 暂时注释
List listStr = new List();
if (repairRecord.AuditDate.HasValue)
@@ -413,7 +414,8 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@DetectionTypeId", repairRecord.DetectionTypeId));
- listStr.Add(new SqlParameter("@WelderId", jot.BackingWelderId));
+ listStr.Add(new SqlParameter("@BackingWelderId", string.IsNullOrEmpty(jot.BackingWelderId) ? (object)DBNull.Value : jot.BackingWelderId));
+ listStr.Add(new SqlParameter("@CoverWelderId", string.IsNullOrEmpty(jot.CoverWelderId) ? (object)DBNull.Value : jot.CoverWelderId));
//listStr.Add(new SqlParameter("@PointBatchId", jot.PointBatchId));
SqlParameter[] parameter = listStr.ToArray();
@@ -421,7 +423,10 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
Grid1.RecordCount = dt.Rows.Count;
- // tb = GetFilteredTable(Grid1.FilteredData, tb);
+ if (Grid1.PageIndex * Grid1.PageSize >= Grid1.RecordCount)
+ {
+ Grid1.PageIndex = 0;
+ }
var table = this.GetPagedDataTable(Grid1, dt);
Grid1.DataSource = table;
Grid1.DataBind();
@@ -441,11 +446,7 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
}
}
- if (!string.IsNullOrEmpty(ids))
- {
- ids = ids.Substring(0, ids.Length - 1);
- this.Grid1.SelectedRowIDArray = ids.Split(',');
- }
+ this.Grid1.SelectedRowIDArray = ids.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (Grid1.Rows.Count > 0)
{
foreach (JObject mergedRow in Grid1.GetMergedData())
@@ -700,35 +701,41 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
protected void btnSave_Click(object sender, EventArgs e)
+ {
+ SaveExpand(true);
+ }
+
+ protected void btnHelp_Click(object sender, EventArgs e)
+ {
+ Alert.ShowInTop(UiText.Get("T_自动扩透说明"), UiText.Get("T_自动扩透"), MessageBoxIcon.Information);
+ }
+
+ protected void btnManualExpand_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIDArray.Length == 0)
+ {
+ Alert.ShowInTop(UiText.Message("请先勾选需要扩透的焊口!"), MessageBoxIcon.Warning);
+ return;
+ }
+ SaveExpand(false);
+ }
+
+ private void SaveExpand(bool isAutoExpand)
{
Model.SGGLDB db = Funs.DB;
string repairRecordId = tvControlItem.SelectedNodeID;
Model.HJGL_RepairRecord repairRecord = BLL.RepairRecordService.GetRepairRecordById(repairRecordId);
- var trustItem = (from x in Funs.DB.HJGL_Batch_BatchTrustItem
- join y in Funs.DB.HJGL_Batch_NDEItem on x.TrustBatchItemId equals y.TrustBatchItemId
- where y.NDEItemID == repairRecord.NDEItemID
- select x).FirstOrDefault();
- //if (trustItem != null)
- //{
- // var trustItems2 = from x in Funs.DB.HJGL_Batch_BatchTrustItem where x.TrustBatchId == trustItem.TrustBatchId select x;
- // foreach (var item in trustItems2)
- // {
- // var ndeItem = Funs.DB.HJGL_Batch_NDEItem.FirstOrDefault(x => x.TrustBatchItemId == item.TrustBatchItemId);
- // if (ndeItem != null)
- // {
- // var repair = Funs.DB.HJGL_RepairRecord.FirstOrDefault(x => x.NDEItemID == ndeItem.NDEItemID);
- // if (repair != null)
- // {
- // var trustItem3s = from x in Funs.DB.HJGL_Batch_BatchTrustItem where x.RepairRecordId == repair.RepairRecordId select x;
- // if (trustItem3s.Count() > 0)
- // {
- // Alert.ShowInTop(BLL.UiText.Message("本次返修已扩透!"), MessageBoxIcon.Warning);
- // return;
- // }
- // }
- // }
- // }
- //}
+ if (repairRecord == null || repairRecord.ProjectId != this.CurrUser.LoginProjectId)
+ {
+ Alert.ShowInTop(UiText.Message("请选择当前项目的返修记录!"), MessageBoxIcon.Warning);
+ return;
+ }
+ if (isAutoExpand && Grid1.Rows.Count == 0
+ && !(BLL.WeldJointService.GetWeldJointByWeldJointId(repairRecord.WeldJointId).Size >= 20))
+ {
+ Alert.ShowInTop(UiText.Message("当前没有可扩透的候选焊口!"), MessageBoxIcon.Warning);
+ return;
+ }
if (!repairRecord.AuditDate.HasValue)
{
// 更新返修记录
@@ -777,7 +784,10 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
}
// 更新扩透口
- RandomExport(repairRecord.RepairMark, pointState);
+ if (isAutoExpand)
+ {
+ RandomExport(repairRecord.RepairMark, pointState);
+ }
string[] checkedRow = Grid1.SelectedRowIDArray;
if (checkedRow.Count() > 0)
{
@@ -1076,6 +1086,12 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
private void RandomExport(string mark, string pointState)
{
int num = Grid1.Rows.Count;
+ if (num == 0)
+ {
+ Grid1.SelectedRowIndexArray = new int[0];
+ return;
+ }
+
if (mark == "A")
{
if (pointState != "2") //非扩透口
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.designer.cs
index 9098c2dc..6c3fee7c 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairAndExpand.aspx.designer.cs
@@ -155,6 +155,12 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
protected global::FineUIPro.Button btnSave;
+
+ /// 自动扩透说明按钮。
+ protected global::FineUIPro.Button btnHelp;
+
+ /// 手动扩透按钮。
+ protected global::FineUIPro.Button btnManualExpand;
///
/// btnPointAudit 控件。
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx
index 24492132..66cfe7ae 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx
@@ -63,8 +63,8 @@
-
+
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.cs b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.cs
index 63d01112..e8cda0c2 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.cs
@@ -397,56 +397,36 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand
}
}
- protected void btnDelete_Click(object sender, EventArgs e)
+ protected void btnBack_Click(object sender, EventArgs e)
{
- if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_RepairTrustMenuId, Const.BtnDelete))
- {
- Model.SGGLDB db = Funs.DB;
- if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
- {
- string trustBatchId = this.tvControlItem.SelectedNodeID;
- string trustBatchCode = this.tvControlItem.SelectedNode.Text;
- var trust = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
-
- if (trust.IsAudit == true)
- {
- ShowNotify("该委托单已审核,不能删除!", MessageBoxIcon.Warning);
- return;
- }
- else
- {
- var batchItem = from y in db.HJGL_Batch_BatchTrustItem where y.TrustBatchId == trustBatchId select y;
- foreach (var item in batchItem)
- {
- Model.HJGL_Batch_PointBatchItem pointBatchItem = null;
- if (item.PointBatchItemId != null)
- {
- pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchItemId == item.PointBatchItemId);
- }
- else
- {
- pointBatchItem = db.HJGL_Batch_PointBatchItem.FirstOrDefault(x => x.RepairRecordId == item.RepairRecordId);
- }
- if (pointBatchItem != null)
- {
- pointBatchItem.IsBuildTrust = null;
- }
- }
-
- db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(batchItem);
- db.HJGL_Batch_BatchTrust.DeleteOnSubmit(trust);
- db.SubmitChanges();
- this.InitTreeMenu();
- this.BindGrid();
- ShowNotify("已删除委托单:" + trustBatchCode, MessageBoxIcon.Success);
- }
- }
- }
- else
+ if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId,
+ Const.HJGL_RepairExpandMenuId, Const.BtnCancelAuditing))
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
+
+ string message = Batch_BatchTrustService.ReturnTrust(this.CurrUser.LoginProjectId,
+ this.tvControlItem.SelectedNodeID, this.CurrUser.PersonId, true);
+ if (!string.IsNullOrEmpty(message))
+ {
+ ShowNotify(message, MessageBoxIcon.Warning);
+ return;
+ }
+
+ InitTreeMenu();
+ this.tvControlItem.SelectedNodeID = string.Empty;
+ this.txtTrustBatchCode.Text = string.Empty;
+ this.txtTrustDate.Text = string.Empty;
+ this.txtDetectionTypeCode.Text = string.Empty;
+ this.lbNDEUnit.Text = string.Empty;
+ this.lbIsCheck.Text = string.Empty;
+ this.lbIsAudit.Text = string.Empty;
+ this.Grid1.PageIndex = 0;
+ this.Grid1.RecordCount = 0;
+ this.Grid1.DataSource = null;
+ this.Grid1.DataBind();
+ ShowNotify("退回成功!", MessageBoxIcon.Success);
}
protected void btnPrintAttachment4_Click(object sender, EventArgs e)
diff --git a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.designer.cs
index 4012529c..f2e7fec1 100644
--- a/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HJGL/RepairAndExpand/RepairTrust.aspx.designer.cs
@@ -157,13 +157,13 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand {
protected global::FineUIPro.Button btnPointAudit;
///
- /// btnDelete 控件。
+ /// btnBack 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.Button btnDelete;
+ protected global::FineUIPro.Button btnBack;
///
/// btnPrint 控件。