打印逻辑修改001

This commit is contained in:
2025-05-15 09:11:21 +08:00
parent f897d641b4
commit fc68f88ca0
2 changed files with 80 additions and 59 deletions

View File

@@ -93,6 +93,8 @@ namespace ZR.Admin.WebApi.Controllers
[HttpPost("StartBackEndWorkOrder")]
[AllowAnonymous]
public IActionResult StartBackEndWorkOrder([FromBody] QcBackEndWorkorderDetailDto parm)
{
try
{
var modal = parm.Adapt<QcBackEndWorkorderDetailDto>().ToCreate(HttpContext);
@@ -100,6 +102,12 @@ namespace ZR.Admin.WebApi.Controllers
return SUCCESS(response);
}
catch (Exception e)
{
return ToResponse(new ApiResult(500, "开启工单异常:" + e.Message));
}
}
/// <summary>
/// 修改缺陷项

View File

@@ -285,7 +285,7 @@ namespace ZR.Service.Business
try
{
// 检查箱标签是否当内标签扫过
bool isInnerLabelScan = Context
/*bool isInnerLabelScan = Context
.Queryable<QcBackEndRecordLabelScan>()
.Where(it => it.Label == data.Label)
.Where(it => it.LabelType == 2)
@@ -293,7 +293,7 @@ namespace ZR.Service.Business
if (isInnerLabelScan)
{
throw new Exception("标签异常,该标签已经当内标签扫过!");
}
}*/
Context.Ado.BeginTran();
DateTime nowTime = DateTime.Now;
// 创建新工单号
@@ -637,12 +637,16 @@ namespace ZR.Service.Business
public string ScanInnerLabel(QcBackEndLabelScanDto data)
{
try
{
Context.Ado.BeginTran();
DateTime nowTime = DateTime.Now;
// 标签防错 (内标签零件号)
string partNumber = DoAnalyzePartnumber(data.Label);
// 内标签包含外标签
if (!partNumber.Contains(data.PartNumber))
{
Context.Ado.RollbackTran();
return "内标签零件号与工单零件号不一致!";
}
bool hasAny = Context
@@ -652,6 +656,7 @@ namespace ZR.Service.Business
.Any();
if (hasAny)
{
Context.Ado.RollbackTran();
return "内标签重复扫码!";
}
// 标签录入
@@ -688,13 +693,21 @@ namespace ZR.Service.Business
int res = Context.Insertable(newLabelScran).ExecuteCommand();
if (res == 0)
{
Context.Ado.RollbackTran();
return "标签录入系统失败!";
}
//TODO 触发箱标签判定
CheckAndPrintPackageLabel(newLabelScran);
Context.Ado.CommitTran();
return "ok";
}
catch (Exception e)
{
Context.Ado.RollbackTran();
return $"异常:{e.Message}";
}
}
/// <summary>
/// 判断是否需要自动出满箱标签