|
|
|
@ -2,26 +2,15 @@
|
|
|
|
|
using Admin.Core.Common;
|
|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Service;
|
|
|
|
|
using log4net;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Aucma.Core.Scanner;
|
|
|
|
|
using static Aucma.Core.Scanner.ScannerService;
|
|
|
|
|
using Admin.Core.Model.Model_New;
|
|
|
|
|
using Quartz;
|
|
|
|
|
using StackExchange.Profiling.Internal;
|
|
|
|
|
using Aucma.Core.HwPLc;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Timers;
|
|
|
|
|
using NetTaste;
|
|
|
|
|
using Org.BouncyCastle.Asn1.Tsp;
|
|
|
|
|
using System.Printing;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
{
|
|
|
|
@ -43,6 +32,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
/// </summary>
|
|
|
|
|
private List<RealTaskInfo> TaskInfos = new List<RealTaskInfo>();
|
|
|
|
|
private Dictionary<string, int> KeyValuePairs = new Dictionary<string, int>();
|
|
|
|
|
|
|
|
|
|
#region 事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 扫码信息刷新
|
|
|
|
@ -83,7 +73,10 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private string storeCode = string.Empty;
|
|
|
|
|
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(InStoreBusiness));
|
|
|
|
|
|
|
|
|
|
#region 初始化
|
|
|
|
|
private readonly IBaseSpaceInfoServices? _baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
|
|
|
|
|
private readonly IRealTaskInfoServices? _realTaskInfoService = App.ServiceProvider.GetService<IRealTaskInfoServices>();
|
|
|
|
|
private readonly IProductPlanInfoServices? _productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
|
|
|
|
@ -93,22 +86,37 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
// 过点数据表,物料完成记录MaterialCompletion
|
|
|
|
|
private readonly IMaterialCompletionServices? _iMaterialCompletionServices = App.ServiceProvider.GetService<IMaterialCompletionServices>();
|
|
|
|
|
private readonly IPrintBarCodeServices? _printBarCodeServices = App.ServiceProvider.GetService<IPrintBarCodeServices>();
|
|
|
|
|
private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
|
|
|
|
|
private readonly IBaseMaterialInfoServices? _baseMaterialInfoServices = App.ServiceProvider.GetService<IBaseMaterialInfoServices>();
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 初始化对象
|
|
|
|
|
|
|
|
|
|
private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
|
|
|
|
|
private SemaphoreSlim semaphore = new SemaphoreSlim(0);
|
|
|
|
|
private string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
|
|
|
|
|
private List<BaseSpaceInfo> allSpaces = null;
|
|
|
|
|
private List<SpaceAddress> spaceAddresses = new List<SpaceAddress>();
|
|
|
|
|
private SemaphoreSlim _lock = new SemaphoreSlim(1);
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 构造函数
|
|
|
|
|
|
|
|
|
|
public InStoreBusiness()
|
|
|
|
|
{
|
|
|
|
|
MvCodeHelper.PQKReceiveCodeEvent += InStore;
|
|
|
|
|
storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void init()
|
|
|
|
|
{
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 初始化入库任务---模拟测试启用
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化入库任务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public async void init()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
allSpaces = _baseSpaceInfoServices.Query(x => x.StoreCode == storeCode);
|
|
|
|
@ -117,10 +125,10 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
spaceAddresses.Add(spaceConfig.GetSpaceAddress(storeCode, space.SpaceCode));
|
|
|
|
|
}
|
|
|
|
|
// 模拟入库
|
|
|
|
|
//Task.Run(() =>
|
|
|
|
|
//Task.Run(async () =>
|
|
|
|
|
//{
|
|
|
|
|
// Thread.Sleep(5000);
|
|
|
|
|
// InStore("B24010183025024860011");
|
|
|
|
|
// await InStore("B24010183025024860011");
|
|
|
|
|
//});
|
|
|
|
|
//实时监测入库任务下发和入库任务完成
|
|
|
|
|
StartPassDownAndRealInstoreFinish();
|
|
|
|
@ -128,9 +136,12 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info(ex.Message.ToString());
|
|
|
|
|
Console.WriteLine($"初始化异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 定时器实时监测入库出库完成信号
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 定时器实时监测入库出库完成信号
|
|
|
|
|
/// </summary>
|
|
|
|
@ -157,7 +168,9 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 实时监测入库任务下发和入库任务完成
|
|
|
|
|
/// <summary>
|
|
|
|
|
///实时监测入库任务下发和入库任务完成
|
|
|
|
|
/// </summary>
|
|
|
|
@ -181,10 +194,10 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取入库任务下发plc
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取入库任务下发plc
|
|
|
|
@ -199,7 +212,8 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
if (taskInfo != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"下发PLC:{taskInfo.ToJson()}");
|
|
|
|
|
#region 测试 禁用PLC 入库先不做交互
|
|
|
|
|
if (SendFoamTask_InStore(taskInfo))
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info($"泡前入库任务:{taskInfo.TaskCode};下发成功,等待PLC执行反馈");
|
|
|
|
@ -217,14 +231,14 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
RefreshDataGridDelegateEvent?.Invoke();//刷新datagrid 列表
|
|
|
|
|
|
|
|
|
|
// logHelper.Info($"泡后入库任务:{taskInfo.TaskCode};执行完成");
|
|
|
|
|
//logHelper.Info($"泡后入库任务:{taskInfo.TaskCode};执行完成");
|
|
|
|
|
// 刷新入库任务列表
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logHelper.Info($"泡前入库任务:{taskInfo.TaskCode};下发失败,请排除PLC连接");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -237,6 +251,10 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取待执行的入库任务
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取待执行的入库任务
|
|
|
|
|
/// </summary>
|
|
|
|
@ -256,9 +274,12 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
logHelper.Info("获取待执行的入库任务异常", ex);
|
|
|
|
|
}
|
|
|
|
|
return taskInfo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 入库
|
|
|
|
|
|
|
|
|
|
#region 入库,扫码器委托触发
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 入库,扫码器委托触发
|
|
|
|
|
/// </summary>
|
|
|
|
@ -268,25 +289,34 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(materialBarCode))
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke("未扫到二维码信息!");
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】未扫到二维码信息,请重新扫码!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】扫码成功,物料条码:{materialBarCode}");
|
|
|
|
|
logHelper.Info($"扫码成功,物料条码:{materialBarCode}");
|
|
|
|
|
LogDelegateEvent?.Invoke($"扫码成功,物料条码:{materialBarCode}");
|
|
|
|
|
var taskList = await _realTaskInfoService.QueryAsync(d => d.MaterialCode.Equals(materialBarCode) && d.StoreCode == storeCode);
|
|
|
|
|
if (taskList.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke($"物料条码[{materialBarCode}],任务创建失败,该物料入库任务已存在!");
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】物料条码[{materialBarCode}],任务创建失败,该物料入库任务已存在!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//获取要进入的货道
|
|
|
|
|
string materialType = SubString(materialBarCode);//截取中间物料条码
|
|
|
|
|
|
|
|
|
|
BaseSpaceInfo spaceInfo = await GetSpaceInfoByMaterialType(storeCode, materialType);
|
|
|
|
|
if (spaceInfo != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
logHelper.Info($"匹配货道:{spaceInfo.ToJson()}");
|
|
|
|
|
LogDelegateEvent?.Invoke($"匹配货道:{spaceInfo.ToJson()}");
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine($"【{DateTime.Now}】匹配货道:{spaceInfo.ToJson()}");
|
|
|
|
|
string message = $"箱体码[{materialBarCode}], 入{spaceInfo.SpaceName},入库中....";
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】{message}");
|
|
|
|
|
PrintBarCode print = await _printBarCodeServices.FirstAsync(x => x.MaterialBarcode == materialBarCode);
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】{message}");
|
|
|
|
|
RefreshScanMateriaCodeEvent?.Invoke(materialBarCode, materialType, print.MaterialName, spaceInfo.SpaceName, message); //刷新界面扫码信息
|
|
|
|
|
var result = await CreateInStoreTask(spaceInfo, materialBarCode); //创建入库任务
|
|
|
|
|
if (result)
|
|
|
|
@ -304,6 +334,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
//await _iMaterialCompletionServices.AddAsync(completion);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
RefreshDataGridDelegateEvent?.Invoke();
|
|
|
|
|
await _baseSpaceInfoServices.UpdateSpaceInfo(spaceInfo);
|
|
|
|
|
}
|
|
|
|
@ -312,7 +343,6 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
{
|
|
|
|
|
//报警停线
|
|
|
|
|
LogDelegateEvent?.Invoke($"未匹配到货道,请设置货道型号!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
@ -321,6 +351,8 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 创建入库任务
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创建入库任务
|
|
|
|
@ -369,59 +401,54 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 筛选货道
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 筛选货道
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="storeCode"></param>
|
|
|
|
|
/// <param name="materialType"></param>
|
|
|
|
|
/// <param name="storeCode">货道编码</param>
|
|
|
|
|
/// <param name="materialType">二维码中间8位</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private async Task<BaseSpaceInfo> GetSpaceInfoByMaterialType(string storeCode, string materialType)
|
|
|
|
|
{
|
|
|
|
|
BaseSpaceInfo result = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
List<BaseSpaceInfo> info = await _baseSpaceInfoServices.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
|
|
|
|
|
if (info != null)
|
|
|
|
|
Console.WriteLine($"根据仓库{storeCode};物料:{materialType};获取到的货道信息:{info.ToJson()}");
|
|
|
|
|
if (info == null || info.Count == 0) return result;
|
|
|
|
|
|
|
|
|
|
// 更新货道库存
|
|
|
|
|
foreach (BaseSpaceInfo item in info)
|
|
|
|
|
{
|
|
|
|
|
if (info.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
// 更新货道库存
|
|
|
|
|
foreach (BaseSpaceInfo item in info)
|
|
|
|
|
{
|
|
|
|
|
var spaceInfo = ReadSpaceInfoByPlc(item);
|
|
|
|
|
item.SpaceStock = spaceInfo.SpaceStock;
|
|
|
|
|
var spaceInfo = ReadSpaceInfoByPlc(item);//更新货道信息
|
|
|
|
|
item.SpaceStock = spaceInfo.SpaceStock;
|
|
|
|
|
|
|
|
|
|
if(item.typeCodeB=="materialType" && (item.SpaceStock+item.OnRouteAmount)==0)
|
|
|
|
|
{
|
|
|
|
|
string str1 = item.typeCodeB;
|
|
|
|
|
string str2 = item.typeNameB;
|
|
|
|
|
item.typeCodeB = item.MaterialType;
|
|
|
|
|
item.typeNameB = item.typeNameA;
|
|
|
|
|
item.MaterialType = str1;
|
|
|
|
|
item.typeNameA = str2;
|
|
|
|
|
}
|
|
|
|
|
// 对调C型号和主型号
|
|
|
|
|
else if(spaceInfo.typeCodeC=="materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
|
|
|
|
|
{
|
|
|
|
|
string str1 = item.typeCodeC;
|
|
|
|
|
string str2 = item.typeNameC;
|
|
|
|
|
item.typeCodeC = item.MaterialType;
|
|
|
|
|
item.typeNameC = item.typeNameA;
|
|
|
|
|
item.MaterialType = str1;
|
|
|
|
|
item.typeNameA = str2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info = info.Where(x => x.SpaceStatus == 1 && x.SpaceCapacity > (x.SpaceStock + x.OnRouteAmount)).ToList();
|
|
|
|
|
if(info.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
result = info.OrderByDescending(x => x.SpaceStock).First();
|
|
|
|
|
}
|
|
|
|
|
if (item.typeCodeB == "materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
|
|
|
|
|
{
|
|
|
|
|
string str1 = item.typeCodeB;
|
|
|
|
|
string str2 = item.typeNameB;
|
|
|
|
|
item.typeCodeB = item.MaterialType;
|
|
|
|
|
item.typeNameB = item.typeNameA;
|
|
|
|
|
item.MaterialType = str1;
|
|
|
|
|
item.typeNameA = str2;
|
|
|
|
|
}
|
|
|
|
|
// 对调C型号和主型号 需要确定未什么要对调类型?
|
|
|
|
|
else if (spaceInfo.typeCodeC == "materialType" && (item.SpaceStock + item.OnRouteAmount) == 0)
|
|
|
|
|
{
|
|
|
|
|
string str1 = item.typeCodeC;
|
|
|
|
|
string str2 = item.typeNameC;
|
|
|
|
|
item.typeCodeC = item.MaterialType;
|
|
|
|
|
item.typeNameC = item.typeNameA;
|
|
|
|
|
item.MaterialType = str1;
|
|
|
|
|
item.typeNameA = str2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info = info.Where(x => x.SpaceStatus == 1 && x.SpaceCapacity > (x.SpaceStock + x.OnRouteAmount)).ToList();
|
|
|
|
|
if (info == null || info.Count == 0) return result;
|
|
|
|
|
|
|
|
|
|
result = info.OrderByDescending(x => x.SpaceStock).First();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -431,10 +458,13 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 通过PLC获取货道信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 通过PLC获取货道信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="spaceInfo"></param>
|
|
|
|
|
/// <param name="spaceInfo">货道信息</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
|
|
|
|
|
{
|
|
|
|
@ -442,13 +472,14 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc"));
|
|
|
|
|
if (obj != null && obj.plc.IsConnected)
|
|
|
|
|
{
|
|
|
|
|
//将货道信息更新到配置文件中
|
|
|
|
|
SpaceAddress spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.StoreCode, spaceInfo.SpaceCode);
|
|
|
|
|
spaceInfo.SpaceStock = obj.plc.ReadInt16(spaceAddress.onStore);
|
|
|
|
|
|
|
|
|
|
spaceInfo.SpaceStock = obj.plc.ReadInt16(spaceAddress.onStore);//获取
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return spaceInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -465,7 +496,6 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 泡前入库任务下发处理
|
|
|
|
|
public bool SendFoamTask_InStore(RealTaskInfo taskInfo)
|
|
|
|
|
{
|
|
|
|
@ -564,6 +594,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 入库完成
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 入库完成
|
|
|
|
|
/// </summary>
|
|
|
|
@ -583,20 +614,20 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
if (spaceInfo != null)
|
|
|
|
|
{
|
|
|
|
|
spaceInfo.MaterialType = taskInfo.MaterialType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//读取PLC获取货道信息:存放数量、在途数量,
|
|
|
|
|
#region Add By wenjy 2023-10-30 13:44:00 通过PLC获取货道信息
|
|
|
|
|
var item = ReadSpaceInfoByPlc(spaceInfo);
|
|
|
|
|
spaceInfo.SpaceStock = item.SpaceStock;
|
|
|
|
|
if (spaceInfo.OnRouteAmount>0)
|
|
|
|
|
if (spaceInfo.OnRouteAmount > 0)
|
|
|
|
|
{
|
|
|
|
|
// 入库完成,在途减1
|
|
|
|
|
spaceInfo.OnRouteAmount -= 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 添加货道明细 不控制出库,暂时未添加明细
|
|
|
|
|
BaseSpaceDetail spaceDetail = new BaseSpaceDetail();
|
|
|
|
@ -623,8 +654,8 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
|
|
|
|
|
await _baseSpaceInfoServices.UpdateSpaceInfo(spaceInfo);
|
|
|
|
|
_ = _recordInstoreServices.AddAsync(recordInstore).Result;
|
|
|
|
|
bool result = _realTaskInfoService.DeleteAsync(taskInfo).Result;
|
|
|
|
|
// bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
|
|
|
|
|
bool result = _realTaskInfoService.DeleteAsync(taskInfo).Result;
|
|
|
|
|
// bool result = await _recordInstoreServices.SaveRecordToDb(recordInstore, taskInfo, spaceInfo, spaceDetail);
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke($"入库完成,更新数据库成功");
|
|
|
|
@ -634,7 +665,7 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
{
|
|
|
|
|
LogDelegateEvent?.Invoke($"更新数据库异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
////清除任务信息
|
|
|
|
|
//await _realTaskInfoService.DeleteTaskInfo(taskCode, storeCode);
|
|
|
|
@ -647,6 +678,9 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取物料名称
|
|
|
|
|
/// <summary>
|
|
|
|
|
///获取物料名称
|
|
|
|
|
/// </summary>
|
|
|
|
@ -663,6 +697,8 @@ namespace Aucma.Core.BoxFoam.Business
|
|
|
|
|
return materialName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region PLC 任务处理表
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// PLC 任务处理表
|
|
|
|
|