feat(hjgl): 完善焊前检查和防腐检查流程
焊前检查需要同时覆盖下料、组对和防腐检查,并支持移动端查询与保存。 扩展焊前检查模型、服务和页面字段,补充检查结果、不合格原因、整改要求、 附件和防腐检查记录,便于按焊口和材料追溯检查过程。
This commit is contained in:
@@ -61,6 +61,22 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 维护管线材料导入编码,只更新材料编码字段,避免影响材料主编码和焊口关联。
|
||||
/// </summary>
|
||||
/// <param name="pipelineMatId">管线材料ID</param>
|
||||
/// <param name="materialCode">材料编码</param>
|
||||
public static void UpdateMaterialCode2(string pipelineMatId, string materialCode)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_PipeLineMat pipeLineMat = db.HJGL_PipeLineMat.FirstOrDefault(e => e.PipeLineMatId == pipelineMatId);
|
||||
if (pipeLineMat != null)
|
||||
{
|
||||
pipeLineMat.MaterialCode2 = materialCode;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据材料匹配结果反写材料主编码
|
||||
/// </summary>
|
||||
@@ -94,6 +110,40 @@ namespace BLL
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按管线材料ID清除已反写的材料主编码,保留导入材料编码。
|
||||
/// </summary>
|
||||
/// <param name="pipeLineMatIds">管线材料ID列表。</param>
|
||||
/// <returns>清除数量。</returns>
|
||||
public static int ClearMaterialCodeByPipeLineMatIds(IEnumerable<string> pipeLineMatIds)
|
||||
{
|
||||
var idList = pipeLineMatIds == null
|
||||
? new List<string>()
|
||||
: pipeLineMatIds.Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
|
||||
if (!idList.Any())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
int count = 0;
|
||||
var pipeLineMats = db.HJGL_PipeLineMat
|
||||
.Where(e => idList.Contains(e.PipeLineMatId) && e.MaterialCode != null && e.MaterialCode != "")
|
||||
.ToList();
|
||||
foreach (var item in pipeLineMats)
|
||||
{
|
||||
item.MaterialCode = null;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据unitworkid删除焊口
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user