|
|
|
@ -60,19 +60,45 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
return query.EExecuteList().Cast<WeightBill>().ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static List<Tuple<long, long>> SyncBillB3Ids(List<long> ids) |
|
|
|
{ |
|
|
|
return GetSyncBaseB3Ids<WeightBill>(ids); |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static List<Tuple<long, long>> SyncWeightDetailB3Ids(List<long> ids) |
|
|
|
{ |
|
|
|
return GetSyncBaseB3Ids<WeightBill_Detail>(ids); |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static List<Tuple<long, long>> SyncFarmerDetailB3Ids(List<long> ids) |
|
|
|
{ |
|
|
|
return GetSyncBaseB3Ids<WeightBill_FarmerDetail>(ids); |
|
|
|
} |
|
|
|
|
|
|
|
static List<Tuple<long, long>> GetSyncBaseB3Ids<T>(List<long> ids) |
|
|
|
where T : SyncBase |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(T))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("B3ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.IsNotNull(DQExpression.Field("B3ID")), DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray()))); |
|
|
|
return query.EExecuteList<long, long>(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static List<WeightBill> GetNoHouseInfoWeightBills(DateTime date) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(WeightBill)); |
|
|
|
var detail = new JoinAlias(typeof(WeightBill_HouseDetail)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.And(DQCondition.EQ(main, "ID", detail, "WeightBill_ID"), DQCondition.EQ(detail, "DeleteState", false))); |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(WeightBill))); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.Between("WeighTime", date.Date, date.Date + new TimeSpan(23, 59, 29))))); |
|
|
|
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field(detail, "ID"))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("B3ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Supplier_Name")); |
|
|
|
var result = query.EExecuteList<long, long?, string>(); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("AlreadyHouse")); |
|
|
|
var result = query.EExecuteList<long, long?, string, bool>(); |
|
|
|
var list = new List<WeightBill>(); |
|
|
|
foreach (var item in result) |
|
|
|
{ |
|
|
|
@ -81,6 +107,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
entity.ID = item.Item1; |
|
|
|
entity.B3ID = item.Item2; |
|
|
|
entity.Supplier_Name = item.Item3; |
|
|
|
entity.AlreadyHouse = item.Item4; |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
@ -100,6 +127,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
update.Columns.Add(new DQUpdateColumn("HogGrade_Name", bo.HogGrade_Name)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Inspector_ID", bo.Inspector_ID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Inspector_Name", bo.Inspector_Name)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("AlreadyHouse", true)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Sync", false)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("ModifyTime", DateTime.Now)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", bo.ID)); |
|
|
|
|