|
|
@ -4,6 +4,7 @@ using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using BWP.B3Frameworks; |
|
|
using BWP.B3Frameworks; |
|
|
using BWP.B3Frameworks.Utils; |
|
|
using BWP.B3Frameworks.Utils; |
|
|
|
|
|
using BWP.B3QingDaoWanFu.BL; |
|
|
using BWP.B3QingDaoWanFu.Utils; |
|
|
using BWP.B3QingDaoWanFu.Utils; |
|
|
using BWP.B3Sale.BL; |
|
|
using BWP.B3Sale.BL; |
|
|
using BWP.B3Sale.BO; |
|
|
using BWP.B3Sale.BO; |
|
|
@ -26,16 +27,10 @@ namespace BWP.B3QingDaoWanFu.Rpc |
|
|
var bl = BIFactory.Create<IGatheringBL>(context); |
|
|
var bl = BIFactory.Create<IGatheringBL>(context); |
|
|
// bl.InitNewDmo(dmo);
|
|
|
// bl.InitNewDmo(dmo);
|
|
|
dmo.Domain_ID = DomainContext.Current.ID; |
|
|
dmo.Domain_ID = DomainContext.Current.ID; |
|
|
var dom = new DQueryDom(new JoinAlias(typeof(Customer))); |
|
|
|
|
|
dom.Columns.Add(DQSelectColumn.Field("AccountCustomer_ID")); |
|
|
|
|
|
dom.Columns.Add(DQSelectColumn.Field("AccountCustomer_Name")); |
|
|
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ("OuterCode", dmo.AccountCustomer_OuterCode));//
|
|
|
|
|
|
//找到该客户对应的结账客户
|
|
|
|
|
|
var info = dom.EExecuteScalar<long, string>(context.Session); |
|
|
|
|
|
if (info == null) |
|
|
|
|
|
throw new ApplicationException(string.Format("没有配置外部编码{0}的对应结账客户", dmo.AccountCustomer_OuterCode)); |
|
|
|
|
|
dmo.AccountCustomer_ID = info.Item1; |
|
|
|
|
|
dmo.AccountCustomer_Name = info.Item2; |
|
|
|
|
|
|
|
|
var customerId = BIFactory.Create<ICustomerDeviceSetBL>().GetAccountCustomer_ID(dmo.AccountCustomer_OuterCode); |
|
|
|
|
|
if (customerId == 0) |
|
|
|
|
|
throw new ApplicationException(string.Format("没有设备号{0}的对应结账客户", dmo.AccountCustomer_OuterCode)); |
|
|
|
|
|
dmo.AccountCustomer_ID = customerId; |
|
|
|
|
|
|
|
|
SetAccountCustomerInfo(dmo, context.Session); |
|
|
SetAccountCustomerInfo(dmo, context.Session); |
|
|
|
|
|
|
|
|
@ -67,7 +62,6 @@ namespace BWP.B3QingDaoWanFu.Rpc |
|
|
private static void SetAccountCustomerInfo(Gathering dmo, IDmoSessionWithTransaction session) |
|
|
private static void SetAccountCustomerInfo(Gathering dmo, IDmoSessionWithTransaction session) |
|
|
{ |
|
|
{ |
|
|
var dom = new DQueryDom(new JoinAlias(typeof(Customer))); |
|
|
var dom = new DQueryDom(new JoinAlias(typeof(Customer))); |
|
|
new Customer().Employee_ID = 1; |
|
|
|
|
|
dom.Columns.Add(DQSelectColumn.Field("Department_ID")); |
|
|
dom.Columns.Add(DQSelectColumn.Field("Department_ID")); |
|
|
dom.Columns.Add(DQSelectColumn.Field("Employee_ID")); |
|
|
dom.Columns.Add(DQSelectColumn.Field("Employee_ID")); |
|
|
dom.Columns.Add(DQSelectColumn.Field("Department_Name")); |
|
|
dom.Columns.Add(DQSelectColumn.Field("Department_Name")); |
|
|
@ -83,7 +77,7 @@ namespace BWP.B3QingDaoWanFu.Rpc |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
throw new ApplicationException(string.Format("不存在编号为{0}的客户", dmo.AccountCustomer_OuterCode)); |
|
|
|
|
|
|
|
|
throw new ApplicationException(string.Format("不存在ID为{0}的客户", dmo.AccountCustomer_ID)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|