From 125c9d6cb96b1bc9ecacc052ea09c9aba38b2c31 Mon Sep 17 00:00:00 2001 From: wugang <425674808@qq.com> Date: Fri, 16 Mar 2018 15:33:35 +0800 Subject: [PATCH 01/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139063?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 6 +-- .../Pages/TypeIOCs/CarLoadingTypeIOC.cs | 37 ++++++++++++++++++- B3QingDaoWanFu/B3QingDaoWanFu.csproj | 4 +- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj index 83b204f..136e4b1 100644 --- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj +++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj @@ -69,11 +69,11 @@ False ..\..\..\tsref\Debug\B3Sale.dll - + False False ..\..\..\tsref\Debug\B3Sale.Web.dll - + False False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll @@ -176,7 +176,7 @@ {b47ce3c3-c269-48b8-84a7-32360e5a9e8e} B3QingDaoWanFu - + False diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index be99900..2820beb 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -14,6 +14,7 @@ using Forks.EnterpriseServices.DataForm; using Forks.Utils; using TSingSoft.WebControls2.BillReports; using TSingSoft.WebPluginFramework; +using Forks.EnterpriseServices.BusinessInterfaces; namespace BWP.Web.Pages.TypeIOCs { @@ -27,10 +28,44 @@ namespace BWP.Web.Pages.TypeIOCs AddParameterss(dic, dmo); } + public class CarLoadingGoodsSumDetailData + { + public string Goods_Name { get; set; } + public string Goods_Code { get; set; } + public string Goods_Spec { get; set; } + public Money? Number { get; set; } + public string Goods_MainUnit { get; set; } + public Money? SecondNumber { get; set; } + public string Goods_SecondUnit { get; set; } + public string Remark { get; set; } + } + //定制打印格式【装车单】 protected void AddParameterss(IDictionary dic, CarLoading Dmo) { - + var list = new List(); + if (Dmo.BillDetails.Count > 0) { + var billInfo = Dmo.BillDetails.Select(detail => new Tuple(detail.BillTypeID, detail.BillID)).ToList(); + var query = CarLoadingUtil.GoodsSumDetailQuery(billInfo); + + using (var context = new TransactionContext()) { + using (var reader = context.Session.ExecuteReader(query)) { + while (reader.Read()) { + var data = new CarLoadingGoodsSumDetailData(); + data.Goods_Name = (string)reader[0]; + data.Goods_Code = (string)reader[1]; + data.Goods_Spec = (string)reader[2]; + data.Number = (Money?)reader[3]; + data.Goods_MainUnit = (string)reader[4]; + data.SecondNumber = (Money?)reader[5]; + data.Goods_SecondUnit = (string)reader[6]; + data.Remark = (string)reader[7]; + list.Add(data); + } + } + } + } + dic.Add("$DetailInfo3", list); PageSize = 100; dic.Add("$DetailInfo2", new Func(() => GetPrintStyle(Dmo))); diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index 1ef3550..c39bf0e 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -69,11 +69,11 @@ False ..\..\..\tsref\Debug\B3Sale.dll - + False False ..\..\..\tsref\Debug\b3saleinterface.dll - + False False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll From d680edd78d336394c504ecbbcc66430f6b9d272c Mon Sep 17 00:00:00 2001 From: wugang <425674808@qq.com> Date: Fri, 16 Mar 2018 18:14:29 +0800 Subject: [PATCH 02/43] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/TypeIOCs/CarLoadingTypeIOC.cs | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index 2820beb..34e140d 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -15,6 +15,9 @@ using Forks.Utils; using TSingSoft.WebControls2.BillReports; using TSingSoft.WebPluginFramework; using Forks.EnterpriseServices.BusinessInterfaces; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.SqlDoms; namespace BWP.Web.Pages.TypeIOCs { @@ -28,6 +31,7 @@ namespace BWP.Web.Pages.TypeIOCs AddParameterss(dic, dmo); } + [DFClass] public class CarLoadingGoodsSumDetailData { public string Goods_Name { get; set; } @@ -37,7 +41,33 @@ namespace BWP.Web.Pages.TypeIOCs public string Goods_MainUnit { get; set; } public Money? SecondNumber { get; set; } public string Goods_SecondUnit { get; set; } - public string Remark { get; set; } + public string Customer_Name { get; set; } + } + + + + static DQueryDom GetSaleOutStoreSumDetails(List billIds) + { + var outStore = new JoinAlias(typeof(SaleOutStore)); + var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var query = new DQueryDom(detail); + query.From.AddJoin(JoinType.Left, new DQDmoSource(outStore), DQCondition.EQ(detail, "SaleOutStore_ID", outStore, "ID")); + query.Columns.Add(DQSelectColumn.Field("Goods_Name")); + query.Columns.Add(DQSelectColumn.Field("Goods_Code")); + query.Columns.Add(DQSelectColumn.Field("Goods_Spec")); + query.Columns.Add(DQSelectColumn.Sum(detail,"Number")); + query.Columns.Add(DQSelectColumn.Field("Goods_MainUnit")); + query.Columns.Add(DQSelectColumn.Sum(detail, "SecondNumber")); + query.Columns.Add(DQSelectColumn.Field("Goods_SecondUnit")); + query.Columns.Add(DQSelectColumn.Field("Customer_Name",outStore)); + query.GroupBy.Expressions.Add(DQExpression.Field("Goods_Name")); + query.GroupBy.Expressions.Add(DQExpression.Field("Goods_Code")); + query.GroupBy.Expressions.Add(DQExpression.Field("Goods_Spec")); + query.GroupBy.Expressions.Add(DQExpression.Field("Goods_MainUnit")); + query.GroupBy.Expressions.Add(DQExpression.Field("Goods_SecondUnit")); + query.GroupBy.Expressions.Add(DQExpression.Field(outStore,"Customer_Name")); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleOutStore_ID"), billIds.Select(item => DQExpression.Value(item)).ToArray())); + return query; } //定制打印格式【装车单】 @@ -45,8 +75,8 @@ namespace BWP.Web.Pages.TypeIOCs { var list = new List(); if (Dmo.BillDetails.Count > 0) { - var billInfo = Dmo.BillDetails.Select(detail => new Tuple(detail.BillTypeID, detail.BillID)).ToList(); - var query = CarLoadingUtil.GoodsSumDetailQuery(billInfo); + var billInfo = Dmo.BillDetails.Where(x=>x.BillTypeID == DmoTypeIDAttribute.GetID(typeof(SaleOutStore))).Select(detail => detail.BillID).ToList(); + var query = GetSaleOutStoreSumDetails(billInfo); using (var context = new TransactionContext()) { using (var reader = context.Session.ExecuteReader(query)) { @@ -59,12 +89,13 @@ namespace BWP.Web.Pages.TypeIOCs data.Goods_MainUnit = (string)reader[4]; data.SecondNumber = (Money?)reader[5]; data.Goods_SecondUnit = (string)reader[6]; - data.Remark = (string)reader[7]; + data.Customer_Name = (string)reader[7]; list.Add(data); } } } } + dic.Add("$DetailInfo3Type", typeof(CarLoadingGoodsSumDetailData)); dic.Add("$DetailInfo3", list); PageSize = 100; dic.Add("$DetailInfo2", new Func(() => GetPrintStyle(Dmo))); From 2cb430533f14f2f4dcd35104bb5b89e23cb32789 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 22 Mar 2018 15:25:18 +0800 Subject: [PATCH 03/43] =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=8C=AA=E4=B8=80?= =?UTF-8?q?=E6=8C=AA=E5=85=88=E5=90=8E=E9=A1=BA=E5=BA=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs index 2185bec..9cb5657 100644 --- a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs @@ -14,27 +14,28 @@ using TSingSoft.WebPluginFramework; namespace BWP.B3QingDaoWanFu.TypeIOCs { - [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.BeforeSave))] - public class StatPayBeforeSaveTypeIoc : StatPayBL.BaseBLIOCs.BeforeSave + //[TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))] + //public class StatPayBeforeSaveTypeIoc : StatPayBL.BaseBLIOCs.AfterSave + //{ + // public void Invoke(IDmoContext context, StatPay dmo) + // { + + // } + //} + + + [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))] + public class StatPayAfterSaveBLTypeIoc : StatPayBL.BaseBLIOCs.AfterSave { public void Invoke(IDmoContext context, StatPay dmo) { var 死猪奖罚设置ID = 36; - dmo.DeadPigRewardMoney = dmo.OtherRewardDetails.Where(x=>x.Sanction_ID== 死猪奖罚设置ID).Sum(x => (x.Money ?? 0).Value); + dmo.DeadPigRewardMoney = dmo.OtherRewardDetails.Where(x => x.Sanction_ID == 死猪奖罚设置ID).Sum(x => (x.Money ?? 0).Value); var butcherdetail = dmo.Details.FirstOrDefault(x => x.HogGrade_ID.HasValue); if (butcherdetail != null) { dmo.HogGrade_ID = butcherdetail.HogGrade_ID; } - } - } - - - [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))] - public class StatPayAfterSaveBLTypeIoc : StatPayBL.BaseBLIOCs.AfterSave - { - public void Invoke(IDmoContext context, StatPay dmo) - { //自定义单价 if (dmo.UpdateActualPrice) { From 50efdd8f7a51ea4ca27d0eb4a07a769d8970aa13 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Fri, 23 Mar 2018 17:31:03 +0800 Subject: [PATCH 04/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139232=20?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=E5=8A=A0=E8=BD=BD=E9=A2=84=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E5=8D=95=20=E5=9C=A8=E4=B8=87=E7=A6=8F=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=20=E4=BB=A5=E4=BE=9B=E5=BA=94=E5=95=86=E5=85=B3=E8=81=94?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E3=80=82=20=E9=9C=80=E6=B1=82=E5=8D=95No.139?= =?UTF-8?q?231=20=E4=BB=98=E6=AC=BE=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=94=B6?= =?UTF-8?q?=E8=B4=AD=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=9C=A8?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=AF=BC=E5=87=BA=E8=A1=A8=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../B3QingDaoWanFu/Reports/PayInfoExport.cs | 25 +++++++++++++++++++ B3QingDaoWanFu.Web/PluginClass.cs | 1 + 2 files changed, 26 insertions(+) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs index 885c39d..cccc5ce 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs @@ -3,7 +3,9 @@ using BWP.B3ButcherManage.BO; using BWP.B3Frameworks; using BWP.Web.Layout; using BWP.Web.Utils; +using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; using System; using System.Collections.Generic; using System.Linq; @@ -24,11 +26,14 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports get { return "付款清单导出"; } } + DFChoiceBox purchaseType; protected override void AddQueryControls(VLayoutPanel vPanel) { var layout = new LayoutManager("Main", mDFInfo, mQueryContainer); layout.Add("AccountingUnit_ID", new SimpleLabel("会计单位"), QueryCreator.DFChoiceBox(mDFInfo.Fields["AccountingUnit_ID"], B3FrameworksConsts.DataSources.授权会计单位全部)); layout.Add("Supplier_ID", new SimpleLabel("供应商"), QueryCreator.DFChoiceBox(mDFInfo.Fields["Supplier_ID"], B3ButcherManageConsts.DataSources.供应商)); + layout.Add("PurchaseType_ID", new SimpleLabel("收购类型"), purchaseType = QueryCreator.DFChoiceBox(mDFInfo.Fields["Supplier_ID"], B3ButcherManageConsts.DataSources.收购类型)); + layout["PurchaseType_ID"].NotAutoAddToContainer = true; layout.Add("Date", new SimpleLabel("付款日期"), QueryCreator.DateRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate", DateTime.Today, null)); layout["Date"].NotAutoAddToContainer = true; @@ -37,6 +42,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports config.Add("ID"); config.Add("AccountingUnit_ID"); config.Add("Supplier_ID"); + config.Add("PurchaseType_ID"); layout.Config = config; vPanel.Add(layout.CreateLayout()); @@ -54,6 +60,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports query.Columns.Add(DQSelectColumn.Field("Money", t + "金额")); SumColumnNames.Add("Money"); query.Columns.Add(DQSelectColumn.Field("Remark", t + "备注")); + if (!purchaseType.IsEmpty) + DetailTemp.AddPurchaseTypeCondition(query, long.Parse(purchaseType.Value)); foreach (var c in query.Columns) ColumnNames.Add(c.Name); return query; @@ -76,4 +84,21 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports } } } + + class DetailTemp + { + public long Pay_ID { get; set; } + + public static void AddPurchaseTypeCondition(DQueryDom root, long purchaseTypeID) + { + var query = new DQueryDom(new JoinAlias(typeof(Pay_Detail))); + query.Where.Conditions.Add(DQCondition.EQ("StatPay_PurchaseType_ID", purchaseTypeID)); + query.Columns.Add(DQSelectColumn.Field("Pay_ID")); + query.GroupBy.Expressions.Add(DQExpression.Field("Pay_ID")); + + root.RegisterQueryTable(typeof(DetailTemp), new string[] { "Pay_ID" }, query); + var detail = new JoinAlias(typeof(DetailTemp)); + root.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(root.From.RootSource.Alias, "ID", detail, "Pay_ID")); + } + } } diff --git a/B3QingDaoWanFu.Web/PluginClass.cs b/B3QingDaoWanFu.Web/PluginClass.cs index 234bb72..d63beba 100644 --- a/B3QingDaoWanFu.Web/PluginClass.cs +++ b/B3QingDaoWanFu.Web/PluginClass.cs @@ -24,6 +24,7 @@ namespace BWP.B3QingDaoWanFu GlobalFlags.On(B3SaleConsts.Flags.MarketingActivityEnableAdjustPrice); GlobalFlags.On(B3SaleConsts.Flags.SendOutStoreNoAvailableStorage); GlobalFlags.On(B3SaleConsts.Flags.CustAcceptAnalyseHasFactoryPrice); + GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.预付款单不关联过磅单); } } } From a8517b138f131b2462b06229fa299e76ca89f247 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Mon, 26 Mar 2018 14:37:09 +0800 Subject: [PATCH 05/43] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=8F=91=E8=BF=87?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=E8=AE=BE=E5=A4=87=E5=8F=B7=E6=9C=89=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs b/B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs index 407c345..7d6a0d8 100644 --- a/B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs +++ b/B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs @@ -60,7 +60,7 @@ namespace RpcHelper { results.SendResult.Add(r); var gathering = new RpcObject("/MainSystem/B3Sale/BO/Gathering"); - SetString(gathering, "AccountCustomer_OuterCode", bill.Head.CustomerCode);// 客户的外部编码 + SetString(gathering, "AccountCustomer_OuterCode", bill.Head.CustomerCode.Trim());// 客户的外部编码 SetDateTime(gathering, "GatheringTime", bill.Head.Time); SetDecimal(gathering, "GatheringMoney", bill.Head.Money); From df4054d8f36f303eb46c42205c86dd0de1cb4927 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Mon, 26 Mar 2018 14:37:44 +0800 Subject: [PATCH 06/43] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E5=8F=91=E8=BF=87?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=E8=AE=BE=E5=A4=87=E5=8F=B7=E6=9C=89=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/Rpc/GatheringRpc.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/B3QingDaoWanFu/Rpc/GatheringRpc.cs b/B3QingDaoWanFu/Rpc/GatheringRpc.cs index 84775f8..04e72cc 100644 --- a/B3QingDaoWanFu/Rpc/GatheringRpc.cs +++ b/B3QingDaoWanFu/Rpc/GatheringRpc.cs @@ -22,14 +22,15 @@ namespace BWP.B3QingDaoWanFu.Rpc [Rpc] public static long Insert(Gathering dmo) { + var outerCode = dmo.AccountCustomer_OuterCode.Trim(); using (var context = new TransactionContext()) { var bl = BIFactory.Create(context); // bl.InitNewDmo(dmo); dmo.Domain_ID = DomainContext.Current.ID; - var customerId = BIFactory.Create().GetAccountCustomer_ID(dmo.AccountCustomer_OuterCode); + var customerId = BIFactory.Create().GetAccountCustomer_ID(outerCode); if (customerId == 0) - throw new ApplicationException(string.Format("没有设备号{0}的对应结账客户", dmo.AccountCustomer_OuterCode)); + throw new ApplicationException(string.Format("没有设备号{0}的对应结账客户", outerCode)); dmo.AccountCustomer_ID = customerId; SetAccountCustomerInfo(dmo, context.Session); From a7a87623c2060d74a908a9ba681c212b5130aa0f Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Tue, 27 Mar 2018 10:28:45 +0800 Subject: [PATCH 07/43] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/TypeIOCs/CarLoadingTypeIOC.cs | 131 +++++++++++++++++- 1 file changed, 129 insertions(+), 2 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index 34e140d..c8bffdd 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -6,10 +6,12 @@ using System.Text; using System.Web.UI; using System.Web.UI.HtmlControls; using BWP.B3Frameworks; +using BWP.B3Frameworks.BO.MoneyTemplate; using BWP.B3Sale.BO; using BWP.Web.Pages.B3Sale; using BWP.Web.Pages.B3Sale.Bills.CarLoading_; using Forks.Drawing; +using Forks.EnterpriseServices; using Forks.EnterpriseServices.DataForm; using Forks.Utils; using TSingSoft.WebControls2.BillReports; @@ -99,9 +101,104 @@ namespace BWP.Web.Pages.TypeIOCs dic.Add("$DetailInfo3", list); PageSize = 100; dic.Add("$DetailInfo2", new Func(() => GetPrintStyle(Dmo))); + dic.Add("$万福装车单明细", new Func(() => Get万福装车单明细(Dmo))); } + private string Get万福装车单明细(CarLoading dmo) + { + var sb=new StringBuilder(); + sb.AppendLine(""); + sb.AppendLine(""); + + var list = GetWanFuCarLoadingList(dmo); + foreach (IGrouping grouping in list.GroupBy(x=>x.Customer_Name)) + { + AppendByGrouping(sb,grouping); + } + + AppendSumRow(sb,list); + + sb.AppendLine("
客户存货名称规格件数主单位计划数量数量发货标记复称数量备注
"); + + return sb.ToString(); + + } + + private void AppendSumRow(StringBuilder sb, List list) + { + var sumOrderSecondNumber = (Money<二位小数>?)list.Sum(x => (x.OrderSecondNumber ?? 0).Value); + var sumOrderUnitNum = (Money<二位小数>?)list.Sum(x => (x.OrderUnitNum ?? 0).Value); + var sumUnitNum = (Money<二位小数>?)list.Sum(x => (x.UnitNum ?? 0).Value); + sb.AppendLine("合计" + sumOrderSecondNumber + "" + sumOrderUnitNum + "" + sumUnitNum + ""); + } + + private void AppendByGrouping(StringBuilder sb, IGrouping grouping) + { + var isfirst = true; + var count = grouping.Count(); + foreach (TempClassForCarLoadingWanFu wanFu in grouping) + { + if (isfirst) + { + isfirst = false; + sb.AppendLine(""+ wanFu.Customer_Name+ ""+wanFu.Goods_Name+""+wanFu.Goods_Spec+""+wanFu.OrderSecondNumber+""+wanFu.Goods_MainUnit+""+wanFu.OrderUnitNum+""+wanFu.UnitNum+""+wanFu.Remark+""); + } + else + { + sb.AppendLine("" + wanFu.Goods_Name + "" + wanFu.Goods_Spec + "" + wanFu.OrderSecondNumber + "" + wanFu.Goods_MainUnit + "" + wanFu.OrderUnitNum + "" + wanFu.UnitNum + "" + wanFu.Remark + ""); + } + } + } + + private List GetWanFuCarLoadingList(CarLoading dmo) + { + + var bill=new JoinAlias(typeof(CarLoading)); + var detail=new JoinAlias(typeof(CarLoading_BillDetail)); + var outstore= new JoinAlias(typeof(SaleOutStore)); + var outstoreDetail= new JoinAlias(typeof(SaleOutStore_Detail)); + var orderDetail= new JoinAlias(typeof(Order_Detail)); + + var query=new DQueryDom(bill); + query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(bill, "ID",detail, "CarLoading_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(outstore), DQCondition.EQ(detail, "BillID", outstore, "ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(outstoreDetail), DQCondition.EQ(outstoreDetail, "SaleOutStore_ID", detail, "BillID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(orderDetail), DQCondition.EQ(outstoreDetail, "Order_DetailID", orderDetail, "ID")); + + query.Columns.Add(DQSelectColumn.Field("Customer_Name", outstore)); + query.Columns.Add(DQSelectColumn.Field("Goods_Name", outstoreDetail)); + query.Columns.Add(DQSelectColumn.Field("Goods_Spec", outstoreDetail)); + query.Columns.Add(DQSelectColumn.Field("SecondNumber", orderDetail, "OrderSecondNumber")); + query.Columns.Add(DQSelectColumn.Field("Goods_MainUnit", outstoreDetail)); + query.Columns.Add(DQSelectColumn.Field("UnitNum", orderDetail, "OrderUnitNum")); + query.Columns.Add(DQSelectColumn.Field("UnitNum", outstoreDetail, "UnitNum")); + query.Columns.Add(DQSelectColumn.Field("Remark", detail)); + + query.Where.Conditions.Add(DQCondition.EQ(bill,"ID", dmo.ID)); + var list = new List(); + using (var session=Dmo.NewSession()) + { + using (var reader= session.ExecuteReader(query)) + { + while (reader.Read()) + { + var model=new TempClassForCarLoadingWanFu(); + model.Customer_Name = (string) reader[0]; + model.Goods_Name= (string)reader[1]; + model.Goods_Spec = (string)reader[2]; + model.OrderSecondNumber = (Money?)reader[3]; + model.Goods_MainUnit = (string)reader[4]; + model.OrderUnitNum = (Money?)reader[5]; + model.UnitNum = (Money?)reader[6]; + model.Remark = (string)reader[7]; + list.Add(model); + } + } + } + return list; + } + readonly StringBuilder mHtml = new StringBuilder(); //readonly StringBuilder mHtml2 = new StringBuilder(); @@ -169,7 +266,7 @@ namespace BWP.Web.Pages.TypeIOCs table.Rows.Add(row); if (first) { - row.EAdd("center", group.Count() + 1, 1, (string)dataRow["Customer_Name"]); + row.EAdd("center", group.Count() , 1, (string)dataRow["Customer_Name"]); first = false; } @@ -180,7 +277,7 @@ namespace BWP.Web.Pages.TypeIOCs main = (main ?? 0) + (mainNum ?? 0); sec = (sec ?? 0) + (secNum ?? 0); } - table.EAddRow("center", 1, 1, "小计", "", sec.ToString(), "", main.ToString(),main.ToString(), "", "", ""); + //table.EAddRow("center", 1, 1, "小计", "", sec.ToString(), "", main.ToString(),main.ToString(), "", "", ""); } } @@ -279,4 +376,34 @@ namespace BWP.Web.Pages.TypeIOCs public static int rowCount; } + + [DFClass,Serializable] + class TempClassForCarLoadingWanFu + { + [LogicName("客户")] + public string Customer_Name { get; set; } + + [LogicName("存货")] + public string Goods_Name { get; set; } + + [LogicName("规格")] + public string Goods_Spec { get; set; } + + [LogicName("件数")] + public Money? OrderSecondNumber { get; set; } + + [LogicName("主单位")] + public string Goods_MainUnit { get; set; } + + [LogicName("计划数量")] + public Money? OrderUnitNum { get; set; } + + [LogicName("数量")] + public Money? UnitNum { get; set; } + + + [LogicName("备注")] + public string Remark { get; set; } + + } } From c0bdba795583dec0f2ab92e8d356bc935f3567ac Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Tue, 27 Mar 2018 11:34:32 +0800 Subject: [PATCH 08/43] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=9B=B4=E6=96=B0=20=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=BB=8F=E5=8A=9E=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/B3QingDaoWanFu.csproj | 8 +- B3QingDaoWanFu/BLActions/BLActionUtil.cs | 34 ++++++++ B3QingDaoWanFu/BLActions/SaleOrderBLAction.cs | 82 +++++++++++++++++++ 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 B3QingDaoWanFu/BLActions/BLActionUtil.cs create mode 100644 B3QingDaoWanFu/BLActions/SaleOrderBLAction.cs diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index c39bf0e..8b8118a 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -69,11 +69,13 @@ False ..\..\..\tsref\Debug\B3Sale.dll - False + False + False ..\..\..\tsref\Debug\b3saleinterface.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll @@ -130,7 +132,9 @@ Customer_version.cs + + diff --git a/B3QingDaoWanFu/BLActions/BLActionUtil.cs b/B3QingDaoWanFu/BLActions/BLActionUtil.cs new file mode 100644 index 0000000..fae9ae8 --- /dev/null +++ b/B3QingDaoWanFu/BLActions/BLActionUtil.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Frameworks.Utils; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; + +namespace BWP.B3QingDaoWanFu.BLActions +{ + class BLActionUtil + { + public static void GetDepEmpByCustomer(IDmoSession session,long customerId,out long? depid,out long? empid) + { + depid = null; + empid = null; + var query = new DQueryDom(new JoinAlias(typeof(Customer))); + query.Columns.Add(DQSelectColumn.Field("Department_ID")); + query.Columns.Add(DQSelectColumn.Field("Employee_ID")); + query.Where.Conditions.Add(DQCondition.EQ("ID",customerId)); + + using (var reader=session.ExecuteReader(query)) + { + if (reader.Read()) + { + depid = (long?) reader[0]; + empid = (long?) reader[1]; + } + } + + } + } +} diff --git a/B3QingDaoWanFu/BLActions/SaleOrderBLAction.cs b/B3QingDaoWanFu/BLActions/SaleOrderBLAction.cs new file mode 100644 index 0000000..ae3084d --- /dev/null +++ b/B3QingDaoWanFu/BLActions/SaleOrderBLAction.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.BusinessInterfaces; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using TSingSoft.WebPluginFramework; +using TSingSoft.WebPluginFramework.BIPlugins.BLEvents; + +namespace BWP.B3QingDaoWanFu.BLActions +{ + class SaleOrderCreateUpdateDepEmpBLAction: IBLMethodAction + { + public void Execute(IDmoContext context, object dmo, object parameter) + { + var order = dmo as Order; + long? depid; + long? empid; + BLActionUtil.GetDepEmpByCustomer(context.Session,order.Customer_ID??0, out depid,out empid); + if (depid != null) + { + order.Department_ID = depid; + } + if (empid != null) + { + order.Employee_ID = empid; + } + } + + public string Name + { + get { return "B3QingDaoWanFu.销售订单创建根据客户档案更新部门经办人"; } + } + public string Description + { + get { return "销售订单创建根据客户档案更新部门经办人"; } + } + public IList Features + { + get { return new List(); } + } + } + + class SaleOrderCheckUpdateDepEmpBLAction : IBLMethodAction + { + public void Execute(IDmoContext context, object dmo, object parameter) + { + var order = dmo as Order; + long? depid; + long? empid; + BLActionUtil.GetDepEmpByCustomer(context.Session, order.Customer_ID ?? 0, out depid, out empid); + if (depid.HasValue || empid.HasValue) + { + var updateDom = new DQUpdateDom(typeof(Order)); + if (depid.HasValue) + { + updateDom.Columns.Add(new DQUpdateColumn("Department_ID", depid)); + } + if (empid.HasValue) + { + updateDom.Columns.Add(new DQUpdateColumn("Employee_ID", empid)); + } + updateDom.Where.Conditions.Add(DQCondition.EQ("ID",order.ID)); + context.Session.ExecuteNonQuery(updateDom); + } + } + + public string Name + { + get { return "B3QingDaoWanFu.销售订单审核根据客户档案更新部门经办人"; } + } + public string Description + { + get { return "销售订单审核根据客户档案更新部门经办人"; } + } + public IList Features + { + get { return new List(); } + } + } +} From 8c2b98cc683e1d47f5778e59403f121ac91ac5a7 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Tue, 27 Mar 2018 18:18:40 +0800 Subject: [PATCH 09/43] . --- B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index c8bffdd..56034f3 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -176,6 +176,14 @@ namespace BWP.Web.Pages.TypeIOCs query.Columns.Add(DQSelectColumn.Field("Remark", detail)); query.Where.Conditions.Add(DQCondition.EQ(bill,"ID", dmo.ID)); + + if (StoreIDs != null && StoreIDs.Count > 0) + { + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(outstore, "Store_ID"), StoreIDs.Select(x => DQExpression.Value(x)).ToArray())); + } + + + var list = new List(); using (var session=Dmo.NewSession()) { From 4f48d8198863733a88fa35a40cf1f93c7e5dfe7b Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Tue, 27 Mar 2018 22:46:39 +0800 Subject: [PATCH 10/43] =?UTF-8?q?=E9=80=81=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tools/CarLoadingBySendLinePage.cs | 8 +++- B3QingDaoWanFu/B3QingDaoWanFu.csproj | 1 + .../BLActions/SaleOutStoreBLActions.cs | 39 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 B3QingDaoWanFu/BLActions/SaleOutStoreBLActions.cs diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs index 1824618..797d8ef 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs @@ -275,8 +275,12 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Tools dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "业务员")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "送货人员ID")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "送货人员")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "车辆ID")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "车辆")); + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine,"Car_ID"), "车辆ID")); + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Car_Name"), "车辆")); + dom.GroupBy.Expressions.Add(DQExpression.Field(sendLine, "Car_ID")); + dom.GroupBy.Expressions.Add(DQExpression.Field(sendLine, "Car_Name")); + // dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "车辆ID")); + // dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "车辆")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "Remark")); dom.Where.Conditions.Add(DQCondition.EQ("BillState", 单据状态.未审核)); dom.Where.Conditions.Add(DQCondition.EQ("TakeGoods_Type", 配送方式.公司配送)); diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index 8b8118a..f63a1d9 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -135,6 +135,7 @@ + diff --git a/B3QingDaoWanFu/BLActions/SaleOutStoreBLActions.cs b/B3QingDaoWanFu/BLActions/SaleOutStoreBLActions.cs new file mode 100644 index 0000000..419a523 --- /dev/null +++ b/B3QingDaoWanFu/BLActions/SaleOutStoreBLActions.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BWP.B3Sale.BL; +using BWP.B3Sale.BO; +using Forks.EnterpriseServices.BusinessInterfaces; +using TSingSoft.WebPluginFramework.BIPlugins.BLEvents; + +namespace BWP.B3QingDaoWanFu.BLActions +{ + //class SaleOutStoreCheckNullifyBLActions : IBLMethodAction + //{ + + // public void Execute(IDmoContext context, object dmo, object parameter) + // { + // var bl = BIFactory.Create(context.Session); + // var outstore = dmo as SaleOutStore; + // if (outstore.Details.Count == 0) + // { + // bl.UnCheck(outstore); + // bl.Nullify(outstore); + // } + // } + + // public string Name + // { + // get { return "B3QingDaoWanFu.销售出库审核作废没有明细的单据"; } + // } + // public string Description + // { + // get { return "销售出库审核作废没有明细的单据"; } + // } + // public IList Features + // { + // get { return new List(); } + // } + //} +} From 521b819087d72d43fa61e3beee44289d9b33fc8f Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Wed, 28 Mar 2018 11:41:37 +0800 Subject: [PATCH 11/43] . --- B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index 56034f3..71db66e 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -137,7 +137,7 @@ namespace BWP.Web.Pages.TypeIOCs { var isfirst = true; var count = grouping.Count(); - foreach (TempClassForCarLoadingWanFu wanFu in grouping) + foreach (TempClassForCarLoadingWanFu wanFu in grouping.OrderBy(x=>x.SaleOutStore_Detail_ID)) { if (isfirst) { @@ -174,7 +174,8 @@ namespace BWP.Web.Pages.TypeIOCs query.Columns.Add(DQSelectColumn.Field("UnitNum", orderDetail, "OrderUnitNum")); query.Columns.Add(DQSelectColumn.Field("UnitNum", outstoreDetail, "UnitNum")); query.Columns.Add(DQSelectColumn.Field("Remark", detail)); - + query.Columns.Add(DQSelectColumn.Field("ID", outstoreDetail, "SaleOutStore_Detail_ID")); + query.Where.Conditions.Add(DQCondition.EQ(bill,"ID", dmo.ID)); if (StoreIDs != null && StoreIDs.Count > 0) @@ -200,6 +201,7 @@ namespace BWP.Web.Pages.TypeIOCs model.OrderUnitNum = (Money?)reader[5]; model.UnitNum = (Money?)reader[6]; model.Remark = (string)reader[7]; + model.SaleOutStore_Detail_ID = (long?)reader[8]; list.Add(model); } } @@ -388,6 +390,8 @@ namespace BWP.Web.Pages.TypeIOCs [DFClass,Serializable] class TempClassForCarLoadingWanFu { + public long? SaleOutStore_Detail_ID { get; set; } + [LogicName("客户")] public string Customer_Name { get; set; } From eebd3810d577dab282d91f728ef867027425edb6 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Wed, 28 Mar 2018 11:51:20 +0800 Subject: [PATCH 12/43] . --- .../Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs index 0151e75..c1f8a5e 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/SaleOutStoreEdit_Ext.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using BWP.Web.Layout; using BWP.Web.Pages.B3Sale.Bills.SaleOutStore_; using TSingSoft.WebControls2; @@ -9,6 +10,11 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays { class SaleOutStoreEdit_Ext: SaleOutStoreEdit { + protected override void AddEmpInfo(AutoLayoutConfig config) + { + config.Add("BalanceMoney"); + } + protected override void AddCustomerDetailColumns(DFEditGrid detailGrid) { detailGrid.Columns.Add(new DFEditGridColumn("FactoryPrice")); From 8eaebfecb5b71aeeaf69ed078d7cbbca9cb6aaa3 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@@qq.com> Date: Wed, 28 Mar 2018 11:58:47 +0800 Subject: [PATCH 13/43] . --- B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs index 71db66e..e0294f4 100644 --- a/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs +++ b/B3QingDaoWanFu.Web/Pages/TypeIOCs/CarLoadingTypeIOC.cs @@ -109,7 +109,7 @@ namespace BWP.Web.Pages.TypeIOCs { var sb=new StringBuilder(); sb.AppendLine(""); - sb.AppendLine(""); + sb.AppendLine(""); var list = GetWanFuCarLoadingList(dmo); foreach (IGrouping grouping in list.GroupBy(x=>x.Customer_Name)) From 837771f53c5196bb9110b35165491c0229bc4b54 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sun, 8 Apr 2018 19:39:04 +0800 Subject: [PATCH 14/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139400=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8D=95=E6=8D=AE=20=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E3=80=82=E5=9C=A8=E6=94=B6=E8=B4=AD=E7=BB=BC?= =?UTF-8?q?=E5=90=88=E5=88=86=E6=9E=90=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5=E3=80=90=E7=BB=8F=E7=BA=AA=E8=B4=B9?= =?UTF-8?q?=E3=80=91=E3=80=90=E8=BF=90=E8=B4=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 21 +++- .../Bills/CostRecord_/CostRecordEdit.cs | 106 ++++++++++++++++++ .../Bills/CostRecord_/CostRecordList.cs | 35 ++++++ .../Bills/CostRecord_/CostRecordList.xml | 58 ++++++++++ .../Bills/CostRecord_/CostRecordPrint.cs | 19 ++++ .../Reports/ComprehensiveReport.cs | 93 +++++++++++---- B3QingDaoWanFu/B3QingDaoWanFu.csproj | 3 + .../BL/Bill/CostRecordBL/CostRecordBL.cs | 20 ++++ .../BO/Bill/CostRecord/CostRecord.cs | 56 +++++++++ .../BO/Bill/CostRecord/CostRecord_Detail.cs | 38 +++++++ .../B3QingDaoWanFu/CostRecordPrint.xml | 25 +++++ .../config/plugins/B3QingDaoWanFu.plugin | 18 ++- 12 files changed, 469 insertions(+), 23 deletions(-) create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordList.cs create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordList.xml create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordPrint.cs create mode 100644 B3QingDaoWanFu/BL/Bill/CostRecordBL/CostRecordBL.cs create mode 100644 B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord.cs create mode 100644 B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord_Detail.cs create mode 100644 WebFolder/config/billreports/B3QingDaoWanFu/CostRecordPrint.xml diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj index 136e4b1..4eb9c99 100644 --- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj +++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj @@ -69,11 +69,13 @@ False ..\..\..\tsref\Debug\B3Sale.dll - False + False + False ..\..\..\tsref\Debug\B3Sale.Web.dll - False + False + False D:\BwpB3Project\tsref\Debug\B3UnitedInfos.dll @@ -141,6 +143,15 @@ ASPXCodeBehind + + ASPXCodeBehind + + + ASPXCodeBehind + + + ASPXCodeBehind + ASPXCodeBehind @@ -176,7 +187,8 @@ {b47ce3c3-c269-48b8-84a7-32360e5a9e8e} B3QingDaoWanFu - False + False + @@ -189,6 +201,9 @@ + + + + @@ -29,6 +29,21 @@ + + + + + + + + + + + + + + + @@ -36,6 +51,7 @@ + From 206f29d765f96d518383771815e928df7b858be8 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sun, 8 Apr 2018 21:46:59 +0800 Subject: [PATCH 15/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139401=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=87=E7=A3=85=E7=9B=B8=E5=85=B3=E5=8D=95?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Overlays/StatPayEdit_Ext.cs | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs index 9616f01..2ad6c60 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs @@ -1,9 +1,13 @@ -using BWP.Web.Pages.B3ButcherManage.Bills.StatPay_; +using BWP.B3ButcherManage.BO; +using BWP.Web.Pages.B3ButcherManage.Bills.StatPay_; +using BWP.Web.WebControls; +using Forks.EnterpriseServices.DataForm; using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; +using System.Web.UI.WebControls; +using TSingSoft.WebControls2; namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays { @@ -15,5 +19,36 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays if (tag != null) tag.Key = "WeightSumRate2"; } + + DFEditGrid _farmerGrid; + protected override void AddFarmerDetail(System.Web.UI.Control control) + { + var panel = control.EAdd(new TitlePanel("养殖户信息", "养殖户信息")); + var editor = new DFCollectionEditor(() => Dmo.FarmerDetails); + editor.AllowDeletionFunc = () => false; + + editor.CanDeleteFunc = detail => false; + editor.IsEditableFunc = (field, detail) => false; + + _farmerGrid = panel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100), ShowLineNo = true }); + _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Name")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_IDCard")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_BankAccount")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Address")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Tel")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Number")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Weight")); + _farmerGrid.Columns.Add(new DFEditGridColumn("Money")); + + var section4 = mPageLayoutManager.AddSection("detailColumns4", "养殖户信息"); + section4.ApplyLayout(_farmerGrid, mPageLayoutManager, DFInfo.Get(typeof(Weigh_FarmerDetail))); + panel.SetPageLayoutSetting(mPageLayoutManager, section4.Name); + } + + public override void AppToUI() + { + base.AppToUI(); + _farmerGrid.DataBind(); + } } } From e6ec6b74a98d9662c02b7518a77014f8ecd63066 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 9 Apr 2018 17:26:57 +0800 Subject: [PATCH 16/43] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../B3QingDaoWanFu/Reports/PayInfoExport.cs | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs index cccc5ce..2302937 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs @@ -26,6 +26,21 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports get { return "付款清单导出"; } } + protected override void InitQueryPanel(WebControls.QueryPanel queryPanel) + { + base.InitQueryPanel(queryPanel); + queryPanel.ConditonPanel.EAdd(CreateExportTypePanel()); + } + + DFBoolComboBox payTarget; + private HLayoutPanel CreateExportTypePanel() + { + var panel = new HLayoutPanel(); + panel.Add(new SimpleLabel("付款对象")); + payTarget = panel.Add(new DFBoolComboBox() { TrueDisplayValue = "供应商", FalseDisplayValue = "养殖户" }); + return panel; + } + DFChoiceBox purchaseType; protected override void AddQueryControls(VLayoutPanel vPanel) { @@ -55,10 +70,29 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports var t = string.Format(SubTitle, GetMinDate()); var query = base.GetQueryDom(); query.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("ROW_NUMBER() OVER(order by [_bill].[ID])"), t + "序号")); - query.Columns.Add(DQSelectColumn.Field("Supplier_BankAccount", t + "卡号")); - query.Columns.Add(DQSelectColumn.Field("Supplier_Name", t + "姓名")); - query.Columns.Add(DQSelectColumn.Field("Money", t + "金额")); - SumColumnNames.Add("Money"); + if (!payTarget.Value.Value) + { + var root = query.From.RootSource.Alias; + var detail = new JoinAlias(typeof(Pay_Detail)); + var rel = new JoinAlias(typeof(Pay_Advance_Relate)); + var adv = new JoinAlias(typeof(Pay_AdvanceDetail)); + query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "ID", detail, "Pay_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(rel), DQCondition.EQ(detail, "ID", rel, "Pay_Detail_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(adv), DQCondition.And(DQCondition.EQ(root, "ID", adv, "Pay_ID"), DQCondition.EQ(rel, "Advance_ID", adv, "AdvancePay_ID"))); + query.Columns.Add(DQSelectColumn.Field("ID", root, t + "付款单号")); + query.Columns.Add(DQSelectColumn.Field("Farmer_BankAccount", adv, t + "卡号")); + query.Columns.Add(DQSelectColumn.Field("Farmer_Name", adv, t + "姓名")); + query.Columns.Add(DQSelectColumn.Field("AdvancePay_Money", adv, t + "金额")); + SumColumnNames.Add("AdvancePay_Money"); + query.Where.Conditions.Add(DQCondition.IsNotNull(DQExpression.Field(adv, "ID"))); + } + else + { + query.Columns.Add(DQSelectColumn.Field("Supplier_BankAccount", t + "卡号")); + query.Columns.Add(DQSelectColumn.Field("Supplier_Name", t + "姓名")); + query.Columns.Add(DQSelectColumn.Field("Money", t + "金额")); + SumColumnNames.Add("Money"); + } query.Columns.Add(DQSelectColumn.Field("Remark", t + "备注")); if (!purchaseType.IsEmpty) DetailTemp.AddPurchaseTypeCondition(query, long.Parse(purchaseType.Value)); From a8adac79dafc43746744b3433950e6458a8068cd Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 10 Apr 2018 11:04:02 +0800 Subject: [PATCH 17/43] . --- .../Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs index 2302937..677e350 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs @@ -75,15 +75,15 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports var root = query.From.RootSource.Alias; var detail = new JoinAlias(typeof(Pay_Detail)); var rel = new JoinAlias(typeof(Pay_Advance_Relate)); - var adv = new JoinAlias(typeof(Pay_AdvanceDetail)); + var adv = new JoinAlias(typeof(AdvancePay_Detail)); query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(root, "ID", detail, "Pay_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(rel), DQCondition.EQ(detail, "ID", rel, "Pay_Detail_ID")); - query.From.AddJoin(JoinType.Left, new DQDmoSource(adv), DQCondition.And(DQCondition.EQ(root, "ID", adv, "Pay_ID"), DQCondition.EQ(rel, "Advance_ID", adv, "AdvancePay_ID"))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(adv), DQCondition.EQ(rel, "AdvancePay_Detail_ID", adv, "ID")); query.Columns.Add(DQSelectColumn.Field("ID", root, t + "付款单号")); query.Columns.Add(DQSelectColumn.Field("Farmer_BankAccount", adv, t + "卡号")); query.Columns.Add(DQSelectColumn.Field("Farmer_Name", adv, t + "姓名")); - query.Columns.Add(DQSelectColumn.Field("AdvancePay_Money", adv, t + "金额")); - SumColumnNames.Add("AdvancePay_Money"); + query.Columns.Add(DQSelectColumn.Field("Money", adv, t + "金额")); + SumColumnNames.Add("Money"); query.Where.Conditions.Add(DQCondition.IsNotNull(DQExpression.Field(adv, "ID"))); } else From 378ed89b9b57f6bdbaf8ea7a6cfc2113624ccc02 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 10 Apr 2018 19:31:55 +0800 Subject: [PATCH 18/43] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=89=AB=E7=A0=81=E9=94=80=E5=94=AE=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/PluginClass.cs | 1 + B3QingDaoWanFu/B3QingDaoWanFu.csproj | 10 ++ .../BO/SaleOutStoreBarCodeToMESLog.cs | 17 +++ .../Tasks/SyncSaleOutStoreInfoToMES.cs | 121 ++++++++++++++++++ .../TypeIOCs/SaleOutStoreBLTypeIoc.cs | 57 ++++++--- 5 files changed, 191 insertions(+), 15 deletions(-) create mode 100644 B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs create mode 100644 B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs diff --git a/B3QingDaoWanFu.Web/PluginClass.cs b/B3QingDaoWanFu.Web/PluginClass.cs index d63beba..0ff7a9d 100644 --- a/B3QingDaoWanFu.Web/PluginClass.cs +++ b/B3QingDaoWanFu.Web/PluginClass.cs @@ -25,6 +25,7 @@ namespace BWP.B3QingDaoWanFu GlobalFlags.On(B3SaleConsts.Flags.SendOutStoreNoAvailableStorage); GlobalFlags.On(B3SaleConsts.Flags.CustAcceptAnalyseHasFactoryPrice); GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.预付款单不关联过磅单); + GlobalFlags.On(B3SaleConsts.Flags.SaleOutStoreEnableScan); } } } diff --git a/B3QingDaoWanFu/B3QingDaoWanFu.csproj b/B3QingDaoWanFu/B3QingDaoWanFu.csproj index 7fe71e2..bc49aa5 100644 --- a/B3QingDaoWanFu/B3QingDaoWanFu.csproj +++ b/B3QingDaoWanFu/B3QingDaoWanFu.csproj @@ -86,11 +86,19 @@ D:\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll False + + False + ..\..\..\tsref\Debug\Forks.JsonRpc.Client.dll + False D:\BwpB3Project\tsref\Debug\Forks.Utils.dll False + + False + ..\..\..\tsref\Debug\Newtonsoft.Json.dll + False @@ -141,9 +149,11 @@ + + diff --git a/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs b/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs new file mode 100644 index 0000000..bcf71e2 --- /dev/null +++ b/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs @@ -0,0 +1,17 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TSingSoft.WebPluginFramework; + +namespace BWP.B3QingDaoWanFu.BO +{ + + [BOClass] + [KeyField("ScanBar_ID", KeyGenType.assigned)] + public class SaleOutStoreBarCodeToMESLog + { + public long ScanBar_ID { get; set; } + } +} diff --git a/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs new file mode 100644 index 0000000..d991e8a --- /dev/null +++ b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs @@ -0,0 +1,121 @@ +using BWP.B3ProcurementInterface.Utils; +using BWP.B3QingDaoWanFu.BO; +using BWP.B3Sale.BO; +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 System.Threading; +using TSingSoft.WebPluginFramework.TimerTasks; +using TSingSoft.WebPluginFramework; +using Forks.JsonRpc.Client; +using Newtonsoft.Json; +using BWP.B3Frameworks.BO.NamedValueTemplate; + +namespace BWP.B3QingDaoWanFu.Tasks +{ + public class SyncSaleOutStoreInfoToMES : ITimerTask + { + volatile static object _lockObj = new object(); + public void Execute() + { + if (!Monitor.TryEnter(_lockObj)) + { + throw new SameTaskNotFinishException(this); + } + try + { + DoExecute(); + } + finally + { + Monitor.Exit(_lockObj); + } + } + + private void DoExecute() + { + if (!ClientServerFacedRpcFacadeUtil.InitRpcFacade()) + return; + var main = new JoinAlias(typeof(SaleOutStore)); + var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var weight = new JoinAlias(typeof(WeightingInfor)); + var scan = new JoinAlias(typeof(WeightingInfo_ScanDetail)); + var relate = new JoinAlias(typeof(SaleOutStoreBarCodeToMESLog)); + var query = new DQueryDom(main); + query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ("BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(scan), DQCondition.And(DQCondition.EQ(detail, "ID", scan, "Detail_ID"), DQCondition.EQ(weight, "ID", scan, "WeightingInfo_ID"))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(relate), DQCondition.EQ(scan, "ID", relate, "ScanBar_ID")); + + query.Columns.Add(DQSelectColumn.Field("ID", scan)); + query.Columns.Add(DQSelectColumn.Field("BarCode", scan)); + query.Columns.Add(DQSelectColumn.Field("NetWeight", weight)); + query.Columns.Add(DQSelectColumn.Field("LoadTime", main)); + query.Columns.Add(DQSelectColumn.Field("ID", weight)); + query.Columns.Add(DQSelectColumn.Field("Goods_Code", detail)); + + + query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.IsNull(DQExpression.Field(relate, "ScanBar_ID")), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); + + using (var session = Dmo.NewSession()) + { + var list = new List(); + var ids = new List(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var entity = new CarcassSaleOutStoreObj(); + entity.BarCode = (string)reader[1]; + entity.Weight = ((Money?)reader[2]).EToDecimal(); + entity.Time = (DateTime?)reader[3]; + entity.GroupID = (long)reader[4]; + entity.SaleGoods_Code = (string)reader[5]; + list.Add(entity); + ids.Add((long)reader[0]); + } + } + if (list.Count == 0) + return; + + foreach (var g in list.GroupBy(x => x.GroupID)) + { + var first = true; + foreach (var item in g) + { + if (first) + first = false; + else + item.Weight = 0; + } + } + var par = JsonConvert.SerializeObject(list); + + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/CarcassSaleOutStoreRpc/UploadCarcassInfo", par); + foreach (var item in ids) + session.Insert(new SaleOutStoreBarCodeToMESLog { ScanBar_ID = item }); + + session.Commit(); + } + } + + public string Name + { + get { return "上传审核的销售出库扫码信息到MES"; } + } + } + + class CarcassSaleOutStoreObj + { + public string BarCode { get; set; } + public decimal? Weight { get; set; } + public DateTime? Time { get; set; } + public long? GroupID { get; set; } + public string SaleGoods_Code { get; set; } + } +} diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index b902bcc..e8ac7dd 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -12,13 +12,12 @@ using Forks.EnterpriseServices.DomainObjects2.DQuery; using Forks.EnterpriseServices.SqlDoms; using Forks.Utils; using TSingSoft.WebPluginFramework; +using BWP.B3ButcherManage.BO; namespace BWP.B3QingDaoWanFu.TypeIOCs { - - [TypeIOC(typeof(SaleOutStoreBL), typeof(SaleOutStoreBL.BaseBLIOCs.BeforeSave))] - public class SaleOutStoreBLTypeIoc:SaleOutStoreBL.BaseBLIOCs.BeforeSave + public class SaleOutStoreBLTypeIoc : SaleOutStoreBL.BaseBLIOCs.BeforeSave { public void Invoke(IDmoContext context, SaleOutStore dmo) { @@ -30,29 +29,57 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs private Money? GetFactoryPrice(IDmoContext context, SaleOutStore dmo, long detailSaleGoodsId) { - var detail=new JoinAlias(typeof(DynamicPrice_Detail)); - var query=new DQueryDom(detail); + 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.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) + 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") ); + 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.EQ(detail, "AccountingUnit_ID", dmo.AccountingUnit_ID)); query.Where.Conditions.Add(DQCondition.LessThanOrEqual(bill, "StartPriceDate", dmo.LoadTime)); - query.OrderBy.Expressions.Add(DQOrderByExpression.Create(bill,"ID",true)); - query.Columns.Add(DQSelectColumn.Field("ID",bill)); - query.Range=SelectRange.Top(1); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create(bill, "ID", true)); + query.Columns.Add(DQSelectColumn.Field("ID", bill)); + query.Range = SelectRange.Top(1); return query; } } + + [TypeIOC(typeof(SaleOutStoreBL), typeof(SaleOutStoreBL.BillBLIOCs.AfterCheck))] + public class SaleOutStoreCheckBLTypeIoc : SaleOutStoreBL.BillBLIOCs.AfterCheck + { + public void Invoke(IDmoContext context, SaleOutStore dmo) + { + var config = new B3ButcherManageOnlineConfiguration(); + if (string.IsNullOrEmpty(config.TraceBackServerUrl)) + return; + var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var weight = new JoinAlias(typeof(WeightingInfor)); + var scan = new JoinAlias(typeof(WeightingInfo_ScanDetail)); + var query = new DQueryDom(detail); + query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ("BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(scan), DQCondition.And(DQCondition.EQ(detail, "ID", scan, "Detail_ID"), DQCondition.EQ(weight, "ID", scan, "WeightingInfo_ID"))); + + query.Columns.Add(DQSelectColumn.Field("BarCode", scan)); + + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(detail, "SaleOutStore_ID", dmo.ID), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); + + var list = query.EExecuteList(context.Session); + if (!list.Any()) + return; + + var letList = list.Select(x => new TraceBackInfo { Code = x, SendCustomer = dmo.Customer_Name, CarNo = dmo.Car_Name, SendDate = dmo.LoadTime.Value.ToString("yyyyMMdd") }); + TraceBackInfoUtil.Insert(config.TraceBackServerUrl, letList.ToList()); + } + } } From 5fc58c1574844f8124570425ddb9a4f58ebd4d94 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Wed, 11 Apr 2018 20:56:59 +0800 Subject: [PATCH 19/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139460?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index e8ac7dd..7a3a610 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -25,6 +25,18 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs { detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); } + + var query=new DmoQuery(typeof(SaleGoods_Accounting_Store)); + query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID",dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"),dmo.Details.Select(x=>DQExpression.Value(x.SaleGoods_ID)).ToArray())); + var list = context.Session.ExecuteList(query).Cast().ToList(); + foreach (SaleGoods_Accounting_Store storeset in list) + { + if (storeset.Store_ID != dmo.Store_ID) + { + throw new Exception(storeset.SaleGoods_Name+"配置的仓库:"+storeset.Store_Name+" 与单据上的仓库不一致,不允许保存"); + } + } } private Money? GetFactoryPrice(IDmoContext context, SaleOutStore dmo, long detailSaleGoodsId) From 85e98cfeb38817ad4d79cdb1f82b4c2ef5e93241 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Thu, 12 Apr 2018 09:24:02 +0800 Subject: [PATCH 20/43] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TypeIOCs/SaleOutStoreBLTypeIoc.cs | 24 +++++++++++++++---- B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs | 14 +++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index 7a3a610..85d018f 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -13,6 +13,7 @@ using Forks.EnterpriseServices.SqlDoms; using Forks.Utils; using TSingSoft.WebPluginFramework; using BWP.B3ButcherManage.BO; +using BWP.B3QingDaoWanFu.Utils; namespace BWP.B3QingDaoWanFu.TypeIOCs { @@ -26,15 +27,30 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); } - var query=new DmoQuery(typeof(SaleGoods_Accounting_Store)); - query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID",dmo.AccountingUnit_ID)); - query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"),dmo.Details.Select(x=>DQExpression.Value(x.SaleGoods_ID)).ToArray())); + CheckStoreGoodsConsistent(context,dmo); + } + + void CheckStoreGoodsConsistent(IDmoContext context, SaleOutStore dmo) + { + var notchntrolstoreids= new WanFuOnlineConfig().SaleoutstoreSaveNotCheckStoreGoodsConsistent.Value.ToList(); + if (notchntrolstoreids.Count == 0) + { + return; + } + if (notchntrolstoreids.Contains(Convert.ToInt32((dmo.Store_ID ?? 0)) )) + { + return; + } + + var query = new DmoQuery(typeof(SaleGoods_Accounting_Store)); + query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID", dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"), dmo.Details.Select(x => DQExpression.Value(x.SaleGoods_ID)).ToArray())); var list = context.Session.ExecuteList(query).Cast().ToList(); foreach (SaleGoods_Accounting_Store storeset in list) { if (storeset.Store_ID != dmo.Store_ID) { - throw new Exception(storeset.SaleGoods_Name+"配置的仓库:"+storeset.Store_Name+" 与单据上的仓库不一致,不允许保存"); + throw new Exception(storeset.SaleGoods_Name + "配置的仓库:" + storeset.Store_Name + " 与单据上的仓库不一致,不允许保存"); } } } diff --git a/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs b/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs index b59b4e6..d487c20 100644 --- a/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs +++ b/B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs @@ -18,6 +18,20 @@ namespace BWP.B3QingDaoWanFu.Utils ConfigurationUtil.Fill(this); } + private IntListConfigRef _saleoutstoreSaveNotCheckStoreGoodsConsistent = new IntListConfigRef(); + + [LogicName("销售出库保存不受存货仓库设置控制的仓库ID")] + [ConfigurationItemGroup("青岛万福")] + [ConfigurationItemDescription("销售出库保存不是存货仓库设置控制的仓库ID")] + [DomainConfigurationItem] + public IntListConfigRef SaleoutstoreSaveNotCheckStoreGoodsConsistent + { + get { return _saleoutstoreSaveNotCheckStoreGoodsConsistent; } + set { _saleoutstoreSaveNotCheckStoreGoodsConsistent = value; } + } + + + private IntConfigRef _receiptTypeID = new IntConfigRef(0); From b105d715b84688cf92d36004c8354c293a465f49 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Thu, 12 Apr 2018 10:14:25 +0800 Subject: [PATCH 21/43] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tools/CarLoadingBySendLinePage.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs index 797d8ef..dc422f9 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Tools/CarLoadingBySendLinePage.cs @@ -270,11 +270,22 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Tools dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("SecondNumber")), "辅数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQCondition.GreaterThan(DQExpression.Field(areadyLoadBill, "SaleOutStore_ID"), DQExpression.Snippet("0")), DQExpression.Field("AllUnitNum"), DQExpression.NULL)), "已派车数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet?>("null"), "本次派车数量")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "业务员ID")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "业务员")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "送货人员ID")); - dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "送货人员")); + +// dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "业务员ID")); +// dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "业务员")); + + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Employee_ID"), "业务员ID")); + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Employee_Name"), "业务员")); + dom.GroupBy.Expressions.Add(DQExpression.Field(sendLine, "Employee_ID")); + dom.GroupBy.Expressions.Add(DQExpression.Field(sendLine, "Employee_Name")); + + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Employee_ID"), "送货人员ID")); + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Employee_Name"), "送货人员")); + +// dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("null"), "送货人员ID")); +// dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet("''"), "送货人员")); + dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine,"Car_ID"), "车辆ID")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(sendLine, "Car_Name"), "车辆")); dom.GroupBy.Expressions.Add(DQExpression.Field(sendLine, "Car_ID")); From ec620634df0920417bedba1227abd2b74320c41a Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 12 Apr 2018 17:00:45 +0800 Subject: [PATCH 22/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139480=20?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E5=BD=95=E5=85=A5=E5=A2=9E=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5=20=E6=94=B6=E8=B4=AD=E7=BB=BC?= =?UTF-8?q?=E5=90=88=E6=8A=A5=E8=A1=A8=E4=B9=9F=E5=8A=A0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bills/CostRecord_/CostRecordEdit.cs | 27 ++++++++++++++++--- .../Reports/ComprehensiveReport.cs | 27 ++++++++++++++----- .../BO/Bill/CostRecord/CostRecord_Detail.cs | 20 +++++++++++++- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs index cb1dfeb..a8b5dad 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs @@ -54,8 +54,12 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.CostRecord_ _detailGrid.Columns.Add(new DFEditGridColumn("WeightBill_ID")); _detailGrid.Columns.Add(new DFEditGridColumn("Supplier_Name")); - _detailGrid.Columns.Add(new DFEditGridColumn("JingJiFee")); + _detailGrid.Columns.Add(new DFEditGridColumn("Employee_Name")); + _detailGrid.Columns.Add(new DFEditGridColumn("Car_Name")); + _detailGrid.Columns.Add(new DFEditGridColumn("BuyNum")); + _detailGrid.Columns.Add(new DFEditGridColumn("Mileage")); _detailGrid.Columns.Add(new DFEditGridColumn("TransferFee")); + _detailGrid.Columns.Add(new DFEditGridColumn("JingJiFee")); var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列"); titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name); @@ -73,10 +77,25 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.CostRecord_ query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("PurchaseType_ID", Dmo.PurchaseType_ID), DQCondition.EQ(DQExpression.Snippet("CAST([_weighBill].[WeighTime] AS DATE)"), DQExpression.Value(Dmo.Date)), DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核))); query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("Supplier_Name")); + query.Columns.Add(DQSelectColumn.Field("Employee_Name")); + query.Columns.Add(DQSelectColumn.Field("Car_Name")); + query.Columns.Add(DQSelectColumn.Field("BuyNum")); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("WeighTime")); - var result = query.EExecuteList(); - foreach (var item in result) - Dmo.Details.Add(new CostRecord_Detail { WeightBill_ID = item.Item1, Supplier_Name = item.Item2 }); + using (var session = Forks.EnterpriseServices.DomainObjects2.Dmo.NewSession()) + { + using (var reader = session.ExecuteReader(query)) + { + var detail = new CostRecord_Detail() + { + WeightBill_ID = (long)reader[0], + Supplier_Name = (string)reader[1], + Employee_Name = (string)reader[2], + Car_Name = (string)reader[3], + BuyNum = (int?)reader[4] + }; + Dmo.Details.Add(detail); + } + } _detailGrid.DataBind(); } diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs index 19c4c9b..3e9883d 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs @@ -94,14 +94,14 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports table.SumRow["死亡头数"] = n; } - if (_checkbox.Items.FindByText("经纪费").Selected) + if (_checkbox.Items.FindByText("人工费").Selected) { Money<金额> n = 0m; foreach (DFDataRow row in table.Rows) { - n += Convert.ToDecimal(row["经纪费"] ?? 0); + n += Convert.ToDecimal(row["人工费"] ?? 0); } - table.SumRow["经纪费"] =n; + table.SumRow["人工费"] = n; } if (_checkbox.Items.FindByText("运费").Selected) @@ -109,9 +109,18 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports Money<金额> n = 0; foreach (DFDataRow row in table.Rows) { - n += Convert.ToInt32(row["运费"] ?? 0); + n += Convert.ToDecimal(row["运费"] ?? 0); } table.SumRow["运费"] = n; + } + if (_checkbox.Items.FindByText("里程").Selected) + { + decimal n = 0; + foreach (DFDataRow row in table.Rows) + { + n += Convert.ToDecimal(row["里程"] ?? 0); + } + table.SumRow["里程"] = n; } // Set占比(table,); @@ -232,8 +241,9 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports _checkbox.Items.Add(new ListItem("过磅单号", "Weigh_ID")); _checkbox.Items.Add(new ListItem("结算单号", "ID")); _checkbox.Items.Add(new ListItem("业务员", "Employee_Name")); - _checkbox.Items.Add(new ListItem("经纪费", "JingJiFee")); + _checkbox.Items.Add(new ListItem("里程", "Mileage")); _checkbox.Items.Add(new ListItem("运费", "TransferFee")); + _checkbox.Items.Add(new ListItem("人工费", "JingJiFee")); _checkbox.Items.Add(new ListItem("收购头数", "RealNumber")); _checkbox.Items.Add(new ListItem("死亡头数", "DeathNumber")); @@ -385,8 +395,9 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports query.Columns.Add(DQSelectColumn.Create(DQExpression.Field(field.Value), field.Text)); query.GroupBy.Expressions.Add(DQExpression.Field(field.Value)); break; - case"经纪费": + case "里程": case"运费": + case"人工费": query.Columns.Add(DQSelectColumn.Create(DQExpression.Field(costRecord, field.Value), field.Text)); query.GroupBy.Expressions.Add(DQExpression.Field(weight, "ID")); query.GroupBy.Expressions.Add(DQExpression.Field(costRecord, field.Value)); @@ -1035,6 +1046,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports public Money<金额>? JingJiFee { get; set; } public Money<金额>? TransferFee { get; set; } + public decimal? Mileage { get; set; } public static void Register(DQueryDom root) { @@ -1045,10 +1057,11 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports query.Columns.Add(DQSelectColumn.Field("WeightBill_ID", detail)); query.Columns.Add(DQSelectColumn.Sum(detail, "JingJiFee")); query.Columns.Add(DQSelectColumn.Sum(detail, "TransferFee")); + query.Columns.Add(DQSelectColumn.Sum(detail, "Mileage")); query.GroupBy.Expressions.Add(DQExpression.Field(detail, "WeightBill_ID")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("BillState", 单据状态.已审核), DQCondition.EQ("Domain_ID", DomainContext.Current.ID))); - root.RegisterQueryTable(typeof(CostRecordTemp), new string[] { "WeightBill_ID", "JingJiFee", "TransferFee" }, query); + root.RegisterQueryTable(typeof(CostRecordTemp), new string[] { "WeightBill_ID", "JingJiFee", "TransferFee", "Mileage" }, query); } } } diff --git a/B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord_Detail.cs b/B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord_Detail.cs index 937e3f9..4bc8cd7 100644 --- a/B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord_Detail.cs +++ b/B3QingDaoWanFu/BO/Bill/CostRecord/CostRecord_Detail.cs @@ -20,7 +20,10 @@ namespace BWP.B3QingDaoWanFu.BO [LogicName("过磅单号")] public long WeightBill_ID { get; set; } - [LogicName("经纪费")] + [LogicName("里程")] + public decimal? Mileage { get; set; } + + [LogicName("人工费")] public Money<金额>? JingJiFee { get; set; } [LogicName("运费")] @@ -30,6 +33,21 @@ namespace BWP.B3QingDaoWanFu.BO [ReferenceTo(typeof(WeighBill), "Supplier_Name")] [Join("WeightBill_ID", "ID")] public string Supplier_Name { get; set; } + + [LogicName("车辆")] + [ReferenceTo(typeof(WeighBill), "Car_Name")] + [Join("WeightBill_ID", "ID")] + public string Car_Name { get; set; } + + [LogicName("经纪人")] + [ReferenceTo(typeof(WeighBill), "Employee_Name")] + [Join("WeightBill_ID", "ID")] + public string Employee_Name { get; set; } + + [LogicName("头数")] + [ReferenceTo(typeof(WeighBill), "BuyNum")] + [Join("WeightBill_ID", "ID")] + public int? BuyNum { get; set; } } [Serializable] From 50b2038c4ec4aa17f60560e37c56ee878e8ae344 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 12 Apr 2018 17:07:24 +0800 Subject: [PATCH 23/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139508=20?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=8C=AA=E7=BB=93=E7=AE=97=E5=8D=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BB=98=E9=87=91=E9=A2=9D=E4=B8=8D=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E4=BB=BB=E4=BD=95=E8=AE=A1=E7=AE=97=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=8F=96=E8=BF=87=E6=A6=9C=E5=8D=95=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=A3=9A=E5=89=8D=E9=87=91=E9=A2=9D=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs index 9cb5657..1b92a0a 100644 --- a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs @@ -44,7 +44,7 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs if (dmo.PurchaseType_Name == "业务") { - dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0) + (dmo.JingJianFee.EToDecimal() ?? 0) - (dmo.DiscontMoney.EToDecimal() ?? 0); + dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0); Money? we = null; if (dmo.ShackWeight != 0) we = dmo.ShackWeight; From 4ae181340da79834e85fad11650b76acb7b9a1a0 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Fri, 13 Apr 2018 16:22:07 +0800 Subject: [PATCH 24/43] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E5=8D=95=20=E5=BA=94=E4=BB=98=E9=87=91=E9=A2=9D=3D?= =?UTF-8?q?=E7=8E=B0=E6=9C=89=E7=9A=84=E5=BA=94=E4=BB=98=E9=87=91=E9=A2=9D?= =?UTF-8?q?-=E4=BA=BA=E5=B7=A5=E8=B4=B9-=E8=BF=90=E8=B4=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bills/CostRecord_/CostRecordEdit.cs | 19 ++++++++------ B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 25 ++++++++++++++++++- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs index a8b5dad..41204c6 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Bills/CostRecord_/CostRecordEdit.cs @@ -85,15 +85,18 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Bills.CostRecord_ { using (var reader = session.ExecuteReader(query)) { - var detail = new CostRecord_Detail() + while (reader.Read()) { - WeightBill_ID = (long)reader[0], - Supplier_Name = (string)reader[1], - Employee_Name = (string)reader[2], - Car_Name = (string)reader[3], - BuyNum = (int?)reader[4] - }; - Dmo.Details.Add(detail); + var detail = new CostRecord_Detail() + { + WeightBill_ID = (long)reader[0], + Supplier_Name = (string)reader[1], + Employee_Name = (string)reader[2], + Car_Name = (string)reader[3], + BuyNum = (int?)reader[4] + }; + Dmo.Details.Add(detail); + } } } _detailGrid.DataBind(); diff --git a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs index 1b92a0a..9fbdbff 100644 --- a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs @@ -10,6 +10,12 @@ using BWP.B3Frameworks; using Forks.EnterpriseServices.BusinessInterfaces; using Forks.Utils; using TSingSoft.WebPluginFramework; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.DomainObjects2; +using BWP.B3QingDaoWanFu.BO; +using Forks.EnterpriseServices.SqlDoms; +using BWP.B3Frameworks.BO.NamedValueTemplate; +using BWP.B3Frameworks.BO.MoneyTemplate; namespace BWP.B3QingDaoWanFu.TypeIOCs { @@ -19,7 +25,7 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs //{ // public void Invoke(IDmoContext context, StatPay dmo) // { - + // } //} @@ -51,7 +57,24 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs dmo.ActualPrice = decimal.Round(dmo.ActualMoney.EToDecimal() ?? 0, 2) / we; if (dmo.ActualPrice.HasValue) dmo.ActualPrice = decimal.Round(dmo.ActualPrice.Value.Value, 2); + if (dmo.Weigh_ID.HasValue) + dmo.Money = dmo.Money - GetCostRecordMoney(dmo.Weigh_ID.Value, context.Session); } } + + decimal GetCostRecordMoney(long weightID, IDmoSession session) + { + var main = new JoinAlias("_Main",typeof(CostRecord)); + var detail = new JoinAlias(typeof(CostRecord_Detail)); + var query = new DQueryDom(main); + query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "CostRecord_ID")); + query.Columns.Add(DQSelectColumn.Sum(detail, "JingJiFee")); + query.Columns.Add(DQSelectColumn.Sum(detail, "TransferFee")); + query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.EQ(detail, "WeightBill_ID", weightID))); + var result = query.EExecuteScalar?, Money<金额>?>(session); + if (result == null) + return 0; + return (result.Item1 ?? 0) + (result.Item2 ?? 0); + } } } From 2ad26ee31a3911b4316484dcd8eabfe208266baa Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 16 Apr 2018 11:26:43 +0800 Subject: [PATCH 25/43] =?UTF-8?q?=E8=BF=BD=E6=BA=AF=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Overlays/StatPayEdit_Ext.cs | 10 +- .../TypeIOCs/SaleOutStoreBLTypeIoc.cs | 105 +++++++++++++++--- 2 files changed, 101 insertions(+), 14 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs index 2ad6c60..1b21e71 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs @@ -28,7 +28,9 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays editor.AllowDeletionFunc = () => false; editor.CanDeleteFunc = detail => false; - editor.IsEditableFunc = (field, detail) => false; + editor.IsEditableFunc = (field, detail) => { + return CanSave && field.Name == "Money"; + }; _farmerGrid = panel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100), ShowLineNo = true }); _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Name")); @@ -45,6 +47,12 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays panel.SetPageLayoutSetting(mPageLayoutManager, section4.Name); } + public override void GetFromUI() + { + base.GetFromUI(); + _farmerGrid.GetFromUI(); + } + public override void AppToUI() { base.AppToUI(); diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index 85d018f..ef2ba1d 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -14,6 +14,10 @@ using Forks.Utils; using TSingSoft.WebPluginFramework; using BWP.B3ButcherManage.BO; using BWP.B3QingDaoWanFu.Utils; +using Newtonsoft.Json; +using System.Net; +using System.IO; +using TSingSoft.WebPluginFramework.QueueTasks; namespace BWP.B3QingDaoWanFu.TypeIOCs { @@ -27,17 +31,17 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); } - CheckStoreGoodsConsistent(context,dmo); + CheckStoreGoodsConsistent(context, dmo); } void CheckStoreGoodsConsistent(IDmoContext context, SaleOutStore dmo) { - var notchntrolstoreids= new WanFuOnlineConfig().SaleoutstoreSaveNotCheckStoreGoodsConsistent.Value.ToList(); + var notchntrolstoreids = new WanFuOnlineConfig().SaleoutstoreSaveNotCheckStoreGoodsConsistent.Value.ToList(); if (notchntrolstoreids.Count == 0) { return; } - if (notchntrolstoreids.Contains(Convert.ToInt32((dmo.Store_ID ?? 0)) )) + if (notchntrolstoreids.Contains(Convert.ToInt32((dmo.Store_ID ?? 0)))) { return; } @@ -88,26 +92,101 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs { public void Invoke(IDmoContext context, SaleOutStore dmo) { - var config = new B3ButcherManageOnlineConfiguration(); - if (string.IsNullOrEmpty(config.TraceBackServerUrl)) - return; + var task = new SaleInfoTractBackTask(dmo.ID); + task.AddTaskUser_ID = BLContext.User.ID; + task.DomainUser_ID = DomainContext.Current.DomainUser.ID; + QueueTaskService.Add(task); + } + } + + [Serializable] + class SaleInfoTractBackTask : QueueTaskBase + { + public long BillID { get; set; } + public long DomainUser_ID { get; set; } + + public SaleInfoTractBackTask(long id) + { + BillID = id; + } + + public override bool PersistTask + { + get + { + return true; + } + } + + protected override bool SingleTaskInQueue + { + get + { + return true; + } + } + + public override void Execute(QueueTaskContext context) + { + using (var scope = new SpecialDomainUserBLScope(DomainUser_ID)) + { + var config = new B3ButcherManageOnlineConfiguration(); + if (string.IsNullOrEmpty(config.TraceBackServerUrl)) + return; + var url = config.TraceBackServerUrl + "InsertSaleOutStore"; + using (var session = Dmo.NewSession()) + { + var infos = GetTraceBackInfos(session, BillID); + var list = TraceBackInfoUtil.SplitList(infos, 1000); + foreach (var letList in list) + { + var arr = JsonConvert.SerializeObject(letList); + TraceBackInfoUtil.Insert(url, arr); + } + } + } + } + + List GetTraceBackInfos(IDmoSession session, long id) + { var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var bill = new JoinAlias(typeof(SaleOutStore)); var weight = new JoinAlias(typeof(WeightingInfor)); var scan = new JoinAlias(typeof(WeightingInfo_ScanDetail)); var query = new DQueryDom(detail); - query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ("BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(bill), DQCondition.EQ(detail, "SaleOutStore_ID", bill, "ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ(weight, "BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); query.From.AddJoin(JoinType.Left, new DQDmoSource(scan), DQCondition.And(DQCondition.EQ(detail, "ID", scan, "Detail_ID"), DQCondition.EQ(weight, "ID", scan, "WeightingInfo_ID"))); - + query.Columns.Add(DQSelectColumn.Field("Customer_Name", bill)); + query.Columns.Add(DQSelectColumn.Field("Car_Name", bill)); + query.Columns.Add(DQSelectColumn.Field("LoadTime", bill)); query.Columns.Add(DQSelectColumn.Field("BarCode", scan)); - query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(detail, "SaleOutStore_ID", dmo.ID), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(detail, "SaleOutStore_ID", id), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); - var list = query.EExecuteList(context.Session); + var list = query.EExecuteList(session); if (!list.Any()) - return; + return new List(); - var letList = list.Select(x => new TraceBackInfo { Code = x, SendCustomer = dmo.Customer_Name, CarNo = dmo.Car_Name, SendDate = dmo.LoadTime.Value.ToString("yyyyMMdd") }); - TraceBackInfoUtil.Insert(config.TraceBackServerUrl, letList.ToList()); + var letList = list.Select(x => new TractBillSaleInfo { Code = x.Item4, SendCustomer = x.Item1, CarNo = x.Item2, SendDate = x.Item3.ToString("yyyyMMdd") }).ToList(); + return letList; } + + public override string Name + { + get { return string.Format("抽取销售出库单No.{0}到追溯信息到服务器", BillID); } + } + } + + class TractBillSaleInfo + { + //[LogicName("条码")] + public string Code { get; set; } + + public string SendCustomer { get; set; } + + public string CarNo { get; set; } + + public string SendDate { get; set; } } } From ff09b582fbb22219a60cd7f0324bc8080296bc11 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 16 Apr 2018 21:05:37 +0800 Subject: [PATCH 26/43] bug. --- B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs index d991e8a..4ea962f 100644 --- a/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs +++ b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs @@ -48,7 +48,7 @@ namespace BWP.B3QingDaoWanFu.Tasks var relate = new JoinAlias(typeof(SaleOutStoreBarCodeToMESLog)); var query = new DQueryDom(main); query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID")); - query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ("BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); + query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ(weight, "BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); query.From.AddJoin(JoinType.Left, new DQDmoSource(scan), DQCondition.And(DQCondition.EQ(detail, "ID", scan, "Detail_ID"), DQCondition.EQ(weight, "ID", scan, "WeightingInfo_ID"))); query.From.AddJoin(JoinType.Left, new DQDmoSource(relate), DQCondition.EQ(scan, "ID", relate, "ScanBar_ID")); From d71aeadce5e8d0ea5c406ad9e8e3294dad7f7f0c Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Tue, 17 Apr 2018 13:18:54 +0800 Subject: [PATCH 27/43] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=A0=E5=85=BB=E6=AE=96=E6=88=B7=E5=BC=80=E6=88=B7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs index 677e350..ef18ac5 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs @@ -80,6 +80,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports query.From.AddJoin(JoinType.Left, new DQDmoSource(rel), DQCondition.EQ(detail, "ID", rel, "Pay_Detail_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(adv), DQCondition.EQ(rel, "AdvancePay_Detail_ID", adv, "ID")); query.Columns.Add(DQSelectColumn.Field("ID", root, t + "付款单号")); + query.Columns.Add(DQSelectColumn.Field("Farmer_Bank", adv, t + "开户银行")); query.Columns.Add(DQSelectColumn.Field("Farmer_BankAccount", adv, t + "卡号")); query.Columns.Add(DQSelectColumn.Field("Farmer_Name", adv, t + "姓名")); query.Columns.Add(DQSelectColumn.Field("Money", adv, t + "金额")); From fc9844fc19ffc040a985dc19fd62aa90b9d96ffb Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Wed, 18 Apr 2018 10:55:17 +0800 Subject: [PATCH 28/43] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E4=B8=8A=E4=BC=A0=E9=94=80=E5=94=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=B0MES=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E3=80=82=E6=94=AF=E6=8C=81=E7=8E=B0=E5=9C=BA=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BO/SaleOutStoreBarCodeToMESLog.cs | 4 +- .../Tasks/SyncSaleOutStoreInfoToMES.cs | 93 ++++++++++++++----- .../TypeIOCs/SaleOutStoreBLTypeIoc.cs | 31 +++++-- 3 files changed, 97 insertions(+), 31 deletions(-) diff --git a/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs b/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs index bcf71e2..4b52673 100644 --- a/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs +++ b/B3QingDaoWanFu/BO/SaleOutStoreBarCodeToMESLog.cs @@ -9,9 +9,9 @@ namespace BWP.B3QingDaoWanFu.BO { [BOClass] - [KeyField("ScanBar_ID", KeyGenType.assigned)] + [KeyField("SaleOutStore_ID", KeyGenType.assigned)] public class SaleOutStoreBarCodeToMESLog { - public long ScanBar_ID { get; set; } + public long SaleOutStore_ID { get; set; } } } diff --git a/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs index 4ea962f..563e404 100644 --- a/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs +++ b/B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs @@ -15,6 +15,7 @@ using TSingSoft.WebPluginFramework; using Forks.JsonRpc.Client; using Newtonsoft.Json; using BWP.B3Frameworks.BO.NamedValueTemplate; +using BWP.B3ButcherManage.Utils; namespace BWP.B3QingDaoWanFu.Tasks { @@ -42,63 +43,86 @@ namespace BWP.B3QingDaoWanFu.Tasks if (!ClientServerFacedRpcFacadeUtil.InitRpcFacade()) return; var main = new JoinAlias(typeof(SaleOutStore)); + var relate = new JoinAlias(typeof(SaleOutStoreBarCodeToMESLog)); var detail = new JoinAlias(typeof(SaleOutStore_Detail)); var weight = new JoinAlias(typeof(WeightingInfor)); var scan = new JoinAlias(typeof(WeightingInfo_ScanDetail)); - var relate = new JoinAlias(typeof(SaleOutStoreBarCodeToMESLog)); + var temp = new JoinAlias(typeof(Temp)); var query = new DQueryDom(main); + query.From.AddJoin(JoinType.Left, new DQDmoSource(relate), DQCondition.EQ(main, "ID", relate, "SaleOutStore_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ(weight, "BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); query.From.AddJoin(JoinType.Left, new DQDmoSource(scan), DQCondition.And(DQCondition.EQ(detail, "ID", scan, "Detail_ID"), DQCondition.EQ(weight, "ID", scan, "WeightingInfo_ID"))); - query.From.AddJoin(JoinType.Left, new DQDmoSource(relate), DQCondition.EQ(scan, "ID", relate, "ScanBar_ID")); + query.RegisterQueryTable(typeof(Temp), new string[] { "GroupID", "Weight" }, Temp.GetQueryDom()); + query.From.AddJoin(JoinType.Left, new DQDmoSource(temp), DQCondition.EQ(detail, "ID", temp, "GroupID")); - query.Columns.Add(DQSelectColumn.Field("ID", scan)); + query.Columns.Add(DQSelectColumn.Field("ID", main)); query.Columns.Add(DQSelectColumn.Field("BarCode", scan)); query.Columns.Add(DQSelectColumn.Field("NetWeight", weight)); + query.Columns.Add(DQSelectColumn.Field("ID", detail)); query.Columns.Add(DQSelectColumn.Field("LoadTime", main)); - query.Columns.Add(DQSelectColumn.Field("ID", weight)); query.Columns.Add(DQSelectColumn.Field("Goods_Code", detail)); + query.Columns.Add(DQSelectColumn.Field("Weight", temp)); - query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.IsNull(DQExpression.Field(relate, "ScanBar_ID")), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); - + query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.IsNull(DQExpression.Field(relate, "SaleOutStore_ID")), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create(main, "ID")); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create(weight, "NetWeight", true)); using (var session = Dmo.NewSession()) { var list = new List(); var ids = new List(); + var discont = new Dictionary(); using (var reader = session.ExecuteReader(query)) { while (reader.Read()) { + var id = (long)reader[0]; + if (!ids.Contains(id)) + ids.Add(id); var entity = new CarcassSaleOutStoreObj(); entity.BarCode = (string)reader[1]; - entity.Weight = ((Money?)reader[2]).EToDecimal(); - entity.Time = (DateTime?)reader[3]; - entity.GroupID = (long)reader[4]; + var wv = ((Money?)reader[2]).EToDecimal(); + entity.GroupID = (long)reader[3]; + if (wv < 0) + { + var first = list.FirstOrDefault(x => x.GroupID == entity.GroupID && x.BarCode == entity.BarCode); + if (first != null) + list.Remove(first); + continue; + } + entity.Time = (DateTime?)reader[4]; entity.SaleGoods_Code = (string)reader[5]; + entity.Weight = (decimal?)reader[6]; list.Add(entity); - ids.Add((long)reader[0]); } } - if (list.Count == 0) + if (ids.Count == 0) return; - - foreach (var g in list.GroupBy(x => x.GroupID)) + if (list.Any()) { - var first = true; - foreach (var item in g) + foreach (var g in list.GroupBy(x => x.GroupID)) { - if (first) - first = false; - else - item.Weight = 0; + var first = true; + foreach (var item in g) + { + if (first) + first = false; + else + item.Weight = 0; + } + } + + var slist = TraceBackInfoUtil.SplitList(list, 1000); + foreach (var items in slist) + { + var par = JsonConvert.SerializeObject(items); + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/CarcassSaleOutStoreRpc/UploadCarcassInfo", par); } } - var par = JsonConvert.SerializeObject(list); - var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/CarcassSaleOutStoreRpc/UploadCarcassInfo", par); foreach (var item in ids) - session.Insert(new SaleOutStoreBarCodeToMESLog { ScanBar_ID = item }); + session.Insert(new SaleOutStoreBarCodeToMESLog { SaleOutStore_ID = item }); session.Commit(); } @@ -108,6 +132,31 @@ namespace BWP.B3QingDaoWanFu.Tasks { get { return "上传审核的销售出库扫码信息到MES"; } } + + class Temp + { + public long GroupID { get; set; } + public decimal? Weight { get; set; } + + public static DQueryDom GetQueryDom() + { + var main = new JoinAlias(typeof(SaleOutStore)); + var relate = new JoinAlias(typeof(SaleOutStoreBarCodeToMESLog)); + var detail = new JoinAlias(typeof(SaleOutStore_Detail)); + var weight = new JoinAlias(typeof(WeightingInfor)); + var query = new DQueryDom(main); + query.From.AddJoin(JoinType.Left, new DQDmoSource(relate), DQCondition.EQ(main, "ID", relate, "SaleOutStore_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "SaleOutStore_ID")); + query.From.AddJoin(JoinType.Left, new DQDmoSource(weight), DQCondition.And(DQCondition.EQ(detail, "ID", weight, "DetailID"), DQCondition.EQ(weight, "BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))))); + + query.Columns.Add(DQSelectColumn.Field("ID", detail)); + query.Columns.Add(DQSelectColumn.Sum(weight, "NetWeight")); + query.GroupBy.Expressions.Add(DQExpression.Field(detail, "ID")); + + query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", 单据状态.已审核), DQCondition.IsNull(DQExpression.Field(relate, "SaleOutStore_ID")), DQCondition.IsNotNull(DQExpression.Field(weight, "ID")))); + return query; + } + } } class CarcassSaleOutStoreObj diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index ef2ba1d..9f9823f 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -161,15 +161,32 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs query.Columns.Add(DQSelectColumn.Field("Car_Name", bill)); query.Columns.Add(DQSelectColumn.Field("LoadTime", bill)); query.Columns.Add(DQSelectColumn.Field("BarCode", scan)); + query.Columns.Add(DQSelectColumn.Field("NetWeight", weight)); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ(detail, "SaleOutStore_ID", id), DQCondition.IsNotNull(DQExpression.Field(scan, "ID")))); - - var list = query.EExecuteList(session); - if (!list.Any()) - return new List(); - - var letList = list.Select(x => new TractBillSaleInfo { Code = x.Item4, SendCustomer = x.Item1, CarNo = x.Item2, SendDate = x.Item3.ToString("yyyyMMdd") }).ToList(); - return letList; + query.OrderBy.Expressions.Add(DQOrderByExpression.Create(weight, "NetWeight", true)); + var list = new List(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var entity = new TractBillSaleInfo(); + entity.Code = (string)reader[3]; + var wv = (Money)reader[4]; + if (wv < 0) + { + var first = list.FirstOrDefault(x => x.Code == entity.Code); + if (first != null) + list.Remove(first); + continue; + } + entity.SendCustomer = (string)reader[0]; + entity.CarNo = (string)reader[1]; + entity.SendDate = ((DateTime)reader[2]).ToString("yyyyMMdd"); + list.Add(entity); + } + } + return list; } public override string Name From 384f428963ab215bd9cb6e00f75500388418c3e2 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Wed, 18 Apr 2018 22:18:38 +0800 Subject: [PATCH 29/43] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E6=8D=AE=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs | 3 ++- .../Pages/B3QingDaoWanFu/Reports/PayInfoExport.xml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs index ef18ac5..ba31fcf 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.cs @@ -52,12 +52,13 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports layout.Add("Date", new SimpleLabel("付款日期"), QueryCreator.DateRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate", DateTime.Today, null)); layout["Date"].NotAutoAddToContainer = true; - var config = new AutoLayoutConfig { Cols = 2 }; + var config = new AutoLayoutConfig { Cols = 4 }; config.Add("Date"); config.Add("ID"); config.Add("AccountingUnit_ID"); config.Add("Supplier_ID"); config.Add("PurchaseType_ID"); + config.Add("BillState"); layout.Config = config; vPanel.Add(layout.CreateLayout()); diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.xml b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.xml index 1262b74..8659d33 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.xml +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/PayInfoExport.xml @@ -28,6 +28,10 @@ + + + + \ No newline at end of file From 4169d8967f6db9dd80e7d606f71b051da875fdb9 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 19 Apr 2018 09:38:10 +0800 Subject: [PATCH 30/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139589=20?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Overlays/StatPayEdit_Ext.cs | 9 ++-- B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 52 +++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs index 1b21e71..e1eea3c 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayEdit_Ext.cs @@ -2,12 +2,14 @@ using BWP.Web.Pages.B3ButcherManage.Bills.StatPay_; using BWP.Web.WebControls; using Forks.EnterpriseServices.DataForm; +using Forks.EnterpriseServices.DomainObjects2.DQuery; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using TSingSoft.WebControls2; +using TSingSoft.WebPluginFramework; namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays { @@ -29,7 +31,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays editor.CanDeleteFunc = detail => false; editor.IsEditableFunc = (field, detail) => { - return CanSave && field.Name == "Money"; + return CanSave && field.Name == "ExtMoney"; }; _farmerGrid = panel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100), ShowLineNo = true }); @@ -39,8 +41,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Address")); _farmerGrid.Columns.Add(new DFEditGridColumn("Farmer_Tel")); _farmerGrid.Columns.Add(new DFEditGridColumn("Number")); - _farmerGrid.Columns.Add(new DFEditGridColumn("Weight")); - _farmerGrid.Columns.Add(new DFEditGridColumn("Money")); + _farmerGrid.Columns.Add(new DFEditGridColumn("ExeWeight")); + _farmerGrid.Columns.Add(new DFEditGridColumn("ExtMoney")); var section4 = mPageLayoutManager.AddSection("detailColumns4", "养殖户信息"); section4.ApplyLayout(_farmerGrid, mPageLayoutManager, DFInfo.Get(typeof(Weigh_FarmerDetail))); @@ -56,6 +58,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Overlays public override void AppToUI() { base.AppToUI(); + mDFContainer.MakeReadonly("ShackMoney"); _farmerGrid.DataBind(); } } diff --git a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs index 9fbdbff..504659d 100644 --- a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs @@ -28,6 +28,56 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs // } //} + [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterInsert))] + public class StatPayAfterInsertBLTypeIoc : StatPayBL.BaseBLIOCs.AfterInsert + { + public void Invoke(IDmoContext context, StatPay dmo) + { + if (dmo.Weigh_ID == null) + return; + var details = GetFarmerDetail(context.Session, dmo.Weigh_ID.Value); + var total = details.Sum(x => x.Item2 ?? 0); + foreach (var detail in details) + { + var arr = new List>(); + if (total != 0) + { + var v = dmo.RealWeight * detail.Item2 / total; + if (v.HasValue) + { + v = decimal.Round(v.Value, 2); + arr.Add(new Tuple("ExeWeight", v)); + } + } + if (detail.Item3 != null) + { + arr.Add(new Tuple("ExtMoney", detail.Item3)); + } + if (arr.Any()) + UpdateProperty(detail.Item1, context.Session, arr.ToArray()); + } + } + + List> GetFarmerDetail(IDmoSession session, long weightID) + { + var query = new DQueryDom(new JoinAlias(typeof(Weigh_FarmerDetail))); + query.Where.Conditions.Add(DQCondition.EQ("Weigh_ID", weightID)); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("Number")); + query.Columns.Add(DQSelectColumn.Field("Money")); + return query.EExecuteList(session); + } + + void UpdateProperty(long id, IDmoSession session, params Tuple[] par) + { + var update = new DQUpdateDom(typeof(Weigh_FarmerDetail)); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + foreach (var item in par) + update.Columns.Add(new DQUpdateColumn(item.Item1, item.Item2)); + session.ExecuteNonQuery(update); + } + } + [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))] @@ -50,6 +100,8 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs if (dmo.PurchaseType_Name == "业务") { + if (dmo.FarmerDetails.Any()) + dmo.ShackMoney = dmo.FarmerDetails.Sum(x => x.ExtMoney ?? 0); dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0); Money? we = null; if (dmo.ShackWeight != 0) From 43ab276e81c01ab9fc5541a07327bfcdaad8068b Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 19 Apr 2018 11:19:45 +0800 Subject: [PATCH 31/43] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139586=20?= =?UTF-8?q?=E5=9C=A8=E4=B8=87=E7=A6=8F=E6=A8=A1=E5=9D=97=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=8A=A5=E8=A1=A8=E3=80=90=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj | 9 ++ .../Overlays/StatPayList_Ext.cs | 20 +++ .../B3QingDaoWanFu/Reports/StatPayAnalyse.cs | 138 ++++++++++++++++++ .../B3QingDaoWanFu/Reports/StatPayAnalyse.xml | 53 +++++++ B3QingDaoWanFu.Web/PluginClass.cs | 1 + B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 4 +- .../config/plugins/B3QingDaoWanFu.plugin | 1 + 7 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Overlays/StatPayList_Ext.cs create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.cs create mode 100644 B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/StatPayAnalyse.xml diff --git a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj index 4eb9c99..fc00557 100644 --- a/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj +++ b/B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj @@ -164,6 +164,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind @@ -173,6 +176,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind @@ -204,6 +210,9 @@ + + +
客户存货名称规格件数主单位计划数量数量发货标记复称数量备注
客户存货名称规格件数主单位计划数量数量发货标记复称数量备注