feat(hjgl): 完善委托焊口调整和返修扩透

支持调整委托焊口和退回委托,完善返修扩透操作,并更新对应页面资源。
This commit is contained in:
2026-12-01 09:34:22 +08:00
parent 61b877207c
commit 443ae01d22
19 changed files with 1030 additions and 271 deletions
+6 -3
View File
@@ -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)
{
+2
View File
@@ -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";
/// <summary>
@@ -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
/// </summary>
public static class Batch_BatchTrustItemService
{
/// <summary>
/// 获取当前委托焊口及同检验批可补入的点口。
/// </summary>
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);
}
}
/// <summary>
/// 差量调整委托焊口,保留原委托表头及未变动明细。
/// </summary>
/// <returns>成功返回空字符串,校验未通过返回提示信息。</returns>
public static string SaveAdjustedTrustItems(string projectId, string trustBatchId,
string[] selectedPointBatchItemIds, string[] originalTrustBatchItemIds)
{
var selectedIds = new HashSet<string>(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<string>(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<string>(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<string>(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;
}
/// <summary>
/// 根据主键获取无损委托明细
/// </summary>
@@ -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);
}
/// <summary>
/// 整单退回。普通委托保留检测数据,返修委托可随单清理尚未产生后续返修的检测数据。
/// </summary>
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 更新委托单 检测状态
/// <summary>
/// 更新委托单 检测状态
@@ -15228,7 +15228,7 @@
<value>Special Review Status</value>
</data>
<data name="T_世界地图" xml:space="preserve">
<value>World Location Drawing</value>
<value>World map</value>
</data>
<data name="T_两个单位为同一个单位_无需合并" xml:space="preserve">
<value>The two organizations are identical. No merge is required.</value>
@@ -15255,7 +15255,7 @@
<value>Resume</value>
</data>
<data name="T_中国地图" xml:space="preserve">
<value>in Country Location Drawing</value>
<value>China map</value>
</data>
<data name="T_中间漆" xml:space="preserve">
<value>Intermediate Coat</value>
@@ -16163,6 +16163,12 @@
<data name="T_删除选中行_2" xml:space="preserve">
<value>Delete the selected rows?</value>
</data>
<data name="T_删除焊接任务选中行确认" xml:space="preserve">
<value>Delete the selected welding task details? The list will refresh and unsaved changes will be lost.</value>
</data>
<data name="T_删除焊接任务部分结果" xml:space="preserve">
<value>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.</value>
</data>
<data name="T_判断题" xml:space="preserve">
<value>True / False</value>
</data>
@@ -26083,4 +26089,229 @@
<data name="T_是否加载多语言" xml:space="preserve">
<value>Enable multiple languages</value>
</data>
<data name="T_公司级看板标题" xml:space="preserve">
<value>Company dashboard title</value>
</data>
<data name="T_留空使用默认标题" xml:space="preserve">
<value>Leave blank to use the default title</value>
</data>
<data name="T_菜单设置" xml:space="preserve">
<value>Menu settings</value>
</data>
<data name="T_菜单名称" xml:space="preserve">
<value>Menu name</value>
</data>
<data name="T_菜单地址" xml:space="preserve">
<value>Menu address</value>
</data>
<data name="T_迁移" xml:space="preserve">
<value>Move</value>
</data>
<data name="T_编辑菜单" xml:space="preserve">
<value>Edit menu</value>
</data>
<data name="T_迁移菜单" xml:space="preserve">
<value>Move menu</value>
</data>
<data name="T_目标菜单类型" xml:space="preserve">
<value>Destination menu type</value>
</data>
<data name="T_确认迁移所选菜单及其子菜单" xml:space="preserve">
<value>Move the selected menu and its submenus?</value>
</data>
<data name="T_菜单根目录" xml:space="preserve">
<value>Menu root</value>
</data>
<data name="T_公司级" xml:space="preserve">
<value>Company</value>
</data>
<data name="T_项目级" xml:space="preserve">
<value>Project</value>
</data>
<data name="T_停用" xml:space="preserve">
<value>Disabled</value>
</data>
<data name="T_请输入不超过_50_个字符的单行标题" xml:space="preserve">
<value>Enter a single-line title of up to 50 characters.</value>
</data>
<data name="T_请选择要维护的菜单" xml:space="preserve">
<value>Select a menu to manage.</value>
</data>
<data name="T_请填写有效的菜单名称和整数排序" xml:space="preserve">
<value>Enter a valid menu name and an integer sort order.</value>
</data>
<data name="T_菜单地址须为站内相对地址_且不超过_200_个字符" xml:space="preserve">
<value>Enter a relative address on this site, up to 200 characters.</value>
</data>
<data name="T_菜单已变更_请重新选择" xml:space="preserve">
<value>This menu has changed. Select it again.</value>
</data>
<data name="T_请选择目标菜单类型和目录" xml:space="preserve">
<value>Select the destination menu type and folder.</value>
</data>
<data name="T_目标目录无效_或位于所选菜单及其子菜单内" xml:space="preserve">
<value>Select a valid folder outside the selected menu and its submenus.</value>
</data>
<data name="T_保存成功_刷新首页后生效" xml:space="preserve">
<value>Saved. Refresh the home page to see the changes.</value>
</data>
<data name="T_焊口调整" xml:space="preserve">
<value>Adjust weld joints</value>
</data>
<data name="T_焊口调整说明" xml:space="preserve">
<value>Select the weld joints to keep or add. Only weld joints without inspection records can be removed.</value>
</data>
<data name="T_委托状态" xml:space="preserve">
<value>Request status</value>
</data>
<data name="T_调整状态" xml:space="preserve">
<value>Adjustment status</value>
</data>
<data name="T_当前委托" xml:space="preserve">
<value>On this request</value>
</data>
<data name="T_新增点口" xml:space="preserve">
<value>Available weld joint</value>
</data>
<data name="T_已有检测记录_必须保留" xml:space="preserve">
<value>Has inspection records; must be kept</value>
</data>
<data name="T_可调整" xml:space="preserve">
<value>Can be removed</value>
</data>
<data name="T_可补入" xml:space="preserve">
<value>Can be added</value>
</data>
<data name="T_退回无损委托确认" xml:space="preserve">
<value>Returning this request deletes it and all its details and makes its weld joints available for selection again. Continue?</value>
</data>
<data name="T_退回返修扩透委托确认" xml:space="preserve">
<value>Returning this request deletes it, all its details, and its inspection records. Continue?</value>
</data>
<data name="T_手动扩透" xml:space="preserve">
<value>Manual inspection expansion</value>
</data>
<data name="T_自动扩透说明" xml:space="preserve">
<value>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.</value>
</data>
<data name="T_请选择要调整焊口的委托单" xml:space="preserve">
<value>Select an inspection request to adjust.</value>
</data>
<data name="T_您没有调整委托焊口的权限" xml:space="preserve">
<value>You do not have permission to adjust weld joints on this request.</value>
</data>
<data name="T_焊口调整仅适用于检验批委托单" xml:space="preserve">
<value>You can adjust weld joints only on requests linked to an inspection batch. Use the repair and expansion workflow for repair requests.</value>
</data>
<data name="T_加载焊口调整失败" xml:space="preserve">
<value>Could not load the weld joints: {0}</value>
</data>
<data name="T_保存焊口调整失败" xml:space="preserve">
<value>Could not save the weld joint changes: {0}</value>
</data>
<data name="T_委托单至少需要保留一个焊口" xml:space="preserve">
<value>The request must contain at least one weld joint.</value>
</data>
<data name="T_请选择当前项目的委托单" xml:space="preserve">
<value>Select a request in the current project.</value>
</data>
<data name="T_委托焊口已发生变化" xml:space="preserve">
<value>The request details have changed. Reopen the weld joint adjustment dialog.</value>
</data>
<data name="T_所选点口已取消或已进入其他委托" xml:space="preserve">
<value>A selected weld joint is no longer available. Reopen the weld joint adjustment dialog.</value>
</data>
<data name="T_已有检测记录的焊口不能移出委托单" xml:space="preserve">
<value>Weld joints with inspection records cannot be removed.</value>
</data>
<data name="T_请选择当前项目对应类型的委托单" xml:space="preserve">
<value>Select a request of the correct type in the current project.</value>
</data>
<data name="T_本单检测记录已生成后续返修通知单" xml:space="preserve">
<value>These inspection records have a follow-up repair notice. Handle the follow-up repair and expansion before returning the request.</value>
</data>
<data name="T_该委托单已有检测记录不能退回" xml:space="preserve">
<value>This request has inspection records and cannot be returned.</value>
</data>
<data name="T_请选择当前项目的返修记录" xml:space="preserve">
<value>Select a repair record in the current project.</value>
</data>
<data name="T_当前没有可扩透的候选焊口" xml:space="preserve">
<value>There are no candidate weld joints for inspection expansion.</value>
</data>
<data name="T_请先勾选需要扩透的焊口" xml:space="preserve">
<value>Select the weld joints for inspection expansion first.</value>
</data>
<data name="T_总焊接达因数" xml:space="preserve">
<value>Total weld dia-inches</value>
</data>
<data name="T_当月完成焊接达因数" xml:space="preserve">
<value>Weld dia-inches completed this month</value>
</data>
<data name="T_累计完成焊接达因数" xml:space="preserve">
<value>Weld dia-inches completed to date</value>
</data>
<data name="T_在建项目数量" xml:space="preserve">
<value>Projects under construction</value>
</data>
<data name="T_当月一次焊接合格率" xml:space="preserve">
<value>First-pass film acceptance this month</value>
</data>
<data name="T_累计一次焊接合格率" xml:space="preserve">
<value>First-pass film acceptance to date</value>
</data>
<data name="T_焊工人数" xml:space="preserve">
<value>Active welders</value>
</data>
<data name="T_焊接工作量" xml:space="preserve">
<value>Welding volume</value>
</data>
<data name="T_焊接质量与人员" xml:space="preserve">
<value>Quality and workforce</value>
</data>
<data name="T_项目位置" xml:space="preserve">
<value>Project location</value>
</data>
<data name="T_焊接进度" xml:space="preserve">
<value>Welding progress</value>
</data>
<data name="T_剩余" xml:space="preserve">
<value>Remaining</value>
</data>
<data name="T_单位_达因" xml:space="preserve">
<value>Unit: dia-inches</value>
</data>
<data name="T_项目_累计工作量" xml:space="preserve">
<value>Project / cumulative volume</value>
</data>
<data name="T_本月完成" xml:space="preserve">
<value>This month</value>
</data>
<data name="T_暂无在建项目" xml:space="preserve">
<value>No projects under construction</value>
</data>
<data name="T_在建项目分布" xml:space="preserve">
<value>Active project locations</value>
</data>
<data name="T_近六月焊接趋势" xml:space="preserve">
<value>Six-month welding trend</value>
</data>
<data name="T_截至某日" xml:space="preserve">
<value>As of {0}</value>
</data>
<data name="T_项目焊接合格率" xml:space="preserve">
<value>Project welding acceptance</value>
</data>
<data name="T_公司当月一次合格率" xml:space="preserve">
<value>Company first-pass rate this month</value>
</data>
<data name="T_合格片数_总片数" xml:space="preserve">
<value>Passed films / total films</value>
</data>
<data name="T_暂无检测" xml:space="preserve">
<value>No tests</value>
</data>
<data name="T_完成焊接量_万达因" xml:space="preserve">
<value>Welded volume (10,000 dia-in)</value>
</data>
</root>
@@ -16163,6 +16163,12 @@
<data name="T_删除选中行_2" xml:space="preserve">
<value>删除选中行?</value>
</data>
<data name="T_删除焊接任务选中行确认" xml:space="preserve">
<value>删除选中的焊接任务明细?列表将刷新,未保存的修改会丢失。</value>
</data>
<data name="T_删除焊接任务部分结果" xml:space="preserve">
<value>已删除 {0} 条,未删除 {1} 条。请核对记录是否仍在当前列表、关联焊口是否存在及是否已生成焊接日报。</value>
</data>
<data name="T_判断题" xml:space="preserve">
<value>判断题</value>
</data>
@@ -26083,4 +26089,229 @@
<data name="T_是否加载多语言" xml:space="preserve">
<value>是否加载多语言</value>
</data>
<data name="T_公司级看板标题" xml:space="preserve">
<value>公司级看板标题</value>
</data>
<data name="T_留空使用默认标题" xml:space="preserve">
<value>留空使用默认标题</value>
</data>
<data name="T_菜单设置" xml:space="preserve">
<value>菜单设置</value>
</data>
<data name="T_菜单名称" xml:space="preserve">
<value>菜单名称</value>
</data>
<data name="T_菜单地址" xml:space="preserve">
<value>菜单地址</value>
</data>
<data name="T_迁移" xml:space="preserve">
<value>迁移</value>
</data>
<data name="T_编辑菜单" xml:space="preserve">
<value>编辑菜单</value>
</data>
<data name="T_迁移菜单" xml:space="preserve">
<value>迁移菜单</value>
</data>
<data name="T_目标菜单类型" xml:space="preserve">
<value>目标菜单类型</value>
</data>
<data name="T_确认迁移所选菜单及其子菜单" xml:space="preserve">
<value>确认迁移所选菜单及其子菜单?</value>
</data>
<data name="T_菜单根目录" xml:space="preserve">
<value>菜单根目录</value>
</data>
<data name="T_公司级" xml:space="preserve">
<value>公司级</value>
</data>
<data name="T_项目级" xml:space="preserve">
<value>项目级</value>
</data>
<data name="T_停用" xml:space="preserve">
<value>停用</value>
</data>
<data name="T_请输入不超过_50_个字符的单行标题" xml:space="preserve">
<value>请输入不超过 50 个字符的单行标题。</value>
</data>
<data name="T_请选择要维护的菜单" xml:space="preserve">
<value>请选择要维护的菜单。</value>
</data>
<data name="T_请填写有效的菜单名称和整数排序" xml:space="preserve">
<value>请填写有效的菜单名称和整数排序。</value>
</data>
<data name="T_菜单地址须为站内相对地址_且不超过_200_个字符" xml:space="preserve">
<value>菜单地址须为站内相对地址,且不超过 200 个字符。</value>
</data>
<data name="T_菜单已变更_请重新选择" xml:space="preserve">
<value>菜单已变更,请重新选择。</value>
</data>
<data name="T_请选择目标菜单类型和目录" xml:space="preserve">
<value>请选择目标菜单类型和目录。</value>
</data>
<data name="T_目标目录无效_或位于所选菜单及其子菜单内" xml:space="preserve">
<value>目标目录无效,或位于所选菜单及其子菜单内。</value>
</data>
<data name="T_保存成功_刷新首页后生效" xml:space="preserve">
<value>保存成功!刷新首页后生效。</value>
</data>
<data name="T_焊口调整" xml:space="preserve">
<value>焊口调整</value>
</data>
<data name="T_焊口调整说明" xml:space="preserve">
<value>勾选要保留或补入的焊口。仅可移出没有检测记录的焊口。</value>
</data>
<data name="T_委托状态" xml:space="preserve">
<value>委托状态</value>
</data>
<data name="T_调整状态" xml:space="preserve">
<value>调整状态</value>
</data>
<data name="T_当前委托" xml:space="preserve">
<value>当前委托</value>
</data>
<data name="T_新增点口" xml:space="preserve">
<value>新增点口</value>
</data>
<data name="T_已有检测记录_必须保留" xml:space="preserve">
<value>已有检测记录,必须保留</value>
</data>
<data name="T_可调整" xml:space="preserve">
<value>可调整</value>
</data>
<data name="T_可补入" xml:space="preserve">
<value>可补入</value>
</data>
<data name="T_退回无损委托确认" xml:space="preserve">
<value>退回将删除该委托单及全部明细,并将相关焊口恢复为未点口。确定要退回吗?</value>
</data>
<data name="T_退回返修扩透委托确认" xml:space="preserve">
<value>退回将删除该委托单、全部明细及本单检测记录。确定要退回吗?</value>
</data>
<data name="T_手动扩透" xml:space="preserve">
<value>手动扩透</value>
</data>
<data name="T_自动扩透说明" xml:space="preserve">
<value>首次返修且原焊口不是扩透口时,当前页候选不超过两个则全部选中,超过两个则随机选两个;其余情况选中当前页全部候选。没有候选且原焊口达因大于等于 20 时,可以确认后生成仅含原返修口的委托。</value>
</data>
<data name="T_请选择要调整焊口的委托单" xml:space="preserve">
<value>请选择要调整焊口的委托单!</value>
</data>
<data name="T_您没有调整委托焊口的权限" xml:space="preserve">
<value>您没有调整委托焊口的权限!</value>
</data>
<data name="T_焊口调整仅适用于检验批委托单" xml:space="preserve">
<value>焊口调整仅适用于检验批委托单,返修委托请使用返修扩透流程!</value>
</data>
<data name="T_加载焊口调整失败" xml:space="preserve">
<value>加载焊口调整失败:{0}</value>
</data>
<data name="T_保存焊口调整失败" xml:space="preserve">
<value>保存焊口调整失败:{0}</value>
</data>
<data name="T_委托单至少需要保留一个焊口" xml:space="preserve">
<value>委托单至少需要保留一个焊口!</value>
</data>
<data name="T_请选择当前项目的委托单" xml:space="preserve">
<value>请选择当前项目的委托单!</value>
</data>
<data name="T_委托焊口已发生变化" xml:space="preserve">
<value>委托焊口已发生变化,请重新打开焊口调整!</value>
</data>
<data name="T_所选点口已取消或已进入其他委托" xml:space="preserve">
<value>所选点口已取消或已进入其他委托,请重新打开焊口调整!</value>
</data>
<data name="T_已有检测记录的焊口不能移出委托单" xml:space="preserve">
<value>已有检测记录的焊口不能移出委托单!</value>
</data>
<data name="T_请选择当前项目对应类型的委托单" xml:space="preserve">
<value>请选择当前项目对应类型的委托单!</value>
</data>
<data name="T_本单检测记录已生成后续返修通知单" xml:space="preserve">
<value>本单检测记录已生成后续返修通知单,请先处理后续返修/扩透流程后再退回!</value>
</data>
<data name="T_该委托单已有检测记录不能退回" xml:space="preserve">
<value>该委托单已有检测记录,不能退回!</value>
</data>
<data name="T_请选择当前项目的返修记录" xml:space="preserve">
<value>请选择当前项目的返修记录!</value>
</data>
<data name="T_当前没有可扩透的候选焊口" xml:space="preserve">
<value>当前没有可扩透的候选焊口!</value>
</data>
<data name="T_请先勾选需要扩透的焊口" xml:space="preserve">
<value>请先勾选需要扩透的焊口!</value>
</data>
<data name="T_总焊接达因数" xml:space="preserve">
<value>总焊接达因数</value>
</data>
<data name="T_当月完成焊接达因数" xml:space="preserve">
<value>当月完成焊接达因数</value>
</data>
<data name="T_累计完成焊接达因数" xml:space="preserve">
<value>累计完成焊接达因数</value>
</data>
<data name="T_在建项目数量" xml:space="preserve">
<value>在建项目数量</value>
</data>
<data name="T_当月一次焊接合格率" xml:space="preserve">
<value>当月一次焊接合格率</value>
</data>
<data name="T_累计一次焊接合格率" xml:space="preserve">
<value>累计一次焊接合格率</value>
</data>
<data name="T_焊工人数" xml:space="preserve">
<value>焊工人数</value>
</data>
<data name="T_焊接工作量" xml:space="preserve">
<value>焊接工作量</value>
</data>
<data name="T_焊接质量与人员" xml:space="preserve">
<value>焊接质量与人员</value>
</data>
<data name="T_项目位置" xml:space="preserve">
<value>项目位置</value>
</data>
<data name="T_焊接进度" xml:space="preserve">
<value>焊接进度</value>
</data>
<data name="T_剩余" xml:space="preserve">
<value>剩余</value>
</data>
<data name="T_单位_达因" xml:space="preserve">
<value>单位:达因</value>
</data>
<data name="T_项目_累计工作量" xml:space="preserve">
<value>项目 / 累计工作量</value>
</data>
<data name="T_本月完成" xml:space="preserve">
<value>本月完成</value>
</data>
<data name="T_暂无在建项目" xml:space="preserve">
<value>暂无在建项目</value>
</data>
<data name="T_在建项目分布" xml:space="preserve">
<value>在建项目分布</value>
</data>
<data name="T_近六月焊接趋势" xml:space="preserve">
<value>近六月焊接趋势</value>
</data>
<data name="T_截至某日" xml:space="preserve">
<value>截至{0}</value>
</data>
<data name="T_项目焊接合格率" xml:space="preserve">
<value>项目焊接合格率</value>
</data>
<data name="T_公司当月一次合格率" xml:space="preserve">
<value>公司当月一次合格率</value>
</data>
<data name="T_合格片数_总片数" xml:space="preserve">
<value>合格片数/总片数</value>
</data>
<data name="T_暂无检测" xml:space="preserve">
<value>暂无检测</value>
</data>
<data name="T_完成焊接量_万达因" xml:space="preserve">
<value>完成焊接量(万达因)</value>
</data>
</root>
+11 -1
View File
@@ -644,6 +644,7 @@
<Content Include="HJGL\PointTrust\PointTrust.aspx" />
<Content Include="HJGL\PointTrust\PointWeldJointView.aspx" />
<Content Include="HJGL\PointTrust\TrustBatch.aspx" />
<Content Include="HJGL\PointTrust\TrustWeldJointAdjust.aspx" />
<Content Include="HJGL\PreDesign\MaterialManage.aspx" />
<Content Include="HJGL\PreDesign\MaterialManageEdit.aspx" />
<Content Include="HJGL\PreDesign\MaterialManageIn.aspx" />
@@ -1041,6 +1042,7 @@
<Content Include="res\indexv1\assets\js\jquery-2.1.1.min.js" />
<Content Include="res\indexv1\css\hScrollPane.css" />
<Content Include="res\indexv1\css\index1.css" />
<Content Include="res\indexv1\css\company-welding.css" />
<Content Include="res\indexv1\css\index2.css" />
<Content Include="res\indexv1\css\video-7.15.0.min.css" />
<Content Include="res\indexv1\iconfont\iconfont.css" />
@@ -1098,6 +1100,7 @@
<Content Include="res\indexv1\image\index2\weather\duoyun.png" />
<Content Include="res\indexv1\image\index2\℃.png" />
<Content Include="res\indexv1\js\china.js" />
<Content Include="res\indexv1\js\company-welding.js" />
<Content Include="res\indexv1\js\draw-circle.js" />
<Content Include="res\indexv1\js\echarts-5.2.0.min.js" />
<Content Include="res\indexv1\js\hScrollPane.js" />
@@ -7190,6 +7193,13 @@
<DependentUpon>TrustBatch.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\PointTrust\TrustWeldJointAdjust.aspx.cs">
<DependentUpon>TrustWeldJointAdjust.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\PointTrust\TrustWeldJointAdjust.aspx.designer.cs">
<DependentUpon>TrustWeldJointAdjust.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\PointTrust\TrustBatch.aspx.designer.cs">
<DependentUpon>TrustBatch.aspx</DependentUpon>
</Compile>
@@ -9308,4 +9318,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
@@ -73,9 +73,6 @@
<%--<f:Button ID="btnPointAudit" Text="生成委托单" ToolTip="监理点口审核并生成委托单" Icon="ArrowNsew" runat="server"
OnClick="btnPointAudit_Click">
</f:Button>--%>
<f:Button ID="btnDelete" Text="<%$ Resources:UiText, T_删除 %>" Icon="Delete" runat="server" Hidden="true"
OnClick="btnDelete_Click">
</f:Button>
<f:Button ID="btnPrint" Text="<%$ Resources:UiText, T_打印 %>" Icon="Printer" runat="server"
MenuID="MenuPrint" ShowMenuIcon="true" Hidden="true">
</f:Button>
@@ -88,7 +85,7 @@
<Rows>
<f:FormRow ColumnWidths="46% 27% 27%">
<Items>
<f:Label ID="txtTrustBatchCode" Label="<%$ Resources:UiText, T_委托单号 %>" runat="server" EncodeText="true"
<f:Label ID="txtTrustBatchCode" EncodeText="true" Label="<%$ Resources:UiText, T_委托单号 %>" runat="server"
LabelWidth="170px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtTrustDate" Label="<%$ Resources:UiText, T_委托日期 %>" runat="server"
@@ -112,7 +109,9 @@
<f:Label ID="lbIsAudit" Label="<%$ Resources:UiText, T_是否审核 %>" runat="server" Hidden="true"
LabelWidth="105px" LabelAlign="Right">
</f:Label>
<f:Button ID="btnBack" Text="<%$ Resources:UiText, T_退回 %>" Icon="ArrowLeft" runat="server" OnClick="btnBack_Click">
<f:Button ID="btnAdjustWeldJoint" Text="<%$ Resources:UiText, T_焊口调整 %>" Icon="ArrowUndo" runat="server" OnClick="btnAdjustWeldJoint_Click">
</f:Button>
<f:Button ID="btnBack" ConfirmText="<%$ Resources:UiText, T_退回无损委托确认 %>" ConfirmTarget="Top" Text="<%$ Resources:UiText, T_退回 %>" Icon="ArrowLeft" runat="server" OnClick="btnBack_Click">
</f:Button>
<f:Button ID="btnEdit" Text="<%$ Resources:UiText, T_编辑 %>" Icon="Pencil" runat="server" OnClick="btnEdit_Click">
</f:Button>
@@ -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
/// </summary>
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<SqlParameter> listStr = new List<SqlParameter>
{
};
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<SqlParameter> listStr = new List<SqlParameter>
{
};
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
/// <param name="e"></param>
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();
}
/// <summary>
@@ -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
/// <summary>
/// 退回
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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);
}
}
}
@@ -149,15 +149,6 @@ namespace FineUIPro.Web.HJGL.PointTrust
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// btnPrint 控件。
/// </summary>
@@ -239,6 +230,11 @@ namespace FineUIPro.Web.HJGL.PointTrust
/// </remarks>
protected global::FineUIPro.Button btnBack;
/// <summary>
/// 焊口调整按钮。
/// </summary>
protected global::FineUIPro.Button btnAdjustWeldJoint;
protected global::FineUIPro.Button btnEdit;
/// <summary>
@@ -0,0 +1,39 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrustWeldJointAdjust.aspx.cs"
Inherits="FineUIPro.Web.HJGL.PointTrust.TrustWeldJointAdjust" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="VBox" BodyPadding="5px">
<Items>
<f:Label ID="txtTrustBatchCode" runat="server" Label="<%$ Resources:UiText, T_委托单号 %>" LabelWidth="90px" EncodeText="true" />
<f:Label ID="lblHelp" runat="server" Text="<%$ Resources:UiText, T_焊口调整说明 %>" />
<f:Grid ID="Grid1" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false"
DataKeyNames="PointBatchItemId" DataIDField="PointBatchItemId" AllowPaging="false"
EnableCheckBoxSelect="true" EnableMultiSelect="true" EnableTextSelection="true" EnableColumnLines="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnSave" runat="server" Text="<%$ Resources:UiText, T_保存 %>" Icon="Accept" OnClick="btnSave_Click" />
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField DataField="PipelineCode" HeaderText="<%$ Resources:UiText, T_管线号 %>" FieldType="String" Width="180px" />
<f:RenderField DataField="WeldJointCode" HeaderText="<%$ Resources:UiText, T_焊口号 %>" FieldType="String" Width="120px" />
<f:RenderField DataField="JointArea" HeaderText="<%$ Resources:UiText, T_区域 %>" FieldType="String" Width="100px" />
<f:RenderField DataField="PointDate" HeaderText="<%$ Resources:UiText, T_点口日期 %>" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" Width="110px" />
<f:RenderField DataField="ItemState" HeaderText="<%$ Resources:UiText, T_委托状态 %>" FieldType="String" Width="100px" />
<f:RenderField DataField="AdjustmentState" HeaderText="<%$ Resources:UiText, T_调整状态 %>" FieldType="String" Width="220px" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -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<string>("TrustBatchItemId")).ToArray();
foreach (DataRow item in items.Rows)
{
item["ItemState"] = UiText.Message(item.Field<string>("ItemState"));
item["AdjustmentState"] = UiText.Message(item.Field<string>("AdjustmentState"));
}
Grid1.RecordCount = items.Rows.Count;
Grid1.DataSource = items;
Grid1.DataBind();
Grid1.SelectedRowIDArray = currentItems.Select(x => x.Field<string>("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);
}
}
}
}
@@ -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;
}
}
@@ -72,6 +72,10 @@
</f:HiddenField>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnHelp" Text="<%$ Resources:UiText, T_帮助 %>" Icon="Help" runat="server" OnClick="btnHelp_Click">
</f:Button>
<f:Button ID="btnManualExpand" Text="<%$ Resources:UiText, T_手动扩透 %>" Icon="TableEdit" runat="server" OnClick="btnManualExpand_Click">
</f:Button>
<f:Button ID="btnSave" Text="<%$ Resources:UiText, T_自动扩透 %>" ToolTip="<%$ Resources:UiText, T_自动扩透 %>"
Icon="SystemSave" runat="server" OnClick="btnSave_Click">
</f:Button>
@@ -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"
>
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
@@ -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<SqlParameter> listStr = new List<SqlParameter>();
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") //非扩透口
@@ -155,6 +155,12 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>自动扩透说明按钮。</summary>
protected global::FineUIPro.Button btnHelp;
/// <summary>手动扩透按钮。</summary>
protected global::FineUIPro.Button btnManualExpand;
/// <summary>
/// btnPointAudit 控件。
@@ -63,8 +63,8 @@
<f:Button ID="btnPointAudit" Text="<%$ Resources:UiText, T_生成委托单 %>" ToolTip="<%$ Resources:UiText, T_监理点口审核并生成委托单 %>" Icon="ArrowNsew" runat="server" Hidden="true"
OnClick="btnPointAudit_Click">
</f:Button>
<f:Button ID="btnDelete" Text="<%$ Resources:UiText, T_删除 %>" Icon="Delete" runat="server" Hidden="true"
OnClick="btnDelete_Click">
<f:Button ID="btnBack" Text="<%$ Resources:UiText, T_退回 %>" Icon="ArrowLeft" runat="server"
ConfirmText="<%$ Resources:UiText, T_退回返修扩透委托确认 %>" ConfirmTarget="Top" OnClick="btnBack_Click">
</f:Button>
<f:Button ID="btnPrint" Text="<%$ Resources:UiText, T_打印 %>" Icon="Printer" runat="server"
MenuID="MenuPrint" ShowMenuIcon="true">
@@ -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)
@@ -157,13 +157,13 @@ namespace FineUIPro.Web.HJGL.RepairAndExpand {
protected global::FineUIPro.Button btnPointAudit;
/// <summary>
/// btnDelete 控件。
/// btnBack 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
protected global::FineUIPro.Button btnBack;
/// <summary>
/// btnPrint 控件。