- 修复结束计划报错提示顺序错误
- 删除无用do while
change
- 修改查询称量信息并且结束任务的顺序,先结束任务,后查询称量信息批次号-然后返回结果
main
SoulStar 3 days ago
parent cd4c800518
commit 12b64bec6a

@ -178,7 +178,6 @@ namespace Admin.Core.Api
{
if (!code.IsNotEmptyOrNull())
return Failed<bool>("桶条码信息传入参数为空!");
var result = await _xl_materialService.BindBarrel(code.Trim());
if (result == 0)
return Failed<bool>("未查询到正在执行的计划!");

@ -302,29 +302,6 @@ namespace Admin.Core.Api.Controllers.Business
}
var result = await _xl_materialService.BindBarrel(barrelBarcode.Trim());
if (result == 0)
return Failed<List<LR_weigh_BatchCode>>("未查询到正在执行的计划!");
if (result == 1)
return Failed<List<LR_weigh_BatchCode>>("未查询到桶!");
if (result == 2)
return Failed<List<LR_weigh_BatchCode>>($"未查询到[{barrelBarcode}]桶信息!");
if (result == 3)
return Failed<List<LR_weigh_BatchCode>>("该桶已经绑定物料,请联系系统管理员处理!");
if (result == 6)
//return Success(true);
log.Info("任务结束成功");
if (result == 7)
return Failed<List<LR_weigh_BatchCode>>("称重未完成!");
if (result == 8)
return Failed<List<LR_weigh_BatchCode>>("PLC连接失败请检查PLC或者联系管理员处理");
if (result == 10)
return Failed<List<LR_weigh_BatchCode>>("未知异常,请查看错误日志!");
if (result == 99)
return Failed<List<LR_weigh_BatchCode>>("保存处理数据失败!");
if (result == 100)
return Failed<List<LR_weigh_BatchCode>>("处理中....");
if (result == 110)
return Failed<List<LR_weigh_BatchCode>>("执行批次未获取!");
MessageModel<List<LR_weigh>> messageModel = new MessageModel<List<LR_weigh>>();
string materialName = _hw_BarrelService.GetMaterialNameByBarrelID(barrelBarcode.Trim());
@ -345,13 +322,38 @@ namespace Admin.Core.Api.Controllers.Business
record.BatchCode = _binFeedingReportServices.GetBatchNumberByMaterialAndBinID(weigh.Material_ID, weigh.Bin_Serial ?? -1);
list.Add(record);
}
if (list != null)
if (list != null && list.Count != 0)
{
return Success(list);
if (result == 0)
return Success(list, "查询成功,任务结束失败,原因:未查询到正在执行的计划!");
if (result == 1)
return Success(list, "查询成功,任务结束失败,原因:未查询到桶!");
if (result == 2)
return Success(list, $"查询成功,任务结束失败,原因:未查询到[{barrelBarcode}]桶信息!");
if (result == 3)
return Success(list, "查询成功,任务结束失败,原因:该桶已经绑定物料,请联系系统管理员处理!");
if (result == 6)
{
log.Info("任务结束成功");
return Success(list, "任务结束成功,计划信息查询成功");
}
if (result == 7)
return Success(list, "查询成功,任务结束失败,原因:称重未完成!");
if (result == 8)
return Success(list, "查询成功任务结束失败原因PLC连接失败请检查PLC或者联系管理员处理");
if (result == 10)
return Success(list, "查询成功,任务结束失败,原因:未知异常,请查看错误日志!");
if (result == 99)
return Success(list, "查询成功,任务结束失败,原因:保存处理数据失败!");
if (result == 100)
return Success(list, "查询成功,任务结束失败,原因:处理中....");
if (result == 110)
return Success(list, "查询成功,任务结束失败,原因:执行批次未获取!");
return Success(list, "查询成功,任务结束失败");
}
else
{
return Failed<List<LR_weigh_BatchCode>>("任务结束成功但称量信息查询失败!");
return Failed<List<LR_weigh_BatchCode>>("称量信息查询失败!查询不到称量信息!任务未结束");
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save