Browse Source

需求单No.137623

master
wugang 8 years ago
parent
commit
0aa8fe05e8
5 changed files with 129 additions and 40 deletions
  1. +1
    -0
      BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj
  2. +78
    -37
      BWP.B3_YunKen.Web/Pages/B3YunKen/Reports/DynamicPriceReport.cs
  3. +2
    -2
      BWP.B3_YunKen.Web/Pages/B3YunKen/Reports/DynamicPriceReport.xml
  4. +38
    -0
      BWP.B3_YunKen.Web/Pages/TypeIOCs/SaleForecastPrintAfterAddParameters.cs
  5. +10
    -1
      BWP.B3_YunKen/B3YunKenOnlineConfiguration.cs

+ 1
- 0
BWP.B3_YunKen.Web/BWP.B3_YunKen.Web.csproj View File

@ -158,6 +158,7 @@
<Compile Include="Pages\TypeIOCs\GatheringPrintTypeIOC.cs" />
<Compile Include="Pages\TypeIOCs\GoodsApplyBasePropertiesIOC.cs" />
<Compile Include="Pages\TypeIOCs\ProductInStore_TempIOC.cs" />
<Compile Include="Pages\TypeIOCs\SaleForecastPrintAfterAddParameters.cs" />
<Compile Include="Pages\TypeIOCs\SaleGoodsBasePropertiesIOC.cs">
<SubType>Code</SubType>
</Compile>


+ 78
- 37
BWP.B3_YunKen.Web/Pages/B3YunKen/Reports/DynamicPriceReport.cs View File

