|
|
|
@ -21,39 +21,6 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
[Rpc] |
|
|
|
public static class SegmentInStoreRpc |
|
|
|
{ |
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string GetSegmentProductInfo(string barCode) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(SegmentProductionInfo)); |
|
|
|
var goods = new JoinAlias(typeof(Goods)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "Goods_ID", goods, "ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Code", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Name", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Spec", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ProductTime")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Weight")); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
using (var reader = session.ExecuteReader(query)) |
|
|
|
{ |
|
|
|
if (reader.Read()) |
|
|
|
{ |
|
|
|
var entity = new SegmentProductObj(); |
|
|
|
entity.Goods_Code = (string)reader[0]; |
|
|
|
entity.Goods_Name = (string)reader[1]; |
|
|
|
entity.Goods_Spec = (string)reader[2]; |
|
|
|
entity.ProductTime = (DateTime?)reader[3]; |
|
|
|
entity.Weight = (decimal?)reader[4]; |
|
|
|
|
|
|
|
return JsonConvert.SerializeObject(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return string.Empty; |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static int UploadSegmentInStoreInfo(string json) |
|
|
|
{ |
|
|
|
@ -102,21 +69,26 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string GetUnInStoreList() |
|
|
|
public static string GetUnInStoreList(int range, long? maxID, string expression) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(SegmentProductionInfo)); |
|
|
|
var goods = new JoinAlias(typeof(Goods)); |
|
|
|
var goods = new JoinAlias("_goods", typeof(Goods)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "Goods_ID", goods, "ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("InStoreTime"))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Delete", false)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("BarCode")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Code", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Name", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Spec", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ProductTime")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Weight")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); |
|
|
|
query.Range = SelectRange.Top(50); |
|
|
|
if (maxID.HasValue) |
|
|
|
query.Where.Conditions.Add(DQCondition.GreaterThan("ID", maxID)); |
|
|
|
query.Range = SelectRange.Top(range); |
|
|
|
if (!string.IsNullOrEmpty(expression)) |
|
|
|
query.Where.Conditions.Add(DQExpression.Snippet(expression)); |
|
|
|
var list = new List<SegmentProductObj>(); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
@ -126,11 +98,11 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
{ |
|
|
|
var obj = new SegmentProductObj(); |
|
|
|
obj.BarCode = (string)reader[0]; |
|
|
|
obj.Goods_Code = (string)reader[1]; |
|
|
|
obj.Goods_Name = (string)reader[2]; |
|
|
|
obj.Goods_Spec = (string)reader[3]; |
|
|
|
obj.ProductTime = (DateTime?)reader[4]; |
|
|
|
obj.Weight = (decimal?)reader[5]; |
|
|
|
obj.Goods_Name = (string)reader[1]; |
|
|
|
obj.Goods_Spec = (string)reader[2]; |
|
|
|
obj.ProductTime = (DateTime?)reader[3]; |
|
|
|
obj.Weight = (decimal?)reader[4]; |
|
|
|
obj.SID = (long)reader[5]; |
|
|
|
list.Add(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -138,6 +110,37 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
return JsonConvert.SerializeObject(list); |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string GetBarInfoByCode(string code) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(SegmentProductionInfo)); |
|
|
|
var goods = new JoinAlias(typeof(Goods)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "Goods_ID", goods, "ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Name", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Spec", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ProductTime")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Weight")); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("BarCode", code)); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Delete", false)); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
using (var reader = session.ExecuteReader(query)) |
|
|
|
{ |
|
|
|
if (reader.Read()) |
|
|
|
{ |
|
|
|
var obj = new SegmentProductObj(); |
|
|
|
obj.Goods_Name = (string)reader[0]; |
|
|
|
obj.Goods_Spec = (string)reader[1]; |
|
|
|
obj.ProductTime = (DateTime?)reader[2]; |
|
|
|
obj.Weight = (decimal?)reader[3]; |
|
|
|
return JsonConvert.SerializeObject(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return string.Empty; |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string StockUpScan(string barCode) |
|
|
|
{ |
|
|
|
@ -149,6 +152,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Weight")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("StandardPic")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("BarCode", barCode), DQCondition.IsNotNull(DQExpression.Field("InStoreTime")), DQCondition.IsNull(DQExpression.Field("BackTime")))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Delete", false)); |
|
|
|
var result = query.EExecuteScalar<string, decimal?, bool>(); |
|
|
|
if (result == null) |
|
|
|
return string.Empty; |
|
|
|
@ -160,7 +164,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
{ |
|
|
|
public string BarCode { get; set; } |
|
|
|
|
|
|
|
public DateTime InStoreTime { get; set; } |
|
|
|
public DateTime? InStoreTime { get; set; } |
|
|
|
|
|
|
|
public long? Store_ID { get; set; } |
|
|
|
|
|
|
|
@ -175,5 +179,6 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
public string Goods_Spec { get; set; } |
|
|
|
public decimal? Weight { get; set; } |
|
|
|
public DateTime? ProductTime { get; set; } |
|
|
|
public long? SID { get; set; } |
|
|
|
} |
|
|
|
} |