|
|
|
@ -18,6 +18,7 @@ using NPOI.SS.Formula.Functions;
|
|
|
|
|
using TouchSocket.Core;
|
|
|
|
|
using System.Numerics;
|
|
|
|
|
using Admin.Core.IService.IService_New;
|
|
|
|
|
using Admin.Core.Model.Model_New;
|
|
|
|
|
|
|
|
|
|
namespace Admin.Core.Api.Controllers.Business
|
|
|
|
|
{
|
|
|
|
@ -51,6 +52,11 @@ namespace Admin.Core.Api.Controllers.Business
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly ILR_weighServices _lr_weighService;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 料仓投料验证服务类
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly IBinFeedingReportServices _binFeedingReportServices;
|
|
|
|
|
|
|
|
|
|
#region 构造方法
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造方法
|
|
|
|
@ -59,12 +65,13 @@ 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) : base(sysUserService)
|
|
|
|
|
public WarehouseController(IHw_WarehouseServices hw_WarehouseServices, ISysUserService sysUserService, IHw_BarrelServices hwBarrelService, ILR_weighServices lrweighService, IBinFeedingReportServices binFeedingReportServices) : base(sysUserService)
|
|
|
|
|
{
|
|
|
|
|
_sysUserService = sysUserService;
|
|
|
|
|
_hw_WarehouseService = hw_WarehouseServices;
|
|
|
|
|
_hw_BarrelService = hwBarrelService;
|
|
|
|
|
_lr_weighService = lrweighService;
|
|
|
|
|
_binFeedingReportServices = binFeedingReportServices;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -162,30 +169,30 @@ namespace Admin.Core.Api.Controllers.Business
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result1.Contains("成功"))
|
|
|
|
|
{
|
|
|
|
|
if (result2.Contains("成功"))
|
|
|
|
|
{
|
|
|
|
|
if (result3.Contains("成功"))
|
|
|
|
|
{
|
|
|
|
|
return Success(true);
|
|
|
|
|
{
|
|
|
|
|
if (result2.Contains("成功"))
|
|
|
|
|
{
|
|
|
|
|
if (result3.Contains("成功"))
|
|
|
|
|
{
|
|
|
|
|
return Success(true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result3 + "执行失败!");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result3 + "执行失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result2 + "执行失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result1 + "执行失败!");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result2 + "执行失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(result1 + "执行失败!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////配方名或配方编号
|
|
|
|
|
////配方名或配方编号
|
|
|
|
|
//string ss1 = "a82d016e813c4ac3bca0244c519da591";
|
|
|
|
|
////批次号
|
|
|
|
|
//string ss2 = "2408090522";
|
|
|
|
@ -198,7 +205,7 @@ namespace Admin.Core.Api.Controllers.Business
|
|
|
|
|
{
|
|
|
|
|
return Failed<bool>(ex.Message + "执行失败!");
|
|
|
|
|
}
|
|
|
|
|
return Failed<bool>("执行失败!");
|
|
|
|
|
return Failed<bool>("执行失败!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -270,27 +277,39 @@ namespace Admin.Core.Api.Controllers.Business
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据罐号查询称量列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="barrelID"></param>
|
|
|
|
|
/// <param name="barrelBarcode"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<MessageModel<List<LR_weigh>>> GetWeightInfoByBarrelID(string barrelBarcode)
|
|
|
|
|
public async Task<MessageModel<List<LR_weigh_BatchCode>>> GetWeightInfoByBarrelID(string barrelBarcode)
|
|
|
|
|
{
|
|
|
|
|
if (!barrelBarcode.IsNotEmptyOrNull())
|
|
|
|
|
{
|
|
|
|
|
return Failed<List<LR_weigh>>("传入参数为空!");
|
|
|
|
|
return Failed<List<LR_weigh_BatchCode>>("传入参数为空!");
|
|
|
|
|
}
|
|
|
|
|
MessageModel<List<LR_weigh>> messageModel = new MessageModel<List<LR_weigh>>();
|
|
|
|
|
string planID = _hw_BarrelService.GetPlanIdByBarrelID(barrelBarcode.Trim());
|
|
|
|
|
if (string.IsNullOrEmpty(planID))
|
|
|
|
|
{
|
|
|
|
|
return Failed<List<LR_weigh>>("查询不到罐号对应的计划ID!");
|
|
|
|
|
return Failed<List<LR_weigh_BatchCode>>("查询不到罐号对应的计划ID!");
|
|
|
|
|
}
|
|
|
|
|
if (planID == "-1")
|
|
|
|
|
{
|
|
|
|
|
return Failed<List<LR_weigh_BatchCode>>("查询不到罐号!");
|
|
|
|
|
}
|
|
|
|
|
List<LR_weigh> wlist = _lr_weighService.GetRecentWeightList(planID);
|
|
|
|
|
List<LR_weigh_BatchCode> list = new List<LR_weigh_BatchCode>();
|
|
|
|
|
foreach (LR_weigh weigh in wlist)
|
|
|
|
|
{
|
|
|
|
|
LR_weigh_BatchCode record = new LR_weigh_BatchCode();
|
|
|
|
|
record.WeightData = weigh;
|
|
|
|
|
record.BatchCode = _binFeedingReportServices.GetBatchNumberByMaterialAndBinID(weigh.Material_ID, weigh.Bin_Serial ?? -1);
|
|
|
|
|
list.Add(record);
|
|
|
|
|
}
|
|
|
|
|
List<LR_weigh> list = _lr_weighService.GetRecentWeightList(planID);
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
return Success(list);
|
|
|
|
|
}
|
|
|
|
|
return Failed<List<LR_weigh>>("执行失败!");
|
|
|
|
|
return Failed<List<LR_weigh_BatchCode>>("执行失败!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|