打印逻辑修改001
This commit is contained in:
@@ -93,6 +93,8 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
[HttpPost("StartBackEndWorkOrder")]
|
[HttpPost("StartBackEndWorkOrder")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public IActionResult StartBackEndWorkOrder([FromBody] QcBackEndWorkorderDetailDto parm)
|
public IActionResult StartBackEndWorkOrder([FromBody] QcBackEndWorkorderDetailDto parm)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var modal = parm.Adapt<QcBackEndWorkorderDetailDto>().ToCreate(HttpContext);
|
var modal = parm.Adapt<QcBackEndWorkorderDetailDto>().ToCreate(HttpContext);
|
||||||
|
|
||||||
@@ -100,6 +102,12 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
|
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return ToResponse(new ApiResult(500, "开启工单异常:" + e.Message));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改缺陷项
|
/// 修改缺陷项
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ namespace ZR.Service.Business
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 检查箱标签是否当内标签扫过
|
// 检查箱标签是否当内标签扫过
|
||||||
bool isInnerLabelScan = Context
|
/*bool isInnerLabelScan = Context
|
||||||
.Queryable<QcBackEndRecordLabelScan>()
|
.Queryable<QcBackEndRecordLabelScan>()
|
||||||
.Where(it => it.Label == data.Label)
|
.Where(it => it.Label == data.Label)
|
||||||
.Where(it => it.LabelType == 2)
|
.Where(it => it.LabelType == 2)
|
||||||
@@ -293,7 +293,7 @@ namespace ZR.Service.Business
|
|||||||
if (isInnerLabelScan)
|
if (isInnerLabelScan)
|
||||||
{
|
{
|
||||||
throw new Exception("标签异常,该标签已经当内标签扫过!");
|
throw new Exception("标签异常,该标签已经当内标签扫过!");
|
||||||
}
|
}*/
|
||||||
Context.Ado.BeginTran();
|
Context.Ado.BeginTran();
|
||||||
DateTime nowTime = DateTime.Now;
|
DateTime nowTime = DateTime.Now;
|
||||||
// 创建新工单号
|
// 创建新工单号
|
||||||
@@ -637,12 +637,16 @@ namespace ZR.Service.Business
|
|||||||
|
|
||||||
public string ScanInnerLabel(QcBackEndLabelScanDto data)
|
public string ScanInnerLabel(QcBackEndLabelScanDto data)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Context.Ado.BeginTran();
|
||||||
DateTime nowTime = DateTime.Now;
|
DateTime nowTime = DateTime.Now;
|
||||||
// 标签防错 (内标签零件号)
|
// 标签防错 (内标签零件号)
|
||||||
string partNumber = DoAnalyzePartnumber(data.Label);
|
string partNumber = DoAnalyzePartnumber(data.Label);
|
||||||
// 内标签包含外标签
|
// 内标签包含外标签
|
||||||
if (!partNumber.Contains(data.PartNumber))
|
if (!partNumber.Contains(data.PartNumber))
|
||||||
{
|
{
|
||||||
|
Context.Ado.RollbackTran();
|
||||||
return "内标签零件号与工单零件号不一致!";
|
return "内标签零件号与工单零件号不一致!";
|
||||||
}
|
}
|
||||||
bool hasAny = Context
|
bool hasAny = Context
|
||||||
@@ -652,6 +656,7 @@ namespace ZR.Service.Business
|
|||||||
.Any();
|
.Any();
|
||||||
if (hasAny)
|
if (hasAny)
|
||||||
{
|
{
|
||||||
|
Context.Ado.RollbackTran();
|
||||||
return "内标签重复扫码!";
|
return "内标签重复扫码!";
|
||||||
}
|
}
|
||||||
// 标签录入
|
// 标签录入
|
||||||
@@ -688,13 +693,21 @@ namespace ZR.Service.Business
|
|||||||
int res = Context.Insertable(newLabelScran).ExecuteCommand();
|
int res = Context.Insertable(newLabelScran).ExecuteCommand();
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
{
|
{
|
||||||
|
Context.Ado.RollbackTran();
|
||||||
return "标签录入系统失败!";
|
return "标签录入系统失败!";
|
||||||
}
|
}
|
||||||
//TODO 触发箱标签判定
|
//TODO 触发箱标签判定
|
||||||
CheckAndPrintPackageLabel(newLabelScran);
|
CheckAndPrintPackageLabel(newLabelScran);
|
||||||
|
Context.Ado.CommitTran();
|
||||||
return "ok";
|
return "ok";
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Context.Ado.RollbackTran();
|
||||||
|
return $"异常:{e.Message}";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断是否需要自动出满箱标签
|
/// 判断是否需要自动出满箱标签
|
||||||
|
|||||||
Reference in New Issue
Block a user