|
|
|
@ -5,6 +5,7 @@ using Forks.EnterpriseServices; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
@ -83,6 +84,27 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
return GoodsCodeToID[code]; |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc(RpcFlags.SkipAuth)] |
|
|
|
public static string GetCarcassInstoreInfo(string barCode) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(CarcassFullInfo)); |
|
|
|
var goods = new JoinAlias(typeof(Goods)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(main, "InStoreGoods_ID", goods, "ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Code", goods)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("InStoreWeight")); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode)); |
|
|
|
query.Range = SelectRange.Top(1); |
|
|
|
var rst = query.EExecuteScalar<string, decimal?>(); |
|
|
|
var entity = new MinCarcassSaleOutObj(); |
|
|
|
if (rst != null) |
|
|
|
{ |
|
|
|
entity.Goods_Code = rst.Item1; |
|
|
|
entity.InStoreWeight = rst.Item2; |
|
|
|
} |
|
|
|
return JsonConvert.SerializeObject(entity); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
class CarcassSaleOutStoreObj |
|
|
|
@ -93,4 +115,10 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
public long? GroupID { get; set; } |
|
|
|
public string SaleGoods_Code { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
class MinCarcassSaleOutObj |
|
|
|
{ |
|
|
|
public string Goods_Code { get; set; } |
|
|
|
public decimal? InStoreWeight { get; set; } |
|
|
|
} |
|
|
|
} |