Browse Source

供应商加区域。

master
yibo 7 years ago
parent
commit
b79e0160bb
3 changed files with 22 additions and 0 deletions
  1. +2
    -0
      B3ClientService/BO/BaseInfo/Supplier.cs
  2. +19
    -0
      B3ClientService/Rpcs/SelfHelpRpc.cs
  3. +1
    -0
      B3ClientService/Tasks/SyncInfoFromServer.cs

+ 2
- 0
B3ClientService/BO/BaseInfo/Supplier.cs View File

@ -13,5 +13,7 @@ namespace BWP.B3ClientService.BO
public string BankAccount { get; set; } public string BankAccount { get; set; }
public string IDCardNumber { get; set; } public string IDCardNumber { get; set; }
public long? Zone_ID { get; set; }
} }
} }

+ 19
- 0
B3ClientService/Rpcs/SelfHelpRpc.cs View File

@ -110,6 +110,12 @@ namespace BWP.B3ClientService.Rpcs
weight.WeighTime = DateTime.Now; weight.WeighTime = DateTime.Now;
weight.Supplier_ID = entity.supplierID; weight.Supplier_ID = entity.supplierID;
weight.Supplier_Name = entity.supplier; 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.BankAccount = entity.supplierIDCard;
weight.PurchaseType_ID = entity.bType + 1; weight.PurchaseType_ID = entity.bType + 1;
weight.PurchaseType_Name = entity.bType == 0 ? "社会" : "业务"; weight.PurchaseType_Name = entity.bType == 0 ? "社会" : "业务";
@ -157,6 +163,19 @@ namespace BWP.B3ClientService.Rpcs
} }
} }
static Tuple<long, string> 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<long, string>(session);
}
private static void FillSendPigWeightID(IDmoSession session, long id, long weightID) private static void FillSendPigWeightID(IDmoSession session, long id, long weightID)
{ {
var update = new DQUpdateDom(typeof(SendPigRecord)); var update = new DQUpdateDom(typeof(SendPigRecord));


+ 1
- 0
B3ClientService/Tasks/SyncInfoFromServer.cs View File

@ -228,6 +228,7 @@ namespace BWP.B3ClientService.Tasks
entity.Spell = o.Get<string>("Spell"); entity.Spell = o.Get<string>("Spell");
entity.IDCardNumber = o.Get<string>("Card_ID"); entity.IDCardNumber = o.Get<string>("Card_ID");
entity.BankAccount = o.Get<string>("BankAccount"); entity.BankAccount = o.Get<string>("BankAccount");
entity.Zone_ID = o.Get<long?>("Zone_ID");
context.Session.Insert(entity); context.Session.Insert(entity);
} }
context.Commit(); context.Commit();


Loading…
Cancel
Save