|
|
|
@ -24,7 +24,13 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string SyncProductBatch() |
|
|
|
{ |
|
|
|
return GetBaseInfoJosn<ProductBatch>(DQCondition.EQ("IsLocked", false)); |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(ProductBatch))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Name")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Date")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("IsLocked", false), DQCondition.EQ("Stopped", false))); |
|
|
|
var list = query.EExecuteList<long, string, DateTime?>().Select(x => new MinProductBatch { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); |
|
|
|
return JsonConvert.SerializeObject(list); |
|
|
|
} |
|
|
|
|
|
|
|
static string GetBaseInfoJosn<T>(IDQExpression withCondition = null) |
|
|
|
@ -118,6 +124,11 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
public string Name { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
class MinProductBatch : MinBaseInfo |
|
|
|
{ |
|
|
|
public DateTime? Date { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
class MinGoods : MinBaseInfo |
|
|
|
{ |
|
|
|
public string Code { get; set; } |
|
|
|
|