diff --git a/.vs/HighWayIot/FileContentIndex/44ab7b7c-69ea-4757-9a3c-094d4d27b927.vsidx b/.vs/HighWayIot/FileContentIndex/44ab7b7c-69ea-4757-9a3c-094d4d27b927.vsidx
new file mode 100644
index 00000000..8e19aba6
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/44ab7b7c-69ea-4757-9a3c-094d4d27b927.vsidx differ
diff --git a/.vs/HighWayIot/FileContentIndex/5460fd56-b0ab-4100-87a1-38dce27ca102.vsidx b/.vs/HighWayIot/FileContentIndex/5460fd56-b0ab-4100-87a1-38dce27ca102.vsidx
new file mode 100644
index 00000000..1ac4faaa
Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/5460fd56-b0ab-4100-87a1-38dce27ca102.vsidx differ
diff --git a/.vs/HighWayIot/v17/.suo b/.vs/HighWayIot/v17/.suo
index 554b1236..ba3e8a08 100644
Binary files a/.vs/HighWayIot/v17/.suo and b/.vs/HighWayIot/v17/.suo differ
diff --git a/Aucma.Scada.Business/AssemblyPlanBusiness.cs b/Aucma.Scada.Business/AssemblyPlanBusiness.cs
index 8676c727..2c10afdb 100644
--- a/Aucma.Scada.Business/AssemblyPlanBusiness.cs
+++ b/Aucma.Scada.Business/AssemblyPlanBusiness.cs
@@ -43,6 +43,16 @@ namespace Aucma.Scada.Business
/// 执行计划
///
private IExecutePlanInfoService _executePlanInfoService;
+
+ ///
+ /// BOM信息
+ ///
+ private IBaseBomInfoService _bomInfoService;
+
+ ///
+ /// 货道明细
+ ///
+ private IBaseSpaceDetailService _spaceDetailService;
#endregion
#region 委托事件
@@ -65,6 +75,8 @@ namespace Aucma.Scada.Business
{
_productPlanInfoService = registerServices.GetService();
_executePlanInfoService = registerServices.GetService();
+ _bomInfoService = registerServices.GetService();
+ _spaceDetailService = registerServices.GetService();
}
@@ -115,6 +127,39 @@ namespace Aucma.Scada.Business
return planInfos;
}
+ ///
+ /// 判断库存
+ ///
+ /// 生产计划
+ /// 下达数量
+ /// BOM类型
+ ///
+ ///
+ public bool JudgmentStock(ProductPlanInfo planInfo, int transmitAmount, string materialType, string storeCode)
+ {
+ bool result = false;
+ try
+ {
+ var bomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, materialType);
+ if (bomInfo != null)
+ {
+ materialType = bomInfo.materialCode;
+
+ List spaceDetails = _spaceDetailService.GetSpaceDetailsByMaterialType(storeCode, materialType);
+
+ if (spaceDetails.Count > transmitAmount)
+ {
+ result = true;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ logHelper.Error("计划下达判断库存异常", ex);
+ }
+ return result;
+ }
+
///
/// 根据生产计划下达执行计划
///
diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll
index 10575f3d..b021b103 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 88a874c0..89eafa01 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.Repository.dll b/Aucma.Scada.Business/bin/Debug/HighWayIot.Repository.dll
index 73d0da65..3830917f 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 90fa4e3b..0aa06743 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 38eb25fc..d68c3db7 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 10575f3d..b021b103 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 88a874c0..89eafa01 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/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache b/Aucma.Scada.HikRobot/obj/Debug/Aucma.Scada.HikRobot.csproj.AssemblyReference.cache
index a3989b02..945983cf 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 761b2fe1..ee3cc483 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 10575f3d..b021b103 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 88a874c0..89eafa01 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/Aucma.Scada.UI.exe b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe
index 90f2062a..f4980b9a 100644
Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.exe differ
diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb
index 731efa13..01c01634 100644
Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.UI.pdb differ
diff --git a/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll b/Aucma.Scada.UI/bin/Debug/HighWayIot.Repository.dll
index 73d0da65..3830917f 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 90fa4e3b..0aa06743 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/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache
index 1c7662c8..bc4b1b22 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/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.exe b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.exe
index 90f2062a..f4980b9a 100644
Binary files a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.exe and b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.exe differ
diff --git a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.pdb b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.pdb
index 731efa13..01c01634 100644
Binary files a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.pdb and b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.pdb differ
diff --git a/Aucma.Scada.UI/viewModel/AssemblyPlan/QuantityIssuedViewModel.cs b/Aucma.Scada.UI/viewModel/AssemblyPlan/QuantityIssuedViewModel.cs
index 4a2efcac..0c5ab676 100644
--- a/Aucma.Scada.UI/viewModel/AssemblyPlan/QuantityIssuedViewModel.cs
+++ b/Aucma.Scada.UI/viewModel/AssemblyPlan/QuantityIssuedViewModel.cs
@@ -2,6 +2,7 @@
using Aucma.Scada.Model.domain;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
+using HighWayIot.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -16,6 +17,7 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
public class QuantityIssuedViewModel : ViewModelBase
{
private AssemblyPlanBusiness assemblyPlanBusiness = AssemblyPlanBusiness.Instance;
+ private AppConfig appConfig = AppConfig.Instance;
public QuantityIssuedViewModel(ProductPlanInfo productPlanInfo)
{
@@ -56,6 +58,25 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
private void PlanInfoTransmit()
{
+ var productPlanInfo = _PlanInfo;
+
+ if (productPlanInfo != null)
+ {
+ var materialType = productPlanInfo.materialCode;
+
+ bool shellResult = assemblyPlanBusiness.JudgmentStock(productPlanInfo, Convert.ToInt32(_TransmitAmount), appConfig.foamMaterialType, appConfig.foamStoreCode);
+ if (!shellResult)
+ {
+ MessageBox.Show("计划下达失败,箱体物料库存不足");
+ return;
+ }
+ }
+ else
+ {
+ MessageBox.Show("生产计划获取失败,加载为空");
+ return;
+ }
+
bool result = assemblyPlanBusiness.PlanTransmitByProductPlan(_PlanInfo.planCode, Convert.ToInt32(_TransmitAmount));
if (result)
{
diff --git a/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache b/HighWayIot.Common/obj/Debug/HighWayIot.Common.csproj.AssemblyReference.cache
index 338e1dd3..f24ee2c7 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/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache b/HighWayIot.Config/obj/Debug/HighWayIot.Config.csproj.AssemblyReference.cache
index 919754dd..ed374782 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.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache b/HighWayIot.Plc/obj/Debug/HighWayIot.Plc.csproj.AssemblyReference.cache
index c34e5fb3..c568b408 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.Repository.dll b/HighWayIot.Repository/bin/Debug/HighWayIot.Repository.dll
index 73d0da65..3830917f 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 90fa4e3b..0aa06743 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 30d92d95..e97b5332 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 73d0da65..3830917f 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 90fa4e3b..0aa06743 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/IBaseSpaceDetailService.cs b/HighWayIot.Repository/service/IBaseSpaceDetailService.cs
index 16d14a92..b87c109d 100644
--- a/HighWayIot.Repository/service/IBaseSpaceDetailService.cs
+++ b/HighWayIot.Repository/service/IBaseSpaceDetailService.cs
@@ -13,6 +13,14 @@ namespace HighWayIot.Repository.service
///
List GetSpaceDetailsBySpaceCode(string storeCode, string spaceCode);
+ ///
+ /// 根据物料类型获取可用的货道明细
+ ///
+ ///
+ ///
+ ///
+ List GetSpaceDetailsByMaterialType(string storeCode, string materialType);
+
///
/// 通过物料编号获取货道明细
///
diff --git a/HighWayIot.Repository/service/Impl/BaseSpaceDetailServiceImpl.cs b/HighWayIot.Repository/service/Impl/BaseSpaceDetailServiceImpl.cs
index e183b56d..5171b5f3 100644
--- a/HighWayIot.Repository/service/Impl/BaseSpaceDetailServiceImpl.cs
+++ b/HighWayIot.Repository/service/Impl/BaseSpaceDetailServiceImpl.cs
@@ -86,6 +86,31 @@ namespace HighWayIot.Repository.service.Impl
return spaceDetails;
}
+ ///
+ /// 根据物料类型获取可用的货道明细
+ ///
+ ///
+ ///
+ ///
+ public List GetSpaceDetailsByMaterialType(string storeCode, string materialType)
+ {
+ List spaceDetails = null;
+ try
+ {
+ Expression> exp = s1 => true;
+ exp = exp.And(x => x.storeCode == storeCode && x.materialType == materialType && x.isFlag != 1);
+
+ spaceDetails = _mesRepository.GetList(exp);
+
+ logHelper.Info($"根据仓库编号:{storeCode};物料类型:{materialType};获取到的货道明细:{jsonChange.ModeToJson(spaceDetails)}");
+ }
+ catch (Exception ex)
+ {
+ logHelper.Error("通过物料类型获取货道明细异常", ex);
+ }
+ return spaceDetails;
+ }
+
///
/// 添加货道明细
///
diff --git a/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache b/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache
index 6c767ae3..d23a723e 100644
Binary files a/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache and b/HighWayIot/obj/Debug/HighWayIot.csproj.AssemblyReference.cache differ