@ -19,6 +19,7 @@ using BWP.B3UnitedInfos.BO;
using BWP.B3Sale.Utils;
using BWP.B3Sale.BO;
using BWP.B3Frameworks.BO;
using Forks.Utils;
namespace BWP.Web.Pages.B3YunKen.Reports
{
@ -54,15 +55,15 @@ namespace BWP.Web.Pages.B3YunKen.Reports
//layout["ID"].NotAutoAddToContainer = true;
layout.Add("AccountingUnit_ID", new SimpleLabel("会计单位"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["AccountingUnit_ID"], mQueryContainer, "AccountingUnit_ID", B3FrameworksConsts.DataSources.));
layout["AccountingUnit_ID"].NotAutoAddToContainer = true;
layout.Add("StandardGoods_ID", new SimpleLabel("标准件"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "StandardGoods_ID", B3SaleDataSources.));
layout["StandardGoods_ID"].NotAutoAddToContainer = true;
//layout.Add("StandardGoods_ID", new SimpleLabel("标准件"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "StandardGoods_ID", B3SaleDataSources.标准件));
//layout["StandardGoods_ID"].NotAutoAddToContainer = true;
//layout.Add("GoodsProperty_ID", new SimpleLabel("存货属性"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "GoodsProperty_ID", B3UnitedInfosConsts.DataSources.存货属性全部));
//layout["GoodsProperty_ID"].NotAutoAddToContainer = true;
//layout.Add("BrandItem_ID", new SimpleLabel("品牌项"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "BrandItem_ID", B3UnitedInfosConsts.DataSources.品牌项));
//layout["BrandItem_ID"].NotAutoAddToContainer = true;
layout.Add("ProductLine_ID", new SimpleLabel("产品线"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "ProductLine_ID", B3UnitedInfosConsts.DataSources.线));
layout["ProductLine_ID"].NotAutoAddToContainer = true;
layout.Add("Goods_ID", new SimpleLabel("非标准件"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "Goods_ID", B3UnitedInfosConsts.DataSources.));
layout.Add("Goods_ID", new SimpleLabel("存货"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], mQueryContainer, "Goods_ID", B3UnitedInfosConsts.DataSources.));
layout["Goods_ID"].NotAutoAddToContainer = true;
//layout.Add("Date", new SimpleLabel("生产日期"), QueryCreator.TimeRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
@ -78,7 +79,7 @@ namespace BWP.Web.Pages.B3YunKen.Reports
//config.Add("GoodsProperty_ID");
//config.Add("BrandItem_ID");
config.Add("ProductLine_ID");
config.Add("StandardGoods_ID");
//config.Add("StandardGoods_ID");
config.Add("Goods_ID");
//config.Add("Date");
//config.Add("BillState");
@ -95,17 +96,14 @@ namespace BWP.Web.Pages.B3YunKen.Reports
//mDisplayHelper.AddOptionItem("部门", "bill", "Department_Name", false);
//mDisplayHelper.AddOptionItem("经办人", "bill", "Employee_Name", false);
//mDisplayHelper.AddOptionItem("客户", "bill", "Customer_Name", false);
mDisplayHelper.AddOptionItem("存货属性", "convert", "GoodsProperty_Name", false);
mDisplayHelper.AddOptionItem("存货属性", "goods", "GoodsProperty_Name", false);
//mDisplayHelper.AddOptionItem("品牌项", "detail", "BrandItem_Name", false);
mDisplayHelper.AddOptionItem("产品线", "goods", "ProductLine_Name", false);
mDisplayHelper.AddOptionItem("存货编号", "convert", "Goods_Code", false);
mDisplayHelper.AddOptionItem("存货名称", "convert", "Goods_Name", false);
mDisplayHelper.AddOptionItem("主单位", "convert", "Goods_MainUnit", false);
mDisplayHelper.AddOptionItem("单价", () => {
return DQExpression.Add(DQExpression.Multiply(DQExpression.Field(JoinAlias.Create("detail"), "Price"), DQExpression.IfNull(DQExpression.Field(JoinAlias.Create("convert"), "Multiplier"), DQExpression.Value(1))), DQExpression.IfNull(DQExpression.Field(JoinAlias.Create("convert"), "Diff"), DQExpression.Value(0)));
}, true);
mDisplayHelper.AddOptionItem("标准件", "detail", "Goods_Name", false);
mDisplayHelper.AddOptionItem("标准单价", "detail", "Price", false);
mDisplayHelper.AddOptionItem("存货编号", "goods", "Code", false);
mDisplayHelper.AddOptionItem("存货名称", "goods", "Name", false);
mDisplayHelper.AddOptionItem("主单位", "goods", "MainUnit", false);
mDisplayHelper.AddOptionItem("标准件", "detail", "StandardName", false);
mDisplayHelper.AddOptionItem("单价", "detail", "Price", false);
AddQueryOption("选项", mDisplayHelper.GetAllDisplayNames(), mDisplayHelper.GetDefaultSelelectedDisplayNames());
base.AddQueryOptions(vPanel);
}
@ -128,42 +126,85 @@ namespace BWP.Web.Pages.B3YunKen.Reports
public long ID { get; set; }
}
protected override DQueryDom GetQueryDom()
private DQueryDom GetPriceBillPrice()
{
var dom = base.GetQueryDom();
var bill = dom.From.RootSource.Alias;
mDisplayHelper.AddAlias("bill", JoinAlias.Create("bill"));
var detail = new JoinAlias("detail", typeof(PriceBill_Detail));
var convert = new JoinAlias("convert", typeof(StandardConvert));
var goods = new JoinAlias("goods", typeof(SaleGoods));
var priceBillID = new JoinAlias("priceBillID", typeof(PriceBillID));
var accountingUnit = new JoinAlias("accountingUnit", typeof(AccountingUnit));
mDisplayHelper.AddAlias("detail", JoinAlias.Create("detail"));
mDisplayHelper.AddAlias("convert", JoinAlias.Create("convert"));
mDisplayHelper.AddAlias("goods", JoinAlias.Create("goods"));
mDisplayHelper.AddAlias("accountingUnit", JoinAlias.Create("accountingUnit"));
dom.RegisterQueryTable(typeof(PriceBillID), new string[] { "AccountingUnit_ID","ID" }, GetMaxPriceBillID());
var bill = new JoinAlias("a",typeof(PriceBill));
var detail = new JoinAlias("b",typeof(PriceBill_Detail));
var priceBillID = new JoinAlias("c", typeof(PriceBillID));
var query = new DQueryDom(bill);
query.From.AddJoin(JoinType.Inner, new DQDmoSource(priceBillID), DQCondition.EQ(bill, "ID", priceBillID, "ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(bill, "ID", detail, "PriceBill_ID"));
query.Columns.Add(DQSelectColumn.Field("AccountingUnit_ID", priceBillID));
query.Columns.Add(DQSelectColumn.Field("SaleGoods_ID",detail));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value("标准件"), "StandardName"));
query.Columns.Add(DQSelectColumn.Field("Price",detail));
return query;
}
class PriceBillID2
{
public long? AccountingUnit_ID { get; set; }
public long ID { get; set; }
}
private DQueryDom GetPriceBillChildPrice()
{
var detail = new JoinAlias("d",typeof(PriceBill_Detail));
var convert = new JoinAlias("e",typeof(StandardConvert));
var priceBillID = new JoinAlias("f",typeof(PriceBillID2));
var bill = new JoinAlias("g",typeof(PriceBill));
var dom = new DQueryDom(bill);
dom.From.AddJoin(JoinType.Inner, new DQDmoSource(priceBillID), DQCondition.EQ(bill, "ID", priceBillID, "ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(accountingUnit), DQCondition.EQ(priceBillID, "AccountingUnit_ID", accountingUnit, "ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(bill, "ID", detail, "PriceBill_ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(convert), DQCondition.EQ(detail, "SaleGoods_ID", convert, "StandardGoods_ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(convert, "Goods_ID", goods, "ID"));
dom.Columns.Add(DQSelectColumn.Field("AccountingUnit_ID", priceBillID));
dom.Columns.Add(DQSelectColumn.Field("Goods_ID", convert));
dom.Columns.Add(DQSelectColumn.Field("StandardGoods_Name", convert));
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Add(DQExpression.Multiply(DQExpression.Field(detail, "Price"), DQExpression.IfNull(DQExpression.Field(convert, "Multiplier"), DQExpression.Value(1))), DQExpression.IfNull(DQExpression.Field(convert, "Diff"), DQExpression.Value(0))),"GoodsPrice"));
dom.Where.Conditions.Add(DQCondition.IsNotNull(DQExpression.Field(convert, "Goods_ID")));
return dom;
}
class PriceBillData
{
public long? AccountingUnit_ID { get; set; }
public long? Goods_ID { get; set; }
public string StandardName { get; set; }
public Money<decimal>? Price { get; set; }
}
protected override DQueryDom GetQueryDom()
{
var query1 = GetPriceBillChildPrice();
query1.UnionNext.Select = GetPriceBillPrice();
query1.UnionNext.Type = UnionType.All;
var detail = new JoinAlias("detail", typeof(PriceBillData));
mDisplayHelper.AddAlias("detail", JoinAlias.Create("detail"));
var accountingUnit = new JoinAlias("accountingUnit", typeof(AccountingUnit));
mDisplayHelper.AddAlias("accountingUnit", JoinAlias.Create("accountingUnit"));
var goods = new JoinAlias("goods", typeof(SaleGoods));
mDisplayHelper.AddAlias("goods", JoinAlias.Create("goods"));
var dom = new DQueryDom(detail);
dom.RegisterQueryTable(typeof(PriceBillID), new string[] { "AccountingUnit_ID", "ID" }, GetMaxPriceBillID());
dom.RegisterQueryTable(typeof(PriceBillID2), new string[] { "AccountingUnit_ID", "ID" }, GetMaxPriceBillID());
dom.RegisterQueryTable(typeof(PriceBillData), new string[] { "AccountingUnit_ID", "Goods_ID","StandardName", "Price" }, query1);
dom.From.AddJoin(JoinType.Left, new DQDmoSource(accountingUnit), DQCondition.EQ(detail, "AccountingUnit_ID", accountingUnit, "ID"));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(detail, "Goods_ID", goods, "ID"));
var goodsChb = mQueryContainer.GetControl<DFChoiceBox>("Goods_ID");
var standChb = mQueryContainer.GetControl<DFChoiceBox>("StandardGoods_ID");
var lineChb = mQueryContainer.GetControl<DFChoiceBox>("ProductLine_ID");
if (!standChb.IsEmpty) {
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "SaleGoods_ID"), standChb.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
}
var accountingUnitChb = mQueryContainer.GetControl<DFChoiceBox>("AccountingUnit_ID");
if (!goodsChb.IsEmpty) {
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(convert, "Goods_ID"), goodsChb.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "Goods_ID"), goodsChb.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
}
if (!lineChb.IsEmpty) {
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(goods, "ProductLine_ID"), lineChb.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
}
dom.Where.Conditions.Add(DQCondition.EQ(goods, "IsStandard",true));
dom.GroupBy.Expressions.Add(DQExpression.Field(convert, "Multiplier"));
dom.GroupBy.Expressions.Add(DQExpression.Field(convert, "Diff"));
if (!accountingUnitChb.IsEmpty) {
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "AccountingUnit_ID"), accountingUnitChb.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
}
mDisplayHelper.AddSelectColumns(dom, (name) => OptionIsSelected("选项", name), SumColumnIndexs);
return dom;
}


