|
|
|
@ -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<decimal>? SecondNumber { get; set; } |
|
|
|
public string Goods_SecondUnit { get; set; } |
|
|
|
public string Remark { get; set; } |
|
|
|
public string Customer_Name { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static DQueryDom GetSaleOutStoreSumDetails(List<long> 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<CarLoadingGoodsSumDetailData>(); |
|
|
|
if (Dmo.BillDetails.Count > 0) { |
|
|
|
var billInfo = Dmo.BillDetails.Select(detail => new Tuple<short, long>(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<decimal>?)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<object>(() => GetPrintStyle(Dmo))); |
|
|
|
|