Browse Source

需求单No.139547 【生产通知单】增加按照‘选择其他出库单’选择数据源,未审核的其他出库单

master
duanluohua 7 years ago
parent
commit
c891c3bb08
8 changed files with 306 additions and 7 deletions
  1. +6
    -0
      B3_DongFangWanQi.Web/B3_DongFangWanQi.Web.csproj
  2. +51
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationEdit.cs
  3. +58
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOtherOutStoreDialog.cs
  4. +45
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOtherOutStoreDialog.xml
  5. +1
    -0
      B3_DongFangWanQi/B3_DongFangWanQi.csproj
  6. +46
    -7
      B3_DongFangWanQi/BL/ProductionNotificationBL_/ProductionNotificationBL.cs
  7. +12
    -0
      B3_DongFangWanQi/BO/Bill/ProductionNotification_/ProductionNotification.cs
  8. +87
    -0
      B3_DongFangWanQi/BO/Bill/ProductionNotification_/ProductionNotificationOutStore_Detail.cs

+ 6
- 0
B3_DongFangWanQi.Web/B3_DongFangWanQi.Web.csproj View File

@ -167,6 +167,9 @@
<Compile Include="Pages\B3_DongFangWanQi\Bills\ProductionNotification_\SelectOrderDialog.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3_DongFangWanQi\Bills\ProductionNotification_\SelectOtherOutStoreDialog.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3_DongFangWanQi\Tools\SaleOrderUpdateEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -223,6 +226,9 @@
<ItemGroup>
<EmbeddedResource Include="Overlays\CarLoadingAnalyse_\CarLoadingAnalyse.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3_DongFangWanQi\Bills\ProductionNotification_\SelectOtherOutStoreDialog.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


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

