change-添加3F手动投料出库模式

dev
liuwf 1 month ago
parent b91ba72fe5
commit 11f71fb97b

@ -68,6 +68,12 @@ namespace SlnMesnac.Business
private readonly ConfigInfoBusiness _configInfoBusiness; private readonly ConfigInfoBusiness _configInfoBusiness;
/// <summary>
/// 消息弹框提示
/// </summary>
/// <param name="msg"></param>
public delegate void MsgHandler(string message, int msgtype, int outTime = 3);
public static event MsgHandler MsgHandlerEvent;
private ISqlSugarClient sqlSugarClient; private ISqlSugarClient sqlSugarClient;
@ -82,7 +88,6 @@ namespace SlnMesnac.Business
_basePalletInfoService = basePalletInfoService; _basePalletInfoService = basePalletInfoService;
_baseRealTaskService = baseRealTaskService; _baseRealTaskService = baseRealTaskService;
_mesPrdBarCodeService = serviceProvider.GetRequiredService<IMesPrdBarCodeService>(); _mesPrdBarCodeService = serviceProvider.GetRequiredService<IMesPrdBarCodeService>();
_configInfoBusiness = configInfoBusiness; _configInfoBusiness = configInfoBusiness;
// TestTran(); // TestTran();
@ -193,6 +198,7 @@ namespace SlnMesnac.Business
{ {
try try
{ {
RefreshMesProdList(); RefreshMesProdList();
var plc = base.GetPlcByKey("plc"); var plc = base.GetPlcByKey("plc");
@ -303,7 +309,7 @@ namespace SlnMesnac.Business
/// <exception cref="ArgumentException"></exception> /// <exception cref="ArgumentException"></exception>
public void MaterialPutInCheck() public void MaterialPutInCheck()
{ {
bool result = false; bool result = false;
var plc = base.GetPlcByKey("plc"); var plc = base.GetPlcByKey("plc");
while (true) while (true)
@ -517,11 +523,27 @@ namespace SlnMesnac.Business
bool result = false; bool result = false;
try try
{ {
//判断当前模式手动需从出库队列叫料如果没有出库队列弹框提醒自动模式库位参数为Null
string targetLocationCode = null;
if(debugConfig.ProductMode== "1")
{
// 手动模式出库队列
WmsRawPreferredOut? PreferredOut = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<WmsRawPreferredOut>().OrderBy(x=>x.RawPreferredOutId).First();
if (PreferredOut == null)
{
MsgHandlerEvent?.Invoke("当前投料手动模式,无出库队列,请在投料管理添加出库队列,或修改为自动投料模式", 2, 4);
return false;
}
else
{
targetLocationCode = PreferredOut.LocationCode;
}
}
var content = new var content = new
{ {
rawOutstockId = taskId, rawOutstockId = taskId,
locationCode = targetLocationCode,
}; };
string message = JsonConvert.SerializeObject(content); string message = JsonConvert.SerializeObject(content);

@ -9,6 +9,7 @@ using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using System.Windows; using System.Windows;
using MaterialDesignThemes.Wpf; using MaterialDesignThemes.Wpf;
using SlnMesnac.Business;
namespace SlnMesnac.WPF.MessageTips namespace SlnMesnac.WPF.MessageTips
{ {
@ -20,6 +21,7 @@ namespace SlnMesnac.WPF.MessageTips
public MessageAdorner(UIElement adornedElement) : base(adornedElement) public MessageAdorner(UIElement adornedElement) : base(adornedElement)
{ {
this.adornedElement = adornedElement as FrameworkElement; this.adornedElement = adornedElement as FrameworkElement;
} }
public void PushMessage(string message, int msgtype, int outTime) public void PushMessage(string message, int msgtype, int outTime)

@ -30,6 +30,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using TouchSocket.Core; using TouchSocket.Core;
using static SlnMesnac.Business.ProdMgmtBusiness;
namespace SlnMesnac.WPF.Page namespace SlnMesnac.WPF.Page
{ {
@ -68,7 +69,7 @@ namespace SlnMesnac.WPF.Page
dmsRecordShutDownService = App.ServiceProvider.GetService<IDmsRecordShutDownService>(); dmsRecordShutDownService = App.ServiceProvider.GetService<IDmsRecordShutDownService>();
dmsRecordAlarmTimeService = App.ServiceProvider.GetService<IDmsRecordAlarmTimeService>(); dmsRecordAlarmTimeService = App.ServiceProvider.GetService<IDmsRecordAlarmTimeService>();
dmsRealtimeStatusService = App.ServiceProvider.GetService<IDmsRealtimeStatusService>(); dmsRealtimeStatusService = App.ServiceProvider.GetService<IDmsRealtimeStatusService>();
ProdMgmtBusiness.MsgHandlerEvent += MsgHandler;
RecipeModeSetWindow.ManualChangeRecipeEvent += ManualChangeRecipe; RecipeModeSetWindow.ManualChangeRecipeEvent += ManualChangeRecipe;
_logger = App.ServiceProvider.GetService<ILogger<DevMonitorPage>>(); _logger = App.ServiceProvider.GetService<ILogger<DevMonitorPage>>();
_configInfoBusiness = App.ServiceProvider.GetService<ConfigInfoBusiness>(); _configInfoBusiness = App.ServiceProvider.GetService<ConfigInfoBusiness>();
@ -83,6 +84,14 @@ namespace SlnMesnac.WPF.Page
StartAdjustRecipe(); StartAdjustRecipe();
} }
private void MsgHandler(string message, int msgtype, int outTime = 3)
{
Application.Current.Dispatcher.Invoke(() =>
{
Msg.MsgShow(message, msgtype, outTime);
});
}
private void Init() private void Init()

Loading…
Cancel
Save