Browse Source

需求单No.137418

master
robin 8 years ago
parent
commit
90b4cfb0cd
6 changed files with 92 additions and 211 deletions
  1. +9
    -21
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/BaseInfos/OutputConfigureEdit.cs
  2. +5
    -11
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/OutputForecastEdit.cs
  3. +40
    -95
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOederUpdateList.cs
  4. +5
    -5
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOrderUpdateEdit.cs
  5. +16
    -40
      B3_DongFangWanQi/BO/Bill/OutputForecast_Detail.cs
  6. +17
    -39
      B3_DongFangWanQi/BO/OutputConfigure_Detail.cs

+ 9
- 21
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/BaseInfos/OutputConfigureEdit.cs View File

@ -3,14 +3,9 @@ using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using B3_DongFangWanQi.BL; using B3_DongFangWanQi.BL;
using B3_DongFangWanQi.BO; using B3_DongFangWanQi.BO;
using BWP.B3Frameworks.Utils;
using BWP.B3Sale.BO;
using BWP.B3Sale.Utils;
using BWP.B3UnitedInfos.Utils;
using BWP.B3UnitedInfos;
using BWP.Web.Layout; using BWP.Web.Layout;
using BWP.Web.Utils;
using BWP.Web.WebControls; using BWP.Web.WebControls;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DataForm;
using TSingSoft.WebControls2; using TSingSoft.WebControls2;
@ -32,8 +27,8 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.BaseInfos {
private void CreateDetail(TitlePanel titlePanel) { private void CreateDetail(TitlePanel titlePanel) {
if (CanSave) { if (CanSave) {
var hPanel = titlePanel.EAdd(new HLayoutPanel()); var hPanel = titlePanel.EAdd(new HLayoutPanel());
hPanel.Add(new LiteralControl("<h2>选择存货:</h2>"));
var goodsSelect = hPanel.Add(new ChoiceBox(B3SaleDataSources.) {
hPanel.Add(new LiteralControl("<h2>选择存货属性:</h2>"));
var goodsSelect = hPanel.Add(new ChoiceBox(B3UnitedInfosConsts.DataSources._存货属性) {
Width = Unit.Pixel(160), Width = Unit.Pixel(160),
EnableInputArgument = true, EnableInputArgument = true,
AutoPostBack = true AutoPostBack = true
@ -46,19 +41,14 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.BaseInfos {
_grid.GetFromUI(); _grid.GetFromUI();
foreach (var id in goodsSelect.GetValues()) { foreach (var id in goodsSelect.GetValues()) {
var selectID = long.Parse(id); var selectID = long.Parse(id);
if (Dmo.Details.Any(x => x.Goods_ID == selectID))
continue;
using (var context = new TransactionContext()) {
var goods = InnerBLUtil.GetSingleDmo<SaleGoods>(context.Session, "ID", selectID, "Name", "Code", "PrintShortName");
if (Dmo.Details.Any(x => x.GoodsProperty_ID == selectID))
continue;
Dmo.Details.Add(new OutputConfigure_Detail { Dmo.Details.Add(new OutputConfigure_Detail {
Goods_ID = selectID,
Goods_Name = goods.Name,
Goods_Code = goods.Code,
Goods_Spec = goods.Spec,
PrintShortName = goods.PrintShortName
GoodsProperty_ID = selectID,
GoodsProperty_Name = goodsSelect.DisplayValue,
}); });
} }
}
_grid.DataBind(); _grid.DataBind();
goodsSelect.Clear(); goodsSelect.Clear();
}; };
@ -70,9 +60,7 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.BaseInfos {
detailEditor.CanDeleteFunc = detail => CanSave; detailEditor.CanDeleteFunc = detail => CanSave;
detailEditor.IsEditableFunc = (field, detail) => CanSave; detailEditor.IsEditableFunc = (field, detail) => CanSave;
_grid = titlePanel.EAdd(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100), ShowLineNo = true }); _grid = titlePanel.EAdd(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100), ShowLineNo = true });
_grid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Name"));
_grid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Code"));
_grid.Columns.Add(new DFEditGridColumn<DFValueLabel>("PrintShortName"));
_grid.Columns.Add(new DFEditGridColumn<DFValueLabel>("GoodsProperty_Name"));
_grid.Columns.Add(new DFEditGridColumn<DFTextBox>("Number")); _grid.Columns.Add(new DFEditGridColumn<DFTextBox>("Number"));
_grid.Columns.Add(new DFEditGridColumn<DFTextBox>("Rate")); _grid.Columns.Add(new DFEditGridColumn<DFTextBox>("Rate"));


+ 5
- 11
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/OutputForecastEdit.cs View File

@ -69,26 +69,20 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills {
foreach (var detail in config.Details) { foreach (var detail in config.Details) {
var d = new OutputForecast_Detail(); var d = new OutputForecast_Detail();
DmoUtil.CopyDmoFields(detail, d, "ID"); DmoUtil.CopyDmoFields(detail, d, "ID");
DmoUtil.RefreshDependency(d, "Goods_ID");
d.Number = detail.Number * number;
if (d.Goods_UnitConvertDirection == . || d.Goods_UnitConvertDirection == .) {
d.SecondNumber = d.Number / (d.Goods_MainUnitRatio ?? 1) * (d.Goods_SecondUnitRatio ?? 1);
}
DmoUtil.RefreshDependency(d, "GoodsProperty_Name");
d.Number = detail.Number * number;
Dmo.Details.Add(d); Dmo.Details.Add(d);
} }
_detailGrid.DataBind(); _detailGrid.DataBind();
};
};
} }
var detailEditor = new DFCollectionEditor<OutputForecast_Detail>(() => Dmo.Details); var detailEditor = new DFCollectionEditor<OutputForecast_Detail>(() => Dmo.Details);
detailEditor.AllowDeletionFunc = () => CanSave; detailEditor.AllowDeletionFunc = () => CanSave;
detailEditor.CanDeleteFunc = (detail) => CanSave; detailEditor.CanDeleteFunc = (detail) => CanSave;
detailEditor.IsEditableFunc = (field, detail) => false; detailEditor.IsEditableFunc = (field, detail) => false;
_detailGrid = vPanel.Add(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100) }); _detailGrid = vPanel.Add(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100) });
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Name"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Code"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("PrintShortName"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("GoodsProperty_Name"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Number")); _detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Number"));
} }