@ -25,6 +25,7 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
class ProductionNotificationEdit : B3SaleWorkFlowBillEditPage<ProductionNotification, IProductionNotificationBL>
{
private DFEditGrid _detailGrid;
private DFEditGrid _outdetailGrid;
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection section)
{
@ -46,8 +47,58 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
{
base.BuildBody(form);
CreateAccDetailPanel(form.EAdd(new TitlePanel("订单明细")));
CreateOutDetailPanel(form.EAdd(new TitlePanel("其他出库明细")));
}
private void CreateOutDetailPanel(TitlePanel titlePanel)
{
var vPanel = new VLayoutPanel();
titlePanel.Controls.Add(vPanel);
if (CanSave)
{
var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left));
var selectOut = hPanel.Add(new DialogButton {
Text = "选择其他出库"
});
selectOut.DialogTitle = "选择其他出库";
selectOut.Url = "SelectOtherOutStoreDialog.aspx";
selectOut.Click += delegate
{
var resultDetails = DialogUtil.GetCachedObj<ProductionNotificationOutStore_Detail>(this);
mBL.LoadOutDetailsByOrders(Dmo, resultDetails);
_outdetailGrid.DataBind();
};
var buttonDele = hPanel.Add(new TSButton("删除"));
buttonDele.Click += delegate
{
_outdetailGrid.GetFromUI();
var details = _outdetailGrid.GetSelectedItems();
foreach (ProductionNotificationOutStore_Detail item in details)
{
Dmo.OutDetails.Remove(item);
}
_outdetailGrid.DataBind();
};
}
var detailEditor = new DFCollectionEditor<ProductionNotificationOutStore_Detail>(() => Dmo.OutDetails);
detailEditor.CanSelectFunc = (detail) => CanSave;
detailEditor.IsEditableFunc = (field, detail) => CanSave;
_outdetailGrid = vPanel.Add(new DFEditGrid(detailEditor) { Width = Unit.Percentage(100), MultiSelectionEnabled = true });
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("OtherOutStore_ID"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Name"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Spec"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_MainUnit"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_SecondUnit"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("GoodsBatch_Name"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("TaxRate"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Price"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("AccountMoney"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Number"));
_outdetailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("SecondNumber"));
}
private void CreateAccDetailPanel(TitlePanel titlePanel)
{


+ 58
- 0
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOtherOutStoreDialog.cs View File

@ -0,0 +1,58 @@
using B3_DongFangWanQi.BO;
using BWP.B3UnitedInfos.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forks.EnterpriseServices.DataForm;
using TSingSoft.WebControls2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.Web.Layout;
namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
{
class SelectOtherOutStoreDialog : DmoMultiSelectDialog<OtherOutStore, ProductionNotificationOutStore_Detail>
{
protected override void CreateQuery(VLayoutPanel vPanel)
{
var layoutManager = new LayoutManager("", mDFInfo, mQueryContainer);
var config = new AutoLayoutConfig();
config.Add("ID");
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Time");
config.Add("OtherOutStoreType_ID");
config.Add("Store_ID");
config.Add("Employee_ID");
layoutManager.Config = config;
vPanel.Add(layoutManager.CreateLayout());
base.CreateQuery(vPanel);
}
protected override void CreateQueryGridColumns(DFBrowseGrid grid)
{
grid.Columns.Add(new DFBrowseGridColumn("ID"));
grid.Columns.Add(new DFBrowseGridColumn("AccountingUnit_Name"));
grid.Columns.Add(new DFBrowseGridColumn("Department_Name"));
grid.Columns.Add(new DFBrowseGridColumn("Time"));
grid.Columns.Add(new DFBrowseGridColumn("OtherOutStoreType_Name"));
grid.Columns.Add(new DFBrowseGridColumn("Store_Name"));
grid.Columns.Add(new DFBrowseGridColumn("Employee_Name"));
}
protected override void SetResultFromDFDataRow(ProductionNotificationOutStore_Detail dmo, DFDataRow row)
{
dmo.OtherOutStore_ID = (long)row["ID"];
}
protected override DQueryDom GetQueryDom()
{
var dom = base.GetQueryDom();
var bill = dom.From.RootSource.Alias;
dom.Where.Conditions.Add(DQCondition.EQ("BillState", .));
return dom;
}
}
}

+ 45
- 0
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOtherOutStoreDialog.xml View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3UnitedInfos.BO.OtherOutStore, B3UnitedInfos"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Department_ID"/>
<QBE paramName="Department_ID"/>
</EQ>
<EQ>
<Field name="OtherOutStoreType_ID"/>
<QBE paramName="OtherOutStoreType_ID"/>
</EQ>
<EQ>
<Field name="Store_ID"/>
<QBE paramName="Store_ID"/>
</EQ>
<EQ>
<Field name="Employee_ID"/>
<QBE paramName="Employee_ID"/>
</EQ>
<GreaterThanOrEqual>
<Field name="Time"/>
<QBE paramName="MinTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Time"/>
<QBE paramName="MaxTime"/>
</LessThanOrEqual>
</And>
</Where>
</Select>

+ 1
- 0
B3_DongFangWanQi/B3_DongFangWanQi.csproj View File

@ -110,6 +110,7 @@
<Compile Include="BO\Bill\Outputforecast.cs" />
<Compile Include="BO\Bill\OutputForecast_Detail.cs" />
<Compile Include="BO\Bill\ProductionNotification_\ProductionNotification.cs" />
<Compile Include="BO\Bill\ProductionNotification_\ProductionNotificationOutStore_Detail.cs" />
<Compile Include="BO\Bill\ProductionNotification_\ProductionNotification_Detail.cs" />
<Compile Include="BO\OutputConfigure.cs" />
<Compile Include="BO\OutputConfigure_Detail.cs" />


+ 46
- 7
B3_DongFangWanQi/BL/ProductionNotificationBL_/ProductionNotificationBL.cs View File

@ -12,6 +12,8 @@ using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.Utils;
using TSingSoft.WebPluginFramework;
using BWP.B3UnitedInfos.BL;
using BWP.B3UnitedInfos.BO;
namespace B3_DongFangWanQi.BL
{
@ -22,6 +24,7 @@ namespace B3_DongFangWanQi.BL
{
void UpdateUnitNumber(ProductionNotification dmo);
void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails);
void LoadOutDetailsByOrders(ProductionNotification dmo, IList<ProductionNotificationOutStore_Detail> resultDetails);
void UpdateSaleOutStoreUnitNum(ProductionNotification dmo);
}
@ -43,8 +46,8 @@ namespace B3_DongFangWanQi.BL
{
foreach (ProductionNotification_Detail detail in dmo.Details)
{
var query=new DQueryDom(new JoinAlias(typeof(Order_Detail)));
query.Where.Conditions.Add(DQCondition.EQ("ID",detail.OrderDetail_ID));
var query = new DQueryDom(new JoinAlias(typeof(Order_Detail)));
query.Where.Conditions.Add(DQCondition.EQ("ID", detail.OrderDetail_ID));
query.Columns.Add(DQSelectColumn.Field("UnitNum"));
var unitnum = query.EExecuteScalar<Money<decimal>?>(Session);
detail.SendNumber = unitnum;
@ -53,9 +56,9 @@ namespace B3_DongFangWanQi.BL
}
}
public void LoadDetailsByOrders(ProductionNotification dmo,IList<ProductionNotification_Detail> resultDetails)
public void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails)
{
// dmo.Details.Clear();
// dmo.Details.Clear();
var orderbl = BIFactory.Create<IOrderBL>(Session);
foreach (ProductionNotification_Detail detail in resultDetails)
@ -90,7 +93,7 @@ namespace B3_DongFangWanQi.BL
public void UpdateSaleOutStoreUnitNum(ProductionNotification dmo)
{
var outstorebl = BIFactory.Create<ISaleOutStoreBL>(Session);
foreach (IGrouping<long, ProductionNotification_Detail> grouping in dmo.Details.GroupBy(x=>x.Order_ID))
foreach (IGrouping<long, ProductionNotification_Detail> grouping in dmo.Details.GroupBy(x => x.Order_ID))
{
var orderid = grouping.Key;
var saleoutstoreid = GetSaleOutStoreId(orderid);
@ -113,10 +116,46 @@ namespace B3_DongFangWanQi.BL
private long? GetSaleOutStoreId(long orderid)
{
var query=new DQueryDom(new JoinAlias(typeof(SaleOutStore)));
query.Where.Conditions.Add(DQCondition.EQ("Order_ID",orderid));
var query = new DQueryDom(new JoinAlias(typeof(SaleOutStore)));
query.Where.Conditions.Add(DQCondition.EQ("Order_ID", orderid));
query.Columns.Add(DQSelectColumn.Field("ID"));
return query.EExecuteScalar<long?>(Session);
}
public void LoadOutDetailsByOrders(ProductionNotification dmo, IList<ProductionNotificationOutStore_Detail> resultDetails)
{
var otheroutStore = BIFactory.Create<IOtherOutStoreBL>(Session);
foreach (ProductionNotificationOutStore_Detail detail in resultDetails)
{
var outstore = otheroutStore.Load(detail.OtherOutStore_ID);
foreach (OtherOutStore_Detail outstoreDetail in outstore.Details)
{
if (dmo.OutDetails.Any(x => x.OtherOutStore_ID == outstore.ID && x.OtherOutStoreDetail_ID == outstoreDetail.ID))
{
continue;
}
var dmodetail = new ProductionNotificationOutStore_Detail()
{
OtherOutStore_ID = outstore.ID,
OtherOutStoreDetail_ID = outstoreDetail.ID,
Goods_ID = outstoreDetail.Goods_ID,
Goods_Name = outstoreDetail.Goods_Name,
Goods_Spec = outstoreDetail.Goods_Spec,
GoodsBatch_ID = outstoreDetail.GoodsBatch_ID,
GoodsBatch_Name = outstoreDetail.GoodsBatch_Name,
Goods_MainUnit = outstoreDetail.Goods_MainUnit,
Goods_SecondUnit = outstoreDetail.Goods_SecondUnit,
Number = outstoreDetail.Number,
AccountMoney = outstoreDetail.AccountMoney,
CargoSpace_ID = outstoreDetail.CargoSpace_ID,
CargoSpace_Name = outstoreDetail.CargoSpace_Name,
Price = outstoreDetail.Price,
SecondNumber = outstoreDetail.SecondNumber,
TaxRate = outstoreDetail.TaxRate,
};
dmo.OutDetails.Add(dmodetail);
}
}
}
}
}

+ 12
- 0
B3_DongFangWanQi/BO/Bill/ProductionNotification_/ProductionNotification.cs View File

@ -41,6 +41,18 @@ namespace B3_DongFangWanQi.BO
}
}
readonly ProductionNotificationOutStore_DetailCollection _outdetails = new ProductionNotificationOutStore_DetailCollection();
[OneToMany(typeof(ProductionNotificationOutStore_Detail), "ID")]
[Join("ID", "ProductionNotification_ID")]
public ProductionNotificationOutStore_DetailCollection OutDetails
{
get
{
return _outdetails;
}
}
public Money<>? Money { get; set; }
}
}

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

