|
|
|
@ -12,6 +12,7 @@ using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using BWP.B3UnitedInfos.BO; |
|
|
|
using Forks.EnterpriseServices.BusinessInterfaces; |
|
|
|
|
|
|
|
namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ |
|
|
|
{ |
|
|
|
@ -46,7 +47,10 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ |
|
|
|
str.Append(@"<table border='1' width='100%'>"); |
|
|
|
|
|
|
|
str.Append("<tr><td>订单号</td><td>发货时间</td><td>购货客户</td><td>存货</td><td>调整数量</td><td>规格</td><td>备注</td></tr>"); |
|
|
|
var details = GetOrderDetail(); |
|
|
|
var detailsnotnull = GetOrderDetail(false); |
|
|
|
var detailsnull = GetOrderDetail(true); |
|
|
|
var details = detailsnotnull.Concat(detailsnull); |
|
|
|
|
|
|
|
foreach (IGrouping<string, ProductionNotification_Detail> grouping in details.GroupBy(x=>x.GoodsProperty_Name)) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -60,19 +64,69 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ |
|
|
|
return str.ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
private List<ProductionNotification_Detail> GetOrderDetail() |
|
|
|
private List<ProductionNotification_Detail> GetOrderDetail(bool isordernull) |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(OutputConfigure_Detail))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("OutputConfigure_ID", GetConfigID())); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("OrderByProperty")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("GoodsProperty_ID")); |
|
|
|
var detail = new JoinAlias("dt",typeof(ProductionNotification_Detail)); |
|
|
|
var goods = new JoinAlias("goods", typeof(Goods)); |
|
|
|
var configDetail = new JoinAlias("cdt",typeof(OutputConfigure_Detail)); |
|
|
|
var dom = new DQueryDom(detail); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods),DQCondition.EQ(goods, "ID", detail, "Goods_ID")); |
|
|
|
var configDetail = new JoinAlias("cdt",typeof(OutputConfigureDetailTmp)); |
|
|
|
var dom = new DQueryDom(goods); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail),DQCondition.EQ(goods, "ID", detail, "Goods_ID")); |
|
|
|
dom.RegisterQueryTable(typeof(OutputConfigureDetailTmp),new List<string> { "OrderByProperty", "GoodsProperty_ID"}, query); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(configDetail),DQCondition.EQ(configDetail, "GoodsProperty_ID", goods, "GoodsProperty_ID")); |
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ("ProductionNotification_ID",Dmo.ID)); |
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(configDetail, "OutputConfigure_ID", GetConfigID())); |
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(detail,"ProductionNotification_ID",Dmo.ID)); |
|
|
|
if(isordernull) |
|
|
|
dom.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field(configDetail, "OrderByProperty"))); |
|
|
|
else |
|
|
|
dom.Where.Conditions.Add(DQCondition.IsNotNull(DQExpression.Field(configDetail, "OrderByProperty"))); |
|
|
|
dom.OrderBy.Expressions.Add(DQOrderByExpression.Create(configDetail, "OrderByProperty")); |
|
|
|
var r = dom.EExecuteDmoList<ProductionNotification_Detail>(); |
|
|
|
return r; |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Order_ID", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("LoadTime", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Customer_ID", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Customer_Name", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Goods_ID", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Goods_Spec", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Goods_Name", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("GoodsProperty_ID", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("GoodsProperty_Name", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("SendNumber", detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Remark",detail)); |
|
|
|
dom.Columns.Add(DQSelectColumn.Field("ID", detail)); |
|
|
|
var list = new List<ProductionNotification_Detail>(); |
|
|
|
using (var context = new TransactionContext()) |
|
|
|
{ |
|
|
|
using (var reader = context.Session.ExecuteReader(dom)) |
|
|
|
{ |
|
|
|
while (reader.Read()) |
|
|
|
{ |
|
|
|
var det = new ProductionNotification_Detail() |
|
|
|
{ |
|
|
|
Order_ID = (long)reader[0], |
|
|
|
LoadTime = (DateTime?)reader[1], |
|
|
|
Customer_ID = (long?)reader[2], |
|
|
|
Customer_Name = (string)reader[3], |
|
|
|
Goods_ID = (long?)reader[4], |
|
|
|
Goods_Spec = (string)reader[5], |
|
|
|
Goods_Name = (string)reader[6], |
|
|
|
GoodsProperty_ID = (long?)reader[7], |
|
|
|
GoodsProperty_Name = (string)reader[8], |
|
|
|
SendNumber = (Money<decimal>?)reader[9], |
|
|
|
Remark = (string)reader[10], |
|
|
|
ID=(long)reader[11] |
|
|
|
}; |
|
|
|
list.Add(det); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
class OutputConfigureDetailTmp |
|
|
|
{ |
|
|
|
public int? OrderByProperty { get; set; } |
|
|
|
public long? GoodsProperty_ID { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
long GetConfigID() |
|
|
|
@ -81,6 +135,9 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ |
|
|
|
dom.Columns.Add(DQSelectColumn.Max("ID")); |
|
|
|
var Id = dom.EExecuteScalar<long>(); |
|
|
|
return Id; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private string Get其他出库相同产品并行显示() |
|
|
|
@ -90,13 +147,13 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ |
|
|
|
AddSolidSType(str); |
|
|
|
str.Append(@"<table border='1' width='100%'>"); |
|
|
|
|
|
|
|
str.Append("<tr><td>其他出库单号</td><td>存货</td><td>规格</td><td>数量</td><td>主单位</td><td>辅单位数量</td><td>辅单位</td><td>税率</td></tr>"); |
|
|
|
str.Append("<tr><td>其他出库单号</td><td>存货</td><td>规格</td><td>数量</td><td>主单位</td><td>辅单位数量</td><td>辅单位</td><td>备注</td></tr>"); |
|
|
|
|
|
|
|
foreach (IGrouping<string, ProductionNotificationOutStore_Detail> grouping in Dmo.OutDetails.GroupBy(x => x.Goods_Name)) |
|
|
|
{ |
|
|
|
foreach (ProductionNotificationOutStore_Detail detail in grouping) |
|
|
|
{ |
|
|
|
str.Append("<tr><td>" + detail.OtherOutStore_ID + "</td><td>" + detail.Goods_Name +"</td><td>" + detail.Goods_Spec + "</td><td>" + detail.Number + "</td><td>" + detail.Goods_MainUnit + "</td><td>" + detail.SecondNumber + "</td><td>" + detail.Goods_SecondUnit + "</td><td>" + detail.TaxRate + "</td></tr>"); |
|
|
|
str.Append("<tr><td>" + detail.OtherOutStore_ID + "</td><td>" + detail.Goods_Name +"</td><td>" + detail.Goods_Spec + "</td><td>" + detail.Number + "</td><td>" + detail.Goods_MainUnit + "</td><td>" + detail.SecondNumber + "</td><td>" + detail.Goods_SecondUnit + "</td><td>" + detail.Remark + "</td></tr>"); |
|
|
|
} |
|
|
|
str.Append("<tr><td colspan='3'>合计</td><td>" + (Money<二位小数>?)grouping.Sum(x => (x.Number ?? 0).Value)+ "</td><td></td><td>"+ (Money<二位小数>?)grouping.Sum(x => (x.SecondNumber ?? 0).Value) + "</td><td></td><td></td></tr>"); |
|
|
|
} |
|
|
|
|