luanhui 8 years ago
parent
commit
31825a295f
1 changed files with 36 additions and 8 deletions
  1. +36
    -8
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs

+ 36
- 8
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/Reports/ComprehensiveReport.cs View File

@ -15,6 +15,7 @@ using System.Text;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using BWP.B3Frameworks.BO.MoneyTemplate; using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3ProduceUnitedInfos.BO; using BWP.B3ProduceUnitedInfos.BO;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.SqlDoms; using Forks.EnterpriseServices.SqlDoms;
using TSingSoft.WebControls2; using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework; using TSingSoft.WebPluginFramework;
@ -44,6 +45,24 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
base.InitBrowseGrid(grid); base.InitBrowseGrid(grid);
grid.DataFilter = (table) => grid.DataFilter = (table) =>
{ {
decimal sum皮肉重量 = 0;
foreach (DFDataRow row in table.Rows)
{
try
{
var = row["皮肉重量"];
var = row["皮重"];
var = (Money<>?)(objToDecimal() + objToDecimal());
row["皮肉重量"] = ;
sum皮肉重量 += (??0);
var = objToDecimal(row["到厂毛重"]);
row["皮肉比"] = Math.Round((double)( / * 100), 2);
}
catch{}
}
try try
{ {
table.SumRow["毛重单价"] = (Money<>?)(objToDecimal(table.SumRow["应付金额"]) / objToDecimal(table.SumRow["到厂毛重"])); table.SumRow["毛重单价"] = (Money<>?)(objToDecimal(table.SumRow["应付金额"]) / objToDecimal(table.SumRow["到厂毛重"]));
@ -54,19 +73,28 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
table.SumRow["实付单价"] = (Money<>?)(objToDecimal(table.SumRow["实付金额"]) / objToDecimal(table.SumRow["到厂毛重"])); table.SumRow["实付单价"] = (Money<>?)(objToDecimal(table.SumRow["实付金额"]) / objToDecimal(table.SumRow["到厂毛重"]));
} }
catch {} catch {}
try
{
table.SumRow["实付单价"] = (Money<>?)(objToDecimal(table.SumRow["实付金额"]) / objToDecimal(table.SumRow["到厂毛重"]));
}
catch {}
try
{
table.SumRow["皮肉重量"] = sum皮肉重量;
}
catch {}
}; };
} }
decimal? objToDecimal(object obj)
decimal objToDecimal(object obj)
{ {
if (obj == null) if (obj == null)
{ {
return null;
return 0;
} }
var r = Convert.ToDecimal(obj); var r = Convert.ToDecimal(obj);
if (r == 0)
return null;
return r; return r;
} }
@ -258,8 +286,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
GroupSumColumnIndexs.Add(query.Columns.Count - 1); GroupSumColumnIndexs.Add(query.Columns.Count - 1);
break; break;
case "皮肉比": case "皮肉比":
var =DQExpression.Multiply( .ESafeDivide(),DQExpression.Value(100)).ECastType<Money<>>();
query.Columns.Add(DQSelectColumn.Create(, "皮肉比"));
// var 皮肉比 =DQExpression.Multiply( 皮肉重量.ESafeDivide(榜前重量),DQExpression.Value(100)).ECastType<Money<金额>>();
query.Columns.Add(DQSelectColumn.Create(DQExpression.NULL.ECastType<decimal?>(), "皮肉比"));
break; break;
case "一二级比": case "一二级比":
var = DQExpression.Add( var = DQExpression.Add(
@ -512,7 +540,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
query.Where.Conditions.Add(DQCondition.EQ(bill, "Date", stat, "Date")); query.Where.Conditions.Add(DQCondition.EQ(bill, "Date", stat, "Date"));
query.Where.Conditions.Add(DQCondition.EQ(statdetail, "Technics",.)); query.Where.Conditions.Add(DQCondition.EQ(statdetail, "Technics",.));
query.Where.Conditions.Add(DQCondition.GreaterThan(stat,"BillState",.));
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(stat,"BillState",.));
query.Columns.Add(DQSelectColumn.Sum(statdetail, "Number")); query.Columns.Add(DQSelectColumn.Sum(statdetail, "Number"));
return query; return query;
@ -526,7 +554,7 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.Reports
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "ByProduct_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "ByProduct_ID"));
query.Where.Conditions.Add(DQCondition.EQ(bill, "Date", main, "ButcherDate")); query.Where.Conditions.Add(DQCondition.EQ(bill, "Date", main, "ButcherDate"));
query.Where.Conditions.Add(DQCondition.GreaterThan(main, "BillState", .));
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(main, "BillState", .));
// query.Where.Conditions.Add(DQCondition.EQ(DQExpression.Snippet("CAST(CONVERT(varchar(10), [bill].[Date], 120 )as smalldatetime)"), DQExpression.Snippet("CAST(CONVERT(varchar(10), [byproduct].[ButcherDate], 120 )as smalldatetime)"))); // query.Where.Conditions.Add(DQCondition.EQ(DQExpression.Snippet("CAST(CONVERT(varchar(10), [bill].[Date], 120 )as smalldatetime)"), DQExpression.Snippet("CAST(CONVERT(varchar(10), [byproduct].[ButcherDate], 120 )as smalldatetime)")));


Loading…
Cancel
Save