Browse Source

需求单No.139563

master
duanluohua 7 years ago
parent
commit
4404b52b14
5 changed files with 76 additions and 15 deletions
  1. +1
    -1
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationEdit.cs
  2. +68
    -11
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationPrint.cs
  3. +3
    -3
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOrderUpdateList.cs
  4. +1
    -0
      B3_DongFangWanQi/BL/ProductionNotificationBL_/ProductionNotificationBL.cs
  5. +3
    -0
      B3_DongFangWanQi/BO/Bill/ProductionNotification_/ProductionNotificationOutStore_Detail.cs

+ 1
- 1
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationEdit.cs View File

@ -94,7 +94,7 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_MainUnit"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("SecondNumber"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_SecondUnit"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("TaxRate"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Remark"));
}
private void CreateAccDetailPanel(TitlePanel titlePanel)


+ 68
- 11
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationPrint.cs View File

@ -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>");
}


+ 3
- 3
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOrderUpdateList.cs View File

@ -277,14 +277,14 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(output, "Number"), "分完数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(outputConfig, "StoreNum"), "当前库存"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(output, "Date"), "测算日期"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), "可用与预算合计"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(outputConfig, "StoreNum").EAdd(DQExpression.Field(output, "Number")), "可用与预算合计"));
dom.Columns.Add(DQSelectColumn.Field("UnitNum", bill));
dom.Columns.Add(DQSelectColumn.Create(
ESubtract(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")), "预计剩余数量"));
ESubtract(DQExpression.Field(outputConfig, "StoreNum").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")), "预计剩余数量"));
dom.Columns.Add(DQSelectColumn.Create(
ESubtract(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")).ESafeDivide(DQExpression.Field(outputConfig, "Number")).ECastType<Money<>?>(), "预计剩余头数"));
ESubtract(DQExpression.Field(outputConfig, "StoreNum").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")).ESafeDivide(DQExpression.Field(outputConfig, "Number")).ECastType<Money<>?>(), "预计剩余头数"));
return dom;
}


+ 1
- 0
B3_DongFangWanQi/BL/ProductionNotificationBL_/ProductionNotificationBL.cs View File

@ -152,6 +152,7 @@ namespace B3_DongFangWanQi.BL
Price = outstoreDetail.Price,
SecondNumber = outstoreDetail.SecondNumber,
TaxRate = outstoreDetail.TaxRate,
Remark = outstoreDetail.Remark
};
dmo.OutDetails.Add(dmodetail);
}


+ 3
- 0
B3_DongFangWanQi/BO/Bill/ProductionNotification_/ProductionNotificationOutStore_Detail.cs View File

@ -77,6 +77,9 @@ namespace B3_DongFangWanQi.BO
[LogicName("辅单位数量")]
public Money<decimal>? SecondNumber { get; set; }
[LogicName("备注")]
public string Remark { get; set; }
}


Loading…
Cancel
Save