质量bug

This commit is contained in:
2024-08-26 17:30:08 +08:00
parent ca47405a20
commit 956fccaf6b
2 changed files with 7 additions and 5 deletions

View File

@@ -439,12 +439,12 @@ namespace Tnb.QcMgr
if (list.IsEmpty())
{
throw Oops.Bah("未找到质检方案");
throw Oops.Bah($"{entity.triggerevent.ToString()}未找到质检方案");
}
if (list.Count > 1)
{
throw Oops.Bah("找到多个质检方案");
throw Oops.Bah($"{entity.triggerevent.ToString()}找到多个质检方案");
}
// List<string> removes = new();

View File

@@ -156,7 +156,7 @@ namespace Tnb.QcMgr
checknum = !string.IsNullOrEmpty(QcCheckExecH.checknum) ? int.Parse(QcCheckExecH.checknum) : 0,
worker_name = userEntity?.RealName ?? "",
bill_code = QcCheckExecH.bill_code,
carry_code = prdReport?.material_box_code,
carry_code = prdReport!=null ? prdReport.material_box_code : "",
};
if (!string.IsNullOrEmpty(CheckTaskOut.workid))
{
@@ -195,7 +195,8 @@ namespace Tnb.QcMgr
Item.setData.errorcause = new List<Error>();
foreach (string str in strs)
{
Item.setData.errorcause.Add(new Error { id = str, name = QcErrorCauses.Where(p => p.id == str).First().name! });
if (string.IsNullOrEmpty(str) || str == "null") continue;
Item.setData.errorcause.Add(new Error { id = str, name = QcErrorCauses.Where(p => p.id == str).First()?.name! });
}
}
if (!string.IsNullOrEmpty(QcCheckExecD.errorlevel))
@@ -204,7 +205,8 @@ namespace Tnb.QcMgr
Item.setData.errorlevel = new List<Error>();
foreach (string str in strs)
{
Item.setData.errorlevel.Add(new Error { id = str, name = QcErrorLevels.Where(p => p.id == str).First().name! });
if (string.IsNullOrEmpty(str) || str == "null") continue;
Item.setData.errorlevel.Add(new Error { id = str, name = QcErrorLevels.Where(p => p.id == str).First()?.name! });
}
}
Item.setData.remark = QcCheckExecD.remark!;