Browse Source

完善需求单No.136603

master
xueyingcheng 8 years ago
parent
commit
cedc519222
3 changed files with 68 additions and 54 deletions
  1. +29
    -14
      BWP.B3_YunKen/BLActions/SaleForecastBLIsSetWrappageActions.cs
  2. +37
    -38
      BWP.B3_YunKen/BLActions/SaleOutStoreBLIsSetWrappageActions.c.cs
  3. +2
    -2
      BWP.B3_YunKen/BWP.B3_YunKen.csproj

BWP.B3_YunKen/TypeIoc/SaleOutStoreBeforeSaveTypeIoc.cs → BWP.B3_YunKen/BLActions/SaleForecastBLIsSetWrappageActions.cs View File

@ -1,30 +1,36 @@
using BWP.B3_YunKen.BO;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3Sale.BL;
using BWP.B3Sale.BO;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
using TSingSoft.WebPluginFramework;
namespace BWP.B3_YunKen.TypeIoc
namespace BWP.B3_YunKen.BLActions
{
[TypeIOC(typeof(SaleOutStoreBL), typeof(SaleOutStoreBL.BaseBLIOCs.BeforeSave))]
public class SaleOutStoreBeforeSaveTypeIoc : SaleOutStoreBL.BaseBLIOCs.BeforeSave
public class SaleForecastBLIsSetWrappageActions : IBLMethodAction
{
public void Invoke(IDmoContext context, SaleOutStore dmo)
//A:根据存货查找【包装物设置】中对应的存货设置
//B:若存货没有在【包装物设置】界面设置包装物,则无法保存。
public string Description
{
get { return "销售预报设置包装物"; }
}
public void Execute(IDmoContext context, object dmo, object parameter)
{
foreach (var detail in dmo.Details)
var bill = dmo as SaleForecast;
if (bill == null)
return;
foreach (var detail in bill.Details)
{
var list = GetGoods_PackageCount(detail.SaleGoods_ID, dmo.AccountingUnit_ID);
var list = GetGoods_PackageCount(detail.SaleGoods_ID, bill.AccountingUnit_ID);
if (list.Count <= 0)
{
string msg = "存货【" + detail.Goods_Name + "】没有在【产品包装物设置】界面设置包装物";
@ -33,8 +39,6 @@ namespace BWP.B3_YunKen.TypeIoc
}
}
//根据存货查找【包装物设置】中对应的存货设置
private List<Tuple<long?, int?>> GetGoods_PackageCount(long? goodID, long? accID)
{
@ -53,7 +57,18 @@ namespace BWP.B3_YunKen.TypeIoc
query.Where.Conditions.Add(DQCondition.EQ(package, "AccountingUnit_ID", accID));
return query.EExecuteList<long?,int?>();
return query.EExecuteList<long?, int?>();
}
public IList<string> Features
{
get { return new List<string>(); }
}
public string Name
{
get { return "B3_YunKen.销售预报设置包装物"; }
}
}

BWP.B3_YunKen/TypeIoc/SaleForecastBeforeSaveTypeIoc.cs → BWP.B3_YunKen/BLActions/SaleOutStoreBLIsSetWrappageActions.c.cs View File

@ -1,31 +1,36 @@
using BWP.B3Frameworks;
using BWP.B3Sale.BL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3_YunKen.BO;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3_YunKen.BO;
using BWP.B3Frameworks.Utils;
using BWP.B3Sale.BO;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.Utils;
using TSingSoft.WebPluginFramework;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
namespace BWP.B3_YunKen.TypeIoc
namespace BWP.B3_YunKen.BLActions
{
[TypeIOC(typeof(SaleForecastBL), typeof(SaleForecastBL.BaseBLIOCs.BeforeSave))]
public class SaleForecastBeforeSaveTypeIoc : SaleForecastBL.BaseBLIOCs.BeforeSave
public class SaleOutStoreBLIsSetWrappageActions : IBLMethodAction
{
public void Invoke(IDmoContext context, SaleForecast dmo)
//A:根据存货查找【包装物设置】中对应的存货设置
//B:若存货没有在【包装物设置】界面设置包装物,则无法保存。
public string Description
{
get { return "销售出库设置包装物"; }
}
foreach (var detail in dmo.Details)
public void Execute(IDmoContext context, object dmo, object parameter)
{
var bill = dmo as SaleOutStore;
if (bill == null)
return;
foreach (var detail in bill.Details)
{
var list = GetGoods_PackageCount(detail.SaleGoods_ID,dmo.AccountingUnit_ID);
var list = GetGoods_PackageCount(detail.SaleGoods_ID, bill.AccountingUnit_ID);
if (list.Count <= 0)
{
string msg = "存货【" + detail.Goods_Name + "】没有在【产品包装物设置】界面设置包装物";
@ -34,27 +39,6 @@ namespace BWP.B3_YunKen.TypeIoc
}
}
////根据存货查找【包装物设置】中对应的存货设置
//private List<Tuple<long?, int?>> GetGoods_PackageCount(long? goodID)
//{
// var main = new JoinAlias(typeof(Goods_Package));
// var query = new DQueryDom(main);
// query.Columns.Add(DQSelectColumn.Field("Package_ID", main));
// query.Columns.Add(DQSelectColumn.Create(DQExpression.Count(), "Count"));
// query.GroupBy.Expressions.Add(DQExpression.Field(main, "Package_ID"));
// query.Where.Conditions.Add(DQCondition.EQ(main, "Goods_ID", goodID));
// //query.Where.Conditions.Add(DQCondition.EQ(main, "Stopped", 0));
// return query.EExecuteList<long?, int?>();
//}
//根据存货查找【包装物设置】中对应的存货设置
private List<Tuple<long?, int?>> GetGoods_PackageCount(long? goodID, long? accID)
{
@ -76,5 +60,20 @@ namespace BWP.B3_YunKen.TypeIoc
return query.EExecuteList<long?, int?>();
}
public IList<string> Features
{
get { return new List<string>(); }
}
public string Name
{
get { return "B3_YunKen.销售出库设置包装物"; }
}
}
}

+ 2
- 2
BWP.B3_YunKen/BWP.B3_YunKen.csproj View File

@ -62,14 +62,14 @@
<Reference Include="Wpf.System, Version=1.3.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="BLActions\SaleForecastBLIsSetWrappageActions.cs" />
<Compile Include="BLActions\SaleOutStoreBLIsSetWrappageActions.c.cs" />
<Compile Include="BL\Bill\Goods_PackageBL.cs" />
<Compile Include="BO\Bill\Goods_Package.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpcs\DriverRpc.cs" />
<Compile Include="TimerTask\NullifyCustomerTask.cs" />
<Compile Include="TypeIoc\DriverBeforeSaveTypeIoc.cs" />
<Compile Include="TypeIoc\SaleForecastBeforeSaveTypeIoc.cs" />
<Compile Include="TypeIoc\SaleOutStoreBeforeSaveTypeIoc.cs" />
<Compile Include="TypeIoc\SaleOutStoreFreightBearTypeIoc.cs" />
</ItemGroup>
<ItemGroup>


Loading…
Cancel
Save