+ 40
- 95
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOederUpdateList.cs View File

@ -130,20 +130,11 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
DFGridSetEnabled = false, DFGridSetEnabled = false,
}; };
_grid.Columns.Add(new DFBrowseGridColumn("Goods_Name"));
_grid.Columns.Add(new DFBrowseGridColumn("Goods_Code"));
_grid.Columns.Add(new DFBrowseGridColumn("SecondNumber"));
_grid.Columns.Add(new DFBrowseGridColumn("Goods_SecondUnit"));
_grid.Columns.Add(new DFBrowseGridColumn("UnitNum"));
_grid.Columns.Add(new DFBrowseGridColumn("Unit"));
_grid.Columns.Add(new DFBrowseGridColumn("库存辅数量"));
_grid.Columns.Add(new DFBrowseGridColumn("GoodsProperty_Name"));
_grid.Columns.Add(new DFBrowseGridColumn("UnitNum"));
_grid.Columns.Add(new DFBrowseGridColumn("库存数量")); _grid.Columns.Add(new DFBrowseGridColumn("库存数量"));
_grid.Columns.Add(new DFBrowseGridColumn("生产辅数量"));
_grid.Columns.Add(new DFBrowseGridColumn("生产数量"));
_grid.Columns.Add(new DFBrowseGridColumn("可用辅数量"));
_grid.Columns.Add(new DFBrowseGridColumn("可用数量"));
_grid.Columns.Add(new DFBrowseGridColumn("差异辅数量"));
_grid.Columns.Add(new DFBrowseGridColumn("测算数量"));
_grid.Columns.Add(new DFBrowseGridColumn("可用数量"));
_grid.Columns.Add(new DFBrowseGridColumn("差异数量")); _grid.Columns.Add(new DFBrowseGridColumn("差异数量"));
_grid.OnDetailDataBound += (htmlRow, dataRow, o) => { _grid.OnDetailDataBound += (htmlRow, dataRow, o) => {
@ -151,7 +142,7 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
if (row == null) if (row == null)
return; return;
var diff = (decimal?)row["差异数量"]; var diff = (decimal?)row["差异数量"];
var numberIndext = 13;
var numberIndext = 5;
var bt = new DialogButton(); var bt = new DialogButton();
bt.CssClass = "btn"; bt.CssClass = "btn";
bt.Text = htmlRow.Cells[numberIndext].InnerText; bt.Text = htmlRow.Cells[numberIndext].InnerText;
@ -167,9 +158,9 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
} }
htmlRow.Cells[numberIndext].InnerHtml = ""; htmlRow.Cells[numberIndext].InnerHtml = "";
htmlRow.Cells[numberIndext].Controls.Add(bt); htmlRow.Cells[numberIndext].Controls.Add(bt);
var idField = row["Goods_ID"];
var idField = row["GoodsProperty_ID"];
var number = ((decimal?)row["可用数量"]) ?? 0; var number = ((decimal?)row["可用数量"]) ?? 0;
var url = AspUtil.UpdateUrlParam("SaleOrderUpdateEdit.aspx", "Goods_ID", ((long)idField).ToString());
var url = AspUtil.UpdateUrlParam("SaleOrderUpdateEdit.aspx", "GoodsProperty_ID", ((long)idField).ToString());
url = AspUtil.UpdateUrlParam(url, "number", number.ToString()); url = AspUtil.UpdateUrlParam(url, "number", number.ToString());
bt.Url = url; bt.Url = url;
bt.Width = 100; bt.Width = 100;
@ -196,38 +187,28 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
private DQueryDom GetQueryDom() { private DQueryDom GetQueryDom() {
var bill = new JoinAlias(typeof(OrderTmp)); var bill = new JoinAlias(typeof(OrderTmp));
var goods = new JoinAlias(typeof(SaleGoods));
var goodsProperty = new JoinAlias(typeof(GoodsProperty));
var storeDetail = new JoinAlias(typeof(StoreDetailTmp)); var storeDetail = new JoinAlias(typeof(StoreDetailTmp));
var output = new JoinAlias(typeof(OutputTmp)); var output = new JoinAlias(typeof(OutputTmp));
var dom = new DQueryDom(bill); var dom = new DQueryDom(bill);
dom.RegisterQueryTable(typeof(OrderTmp), new[] { "Goods_ID", "Unit", "Number", "SecondNumber", "UnitNum" }, GetOrderDQueryDom());
dom.RegisterQueryTable(typeof(StoreDetailTmp), new[] { "Goods_ID", "Number", "SecondNumber" }, GetStoreDetailDQueryDom());
dom.RegisterQueryTable(typeof(OutputTmp), new[] { "Goods_ID", "Number", "SecondNumber" }, GetOutputDQueryDom());
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(bill, "Goods_ID", goods, "ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(storeDetail), DQCondition.EQ(bill, "Goods_ID", storeDetail, "Goods_ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(output), DQCondition.EQ(bill, "Goods_ID", output, "Goods_ID"));
dom.Columns.Add(DQSelectColumn.Field("Goods_ID", bill));
dom.Columns.Add(DQSelectColumn.Field("Goods_Name", bill));
dom.Columns.Add(DQSelectColumn.Field("Goods_Code", bill));
dom.Columns.Add(DQSelectColumn.Field("PrintShortName", bill));
dom.Columns.Add(DQSelectColumn.Field("UnitNum", bill));
dom.Columns.Add(DQSelectColumn.Field("Unit", bill));
dom.Columns.Add(DQSelectColumn.Field("SecondNumber", bill));
dom.Columns.Add(DQSelectColumn.Field("Goods_SecondUnit", bill));
dom.RegisterQueryTable(typeof(OrderTmp), new[] { "GoodsProperty_ID", "Number", "SecondNumber", "UnitNum" }, GetOrderDQueryDom());
dom.RegisterQueryTable(typeof(StoreDetailTmp), new[] { "GoodsProperty_ID", "Number", "SecondNumber" }, GetStoreDetailDQueryDom());
dom.RegisterQueryTable(typeof(OutputTmp), new[] { "GoodsProperty_ID", "Number" }, GetOutputDQueryDom());
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(bill, "GoodsProperty_ID", goodsProperty, "ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(storeDetail), DQCondition.EQ(bill, "GoodsProperty_ID", storeDetail, "GoodsProperty_ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(output), DQCondition.EQ(bill, "GoodsProperty_ID", output, "GoodsProperty_ID"));
dom.Columns.Add(DQSelectColumn.Field("GoodsProperty_ID", bill));
dom.Columns.Add(DQSelectColumn.Field("GoodsProperty_Name", bill));
dom.Columns.Add(DQSelectColumn.Field("UnitNum", bill));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "Number"), "库存数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "Number"), "库存数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "SecondNumber"), "库存辅数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(output, "Number"), "生产数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(output, "SecondNumber"), "生产辅数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(output, "Number"), "测算数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), "可用数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "SecondNumber").EAdd(DQExpression.Field(output, "SecondNumber")), "可用辅数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), "可用数量"));
dom.Columns.Add(DQSelectColumn.Create( dom.Columns.Add(DQSelectColumn.Create(
ESubtract(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")), "差异数量")); ESubtract(DQExpression.Field(storeDetail, "Number").EAdd(DQExpression.Field(output, "Number")), DQExpression.Field(bill, "UnitNum")), "差异数量"));
dom.Columns.Add(DQSelectColumn.Create(
ESubtract(DQExpression.Field(storeDetail, "SecondNumber").EAdd(DQExpression.Field(output, "SecondNumber")), DQExpression.Field(bill, "SecondNumber")), "差异辅数量"));
return dom;
return dom;
} }
static IDQExpression ESubtract(IDQExpression expression, IDQExpression right) { static IDQExpression ESubtract(IDQExpression expression, IDQExpression right) {
@ -236,8 +217,8 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
[DFClass] [DFClass]
class OrderTmp { class OrderTmp {
public long Goods_ID { get; set; }
[LogicName("存货属性")]
public long? GoodsProperty_ID { get; set; }
[LogicName("主数量")] [LogicName("主数量")]
public Money<decimal>? Number { get; set; } public Money<decimal>? Number { get; set; }
@ -247,47 +228,16 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
[LogicName("订货报价数量")] [LogicName("订货报价数量")]
public Money<decimal>? UnitNum { get; set; } public Money<decimal>? UnitNum { get; set; }
[LogicName("报价单位")]
public string Unit { get; set; }
[LogicName("存货名称")]
[ReferenceTo(typeof(SaleGoods), "Name")]
[Join("Goods_ID", "ID")]
public string Goods_Name { get; set; }
[ReferenceTo(typeof(SaleGoods), "Spell")]
[Join("Goods_ID", "ID")]
public string Goods_Spell { get; set; }
[LogicName("规格")]
[ReferenceTo(typeof(SaleGoods), "Spec")]
[Join("Goods_ID", "ID")]
public string Goods_Spec { get; set; }
[LogicName("存货编码")]
[ReferenceTo(typeof(SaleGoods), "Code")]
[Join("Goods_ID", "ID")]
public string Goods_Code { get; set; }
[LogicName("简称")]
[ReferenceTo(typeof(SaleGoods), "PrintShortName")]
[Join("Goods_ID", "ID")]
public string PrintShortName { get; set; }
[LogicName("主单位")]
[ReferenceTo(typeof(SaleGoods), "MainUnit")]
[Join("Goods_ID", "ID")]
public string Goods_MainUnit { get; set; }
[LogicName("辅单位")]
[ReferenceTo(typeof(SaleGoods), "SecondUnit")]
[Join("Goods_ID", "ID")]
public string Goods_SecondUnit { get; set; }
[LogicName("存货属性名称")]
[ReferenceTo(typeof(GoodsProperty), "Name")]
[Join("GoodsProperty_ID", "ID")]
public string GoodsProperty_Name { get; set; }
} }
class StoreDetailTmp { class StoreDetailTmp {
public long Goods_ID { get; set; }
public long GoodsProperty_ID { get; set; }
[LogicName("主数量")] [LogicName("主数量")]
public Money<decimal>? Number { get; set; } public Money<decimal>? Number { get; set; }
@ -298,7 +248,7 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
} }
class OutputTmp { class OutputTmp {
public long Goods_ID { get; set; }
public long GoodsProperty_ID { get; set; }
[LogicName("主数量")] [LogicName("主数量")]
public Money<decimal>? Number { get; set; } public Money<decimal>? Number { get; set; }
@ -322,14 +272,12 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID")); dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID"));
AddGoodsCondition(goodsPropertyCatalog, goodsProperty, dom); AddGoodsCondition(goodsPropertyCatalog, goodsProperty, dom);
dom.Columns.Add(DQSelectColumn.Field("SaleGoods_ID", detail));
dom.Columns.Add(DQSelectColumn.Field("Unit", detail));
dom.Columns.Add(DQSelectColumn.Field("ID", goodsProperty));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "Number")), "主数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "Number")), "主数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "SecondNumber")), "主数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "SecondNumber")), "主数量"));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "UnitNum")), "主数量")); dom.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field(detail, "UnitNum")), "主数量"));
dom.GroupBy.Expressions.Add(DQExpression.Field(detail, "SaleGoods_ID"));
dom.GroupBy.Expressions.Add(DQExpression.Field(detail, "Unit"));
dom.GroupBy.Expressions.Add(DQExpression.Field(goodsProperty, "ID"));
dom.Where.Conditions.Add(DQCondition.EQ("BillState", .)); dom.Where.Conditions.Add(DQCondition.EQ("BillState", .));
OrganizationUtil.AddOrganizationLimit(dom, typeof(Order)); OrganizationUtil.AddOrganizationLimit(dom, typeof(Order));
dom.Where.Conditions.Add(DQCondition.EQ(bill, "Domain_ID", DomainContext.Current.ID)); dom.Where.Conditions.Add(DQCondition.EQ(bill, "Domain_ID", DomainContext.Current.ID));
@ -353,11 +301,11 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
query.From.AddJoin(JoinType.Left, new DQDmoSource(store), DQCondition.EQ(store, "ID", storeDetail, "Store_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(store), DQCondition.EQ(store, "ID", storeDetail, "Store_ID"));
query.Columns.Add(DQSelectColumn.Field("Goods_ID"));
query.Columns.Add(DQSelectColumn.Field("ID", goodsProperty));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("Number")), "主数量")); query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("Number")), "主数量"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("SecondNumber")), "主数量")); query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("SecondNumber")), "主数量"));
query.GroupBy.Expressions.Add(DQExpression.Field("Goods_ID"));
query.GroupBy.Expressions.Add(DQExpression.Field(goodsProperty, "ID"));
query.Where.Conditions.Add(DQCondition.EQ(store, "Domain_ID", DomainContext.Current.ID)); query.Where.Conditions.Add(DQCondition.EQ(store, "Domain_ID", DomainContext.Current.ID));
@ -375,23 +323,20 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
var bill = new JoinAlias(typeof(OutputForecast)); var bill = new JoinAlias(typeof(OutputForecast));
var goodsPropertyCatalog = new JoinAlias(typeof(GoodsPropertyCatalog)); var goodsPropertyCatalog = new JoinAlias(typeof(GoodsPropertyCatalog));
var goodsProperty = new JoinAlias(typeof(GoodsProperty)); var goodsProperty = new JoinAlias(typeof(GoodsProperty));
var goods = new JoinAlias(typeof(SaleGoods));
var query = new DQueryDom(detail); var query = new DQueryDom(detail);
query.From.AddJoin(JoinType.Inner, new DQDmoSource(bill), query.From.AddJoin(JoinType.Inner, new DQDmoSource(bill),
DQCondition.EQ(bill, "ID", detail, "OutputForecast_ID")); DQCondition.EQ(bill, "ID", detail, "OutputForecast_ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(detail, "Goods_ID", goods, "ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goodsProperty, "ID", goods, "GoodsProperty_ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goodsProperty, "ID", detail, "GoodsProperty_ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID"));
AddGoodsCondition(goodsPropertyCatalog, goodsProperty, query); AddGoodsCondition(goodsPropertyCatalog, goodsProperty, query);
query.Columns.Add(DQSelectColumn.Field("Goods_ID"));
query.Columns.Add(DQSelectColumn.Field("GoodsProperty_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("Number")), "主数量")); query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("Number")), "主数量"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.Field("SecondNumber")), "主数量"));
query.GroupBy.Expressions.Add(DQExpression.Field("Goods_ID"));
query.GroupBy.Expressions.Add(DQExpression.Field("GoodsProperty_ID"));
query.Where.Conditions.Add(DQCondition.EQ(bill, "ID", id)); query.Where.Conditions.Add(DQCondition.EQ(bill, "ID", id));
return query; return query;
} }


+ 5
- 5
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Tools/SaleOrderUpdateEdit.cs View File

@ -23,11 +23,11 @@ using TSingSoft.WebPluginFramework.Controls;
namespace BWP.Web.Pages.B3_DongFangWanQi.Tools { namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
class SaleOrderUpdateEdit : AppBasePage { class SaleOrderUpdateEdit : AppBasePage {
long? SaleGoods_ID {
long? GoodsProperty_ID {
get { get {
if (string.IsNullOrEmpty(Request.QueryString["Goods_ID"]))
if (string.IsNullOrEmpty(Request.QueryString["GoodsProperty_ID"]))
return null; return null;
return long.Parse(Request.QueryString["Goods_ID"]);
return long.Parse(Request.QueryString["GoodsProperty_ID"]);
} }
} }
@ -341,8 +341,8 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Tools {
dom.Columns.Add(DQSelectColumn.Field("GoodsBatch_ID", detailAlias)); dom.Columns.Add(DQSelectColumn.Field("GoodsBatch_ID", detailAlias));
dom.Columns.Add(DQSelectColumn.Field("GoodsBatch_Name", detailAlias)); dom.Columns.Add(DQSelectColumn.Field("GoodsBatch_Name", detailAlias));
if (SaleGoods_ID != null) {
dom.Where.Conditions.Add(DQCondition.EQ(detailAlias, "SaleGoods_ID", SaleGoods_ID));
if (GoodsProperty_ID != null) {
dom.Where.Conditions.Add(DQCondition.EQ(goodsProperty, "ID", GoodsProperty_ID));
} }
if (AccountingUnit_ID != null) { if (AccountingUnit_ID != null) {


+ 16
- 40
B3_DongFangWanQi/BO/Bill/OutputForecast_Detail.cs View File

@ -1,66 +1,42 @@
using System; using System;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO; using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.NamedValueTemplate; using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3Sale.BO; using BWP.B3Sale.BO;
using BWP.B3UnitedInfos;
using BWP.B3UnitedInfos.BO;
using Forks.EnterpriseServices; using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils; using Forks.Utils;
namespace B3_DongFangWanQi.BO
{
namespace B3_DongFangWanQi.BO {
[DFClass, Serializable, LogicName("产值预测明细")] [DFClass, Serializable, LogicName("产值预测明细")]
public class OutputForecast_Detail : Base { public class OutputForecast_Detail : Base {
public long OutputForecast_ID { get; set; } public long OutputForecast_ID { get; set; }
[LogicName("存货")]
public long Goods_ID { get; set; }
[LogicName("产量")] [LogicName("产量")]
public Money<decimal>? Number { get; set; } public Money<decimal>? Number { get; set; }
[LogicName("辅数量")] [LogicName("辅数量")]
public Money<decimal>? SecondNumber { get; set; } public Money<decimal>? SecondNumber { get; set; }
[LogicName("比例")] [LogicName("比例")]
public Money<decimal>? Rate { get; set; } public Money<decimal>? Rate { get; set; }
[LogicName("存货名称")]
[ReferenceTo(typeof(SaleGoods), "Name")]
[Join("Goods_ID", "ID")]
public string Goods_Name { get; set; }
[LogicName("规格")]
[ReferenceTo(typeof(SaleGoods), "Spec")]
[Join("Goods_ID", "ID")]
public string Goods_Spec { get; set; }
[LogicName("存货编码")]
[ReferenceTo(typeof(SaleGoods), "Code")]
[Join("Goods_ID", "ID")]
public string Goods_Code { get; set; }
[LogicName("简称")]
[ReferenceTo(typeof(SaleGoods), "PrintShortName")]
[Join("Goods_ID", "ID")]
public string PrintShortName { get; set; }
[LogicName("主辅转换方向")]
[ReferenceTo(typeof(SaleGoods), "UnitConvertDirection")]
[Join("Goods_ID", "ID")]
public NamedValue<>? Goods_UnitConvertDirection { get; set; }
[LogicName("主辅换算主单位比例")]
[ReferenceTo(typeof(SaleGoods), "MainUnitRatio")]
[Join("Goods_ID", "ID")]
public Money<decimal>? Goods_MainUnitRatio { get; set; }
[LogicName("主辅换算辅单位比例")]
[ReferenceTo(typeof(SaleGoods), "SecondUnitRatio")]
[Join("Goods_ID", "ID")]
public Money<decimal>? Goods_SecondUnitRatio { get; set; }
[LogicName("存货属性")]
[DFDataKind(B3UnitedInfosConsts.DataSources.存货管理_存货属性)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3UnitedInfosConsts.DataSources.存货属性全部)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "GoodsProperty_Name")]
public long? GoodsProperty_ID { get; set; }
[LogicName("存货属性名称")]
[ReferenceTo(typeof(GoodsProperty), "Name")]
[Join("GoodsProperty_ID", "ID")]
public string GoodsProperty_Name { get; set; }
public long Goods_ID { get; set; }
} }
[Serializable] [Serializable]


+ 17
- 39
B3_DongFangWanQi/BO/OutputConfigure_Detail.cs View File

@ -1,8 +1,12 @@
using System; using System;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO; using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.NamedValueTemplate; using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3Sale.BO; using BWP.B3Sale.BO;
using BWP.B3UnitedInfos;
using BWP.B3UnitedInfos.BO;
using Forks.EnterpriseServices; using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataDictionary;
using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2; using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils; using Forks.Utils;
@ -13,9 +17,6 @@ namespace B3_DongFangWanQi.BO {
public long OutputConfigure_ID { get; set; } public long OutputConfigure_ID { get; set; }
[LogicName("存货")]
public long Goods_ID { get; set; }
[LogicName("产量")] [LogicName("产量")]
public Money<decimal>? Number { get; set; } public Money<decimal>? Number { get; set; }
@ -24,42 +25,19 @@ namespace B3_DongFangWanQi.BO {
[LogicName("比例")] [LogicName("比例")]
public Money<decimal>? Rate { get; set; } public Money<decimal>? Rate { get; set; }
[LogicName("存货名称")]
[ReferenceTo(typeof(SaleGoods), "Name")]
[Join("Goods_ID", "ID")]
public string Goods_Name { get; set; }
[LogicName("规格")]
[ReferenceTo(typeof(SaleGoods), "Spec")]
[Join("Goods_ID", "ID")]
public string Goods_Spec { get; set; }
[LogicName("存货编码")]
[ReferenceTo(typeof(SaleGoods), "Code")]
[Join("Goods_ID", "ID")]
public string Goods_Code { get; set; }
[LogicName("简称")]
[ReferenceTo(typeof(SaleGoods), "PrintShortName")]
[Join("Goods_ID", "ID")]
public string PrintShortName { get; set; }
[LogicName("主辅转换方向")]
[ReferenceTo(typeof(SaleGoods), "UnitConvertDirection")]
[Join("Goods_ID", "ID")]
public NamedValue<>? Goods_UnitConvertDirection { get; set; }
[LogicName("主辅换算主单位比例")]
[ReferenceTo(typeof(SaleGoods), "MainUnitRatio")]
[Join("Goods_ID", "ID")]
public Money<decimal>? Goods_MainUnitRatio { get; set; }
[LogicName("主辅换算辅单位比例")]
[ReferenceTo(typeof(SaleGoods), "SecondUnitRatio")]
[Join("Goods_ID", "ID")]
public Money<decimal>? Goods_SecondUnitRatio { get; set; }
[LogicName("存货属性")]
[DFDataKind(B3UnitedInfosConsts.DataSources.存货管理_存货属性)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3UnitedInfosConsts.DataSources.存货属性全部)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "GoodsProperty_Name")]
public long? GoodsProperty_ID { get; set; }
[LogicName("存货属性名称")]
[ReferenceTo(typeof(GoodsProperty), "Name")]
[Join("GoodsProperty_ID", "ID")]
public string GoodsProperty_Name { get; set; }
public long Goods_ID { get; set; }
} }
[Serializable] [Serializable]


Loading…
Cancel
Save