diff --git a/B3ClientService/BO/BaseInfo/Supplier.cs b/B3ClientService/BO/BaseInfo/Supplier.cs index fd0f294..a58cd15 100644 --- a/B3ClientService/BO/BaseInfo/Supplier.cs +++ b/B3ClientService/BO/BaseInfo/Supplier.cs @@ -13,5 +13,7 @@ namespace BWP.B3ClientService.BO public string BankAccount { get; set; } public string IDCardNumber { get; set; } + + public long? Zone_ID { get; set; } } } diff --git a/B3ClientService/Rpcs/SelfHelpRpc.cs b/B3ClientService/Rpcs/SelfHelpRpc.cs index c4fe260..a901741 100644 --- a/B3ClientService/Rpcs/SelfHelpRpc.cs +++ b/B3ClientService/Rpcs/SelfHelpRpc.cs @@ -110,6 +110,12 @@ namespace BWP.B3ClientService.Rpcs weight.WeighTime = DateTime.Now; weight.Supplier_ID = entity.supplierID; weight.Supplier_Name = entity.supplier; + var supInfo = GetSupplierZone(session, weight.Supplier_ID.Value); + if (supInfo != null) + { + weight.Zone_ID = supInfo.Item1; + weight.Zone_Name = supInfo.Item2; + } weight.BankAccount = entity.supplierIDCard; weight.PurchaseType_ID = entity.bType + 1; weight.PurchaseType_Name = entity.bType == 0 ? "社会" : "业务"; @@ -157,6 +163,19 @@ namespace BWP.B3ClientService.Rpcs } } + static Tuple GetSupplierZone(IDmoSession session, long supplierID) + { + var supplier = new JoinAlias(typeof(Supplier)); + var zone = new JoinAlias(typeof(Zone)); + var query = new DQueryDom(supplier); + query.From.AddJoin(JoinType.Left, new DQDmoSource(zone), DQCondition.EQ(supplier + , "Zone_ID", zone, "ID")); + query.Columns.Add(DQSelectColumn.Field("")); + query.Columns.Add(DQSelectColumn.Field("")); + query.Where.Conditions.Add(DQCondition.And(DQCondition.IsNotNull(DQExpression.Field(supplier, "Zone_ID")), DQCondition.EQ("ID", supplierID))); + return query.EExecuteScalar(session); + } + private static void FillSendPigWeightID(IDmoSession session, long id, long weightID) { var update = new DQUpdateDom(typeof(SendPigRecord)); diff --git a/B3ClientService/Tasks/SyncInfoFromServer.cs b/B3ClientService/Tasks/SyncInfoFromServer.cs index b799ea5..7569ce2 100644 --- a/B3ClientService/Tasks/SyncInfoFromServer.cs +++ b/B3ClientService/Tasks/SyncInfoFromServer.cs @@ -228,6 +228,7 @@ namespace BWP.B3ClientService.Tasks entity.Spell = o.Get("Spell"); entity.IDCardNumber = o.Get("Card_ID"); entity.BankAccount = o.Get("BankAccount"); + entity.Zone_ID = o.Get("Zone_ID"); context.Session.Insert(entity); } context.Commit();