+ 2
- 2
BWP.B3_YunKen.Web/Pages/B3YunKen/Reports/DynamicPriceReport.xml View File

@ -6,12 +6,12 @@
<From>
<DmoClass class="BWP.B3Sale.BO.PriceBill, B3Sale" alias="bill"/>
</From>
<Where>
<!--<Where>
<And>
<QBEIn>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</QBEIn>
</And>
</Where>
</Where>-->
</Select>

+ 38
- 0
BWP.B3_YunKen.Web/Pages/TypeIOCs/SaleForecastPrintAfterAddParameters.cs View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3_YunKen;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.MoneyTemplate;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.Utils;
using BWP.B3Sale.BO;
using TSingSoft.WebPluginFramework;
using BWP.Web.Pages.B3Sale.Bills.CustomerAccept_;
namespace BWP.Web.Pages.TypeIOCs
{
[TypeIOC(typeof(CustomerAcceptPrint), typeof(CustomerAcceptPrint.AfterAddParameters))]
class CustomerAcceptPrintAfterAddParameters : CustomerAcceptPrint.AfterAddParameters
{
public void Invoke(IDictionary<string, object> dic, CustomerAccept dmo)
{
var html = new StringBuilder();
var config = new B3YunKenOnlineConfiguration();
var str = config.CustomerAcceptPrint.Value.Split(',');
html.Append("<style type=\"text/css\">");
html.Append("#tblId td{font-size:" + str[2] + "px;margin-top:20px;}");
html.Append("</style>");
html.Append("<table style=\"border-collapse:collapse;\" bordercolor=\"black\" id = \"tblId\" cellpadding=\"3\" cellspacing=\"0\" border = \"1\" width=\"" + str[0] + "\" height=\"" + str[1] + "\" >");
html.Append("<tr><td colspan=\"2\" align=\"center\" >客户出门证No." + dmo.ID + "</td></tr>");
html.Append("<tr><td>发货时间:</td><td>" + dmo.LoadTime==null?string.Empty:dmo.LoadTime.ToString() + "</td></tr>");
html.Append("<tr><td>购货客户:</td><td>" + dmo.Customer_Name + "</td></tr>");
html.Append("<tr><td>运输车辆:</td><td>" + dmo.Car_Name + "</td></tr>");
html.Append("<tr><td>经 办 人:</td><td>" + BLContext.User.Name + "</td></tr>");
html.Append("</table>");
dic.Add("$YunKen", html.ToString());
}
}
}

+ 10
- 1
BWP.B3_YunKen/B3YunKenOnlineConfiguration.cs View File

@ -28,7 +28,16 @@ namespace BWP.B3_YunKen
set { mSaleOutStorePrint = value; }
}
private StringConfigRef mCustomerAcceptPrint = new StringConfigRef("200,200,12");
[LogicName("耘垦客户验收单打印参数配置")]
[ConfigurationItemGroup("耘垦模块")]
[ConfigurationItemDescription("按表格宽,高,字体大小来配置,例如:200,200,12")]
[DomainConfigurationItem]
public StringConfigRef CustomerAcceptPrint
{
get { return mCustomerAcceptPrint; }
set { mCustomerAcceptPrint = value; }
}
private IntConfigRef mAccountUnit_ID = new IntConfigRef(1);


Loading…
Cancel
Save