diff --git a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs index d15f369..59ec104 100644 --- a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs +++ b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs @@ -49,7 +49,7 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_ mZone.Add(CreateResultTab()); } - ChoiceBox batchSelect; + ChoiceBox batchSelect, goodsSelect; DFCheckBox noCodeBox; DateInput butcherDate; DFTextBox minInput, maxInput; @@ -60,10 +60,12 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_ hp.EAdd(new SimpleLabel("屠宰日期")); butcherDate = hp.EAdd(new DateInput()); hp.EAdd(new SimpleLabel("生产批次")); - batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.生产批次) { EnableInputArgument = true, EnableTopItem = true, Width = Unit.Pixel(160) }); + batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.生产批次) { EnableInputArgument = true, EnableTopItem = true, Width = Unit.Pixel(160) }); var batch = GetYesterdayBatch(); if (batch != null) batchSelect.Fill(batch.Item1.ToString(), batch.Item2); + hp.EAdd(new SimpleLabel("存货")); + goodsSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.存货) { EnableInputArgument = true, EnableTopItem = true, Width = Unit.Pixel(160) }); hp.EAdd(new SimpleLabel("入库重量")); minInput = hp.EAdd(new DFTextBox() { Width = Unit.Pixel(50) }); hp.EAdd(new LiteralControl("-")); @@ -144,6 +146,8 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_ { query.Where.Conditions.Add(DQCondition.Or(DQCondition.EQ(batch, "Date", butcherDate.Value), DQCondition.EQ("ButcherDate", butcherDate.Value))); } + if (!goodsSelect.IsEmpty) + query.Where.Conditions.Add(DQCondition.EQ("InStoreGoods_ID", long.Parse(goodsSelect.Value))); if (noCodeBox.Checked) query.Where.Conditions.Add(DQCondition.Or(DQCondition.IsNull(DQExpression.Field("BarCode")), DQCondition.EQ("BarCode", ""))); if (!minInput.IsEmpty) diff --git a/B3ClientService/OfflinRpc/BaseInfoRpc.cs b/B3ClientService/OfflinRpc/BaseInfoRpc.cs index 93b3286..59d84d7 100644 --- a/B3ClientService/OfflinRpc/BaseInfoRpc.cs +++ b/B3ClientService/OfflinRpc/BaseInfoRpc.cs @@ -117,6 +117,20 @@ namespace BWP.B3ClientService.Rpcs return JsonConvert.SerializeObject(list); } + [Rpc(RpcFlags.SkipAuth)] + public static string GetProductBatch(int range) + { + 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))); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); + query.Range = SelectRange.Top(range); + var list = query.EExecuteList().Select(x => new MinProductBatch { ID = x.Item1, Name = x.Item2, Date = x.Item3 }); + return JsonConvert.SerializeObject(list); + } + class MinBaseInfo { public long ID { get; set; } diff --git a/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs b/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs index 210865d..3d20ec6 100644 --- a/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs +++ b/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs @@ -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(); + 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; } + } }