From 0eb1fbf4e633a3ae4098c3dd9b0a5f71b9fb944b Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Tue, 19 Dec 2017 11:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.137752?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 11 ++++ .../Overlays/SaleOutStoreEdit_Ext.cs | 17 ++++++ B3QingDaoWanFu.Web/PluginClass.cs | 2 + B3QingDaoWanFu/B3QingDaoWanFu.csproj | 5 ++ .../TypeIOCs/SaleOutStoreBLTypeIoc.cs | 58 +++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs create mode 100644 B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj index 044d165..2d265d4 100644 --- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj +++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj @@ -66,6 +66,14 @@ D:\BwpB3Project\tsref\Debug\B3ProduceUnitedInfos.dll False + + False + ..\..\..\tsref\Debug\B3Sale.dll + + + False + ..\..\..\tsref\Debug\B3Sale.Web.dll + False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll @@ -133,6 +141,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs new file mode 100644 index 0000000..0151e75 --- /dev/null +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.Web.Pages.B3Sale.Bills.SaleOutStore_; +using TSingSoft.WebControls2; + +namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays +{ + class SaleOutStoreEdit_Ext: SaleOutStoreEdit + { + protected override void AddCustomerDetailColumns(DFEditGrid detailGrid) + { + detailGrid.Columns.Add(new DFEditGridColumn("FactoryPrice")); + } + } +} diff --git a/B3QingDaoWanFu.Web/PluginClass.cs b/B3QingDaoWanFu.Web/PluginClass.cs index 6b42257..3f69b59 100644 --- a/B3QingDaoWanFu.Web/PluginClass.cs +++ b/B3QingDaoWanFu.Web/PluginClass.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using BWP.Web.Pages.B3Sale.Bills.SaleOutStore_; using TSingSoft.WebPluginFramework; using TSingSoft.WebPluginFramework.Pages; @@ -17,6 +18,7 @@ namespace BWP.B3QingDaoWanFu { WpfPageFactory.RegisterPageOverlay(typeof(StatPayEdit).FullName, typeof(StatPayEdit_Ext).FullName); WpfPageFactory.RegisterPageOverlay(typeof(StatPayAnalyse).FullName, typeof(StatPayAnalyse_Ext).FullName); + WpfPageFactory.RegisterPageOverlay(typeof(SaleOutStoreEdit).FullName, typeof(SaleOutStoreEdit_Ext).FullName); GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.StatPayAddRewardWithButcherUseWeight); } } diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index be69854..2f78b47 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -66,6 +66,10 @@ D:\BwpB3Project\tsref\Debug\B3ProduceUnitedInfos.dll False + + False + ..\..\..\tsref\Debug\B3Sale.dll + False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll @@ -124,6 +128,7 @@ + diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs new file mode 100644 index 0000000..2050655 --- /dev/null +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3ButcherManage.Utils; +using BWP.B3Frameworks; +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 TSingSoft.WebPluginFramework; + +namespace BWP.B3QingDaoWanFu.TypeIOCs +{ + + + [TypeIOC(typeof(SaleOutStoreBL), typeof(SaleOutStoreBL.BaseBLIOCs.BeforeSave))] + public class SaleOutStoreBLTypeIoc:SaleOutStoreBL.BaseBLIOCs.BeforeSave + { + public void Invoke(IDmoContext context, SaleOutStore dmo) + { + foreach (SaleOutStore_Detail detail in dmo.Details) + { + detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); + } + } + + private Money? GetFactoryPrice(IDmoContext context, SaleOutStore dmo, long detailSaleGoodsId) + { + var detail=new JoinAlias(typeof(DynamicPrice_Detail)); + var query=new DQueryDom(detail); + query.Where.Conditions.Add(DQCondition.EQ("SaleGoods_ID", detailSaleGoodsId)); + query.Where.Conditions.Add(DQCondition.InSubQuery(DQExpression.Field("DynamicPrice_ID"),GetSubQueryDom(dmo))); + query.Columns.Add(DQSelectColumn.Field("Price")); + + return query.EExecuteScalar?>(context.Session); + } + + private DQueryDom GetSubQueryDom( SaleOutStore dmo) + { + var bill=new JoinAlias("bill",typeof(DynamicPrice)); + var detail=new JoinAlias("detail",typeof(DynamicPrice_AccountingUnitDetail)); + var query=new DQueryDom(bill); + query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail),DQCondition.EQ(bill,"ID",detail, "DynamicPrice_ID") ); + query.AddBillStateCondition(bill); + query.Where.Conditions.Add(DQCondition.EQ(detail, "AccountingUnit_ID",dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.LessThanOrEqual(bill, "StartPriceDate", dmo.LoadTime)); + + query.Columns.Add(DQSelectColumn.Field("ID",bill)); + query.Range=SelectRange.Top(1); + + return query; + } + } +}