diff --git a/Aucma.Scada.Business/InStoreBusiness.cs b/Aucma.Scada.Business/InStoreBusiness.cs
index f1a39034..f31bef0a 100644
--- a/Aucma.Scada.Business/InStoreBusiness.cs
+++ b/Aucma.Scada.Business/InStoreBusiness.cs
@@ -258,6 +258,8 @@ namespace Aucma.Scada.Business
{
string str = storeCode == appConfig.shellStoreCode ? "箱壳异常入库" : "内胆异常入库";
PrintLogInfoMessage(str + "; 未获取到可用的异常货道");
+ CreateInStoreTask(spaceList.First(), null);
+ PrintLogInfoMessage(str + "; 创建异常任务暂存等待异常道进入");
}
}
else
diff --git a/Aucma.Scada.Business/InStoreTaskHandle.cs b/Aucma.Scada.Business/InStoreTaskHandle.cs
index d4a76b85..275a6036 100644
--- a/Aucma.Scada.Business/InStoreTaskHandle.cs
+++ b/Aucma.Scada.Business/InStoreTaskHandle.cs
@@ -157,29 +157,36 @@ namespace Aucma.Scada.Business
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
RefreshShellStockEvent?.Invoke();
RefreshLinerStockEvent?.Invoke();
+ }
- if ((spaceInfo.spaceCapacity - spaceInfo.spaceStock) <= 5)
+ if ((spaceInfo.spaceCapacity - spaceInfo.spaceStock) <= 5)
+ {
+ if (spaceInfo.storeCode == appConfig.shellStoreCode)
+ {
+ ShellAlarmSpaceName.Add(spaceInfo.spaceName);
+ }
+ else
{
- if (spaceInfo.storeCode == appConfig.shellStoreCode)
- {
- ShellAlarmSpaceName.Add(spaceInfo.spaceName);
- }
- else
- {
- LinerAlarmSpaceName.Add(spaceInfo.spaceName);
- }
+ LinerAlarmSpaceName.Add(spaceInfo.spaceName);
}
}
}
+ string str = string.Empty;
if (ShellAlarmSpaceName.Count > 0)
{
- SpaceCapacityAlarmEvent?.Invoke(appConfig.shellStoreCode, jsonChange.ModeToJson(ShellAlarmSpaceName));
+ str += $"箱壳库货道:{jsonChange.ModeToJson(ShellAlarmSpaceName)};";
}
if (LinerAlarmSpaceName.Count > 0)
{
- SpaceCapacityAlarmEvent?.Invoke(appConfig.linerStoreCode, jsonChange.ModeToJson(LinerAlarmSpaceName));
+ str += $"内胆库货道:{jsonChange.ModeToJson(LinerAlarmSpaceName)};";
+ }
+
+ if (!string.IsNullOrEmpty(str))
+ {
+
+ SpaceCapacityAlarmEvent?.Invoke(appConfig.shellStoreCode, str);
}
}
diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll
index d7b79d30..66a1b97b 100644
Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll differ
diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb
index 9e576b18..e990fdd4 100644
Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb differ
diff --git a/Aucma.Scada.UI/Page/InStoreInfo/InStoreInfoControl.xaml b/Aucma.Scada.UI/Page/InStoreInfo/InStoreInfoControl.xaml
index e5e35722..407a0deb 100644
--- a/Aucma.Scada.UI/Page/InStoreInfo/InStoreInfoControl.xaml
+++ b/Aucma.Scada.UI/Page/InStoreInfo/InStoreInfoControl.xaml
@@ -107,9 +107,8 @@
-
-
+
@@ -136,7 +135,7 @@
-
+
@@ -163,6 +162,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -236,8 +250,7 @@
-
-
+
+
+ inStoreTaskHandle.SpaceCapacityAlarmEvent += async (storeCode, spaceName) =>
{
- if(storeCode == appConfig.shellStoreCode)
- {
- MessageBoxTimeoutA((IntPtr)0, $"箱壳库货道预警:{spaceName};库存即将放满请尽快清理库存,3秒后关闭提示", "告警提示", 0, 0, 3000);
- }
- else
- {
- MessageBoxTimeoutA((IntPtr)0, $"箱壳库货道预警:{spaceName};库存即将放满请尽快清理库存,3秒后关闭提示", "告警提示", 0, 0, 3000);
- }
+ // MessageBoxTimeoutA((IntPtr)0, $"货道预警:{spaceName};库存即将放满请尽快清理库存,10秒后关闭提示", "告警提示", 0, 0, 10000);
+
+ AlarmMessage = $"货道预警:{spaceName}库存即将放满请尽快清理库存";
+ Task.Delay(1000*10).Wait();
+ AlarmMessage = string.Empty;
};
QueryCommand = new RelayCommand(Query);
@@ -124,6 +123,12 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
set { linerSpaceName = value; RaisePropertyChanged(nameof(LinerSpaceName)); }
}
+ private string alarmMessage = string.Empty;
+ public string AlarmMessage
+ {
+ get { return alarmMessage; }
+ set { alarmMessage = value; RaisePropertyChanged(nameof(AlarmMessage)); }
+ }
///
/// LisBox数据模板
@@ -277,7 +282,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
//info.ForEach(x => RefreshInStoreTask(x));
try
{
-
+
info = info.Where(x => !string.IsNullOrEmpty(search) ? x.materialCode == search : 1 == 1 && !string.IsNullOrEmpty(materialTypeCombox) ? x.storeCode == materialTypeCombox : 1 == 1).ToList();
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
@@ -297,7 +302,8 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
}
}
#endregion
- }catch(Exception ex)
+ }
+ catch (Exception ex)
{
logHelper.Error("入库任务加载异常", ex);
}
@@ -314,7 +320,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
this.Query();
}
-
+
///
/// 柱状体加载
@@ -365,11 +371,12 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
Achievement.Add(shellColumn);
Achievement.Add(linerColumn);
}));
- }catch(Exception ex)
+ }
+ catch (Exception ex)
{
logHelper.Error(ex.Message.ToString());
}
-
+
}
///
/// 截取逗号之间的名称
@@ -378,11 +385,11 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
///
private string SubStringByName(string name)
{
- if(string.IsNullOrEmpty(name)) return string.Empty;
+ if (string.IsNullOrEmpty(name)) return string.Empty;
string result = string.Empty;
try
{
-
+
int firstCommaIndex = name.IndexOf(',');
int secondCommaIndex = name.IndexOf(',', firstCommaIndex + 1);
@@ -390,7 +397,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
{
result = name.Substring(firstCommaIndex + 1, secondCommaIndex - firstCommaIndex - 1);
}
-
+
}
catch (Exception ex)
{