feat(hjgl):增加焊接日报待审核表格编辑
This commit is contained in:
@@ -382,6 +382,53 @@ namespace BLL
|
||||
}, out totalCount).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新待审核明细的实际施工工艺参数。
|
||||
/// </summary>
|
||||
/// <param name="input">待审核明细及四项工艺参数</param>
|
||||
/// <returns>错误信息,空字符串表示成功</returns>
|
||||
public static string UpdateWeldingDailyTempDetailParameters(Model.WeldingDailyTempDetailEditInput input)
|
||||
{
|
||||
if (input == null || string.IsNullOrWhiteSpace(input.TempDetailId)
|
||||
|| string.IsNullOrWhiteSpace(input.ProjectId))
|
||||
{
|
||||
return "待审核明细或项目不能为空";
|
||||
}
|
||||
|
||||
string weldingMethodId = NormalizeOptionalId(input.WeldingMethodId);
|
||||
string weldTypeId = NormalizeOptionalId(input.WeldTypeId);
|
||||
string weldingWire = NormalizeOptionalId(input.WeldingWire);
|
||||
string weldingRod = NormalizeOptionalId(input.WeldingRod);
|
||||
string parameterError = ValidatePendingWeldingParameters(
|
||||
weldingMethodId, weldTypeId, weldingWire, weldingRod);
|
||||
if (!string.IsNullOrEmpty(parameterError))
|
||||
{
|
||||
return parameterError;
|
||||
}
|
||||
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var detail = db.HJGL_WeldingDailyTempDetail.FirstOrDefault(x =>
|
||||
x.TempDetailId == input.TempDetailId && x.ProjectId == input.ProjectId);
|
||||
if (detail == null)
|
||||
{
|
||||
return "待审核明细不存在";
|
||||
}
|
||||
if (detail.AuditState >= AuditStateApproved)
|
||||
{
|
||||
return "该明细已完成审核,不能修改";
|
||||
}
|
||||
|
||||
// 编辑页只维护临时工艺快照;正式焊口仍在专工审核通过时统一回写。
|
||||
detail.WeldingMethodId = weldingMethodId;
|
||||
detail.WeldTypeId = weldTypeId;
|
||||
detail.WeldingWire = weldingWire;
|
||||
detail.WeldingRod = weldingRod;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造待审核查询。PC端列表和接口列表、明细均从这里读取,确保字段映射和待审核状态一致。
|
||||
/// </summary>
|
||||
@@ -1109,6 +1156,11 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
private static string NormalizeOptionalId(string value)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(value) ? null : value.Trim();
|
||||
}
|
||||
|
||||
private static string FirstNotEmpty(params string[] values)
|
||||
{
|
||||
return values == null ? null : values.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x));
|
||||
|
||||
Reference in New Issue
Block a user