|
|
|
@ -27,7 +27,7 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
return list; |
|
|
|
|
|
|
|
var goodsBarCode = data.Select(x => new Tuple<long, string>(x.Goods_ID, x.BarCode)); |
|
|
|
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode); |
|
|
|
list = InsertOrUpdate(workUnitID, batchID, goodsBarCode, true); |
|
|
|
|
|
|
|
var backInfo = data.Select(x => new ExtensionObj { LongExt1 = x.ID, DecimalExt1 = x.RowVersion }); |
|
|
|
RpcFacade.Call<int>(RpcPath + "SetPadDataSync", JsonConvert.SerializeObject(backInfo)); |
|
|
|
@ -37,10 +37,10 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
public static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, long goodsID, string barCode) |
|
|
|
{ |
|
|
|
var list = new List<Tuple<long, string>> { new Tuple<long, string>(goodsID, barCode) }; |
|
|
|
return InsertOrUpdate(workUnitID, batchID, list); |
|
|
|
return InsertOrUpdate(workUnitID, batchID, list, false); |
|
|
|
} |
|
|
|
|
|
|
|
static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, IEnumerable<Tuple<long, string>> data) |
|
|
|
static List<CarcassInStore> InsertOrUpdate(long? workUnitID, long? batchID, IEnumerable<Tuple<long, string>> data, bool fromPad) |
|
|
|
{ |
|
|
|
var list = new List<CarcassInStore>(); |
|
|
|
using (var session = Dmo.NewSession(AppContext.ConnectInfo.SqlConnection)) |
|
|
|
@ -58,7 +58,7 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var entity = CreateCarcassInStore(workUnitID, batchID, item); |
|
|
|
var entity = CreateCarcassInStore(workUnitID, batchID, item, fromPad); |
|
|
|
entity.Goods_Name = GetGoodsName(item.Item1, session); |
|
|
|
session.Insert(entity); |
|
|
|
list.Add(entity); |
|
|
|
@ -69,10 +69,10 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
static CarcassInStore CreateCarcassInStore(long? workUnitID, long? batchID, Tuple<long, string> goodsCode) |
|
|
|
static CarcassInStore CreateCarcassInStore(long? workUnitID, long? batchID, Tuple<long, string> goodsCode, bool fromPad) |
|
|
|
{ |
|
|
|
var entity = new CarcassInStore(); |
|
|
|
entity.FromPad = true; |
|
|
|
entity.FromPad = fromPad; |
|
|
|
entity.WorkUnit_ID = workUnitID; |
|
|
|
entity.ProductBatch_ID = batchID; |
|
|
|
entity.UserID = AppContext.Worker.ID; |
|
|
|
@ -196,7 +196,7 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
{ |
|
|
|
var update = new DQUpdateDom(typeof(CarcassInStore)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("BarCode", obj.StringExt1)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Weight", obj.DecimalExt1)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("BeforeWeight", obj.DecimalExt1)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
|
|
|
|
|