Browse Source

过磅单选择养殖户,带出养殖户具体信息,信息不全,不允许打印。

master
yibo 7 years ago
parent
commit
6cdfa176b2
6 changed files with 50 additions and 2 deletions
  1. +5
    -0
      B3ClientService/BO/BaseInfo/Farmer.cs
  2. +9
    -0
      B3ClientService/BO/Bill/WeightBill/WeightBill.cs
  3. +2
    -0
      B3ClientService/BO/MaterialRequisitionRecord_/MaterialRequisitionRecord.cs
  4. +8
    -1
      B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordRpc.cs
  5. +8
    -0
      B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs
  6. +18
    -1
      B3ClientService/Tasks/SyncInfoFromServer.cs

+ 5
- 0
B3ClientService/BO/BaseInfo/Farmer.cs View File

@ -9,5 +9,10 @@ namespace BWP.B3ClientService.BO
[Serializable] [Serializable]
public class Farmer : BaseInfo public class Farmer : BaseInfo
{ {
public string IDCard { get; set; }
public string Tel { get; set; }
public string Address { get; set; }
} }
} }

+ 9
- 0
B3ClientService/BO/Bill/WeightBill/WeightBill.cs View File

@ -64,6 +64,15 @@ namespace BWP.B3ClientService.BO
public string AnimalTestMan { get; set; } public string AnimalTestMan { get; set; }
public string Remark { get; set; } public string Remark { get; set; }
public string Farmer_Name { get; set; }
public string Farmer_IDCard { get; set; }
public string Farmer_Tel { get; set; }
public string Farmer_Address { get; set; }
#endregion #endregion
#region Special #region Special


+ 2
- 0
B3ClientService/BO/MaterialRequisitionRecord_/MaterialRequisitionRecord.cs View File

@ -47,5 +47,7 @@ namespace BWP.B3ClientService.BO
public int RowVersion { get; set; } public int RowVersion { get; set; }
public DateTime? CreateTime { get; set; } public DateTime? CreateTime { get; set; }
public long? GroupID { get; set; }
} }
} }

+ 8
- 1
B3ClientService/Rpcs/BillRpc/MaterialRequisitionRecordRpc_/MaterialRequisitionRecordRpc.cs View File

@ -102,14 +102,21 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
} }
[Rpc] [Rpc]
public static int FillWeight(long id, decimal weight)
public static int FillWeight(long id, decimal weight, List<long> ids)
{ {
var update = new DQUpdateDom(typeof(MaterialRequisitionRecord)); var update = new DQUpdateDom(typeof(MaterialRequisitionRecord));
update.Where.Conditions.Add(DQCondition.EQ("ID", id)); update.Where.Conditions.Add(DQCondition.EQ("ID", id));
update.Columns.Add(new DQUpdateColumn("GroupID", id));
update.Columns.Add(new DQUpdateColumn("Weight", weight)); update.Columns.Add(new DQUpdateColumn("Weight", weight));
var up2 = new DQUpdateDom(typeof(MaterialRequisitionRecord));
up2.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray()));
up2.Columns.Add(new DQUpdateColumn("GroupID", id));
up2.Columns.Add(new DQUpdateColumn("Weight", 0));
using (var session = Dmo.NewSession()) using (var session = Dmo.NewSession())
{ {
session.ExecuteNonQuery(update); session.ExecuteNonQuery(update);
session.ExecuteNonQuery(up2);
session.Commit(); session.Commit();
} }
return 1; return 1;


+ 8
- 0
B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs View File

@ -345,5 +345,13 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
query.Where.Conditions.Add(DQCondition.EQ("ID", id)); query.Where.Conditions.Add(DQCondition.EQ("ID", id));
return query.EExecuteScalar<string>(); return query.EExecuteScalar<string>();
} }
[Rpc]
public static string GetFarmerInfo(long id)
{
var query = new DmoQuery(typeof(Farmer));
query.Where.Conditions.Add(DQCondition.EQ("ID", id));
return serializer.Serialize(query.EExecuteScalar<Farmer>());
}
} }
} }

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

@ -367,7 +367,24 @@ namespace BWP.B3ClientService.Tasks
void SyncFarmer() void SyncFarmer()
{ {
SyncBaseInfo<Farmer>("GetFarmer");
var list = RpcFacade.Call<List<RpcObject>>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetFarmer");
using (var context = new TransactionContext())
{
var sql1 = @"truncate table [B3ClientService_Farmer];";
context.Session.ExecuteSqlNonQuery(sql1);
foreach (RpcObject o in list)
{
var entity = new Farmer();
entity.ID = o.Get<long>("ID");
entity.Name = o.Get<string>("Name");
entity.Spell = o.Get<string>("Spell");
entity.Tel = o.Get<string>("Tel");
entity.Address = o.Get<string>("Address");
entity.IDCard = o.Get<string>("IDCard");
context.Session.Insert(entity);
}
context.Commit();
}
} }
void SyncHogGrade() void SyncHogGrade()


Loading…
Cancel
Save