change - 入库逻辑优化

foamRearStore
wenjy 1 year ago
parent 2e07cfd49e
commit ea28510fcb

Binary file not shown.

@ -108,10 +108,10 @@ namespace Aucma.Scada.Business
//Task.Run(() => //Task.Run(() =>
//{ //{
// Thread.Sleep(6000); // Thread.Sleep(6000);
// for (int i = 1; i < 3; i++) // for (int i = 1; i < 5; i++)
// { // {
// InStore("F2340600122510190" + i.ToString().PadLeft(2, '0')); // InStore("F2340600122511150" + i.ToString().PadLeft(2, '0'));
// Thread.Sleep(1000); // Thread.Sleep(1000 * 10);
// } // }
//}); //});
} }
@ -541,7 +541,7 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"通过PLC读取货道信息货道{spaceInfo.spaceName};在库数量:{item.spaceStock};在途数量:{item.onRouteAmount};货道状态:{item.spaceStatus}"); PrintLogInfoMessage($"通过PLC读取货道信息货道{spaceInfo.spaceName};在库数量:{item.spaceStock};在途数量:{item.onRouteAmount};货道状态:{item.spaceStatus}");
} }
var list = info.Where(x => x.spaceStock > 0 ? x.spaceCapacity > (x.spaceStock + x.onRouteAmount) : 1 == 1 && x.spaceStatus == 1).ToList(); var list = info.Where(x => x.spaceCapacity > 0 ? x.spaceCapacity > (x.spaceStock + x.onRouteAmount) : 1 == 1 && x.spaceStatus == 1).ToList();
if (list.Count > 0) if (list.Count > 0)
{ {

@ -85,7 +85,7 @@ namespace Aucma.Scada.Business
bool result = false; bool result = false;
try try
{ {
IPlc _plc = _plcDictionary[taskInfo.storeCode]; IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
if (_plc != null) if (_plc != null)
{ {
@ -154,7 +154,7 @@ namespace Aucma.Scada.Business
WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false); WritePlc(taskInfo.storeCode, taskInfo.spaceCode, false);
//ReadShellFinish_InStore(taskCode); //ReadShellFinish_InStore(taskCode);
InStoreAnswerEvent?.Invoke(appConfig.shellStoreCode, taskInfo.taskCode); InStoreAnswerEvent?.Invoke(appConfig.foamStoreCode, taskInfo.taskCode);
foamRearTaskInfos.Add(taskInfo); foamRearTaskInfos.Add(taskInfo);
} }
@ -270,7 +270,7 @@ namespace Aucma.Scada.Business
string spaceCode = spaceCodes[i]; string spaceCode = spaceCodes[i];
BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.shellStoreCode, spaceCode = spaceCode }; BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.foamStoreCode, spaceCode = spaceCode };
spaceInfo = ReadSpaceInfoByPlc(spaceInfo); spaceInfo = ReadSpaceInfoByPlc(spaceInfo);

@ -162,7 +162,7 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" > <Border Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="系统日志" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/> <TextBlock Text="设备监控" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border> </Border>
<!--日志信息--> <!--日志信息-->

@ -91,7 +91,7 @@
<RowDefinition Height="13*"/> <RowDefinition Height="13*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="泡 库 库 存" Foreground="#FFFFFF" FontSize="15"/> <TextBlock Text="泡 库 库 存" Foreground="#FFFFFF" FontSize="15"/>
</StackPanel> </StackPanel>
<DataGrid Grid.Row="1" ItemsSource="{Binding FoamBeforeMaterialStockDataGrid}" Background="Transparent" <DataGrid Grid.Row="1" ItemsSource="{Binding FoamBeforeMaterialStockDataGrid}" Background="Transparent"

@ -304,12 +304,15 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\A
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe.config E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\QuantityIssuedWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\SearchCriteriaWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\MaterialStatisticsWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.g.cs E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.g.cs
@ -323,12 +326,15 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\A
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\App.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\App.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\QuantityIssuedWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\SearchCriteriaWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\MaterialStatisticsWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.baml E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.baml
@ -343,9 +349,3 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\A
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.CopyComplete E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.pdb E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\MaterialStatisticsWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\MaterialStatisticsWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\QuantityIssuedWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\SearchCriteriaWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\QuantityIssuedWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\SearchCriteriaWindow.baml

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "799341851DF4A31059EBF44128122192259D792DA974B31DABB90BE7E2701C88" #pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2B8D2B5D6D8824A68899B8BBF491AF577C470A1C522B78141C3A08DB9A772394"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "799341851DF4A31059EBF44128122192259D792DA974B31DABB90BE7E2701C88" #pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2B8D2B5D6D8824A68899B8BBF491AF577C470A1C522B78141C3A08DB9A772394"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6115A2C17413027853AD6AD01ACA0BF1E9A9CE6A7FB8974C23DB19A81304037F" #pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E412F80108BCA4EC02AA76F22EC87D4EAC59619196131B5C38E306CDE02720F6"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6115A2C17413027853AD6AD01ACA0BF1E9A9CE6A7FB8974C23DB19A81304037F" #pragma checksum "..\..\..\..\Page\InventoryInfo\MaterialStatisticsWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E412F80108BCA4EC02AA76F22EC87D4EAC59619196131B5C38E306CDE02720F6"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。

@ -9,8 +9,8 @@ namespace HighWayIot.Config
{ {
public sealed class PlcSpaceConfig public sealed class PlcSpaceConfig
{ {
private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/PlcSpace.Ini"); //private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/PlcSpace.Ini");
//private static IniHelper iniHelper = new IniHelper("E:/桌面/澳柯玛MES项目/程序设计/Aucma.Scada/Aucma.Scada.UI/bin/Debug/config/PlcSpace.Ini"); private static IniHelper iniHelper = new IniHelper("E:\\桌面\\澳柯玛MES项目\\程序设计\\Aucma.Scada\\Aucma.Scada.UI\\bin\\Debug\\config\\PlcSpace.Ini");
private static readonly Lazy<PlcSpaceConfig> lazy = new Lazy<PlcSpaceConfig>(() => new PlcSpaceConfig()); private static readonly Lazy<PlcSpaceConfig> lazy = new Lazy<PlcSpaceConfig>(() => new PlcSpaceConfig());
public static PlcSpaceConfig Instance public static PlcSpaceConfig Instance

@ -97,14 +97,12 @@ namespace HighWayIot.Plc.Impl
else else
{ {
log.PlcLog("通过地址和长度读取PLC数据失败"); log.PlcLog("通过地址和长度读取PLC数据失败");
this.IsConnected = false;
return new byte[0]; return new byte[0];
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过地址和长度读取PLC数据异常", ex); log.Error("通过地址和长度读取PLC数据异常", ex);
this.IsConnected = false;
return new byte[0]; return new byte[0];
} }
} }
@ -128,13 +126,11 @@ namespace HighWayIot.Plc.Impl
return true; return true;
} }
log.PlcLog(String.Format("开始通过PLC地址{0}写入int类型数据{1}失败!!!", address, value)); log.PlcLog(String.Format("开始通过PLC地址{0}写入int类型数据{1}失败!!!", address, value));
this.IsConnected = false;
return false; return false;
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过PLC地址写入int类型数据", ex); log.Error("通过PLC地址写入int类型数据", ex);
this.IsConnected = false;
return false; return false;
} }
} }
@ -195,14 +191,12 @@ namespace HighWayIot.Plc.Impl
else else
{ {
log.PlcLog(String.Format("通过PLC地址{0}读取EA值失败", address)); log.PlcLog(String.Format("通过PLC地址{0}读取EA值失败", address));
this.IsConnected = false;
return ""; return "";
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过PLC地址读取EA值异常", ex); log.Error("通过PLC地址读取EA值异常", ex);
this.IsConnected = false;
return ""; return "";
} }
} }
@ -224,13 +218,11 @@ namespace HighWayIot.Plc.Impl
return read.Content; return read.Content;
} }
log.PlcLog(String.Format("通过PLC地址{0}读取交互信号失败!!!", address)); log.PlcLog(String.Format("通过PLC地址{0}读取交互信号失败!!!", address));
this.IsConnected = false;
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过PLC地址读取交互信号异常", ex); log.Error("通过PLC地址读取交互信号异常", ex);
this.IsConnected = false;
return 0; return 0;
} }
} }
@ -252,13 +244,11 @@ namespace HighWayIot.Plc.Impl
return read.Content; return read.Content;
} }
log.PlcLog(String.Format("通过PLC地址{0}读取int32类型数据失败", address)); log.PlcLog(String.Format("通过PLC地址{0}读取int32类型数据失败", address));
this.IsConnected = false;
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过PLC地址读取int32类型数据异常", ex); log.Error("通过PLC地址读取int32类型数据异常", ex);
this.IsConnected = false;
return 0; return 0;
} }
} }
@ -339,7 +329,6 @@ namespace HighWayIot.Plc.Impl
return read.Content; return read.Content;
} }
log.PlcLog(String.Format("通过PLC地址{0}读取string类型数据失败", address)); log.PlcLog(String.Format("通过PLC地址{0}读取string类型数据失败", address));
this.IsConnected = false;
return ""; return "";
} }
catch (Exception ex) catch (Exception ex)
@ -367,13 +356,11 @@ namespace HighWayIot.Plc.Impl
return read.Content; return read.Content;
} }
log.PlcLog(String.Format("通过PLC地址{0}读取bool类型数据失败", address)); log.PlcLog(String.Format("通过PLC地址{0}读取bool类型数据失败", address));
this.IsConnected = false;
return false; return false;
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error("通过PLC地址读取int32类型数据异常", ex); log.Error("通过PLC地址读取int32类型数据异常", ex);
this.IsConnected = false;
return false; return false;
} }
} }
@ -396,13 +383,11 @@ namespace HighWayIot.Plc.Impl
return true; return true;
} }
log.PlcLog(String.Format("通过PLC地址{0}写入bool类型数据{1}失败!!!", address, value)); log.PlcLog(String.Format("通过PLC地址{0}写入bool类型数据{1}失败!!!", address, value));
this.IsConnected = false;
return false; return false;
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error(String.Format("通过PLC地址{0}写入bool类型数据异常", address), ex); log.Error(String.Format("通过PLC地址{0}写入bool类型数据异常", address), ex);
this.IsConnected = false;
return false; return false;
} }
} }

