Browse Source

个性需求

master
luanhui 8 years ago
parent
commit
cc59be985b
4 changed files with 62 additions and 1 deletions
  1. +8
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationEdit.cs
  2. +20
    -1
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOrderDialog.cs
  3. +1
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOrderDialog.xml
  4. +33
    -0
      B3_DongFangWanQi/BL/ProductionNotificationBL_/ProductionNotificationBL.cs

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

@ -72,6 +72,14 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
mBL.UpdateUnitNumber(Dmo); mBL.UpdateUnitNumber(Dmo);
_detailGrid.DataBind(); _detailGrid.DataBind();
}; };
var buttonUpdateOutStore = hPanel.Add(new TSButton("更改出库数量"));
buttonUpdateOutStore.Click += delegate
{
_detailGrid.GetFromUI();
mBL.UpdateSaleOutStoreUnitNum(Dmo);
AspUtil.Alert(this,"更新成功");
};
} }
var detailEditor = new DFCollectionEditor<ProductionNotification_Detail>(() => Dmo.Details); var detailEditor = new DFCollectionEditor<ProductionNotification_Detail>(() => Dmo.Details);
detailEditor.AllowDeletionFunc = () => CanSave; detailEditor.AllowDeletionFunc = () => CanSave;


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

@ -4,22 +4,32 @@ using System.Linq;
using System.Text; using System.Text;
using B3_DongFangWanQi.BO; using B3_DongFangWanQi.BO;
using BWP.B3Frameworks; using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.NamedValueTemplate; using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3Sale.BO; using BWP.B3Sale.BO;
using BWP.Web.Layout; using BWP.Web.Layout;
using BWP.Web.Utils; using BWP.Web.Utils;
using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery; using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using TSingSoft.WebControls2; using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
{ {
class SelectOrderDialog: DmoMultiSelectDialog<Order, ProductionNotification_Detail> class SelectOrderDialog: DmoMultiSelectDialog<Order, ProductionNotification_Detail>
{ {
private DFChoiceBox _liuchengfenlei;
protected override void CreateQuery(VLayoutPanel vPanel) protected override void CreateQuery(VLayoutPanel vPanel)
{ {
var layoutManager = new LayoutManager("", mDFInfo, mQueryContainer); var layoutManager = new LayoutManager("", mDFInfo, mQueryContainer);
_liuchengfenlei = QueryCreator.DFChoiceBox(mDFInfo.Fields["ID"], B3FrameworksConsts.DataSources.);
layoutManager.Add("DepartmentWorkFlowStateCategory_ID", new SimpleLabel("流程状态分类"), _liuchengfenlei);
layoutManager["DepartmentWorkFlowStateCategory_ID"].NotAutoAddToContainer = true;
var config = new AutoLayoutConfig(); var config = new AutoLayoutConfig();
config.Add("ID"); config.Add("ID");
config.Add("Customer_ID"); config.Add("Customer_ID");
@ -31,6 +41,8 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
config.Add("SaleKind_ID"); config.Add("SaleKind_ID");
config.Add("OrderDate"); config.Add("OrderDate");
config.Add("LoadTime"); config.Add("LoadTime");
config.Add("DepartmentWorkFlowStateCategory_ID");
layoutManager.Config = config; layoutManager.Config = config;
vPanel.Add(layoutManager.CreateLayout()); vPanel.Add(layoutManager.CreateLayout());
base.CreateQuery(vPanel); base.CreateQuery(vPanel);
@ -52,9 +64,16 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
protected override DQueryDom GetQueryDom() protected override DQueryDom GetQueryDom()
{ {
var dom= base.GetQueryDom(); var dom= base.GetQueryDom();
// var bill = dom.From.RootSource.Alias;
var bill = dom.From.RootSource.Alias;
dom.Where.Conditions.Add(DQCondition.EQ("BillState",.)); dom.Where.Conditions.Add(DQCondition.EQ("BillState",.));
var flowdetail = new JoinAlias("flowdetail", typeof(DepartmentWorkFlow_Detail));
dom.From.AddJoin(JoinType.Left, new DQDmoSource(flowdetail), DQCondition.EQ(bill, "DepartmentWorkFlow_Detail_ID", flowdetail, "ID"));
if (!_liuchengfenlei.IsEmpty)
{
dom.Where.Conditions.Add(DQCondition.EQ(flowdetail, "DepartmentWorkFlowStateCategory_ID", long.Parse(_liuchengfenlei.Value)));
}
return dom; return dom;
} }
} }


+ 1
- 0
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/SelectOrderDialog.xml View File

@ -96,6 +96,7 @@
<Field name="Carrier_ID"/> <Field name="Carrier_ID"/>
<QBE paramName ="Carrier_ID"/> <QBE paramName ="Carrier_ID"/>
</EQ> </EQ>
<Contains> <Contains>
<Field name="Code"/> <Field name="Code"/>
<QBE paramName="Code"/> <QBE paramName="Code"/>


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

@ -22,6 +22,7 @@ namespace B3_DongFangWanQi.BL
{ {
void UpdateUnitNumber(ProductionNotification dmo); void UpdateUnitNumber(ProductionNotification dmo);
void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails); void LoadDetailsByOrders(ProductionNotification dmo, IList<ProductionNotification_Detail> resultDetails);
void UpdateSaleOutStoreUnitNum(ProductionNotification dmo);
} }
public class ProductionNotificationBL : SaleDepartmentWorkFlowBillBL<ProductionNotification>, IProductionNotificationBL public class ProductionNotificationBL : SaleDepartmentWorkFlowBillBL<ProductionNotification>, IProductionNotificationBL
@ -80,5 +81,37 @@ 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))
{
var orderid = grouping.Key;
var saleoutstoreid = GetSaleOutStoreId(orderid);
if (saleoutstoreid.HasValue)
{
var outstore = outstorebl.Load(saleoutstoreid.Value);
foreach (SaleOutStore_Detail detail in outstore.Details)
{
var fd = grouping.FirstOrDefault(x => x.Goods_ID == detail.SaleGoods_ID);
if (fd != null)
{
detail.UnitNum = fd.LoadCarNumber;
}
}
outstorebl.Update(outstore);
}
}
}
private long? GetSaleOutStoreId(long 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);
}
} }
} }

Loading…
Cancel
Save