Browse Source

调整问题。

master
yibo 7 years ago
parent
commit
6db650b16e
5 changed files with 28 additions and 25 deletions
  1. +0
    -2
      B3ClientService/BO/BaseInfo/Supplier.cs
  2. +8
    -2
      B3ClientService/BO/MiniProgram/SendPigRecord.cs
  3. +12
    -0
      B3ClientService/OfflinRpc/MiniProgramRpc.cs
  4. +7
    -19
      B3ClientService/Rpcs/SelfHelpRpc.cs
  5. +1
    -2
      B3ClientService/Tasks/SyncInfoFromServer.cs

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

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

+ 8
- 2
B3ClientService/BO/MiniProgram/SendPigRecord.cs View File

@ -17,6 +17,12 @@ namespace BWP.B3ClientService.BO
public int bType { get; set; }
public long? zoneID { get; set; }
[ReferenceTo(typeof(Zone), "Name")]
[Join("zoneID", "ID")]
public string zoneName { get; set; }
public long carID { get; set; }
[ReferenceTo(typeof(Car), "Name")]
@ -65,8 +71,8 @@ namespace BWP.B3ClientService.BO
public int fidx { get; set; }
[ReferenceTo(typeof(Farmer),"Name")]
[Join("farmerID","ID")]
[ReferenceTo(typeof(Farmer), "Name")]
[Join("farmerID", "ID")]
public string fName { get; set; }
public long farmerID { get; set; }


+ 12
- 0
B3ClientService/OfflinRpc/MiniProgramRpc.cs View File

@ -218,6 +218,18 @@ namespace BWP.B3ClientService.Rpcs
}
return null;
}
[Rpc(RpcFlags.SkipAuth)]
public static string GetZoneList(string name)
{
var query = new DQueryDom(new JoinAlias(typeof(Zone)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("Name"));
query.Where.Conditions.Add(DQCondition.Like("Name", name));
query.Range = SelectRange.Top(3);
var list = query.EExecuteList<long, string>().Select(x => new Zone { ID = x.Item1, Name = x.Item2 });
return JsonConvert.SerializeObject(list);
}
}
class HistoryObj


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

@ -107,18 +107,19 @@ namespace BWP.B3ClientService.Rpcs
weight.Department_ID = 2;
weight.Employee_Name = entity.employee;
weight.Employee_ID = entity.employeeID;
weight.Zone_ID = entity.zoneID;
weight.Zone_Name = entity.zoneName;
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 ? "社会" : "业务";
if (weight.Employee_ID == null && weight.PurchaseType_Name == "社会")
{
weight.Employee_ID = 1;
weight.Employee_Name = "王新辉";
}
weight.Car_Name = entity.carNum;
weight.Car_ID = entity.carID;
weight.JingJianFee = entity.jjf;
@ -163,19 +164,6 @@ 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)
{
var update = new DQUpdateDom(typeof(SendPigRecord));


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

@ -228,7 +228,6 @@ namespace BWP.B3ClientService.Tasks
entity.Spell = o.Get<string>("Spell");
entity.IDCardNumber = o.Get<string>("Card_ID");
entity.BankAccount = o.Get<string>("BankAccount");
entity.Zone_ID = o.Get<long?>("Zone_ID");
context.Session.Insert(entity);
}
context.Commit();
@ -304,7 +303,7 @@ namespace BWP.B3ClientService.Tasks
public void Execute()
{
var serverUri = ServerHost.GetServerUrl();
if (string.IsNullOrEmpty(serverUri))
if (!string.IsNullOrEmpty(serverUri))
{
try
{


Loading…
Cancel
Save