@ -0,0 +1,87 @@
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3UnitedInfos.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
using System;
using TSingSoft.WebControls2;
namespace B3_DongFangWanQi.BO
{
[DFClass, Serializable, LogicName("生产通知明细")]
public class ProductionNotificationOutStore_Detail: Base
{
public long ProductionNotification_ID { get; set; }
[LogicName("其他出库单号")]
public long OtherOutStore_ID { get; set; }
[LogicName("其他出库单明细号")]
public long? OtherOutStoreDetail_ID { get; set; }
[LogicName("存货")]
public long? Goods_ID { get; set; }
[LogicName("存货")]
[ReferenceTo(typeof(Goods), "Name")]
[Join("Goods_ID", "ID")]
public string Goods_Name { get; set; }
[LogicName("规格")]
[ReferenceTo(typeof(Goods), "Spec")]
[Join("Goods_ID", "ID")]
public string Goods_Spec { get; set; }
[LogicName("主单位")]
[ReferenceTo(typeof(Goods), "MainUnit")]
[Join("Goods_ID", "ID")]
public string Goods_MainUnit { get; set; }
[LogicName("辅单位")]
[ReferenceTo(typeof(Goods), "SecondUnit")]
[Join("Goods_ID", "ID")]
public string Goods_SecondUnit { get; set; }
[LogicName("存货批号")]
public long? GoodsBatch_ID { get; set; }
[ReferenceTo(typeof(GoodsBatch), "Name")]
[Join("GoodsBatch_ID", "ID")]
[DFPrompt("批号")]
public string GoodsBatch_Name { get; set; }
[LogicName("货位ID")]
[DFPrompt("货位")]
public long? CargoSpace_ID { get; set; }
[ReferenceTo(typeof(CargoSpace), "Name")]
[Join("CargoSpace_ID", "ID")]
[DFPrompt("货位")]
public string CargoSpace_Name { get; set; }
[LogicName("税率")]
[DFExtProperty("WebControlType", DFEditControl.PercentageInput)]
public Money<>? TaxRate { get; set; }
[LogicName("单价")]
public Money<decimal>? Price { get; set; }
[LogicName("往来金额")]
public Money<>? AccountMoney { get; set; }
[LogicName("数量")]
public Money<decimal>? Number { get; set; }
[LogicName("辅单位数量")]
public Money<decimal>? SecondNumber { get; set; }
}
[Serializable]
public class ProductionNotificationOutStore_DetailCollection : DmoCollection<ProductionNotificationOutStore_Detail>
{
}
}

Loading…
Cancel
Save