change - 整合结束任务和返回物料信息

main
SoulStar 2 weeks ago
parent 427309e2ce
commit fa2c47a7d2

@ -410,7 +410,12 @@
料仓投料验证服务类
</summary>
</member>
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.#ctor(Admin.Core.IService.IHw_WarehouseServices,Admin.Core.IService.ISys.ISysUserService,Admin.Core.IService.IService_New.IHw_BarrelServices,Admin.Core.IService.ILR_weighServices,Admin.Core.IService.IBinFeedingReportServices)">
<member name="F:Admin.Core.Api.Controllers.Business.WarehouseController._xl_materialService">
<summary>
物料服务
</summary>
</member>
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.#ctor(Admin.Core.IService.IHw_WarehouseServices,Admin.Core.IService.ISys.ISysUserService,Admin.Core.IService.IService_New.IHw_BarrelServices,Admin.Core.IService.ILR_weighServices,Admin.Core.IService.IBinFeedingReportServices,Admin.Core.IService.Ixl_materialServices)">
<summary>
构造方法
</summary>
@ -418,6 +423,8 @@
<param name="sysUserService"></param>
<param name="hwBarrelService"></param>
<param name="lrweighService"></param>
<param name="binFeedingReportServices"></param>
<param name="xl_materialService"></param>
</member>
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.GetByBarrelInfo(System.String,System.String,System.String)">
<summary>
@ -471,9 +478,9 @@
</summary>
<returns></returns>
</member>
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.GetWeightInfoByBarrelID(System.String)">
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.GetWeightInfoByBarrelIDAndEndTask(System.String)">
<summary>
根据罐号查询称量列表
根据罐号查询称量列表并结束任务
</summary>
<param name="barrelBarcode"></param>
<returns></returns>

@ -19,6 +19,7 @@ using TouchSocket.Core;
using System.Numerics;
using Admin.Core.IService.IService_New;
using Admin.Core.Model.Model_New;
using log4net;
namespace Admin.Core.Api.Controllers.Business
{
@ -37,6 +38,8 @@ namespace Admin.Core.Api.Controllers.Business
//25kg物料重量
#endregion
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(WarehouseController));
/// <summary>
/// 投料仓服务
/// </summary>
@ -57,6 +60,11 @@ namespace Admin.Core.Api.Controllers.Business
/// </summary>
private readonly IBinFeedingReportServices _binFeedingReportServices;
/// <summary>
/// 物料服务
/// </summary>
private readonly Ixl_materialServices _xl_materialService;
#region 构造方法
/// <summary>
/// 构造方法
@ -65,13 +73,17 @@ namespace Admin.Core.Api.Controllers.Business
/// <param name="sysUserService"></param>
/// <param name="hwBarrelService"></param>
/// <param name="lrweighService"></param>
public WarehouseController(IHw_WarehouseServices hw_WarehouseServices, ISysUserService sysUserService, IHw_BarrelServices hwBarrelService, ILR_weighServices lrweighService, IBinFeedingReportServices binFeedingReportServices) : base(sysUserService)
/// <param name="binFeedingReportServices"></param>
/// <param name="xl_materialService"></param>
public WarehouseController(IHw_WarehouseServices hw_WarehouseServices, ISysUserService sysUserService,
IHw_BarrelServices hwBarrelService, ILR_weighServices lrweighService, IBinFeedingReportServices binFeedingReportServices, Ixl_materialServices xl_materialService) : base(sysUserService)
{
_sysUserService = sysUserService;
_hw_WarehouseService = hw_WarehouseServices;
_hw_BarrelService = hwBarrelService;
_lr_weighService = lrweighService;
_binFeedingReportServices = binFeedingReportServices;
_xl_materialService = xl_materialService;
}
#endregion
@ -274,18 +286,46 @@ namespace Admin.Core.Api.Controllers.Business
}
#endregion
#region 读取对应料罐的编码并结束任务
/// <summary>
/// 根据罐号查询称量列表
/// 根据罐号查询称量列表并结束任务
/// </summary>
/// <param name="barrelBarcode"></param>
/// <returns></returns>
[HttpGet]
public async Task<MessageModel<List<LR_weigh_BatchCode>>> GetWeightInfoByBarrelID(string barrelBarcode)
public async Task<MessageModel<List<LR_weigh_BatchCode>>> GetWeightInfoByBarrelIDAndEndTask(string barrelBarcode)
{
if (!barrelBarcode.IsNotEmptyOrNull())
{
return Failed<List<LR_weigh_BatchCode>>("传入参数为空!");
}
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());
if (string.IsNullOrEmpty(materialName))
@ -309,8 +349,12 @@ namespace Admin.Core.Api.Controllers.Business
{
return Success(list);
}
return Failed<List<LR_weigh_BatchCode>>("执行失败!");
else
{
return Failed<List<LR_weigh_BatchCode>>("任务结束成功但称量信息查询失败!");
}
}
#endregion
}
}
Loading…
Cancel
Save