@ -52,6 +52,7 @@ namespace HighWayIot.Plc
var connectResult = _plc.Connect(ip, port); var connectResult = _plc.Connect(ip, port);
if (connectResult) if (connectResult)
{ {
_plc.IsConnected = true;
keyValuePairs.Add(key, _plc); keyValuePairs.Add(key, _plc);
} }
} }

@ -174,7 +174,28 @@ namespace HighWayIot.Repository.service.Impl
List<BaseSpaceInfo> spaceInfos = null; List<BaseSpaceInfo> spaceInfos = null;
try try
{ {
spaceInfos = _mesRepository.GetList(x => x.storeCode == storeCode).ToList(); //spaceInfos = _mesRepository.GetList(x => x.storeCode == storeCode).ToList();
spaceInfos = _mesRepository.Context.Queryable<BaseSpaceInfo>()
.LeftJoin<BaseBomInfo>((s, b) => s.materialType == b.materialCode)
.Where((s, b) => s.storeCode == storeCode)
.Select((s, b) => new BaseSpaceInfo()
{
objId = s.objId,
spaceCode = s.spaceCode,
spaceName = s.spaceName,
spaceCapacity = s.spaceCapacity,
spaceStock = s.spaceStock,
spaceStatus = s.spaceStatus,
spaceType = s.spaceType,
isFlag = s.isFlag,
materialType = b.materialName,
onRouteAmount = s.onRouteAmount,
inStoreFlag = s.inStoreFlag,
outRouteAmount = s.outRouteAmount,
outStoreFlag = s.outStoreFlag,
unusualFlag = s.unusualFlag,
}).ToList();
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save