diff --git a/.vs/HighWayIot/FileContentIndex/70d30014-92c1-4e27-98d2-02d397c6b0ff.vsidx b/.vs/HighWayIot/FileContentIndex/70d30014-92c1-4e27-98d2-02d397c6b0ff.vsidx
new file mode 100644
index 00000000..59ebb206
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/70d30014-92c1-4e27-98d2-02d397c6b0ff.vsidx differ
diff --git a/.vs/HighWayIot/FileContentIndex/b530e419-fdaf-4327-aec3-10bbda2a71b3.vsidx b/.vs/HighWayIot/FileContentIndex/b530e419-fdaf-4327-aec3-10bbda2a71b3.vsidx
new file mode 100644
index 00000000..88171f60
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/b530e419-fdaf-4327-aec3-10bbda2a71b3.vsidx differ
diff --git a/.vs/HighWayIot/FileContentIndex/e462e3f4-0a51-4b54-a4cb-49ed1d7ee163.vsidx b/.vs/HighWayIot/FileContentIndex/e462e3f4-0a51-4b54-a4cb-49ed1d7ee163.vsidx
deleted file mode 100644
index c9efb2e4..00000000
Binary files a/.vs/HighWayIot/FileContentIndex/e462e3f4-0a51-4b54-a4cb-49ed1d7ee163.vsidx and /dev/null differ
diff --git a/.vs/HighWayIot/FileContentIndex/eb89d59f-541e-4b12-b608-b6f526d0b1d0.vsidx b/.vs/HighWayIot/FileContentIndex/eb89d59f-541e-4b12-b608-b6f526d0b1d0.vsidx
new file mode 100644
index 00000000..6d23170a
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/eb89d59f-541e-4b12-b608-b6f526d0b1d0.vsidx differ
diff --git a/.vs/HighWayIot/FileContentIndex/ec1df97f-80fc-46b5-9566-72fccef6bce2.vsidx b/.vs/HighWayIot/FileContentIndex/ec1df97f-80fc-46b5-9566-72fccef6bce2.vsidx
new file mode 100644
index 00000000..171bf025
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/ec1df97f-80fc-46b5-9566-72fccef6bce2.vsidx differ
diff --git a/.vs/HighWayIot/v17/.suo b/.vs/HighWayIot/v17/.suo
index f9a70df2..4ec4bf71 100644
Binary files a/.vs/HighWayIot/v17/.suo and b/.vs/HighWayIot/v17/.suo differ
diff --git a/Aucma.Scada.Business/InStoreBusiness.cs b/Aucma.Scada.Business/InStoreBusiness.cs
index 9f39f29b..319c6477 100644
--- a/Aucma.Scada.Business/InStoreBusiness.cs
+++ b/Aucma.Scada.Business/InStoreBusiness.cs
@@ -5,6 +5,7 @@ using HighWayIot.Log4net;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@@ -38,6 +39,7 @@ namespace Aucma.Scada.Business
private InStoreTaskHandle taskHandle = InStoreTaskHandle.Instance;
private GrabImage grabImage = GrabImage.Instance;
+
#endregion
#region 接口引用
@@ -100,12 +102,12 @@ namespace Aucma.Scada.Business
//Task.Run(() =>
//{
// Thread.Sleep(6000);
- // for (int i = 1; i < 15; i++)
+ // for (int i = 1; i < 2; i++)
// {
- // InStore(appConfig.shellStoreCode, "B2360000078110240" + i.ToString().PadLeft(2, '0'));
- // Thread.Sleep(1000);
- // InStore(appConfig.linerStoreCode, "L2360000078810240" + i.ToString().PadLeft(2, '0'));
- // Thread.Sleep(1000);
+ // //InStore(appConfig.shellStoreCode, "B2360000078110300" + i.ToString().PadLeft(2, '0'));
+ // //Thread.Sleep(1000);
+ // //InStore(appConfig.linerStoreCode, "L2360000078810240" + i.ToString().PadLeft(2, '0'));
+ // //Thread.Sleep(1000);
// }
//});
}
@@ -121,7 +123,10 @@ namespace Aucma.Scada.Business
{
PrintLogInfoMessage($"扫码成功,物料码:{materialCode}");
string materialType = SubStringMaterialCode(materialCode);
- var spaceInfo = _spaceInfoService.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
+ #region Delete By wenjy 2023-10-30 11:41:00 取消通过数据库获取货道数量、在途量,改为实时读取PLC数据
+ //var spaceInfo = _spaceInfoService.InStoreGetSpaceInfoByMaterialType(storeCode, materialType);
+ #endregion
+ var spaceInfo = GetSpaceInfoByMaterialType(storeCode, materialType);
if (spaceInfo != null)
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
@@ -501,5 +506,43 @@ namespace Aucma.Scada.Business
{
return _spaceInfoService.GetMaterialStock(appConfig.shellStoreCode, appConfig.linerStoreCode);
}
+
+ ///
+ /// 通过PLC读取货道信息(在途数量、在库数量、货道状态)
+ ///
+ ///
+ ///
+ ///
+ private BaseSpaceInfo GetSpaceInfoByMaterialType(string storeCode,string materialType)
+ {
+ BaseSpaceInfo result = null;
+
+ try
+ {
+ List info = _spaceInfoService.GetBaseSpaceInfosByMaterialType(storeCode, materialType);
+
+ if (info != null)
+ {
+ if (info.Count > 0)
+ {
+ foreach (BaseSpaceInfo item in info)
+ {
+ var spaceInfo = taskHandle.ReadSpaceInfoByPlc(item);
+ item.spaceStock = spaceInfo.spaceStock;
+ item.onRouteAmount = spaceInfo.onRouteAmount;
+ item.spaceStatus = spaceInfo.spaceStatus;
+ }
+
+ result = info.Where(x=>x.spaceStatus == 1 && x.spaceCapacity > 0 ? x.spaceCapacity > (x.spaceStock + x.onRouteAmount) : 1 == 1).OrderByDescending(x => x.spaceStock).OrderBy(x=>x.spaceCode).First();
+
+ }
+ }
+ }catch (Exception ex)
+ {
+ PrintLogErrorMessage("货道信息读取异常", ex);
+ }
+
+ return result;
+ }
}
}
diff --git a/Aucma.Scada.Business/InStoreTaskHandle.cs b/Aucma.Scada.Business/InStoreTaskHandle.cs
index 07590362..c646cd84 100644
--- a/Aucma.Scada.Business/InStoreTaskHandle.cs
+++ b/Aucma.Scada.Business/InStoreTaskHandle.cs
@@ -33,6 +33,8 @@ namespace Aucma.Scada.Business
private PlcConfig plcConfig = PlcConfig.Instance;
private PlcPool _pool = PlcPool.Instance;
+
+ private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
#endregion
#region 私有变量
@@ -368,5 +370,28 @@ namespace Aucma.Scada.Business
}
}
#endregion
+
+ ///
+ /// 通过PLC获取货道信息
+ ///
+ ///
+ ///
+ public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
+ {
+ var spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.storeCode, spaceInfo.spaceCode);
+ IPlc _plc = _plcDictionary[spaceInfo.storeCode];
+
+ if (_plc != null)
+ {
+ if (_plc.IsConnected)
+ {
+ spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
+ spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
+ spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
+ }
+ }
+
+ return spaceInfo;
+ }
}
}
diff --git a/Aucma.Scada.Business/MainBusiness.cs b/Aucma.Scada.Business/MainBusiness.cs
index a4202fdb..71d6e508 100644
--- a/Aucma.Scada.Business/MainBusiness.cs
+++ b/Aucma.Scada.Business/MainBusiness.cs
@@ -25,6 +25,8 @@ namespace Aucma.Scada.Business
private PlcConfig plcConfig = PlcConfig.Instance;
+ private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
+
private PlcPool plcPool = PlcPool.Instance;
private GrabImage grabImage = GrabImage.Instance;
@@ -42,6 +44,7 @@ namespace Aucma.Scada.Business
//初始化Plc
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.shell_Plc_Ip, plcConfig.shell_Plc_Port, appConfig.shellStoreCode);
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.liner_Plc_Ip, plcConfig.liner_Plc_Port, appConfig.linerStoreCode);
+
}
///
diff --git a/Aucma.Scada.Business/OutStoreBusiness.cs b/Aucma.Scada.Business/OutStoreBusiness.cs
index e7bfca2d..89604b41 100644
--- a/Aucma.Scada.Business/OutStoreBusiness.cs
+++ b/Aucma.Scada.Business/OutStoreBusiness.cs
@@ -166,7 +166,10 @@ namespace Aucma.Scada.Business
try
{
PrintLogInfoMessage($"收到出库计划,物料码:{bomInfo.materialCode}");
- BaseSpaceInfo spaceInfo = _spaceInfoService.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.materialCode);
+ #region Delete By wenjy 2023-10-30 11:41:00 取消通过数据库获取货道数量、在途量,改为实时读取PLC数据
+ //BaseSpaceInfo spaceInfo = _spaceInfoService.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.materialCode);
+ #endregion
+ BaseSpaceInfo spaceInfo = GetSpaceInfoByMaterialType(storeCode, bomInfo.materialCode);
if (spaceInfo != null)
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
@@ -739,5 +742,44 @@ namespace Aucma.Scada.Business
return materialName;
}
+
+ ///
+ /// 通过PLC读取货道信息(在库数量、货道状态)
+ ///
+ ///
+ ///
+ ///
+ private BaseSpaceInfo GetSpaceInfoByMaterialType(string storeCode, string materialType)
+ {
+ BaseSpaceInfo result = null;
+
+ try
+ {
+ List info = _spaceInfoService.GetBaseSpaceInfosByMaterialType(storeCode, materialType);
+
+ if (info != null)
+ {
+ if (info.Count > 0)
+ {
+ foreach (BaseSpaceInfo item in info)
+ {
+ var spaceInfo = taskHandleBusiness.ReadSpaceInfoByPlc(item);
+ item.spaceStock = spaceInfo.spaceStock;
+ item.onRouteAmount = spaceInfo.onRouteAmount;
+ item.spaceStatus = spaceInfo.spaceStatus;
+ }
+
+ result = info.Where(x => x.spaceStatus == 1 && x.spaceStock > 0).OrderBy(x => x.spaceStock).OrderBy(x => x.spaceCode).First();
+
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ PrintLogErrorMessage("货道信息读取异常", ex);
+ }
+
+ return result;
+ }
}
}
diff --git a/Aucma.Scada.Business/OutStoreTaskHandle.cs b/Aucma.Scada.Business/OutStoreTaskHandle.cs
index 2bf743a8..d62ab996 100644
--- a/Aucma.Scada.Business/OutStoreTaskHandle.cs
+++ b/Aucma.Scada.Business/OutStoreTaskHandle.cs
@@ -34,6 +34,8 @@ namespace Aucma.Scada.Business
private PlcConfig plcConfig = PlcConfig.Instance;
private PlcPool _pool = PlcPool.Instance;
+
+ private PlcSpaceConfig spaceConfig = PlcSpaceConfig.Instance;
#endregion
#region 私有变量
@@ -386,6 +388,27 @@ namespace Aucma.Scada.Business
}
#endregion
+ ///
+ /// 通过PLC获取货道信息
+ ///
+ ///
+ ///
+ public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
+ {
+ var spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.storeCode, spaceInfo.spaceCode);
+ IPlc _plc = _plcDictionary[spaceInfo.storeCode];
+
+ if (_plc != null)
+ {
+ if (_plc.IsConnected)
+ {
+ spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
+ spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
+ spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
+ }
+ }
+ return spaceInfo;
+ }
}
}
diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll
index 534677e3..9be17b22 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 db76c9a5..27572c47 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.Business/bin/Debug/HighWayIot.Config.dll b/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.dll and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.dll differ
diff --git a/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.pdb b/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.pdb and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll
index 9c277a85..88796a59 100644
Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll differ
diff --git a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb
index fa92bdb7..25e920d1 100644
Binary files a/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb and b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.pdb differ
diff --git a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.csproj.AssemblyReference.cache b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.csproj.AssemblyReference.cache
index e97fedf6..38bfe376 100644
Binary files a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.csproj.AssemblyReference.cache and b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.csproj.AssemblyReference.cache differ
diff --git a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll
index 534677e3..9be17b22 100644
Binary files a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll differ
diff --git a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb
index db76c9a5..27572c47 100644
Binary files a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb differ
diff --git a/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.dll b/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.dll and b/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.dll differ
diff --git a/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.pdb b/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.pdb and b/Aucma.Scada.HikRobot/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/Aucma.Scada.HikRobot/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache b/Aucma.Scada.HikRobot/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache
index 6ac346ba..11d71342 100644
Binary files a/Aucma.Scada.HikRobot/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache and b/Aucma.Scada.HikRobot/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache differ
diff --git a/Aucma.Scada.Model/obj/Debug/Aucma.Scada.Model.csproj.AssemblyReference.cache b/Aucma.Scada.Model/obj/Debug/Aucma.Scada.Model.csproj.AssemblyReference.cache
index 63ddfe65..75f86db8 100644
Binary files a/Aucma.Scada.Model/obj/Debug/Aucma.Scada.Model.csproj.AssemblyReference.cache and b/Aucma.Scada.Model/obj/Debug/Aucma.Scada.Model.csproj.AssemblyReference.cache differ
diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll
index 534677e3..9be17b22 100644
Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll differ
diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb
index db76c9a5..27572c47 100644
Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb differ
diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.dll b/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.dll and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.dll differ
diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.pdb b/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.pdb and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll
index 9c277a85..88796a59 100644
Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll differ
diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb
index fa92bdb7..25e920d1 100644
Binary files a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb and b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.pdb differ
diff --git a/Aucma.Scada.UI/bin/Debug/config/PlcSpace.Ini b/Aucma.Scada.UI/bin/Debug/config/PlcSpace.Ini
new file mode 100644
index 00000000..5f9599be
--- /dev/null
+++ b/Aucma.Scada.UI/bin/Debug/config/PlcSpace.Ini
@@ -0,0 +1,42 @@
+[XKJCK-001_XK_001]
+ڿ=D7201
+;=D7211
+Ƿ=D7221
+״̬=D7231
+ֿ״̬=D7300
+=D7240
+[XKJCK-001_XK_002]
+ڿ=D7202
+;=D7212
+Ƿ=D7222
+״̬=D7232
+ֿ״̬=D7300
+=D7240
+[XKJCK-001_XK_003]
+ڿ=D7203
+;=D7213
+Ƿ=D7223
+״̬=D7233
+ֿ״̬=D7300
+=D7240
+[XKJCK-001_XK_004]
+ڿ=D7204
+;=D7214
+Ƿ=D7224
+״̬=D7234
+ֿ״̬=D7300
+=D7240
+[XKJCK-001_XK_005]
+ڿ=D7205
+;=D7215
+Ƿ=D7225
+״̬=D7235
+ֿ״̬=D7300
+=D7240
+[XKJCK-001_XK_006]
+ڿ=D7206
+;=D7216
+Ƿ=D7226
+״̬=D7236
+ֿ״̬=D7300
+=D7240
\ No newline at end of file
diff --git a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache
index 3bd243e9..7890acfd 100644
Binary files a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache and b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache b/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache
index c0b50a6a..f813a009 100644
Binary files a/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache and b/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot.Config/HighWayIot.Config.csproj b/HighWayIot.Config/HighWayIot.Config.csproj
index 499c6aff..38cf5a9b 100644
--- a/HighWayIot.Config/HighWayIot.Config.csproj
+++ b/HighWayIot.Config/HighWayIot.Config.csproj
@@ -43,6 +43,7 @@
+
diff --git a/HighWayIot.Config/PlcSpaceConfig.cs b/HighWayIot.Config/PlcSpaceConfig.cs
new file mode 100644
index 00000000..e181e886
--- /dev/null
+++ b/HighWayIot.Config/PlcSpaceConfig.cs
@@ -0,0 +1,61 @@
+using HighWayIot.Common;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HighWayIot.Config
+{
+ public sealed class PlcSpaceConfig
+ {
+ private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/PlcSpace.Ini");
+
+
+ private static readonly Lazy lazy = new Lazy(() => new PlcSpaceConfig());
+ public static PlcSpaceConfig Instance
+ {
+ get
+ {
+ return lazy.Value;
+ }
+ }
+
+ private PlcSpaceConfig()
+ {
+
+ }
+
+
+ public SpaceAddress GetSpaceAddress(string storeCode,string spaceCode)
+ {
+ SpaceAddress spaceAddress = new SpaceAddress();
+ spaceAddress.onStore = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在库数量");
+ spaceAddress.onRoute = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "在途数量");
+ spaceAddress.isFull = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "是否已满");
+ spaceAddress.spaceStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "货道状态");
+ spaceAddress.storeStatus = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "仓库状态");
+ spaceAddress.alarmInfo = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "报警信息");
+ spaceAddress.outStoreFinish = iniHelper.IniReadValue($"{storeCode}_{spaceCode}", "出库完成");
+ return spaceAddress;
+ }
+ }
+
+ public class SpaceAddress
+ {
+ public string onStore { get; set; }
+
+ public string onRoute { get; set; }
+
+ public string isFull { get; set; }
+
+ public string spaceStatus { get; set; }
+
+ public string storeStatus { get; set; }
+
+ public string alarmInfo { get; set; }
+
+ public string outStoreFinish { get; set; }
+ }
+
+}
diff --git a/HighWayIot.Config/bin/Debug/HighWayIot.Config.dll b/HighWayIot.Config/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/HighWayIot.Config/bin/Debug/HighWayIot.Config.dll and b/HighWayIot.Config/bin/Debug/HighWayIot.Config.dll differ
diff --git a/HighWayIot.Config/bin/Debug/HighWayIot.Config.pdb b/HighWayIot.Config/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/HighWayIot.Config/bin/Debug/HighWayIot.Config.pdb and b/HighWayIot.Config/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache b/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache
index 1bb5c21f..f5dfd507 100644
Binary files a/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache and b/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.CoreCompileInputs.cache b/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.CoreCompileInputs.cache
index 7ec6a2df..60a1cb29 100644
--- a/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.CoreCompileInputs.cache
+++ b/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-498314701cc69a2bb9a908cd676c2b8fb46f08d1
+2e5578ef355ebd86a51e35872287d736e1b032e2
diff --git a/HighWayIot.Config/obj/Debug/HighWayIot.Config.dll b/HighWayIot.Config/obj/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/HighWayIot.Config/obj/Debug/HighWayIot.Config.dll and b/HighWayIot.Config/obj/Debug/HighWayIot.Config.dll differ
diff --git a/HighWayIot.Config/obj/Debug/HighWayIot.Config.pdb b/HighWayIot.Config/obj/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/HighWayIot.Config/obj/Debug/HighWayIot.Config.pdb and b/HighWayIot.Config/obj/Debug/HighWayIot.Config.pdb differ
diff --git a/HighWayIot.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache b/HighWayIot.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache
index f74b7f5e..bf89d06f 100644
Binary files a/HighWayIot.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache and b/HighWayIot.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Config.dll b/HighWayIot.Repository/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Config.dll and b/HighWayIot.Repository/bin/Debug/HighWayIot.Config.dll differ
diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Config.pdb b/HighWayIot.Repository/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Config.pdb and b/HighWayIot.Repository/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll
index 9c277a85..88796a59 100644
Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll and b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll differ
diff --git a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb
index fa92bdb7..25e920d1 100644
Binary files a/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb and b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.pdb differ
diff --git a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.csproj.AssemblyReference.cache b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.csproj.AssemblyReference.cache
index f6e5bf0b..10dea1f0 100644
Binary files a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.csproj.AssemblyReference.cache and b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.dll b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.dll
index 9c277a85..88796a59 100644
Binary files a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.dll and b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.dll differ
diff --git a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.pdb b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.pdb
index fa92bdb7..25e920d1 100644
Binary files a/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.pdb and b/HighWayIot.Repository/obj/Debug/HighWayIot.Repository.pdb differ
diff --git a/HighWayIot.Repository/service/IBaseSpaceInfoService.cs b/HighWayIot.Repository/service/IBaseSpaceInfoService.cs
index 15ba32ec..2dd5f70b 100644
--- a/HighWayIot.Repository/service/IBaseSpaceInfoService.cs
+++ b/HighWayIot.Repository/service/IBaseSpaceInfoService.cs
@@ -40,6 +40,14 @@ namespace HighWayIot.Repository.service
///
List GetSpaceInfosByStoreCode(string storeCode);
+ ///
+ /// 通过物料类型获取货道信息,如果没有返回空白货道
+ ///
+ ///
+ ///
+ ///
+ List GetBaseSpaceInfosByMaterialType(string storeCode, string materialType);
+
///
/// 更新货道信息
///
diff --git a/HighWayIot.Repository/service/Impl/BaseSpaceInfoServiceImpl.cs b/HighWayIot.Repository/service/Impl/BaseSpaceInfoServiceImpl.cs
index 5f77c46f..390f019f 100644
--- a/HighWayIot.Repository/service/Impl/BaseSpaceInfoServiceImpl.cs
+++ b/HighWayIot.Repository/service/Impl/BaseSpaceInfoServiceImpl.cs
@@ -239,5 +239,28 @@ namespace HighWayIot.Repository.service.Impl
}
return result;
}
+
+ public List GetBaseSpaceInfosByMaterialType(string storeCode, string materialType)
+ {
+ List spaceInfos = null;
+ try
+ {
+ Expression> exp = s1 => true;
+ exp = exp.And(x => x.storeCode == storeCode && x.materialType == materialType && x.spaceStatus == 1); //相同型号、启用状态的货道信息
+
+ spaceInfos = _mesRepository.GetList(exp);
+
+ if (spaceInfos.Count == 0) //没有指定该类型物料的货道信息,需获取空白货道信息进行分配
+ {
+ spaceInfos = GetEmptySpaceInfo(storeCode);
+ }
+ logHelper.Info($"根据仓库{storeCode};物料:{materialType};获取到的货道信息:{jsonChange.ModeToJson(spaceInfos)}");
+ }
+ catch (Exception ex)
+ {
+ logHelper.Error("获取货道信息异常", ex);
+ }
+ return spaceInfos;
+ }
}
}
\ No newline at end of file
diff --git a/HighWayIot.Rfid/obj/Debug/HighWayIot.Rfid.csproj.AssemblyReference.cache b/HighWayIot.Rfid/obj/Debug/HighWayIot.Rfid.csproj.AssemblyReference.cache
index 5f0bdce9..a2e356c5 100644
Binary files a/HighWayIot.Rfid/obj/Debug/HighWayIot.Rfid.csproj.AssemblyReference.cache and b/HighWayIot.Rfid/obj/Debug/HighWayIot.Rfid.csproj.AssemblyReference.cache differ
diff --git a/HighWayIot/bin/Debug/HighWayIot.Config.dll b/HighWayIot/bin/Debug/HighWayIot.Config.dll
index 8c479e3f..74413d64 100644
Binary files a/HighWayIot/bin/Debug/HighWayIot.Config.dll and b/HighWayIot/bin/Debug/HighWayIot.Config.dll differ
diff --git a/HighWayIot/bin/Debug/HighWayIot.Config.pdb b/HighWayIot/bin/Debug/HighWayIot.Config.pdb
index 471ff9dc..f2e8bf57 100644
Binary files a/HighWayIot/bin/Debug/HighWayIot.Config.pdb and b/HighWayIot/bin/Debug/HighWayIot.Config.pdb differ
diff --git a/HighWayIot/bin/Debug/HighWayIot.Repository.dll b/HighWayIot/bin/Debug/HighWayIot.Repository.dll
index 9c277a85..88796a59 100644
Binary files a/HighWayIot/bin/Debug/HighWayIot.Repository.dll and b/HighWayIot/bin/Debug/HighWayIot.Repository.dll differ
diff --git a/HighWayIot/bin/Debug/HighWayIot.Repository.pdb b/HighWayIot/bin/Debug/HighWayIot.Repository.pdb
index fa92bdb7..25e920d1 100644
Binary files a/HighWayIot/bin/Debug/HighWayIot.Repository.pdb and b/HighWayIot/bin/Debug/HighWayIot.Repository.pdb differ
diff --git a/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache b/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache
index b10fe949..fc8b4dfc 100644
Binary files a/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache and b/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache differ