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

main
SoulStar 2 weeks ago
parent 427309e2ce
commit fa2c47a7d2

@ -410,7 +410,12 @@
料仓投料验证服务类 料仓投料验证服务类
</summary> </summary>
</member> </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>
构造方法 构造方法
</summary> </summary>
@ -418,6 +423,8 @@
<param name="sysUserService"></param> <param name="sysUserService"></param>
<param name="hwBarrelService"></param> <param name="hwBarrelService"></param>
<param name="lrweighService"></param> <param name="lrweighService"></param>
<param name="binFeedingReportServices"></param>
<param name="xl_materialService"></param>
</member> </member>
<member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.GetByBarrelInfo(System.String,System.String,System.String)"> <member name="M:Admin.Core.Api.Controllers.Business.WarehouseController.GetByBarrelInfo(System.String,System.String,System.String)">
<summary> <summary>
@ -471,9 +478,9 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </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>
根据罐号查询称量列表 根据罐号查询称量列表并结束任务
</summary> </summary>
<param name="barrelBarcode"></param> <param name="barrelBarcode"></param>
<returns></returns> <returns></returns>

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