fix(hjgl): 修复焊口打印与防腐数据处理

This commit is contained in:
2026-08-13 16:58:22 +08:00
parent 5160dde702
commit 0fb67e2006
6 changed files with 50 additions and 33 deletions
@@ -802,7 +802,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (!string.IsNullOrEmpty(col30))
{
// AF列为非必填项,只有填写时才按防腐字典校验并回填字典ID
var paint = getPaintCodeDict.FirstOrDefault(x => !string.IsNullOrEmpty(x.PaintCode) && x.PaintCode.Contains(col30));
// LINQ to SQL 不支持翻译 string.IsNullOrEmptyAF 已确认非空,直接按字典编码精确匹配。
var paint = getPaintCodeDict.FirstOrDefault(x => x.PaintCode == col30);
if (paint == null)
{
result.Add("第" + (i + 1).ToString() + "行," + "防腐等级" + "【" + col30 + "】不存在!" + "|");
@@ -1422,15 +1422,23 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
BLL.FastReportService.ResetData();
var result = Funs.DB.View_HJGL_WeldJoint.Where(x => jointids.Contains(x.WeldJointId)).Select(x => new
{
pipelineCode = x.PipelineCode,
Mat = x.MaterialCode,
WeldJointId = x.WeldJointId,
Spec = x.Specification,
SortIndex = x.WeldJointCode.Replace(x.PipelineCode + "/", ""),
WeldJointPoint=x.WeldJointPoint
}).OrderBy(x => x.pipelineCode).ThenBy(x => x.SortIndex).ToList();
// 防腐等级维护在管线上,打印时由焊口关联管线,再通过防腐字典取得显示代码。
var result = (from weldJoint in Funs.DB.View_HJGL_WeldJoint
where jointids.Contains(weldJoint.WeldJointId)
join pipeline in Funs.DB.HJGL_Pipeline on weldJoint.PipelineId equals pipeline.PipelineId into pipelineGroup
from pipeline in pipelineGroup.DefaultIfEmpty()
join paint in Funs.DB.Tw_PaintCodeDict on pipeline.PaintId equals paint.Id into paintGroup
from paint in paintGroup.DefaultIfEmpty()
select new
{
pipelineCode = weldJoint.PipelineCode,
Mat = weldJoint.MaterialCode,
WeldJointId = weldJoint.WeldJointId,
Spec = weldJoint.Specification,
SortIndex = weldJoint.WeldJointCode.Replace(weldJoint.PipelineCode + "/", ""),
WeldJointPoint = weldJoint.WeldJointPoint,
PaintCode = paint == null ? string.Empty : paint.PaintCode
}).OrderBy(x => x.pipelineCode).ThenBy(x => x.SortIndex).ToList();
var tb = LINQToDataTable(result);
if (tb != null && tb.Rows.Count > 0)
{