|
|
|
@ -1,8 +1,10 @@ |
|
|
|
using BWP.B3ClientService.BO; |
|
|
|
using BWP.B3ClientService.NamedValueTemplate; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using Forks.Utils; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
@ -63,6 +65,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
//类别、本地客户端配置、本地存货配置
|
|
|
|
public static string SyncClientGoodsSetByClient(short type, string par, string p2) |
|
|
|
{ |
|
|
|
var local = JsonConvert.DeserializeObject<List<Tuple<long, int>>>(par); |
|
|
|
@ -89,6 +92,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Code", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Spec", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("MainUnit", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("GoodsType", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("RowVersion", goods)); |
|
|
|
|
|
|
|
var insert = new List<MinClientGoodsSet>(); |
|
|
|
@ -150,11 +154,12 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
if (!gsID.Contains(goodsID)) |
|
|
|
gsID.Add(goodsID); |
|
|
|
|
|
|
|
var gVersion = (int)reader[12]; |
|
|
|
var gVersion = (int)reader[13]; |
|
|
|
if (!g2.Any(x => x.Item1 == goodsID))//insert
|
|
|
|
{ |
|
|
|
if (!gInsert.Any(x => x.ID == goodsID)) |
|
|
|
{ |
|
|
|
var gt = (NamedValue<存货类别>?)reader[12]; |
|
|
|
gInsert.Add(new MinGoods |
|
|
|
{ |
|
|
|
ID = goodsID, |
|
|
|
@ -162,6 +167,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
Code = (string)reader[9], |
|
|
|
Spec = (string)reader[10], |
|
|
|
MainUnit = (string)reader[11], |
|
|
|
GoodsType = (NamedValue<存货类别>?)reader[12], |
|
|
|
RowVersion = gVersion |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -177,6 +183,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
Code = (string)reader[9], |
|
|
|
Spec = (string)reader[10], |
|
|
|
MainUnit = (string)reader[11], |
|
|
|
GoodsType = (NamedValue<存货类别>?)reader[12], |
|
|
|
RowVersion = gVersion |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -202,7 +209,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
query.Range = SelectRange.Top(top); |
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Date", true)); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("BatchType", type), DQCondition.EQ("Stopped", false))); |
|
|
|
var result= query.EExecuteList<long, string, DateTime?>().Select(x => new { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); |
|
|
|
var result = query.EExecuteList<long, string, DateTime?>().Select(x => new { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); |
|
|
|
return JsonConvert.SerializeObject(result); |
|
|
|
} |
|
|
|
|
|
|
|
@ -239,6 +246,9 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
public string Code { get; set; } |
|
|
|
public string Spec { get; set; } |
|
|
|
public string MainUnit { get; set; } |
|
|
|
|
|
|
|
[JsonConverter(typeof(NameValueJsonConverter<存货类别>))] |
|
|
|
public NamedValue<存货类别>? GoodsType { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
class MinClientGoodsSet : MinBaseInfo |
|
|
|
|