Browse Source

白条发货。

master
yibo 7 years ago
parent
commit
6e3affc26a
3 changed files with 48 additions and 2 deletions
  1. +6
    -2
      B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs
  2. +14
    -0
      B3ClientService/OfflinRpc/BaseInfoRpc.cs
  3. +28
    -0
      B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs

+ 6
- 2
B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs View File

@ -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)


+ 14
- 0
B3ClientService/OfflinRpc/BaseInfoRpc.cs View File

@ -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<long, string, DateTime?>().Select(x => new MinProductBatch { ID = x.Item1, Name = x.Item2, Date = x.Item3 });
return JsonConvert.SerializeObject(list);
}
class MinBaseInfo
{
public long ID { get; set; }


+ 28
- 0
B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs View File

@ -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; }
}
}

Loading…
Cancel
Save