Browse Source

对退库扫码的处理。

master
yibo 7 years ago
parent
commit
e7c229083c
2 changed files with 69 additions and 34 deletions
  1. +41
    -24
      B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs
  2. +28
    -10
      B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs

+ 41
- 24
B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs View File

@ -16,32 +16,49 @@ namespace BWP.Web.Pages.B3ClientService
{
protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
{
var textbox = form.EAdd(new DFDateInput());
var range = form.EAdd(new DFTextBox());
var minID = form.EAdd(new DFTextBox());
form.Controls.Add(new TSButton("DO", delegate
{
//var range = form.EAdd(new DFTextBox());
//form.Controls.Add(new TSButton("dddd", delegate
//{
// using (var session = Dmo.NewSession())
// {
// var obj = new CarcassFullInfo();
// obj.PickTime = null;
// var update = new DQUpdateDom(typeof(CarcassFullInfo));
// update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.NULL));
// update.Columns.Add(new DQUpdateColumn("PickTime", obj.PickTime));
// update.Where.Conditions.Add(DQCondition.EQ("BarCode", range.Text));
// session.ExecuteNonQuery(update);
// session.Commit();
// }
// AspUtil.Alert(this, "OK");
//}));
using (var session = Dmo.NewSession())
{
var q = new DmoQuery(typeof(GradeAndWeight_Detail));
q.Range = SelectRange.Top(int.Parse(range.Text));
q.Where.Conditions.Add(DQCondition.EQ("Date", textbox.Date));
q.Where.Conditions.Add(DQCondition.GreaterThan("ID", long.Parse(minID.Text)));
q.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
var lst = session.ExecuteList(q).Cast<GradeAndWeight_Detail>();
foreach (var item in lst)
{
GradeAndWeightBL.InsertTraceBack(item, session);
}
//var textbox = form.EAdd(new DFDateInput());
//var range = form.EAdd(new DFTextBox());
//var minID = form.EAdd(new DFTextBox());
//form.Controls.Add(new TSButton("DO", delegate
//{
session.Commit();
var mx = 0L;
if (lst.Any())
mx = lst.Max(x => x.ID);
AspUtil.Alert(this, lst.Count().ToString() + "Max_" + mx);
}
}));
// using (var session = Dmo.NewSession())
// {
// var q = new DmoQuery(typeof(GradeAndWeight_Detail));
// q.Range = SelectRange.Top(int.Parse(range.Text));
// q.Where.Conditions.Add(DQCondition.EQ("Date", textbox.Date));
// q.Where.Conditions.Add(DQCondition.GreaterThan("ID", long.Parse(minID.Text)));
// q.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
// var lst = session.ExecuteList(q).Cast<GradeAndWeight_Detail>();
// foreach (var item in lst)
// {
// GradeAndWeightBL.InsertTraceBack(item, session);
// }
// session.Commit();
// var mx = 0L;
// if (lst.Any())
// mx = lst.Max(x => x.ID);
// AspUtil.Alert(this, lst.Count().ToString() + "Max_" + mx);
// }
//}));
}
}
}

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

@ -53,17 +53,28 @@ namespace BWP.B3ClientService.Rpcs
static void Update(long id, CarcassSaleOutStoreObj obj, IDmoSession session)
{
var goodsID = GetGoodsID(obj.SaleGoods_Code, session);
var update = new DQUpdateDom(typeof(CarcassFullInfo));
update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", goodsID));
if (obj.Weight.HasValue)
update.Columns.Add(new DQUpdateColumn("PickWeight", obj.Weight));
update.Where.Conditions.Add(DQCondition.EQ("ID", id));
if (obj.Number < 0)
{
update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", DQExpression.NULL));
update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.NULL));
update.Columns.Add(new DQUpdateColumn("PickType", DQExpression.NULL));
obj.Time = null;
obj.Number = null;
}
else
update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.Field("InStoreWeight")));
{
var goodsID = GetGoodsID(obj.SaleGoods_Code, session);
update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", goodsID));
if (obj.Weight.HasValue)
update.Columns.Add(new DQUpdateColumn("PickWeight", obj.Weight));
else
update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.Field("InStoreWeight")));
update.Columns.Add(new DQUpdateColumn("PickType", .));
}
update.Columns.Add(new DQUpdateColumn("PickTime", obj.Time));
update.Columns.Add(new DQUpdateColumn("PickNumber", obj.Number));
update.Columns.Add(new DQUpdateColumn("PickType", .));
update.Where.Conditions.Add(DQCondition.EQ("ID", id));
session.ExecuteNonQuery(update);
}
@ -96,10 +107,17 @@ namespace BWP.B3ClientService.Rpcs
static void FillSectionStoreWeight(CarcassSaleOutStoreObj item, IDmoSession session)
{
var update = new DQUpdateDom(typeof(SectionStoreDetail));
if (item.Weight.HasValue)
update.Columns.Add(new DQUpdateColumn("Weight", item.Weight));
if (item.Number < 0)
{
item.Weight = null;
item.Time = null;
item.Number = null;
update.Columns.Add(new DQUpdateColumn("PickType", DQExpression.NULL));
}
else
update.Columns.Add(new DQUpdateColumn("PickType", .));
update.Columns.Add(new DQUpdateColumn("Weight", item.Weight));
update.Columns.Add(new DQUpdateColumn("OutStoreTime", item.Time));
update.Columns.Add(new DQUpdateColumn("PickType", .));
update.Columns.Add(new DQUpdateColumn("PickNumber", item.Number));
update.Where.Conditions.Add(DQCondition.EQ("BarCode", item.BarCode));
session.ExecuteNonQuery(update);


Loading…
Cancel
Save