|
|
|
@ -31,6 +31,8 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("BarCode"), arr.Select(x => DQExpression.Value(x.BarCode)).ToArray())); |
|
|
|
|
|
|
|
var config = GetSectionConfig(session); |
|
|
|
var tp = new List<Tuple<long, DateTime, long>>(); |
|
|
|
var list = new List<SectionStoreDetail>(); |
|
|
|
using (var reader = session.ExecuteReader(query)) |
|
|
|
{ |
|
|
|
while (reader.Read()) |
|
|
|
@ -51,27 +53,31 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
throw new Exception("未配置条段对应关系"); |
|
|
|
e2.Goods_ID = c.Item2; |
|
|
|
e2.Worker_ID = entity.Worker_ID; |
|
|
|
tp.Add(new Tuple<long, DateTime, long>((long)reader[2], entity.InStoreTime, entity.Worker_ID)); |
|
|
|
|
|
|
|
session.Insert(entity); |
|
|
|
session.Insert(e2); |
|
|
|
|
|
|
|
SetCarcassTakeOut(session, (long)reader[2], entity.InStoreTime, entity.Worker_ID); |
|
|
|
list.Add(entity); |
|
|
|
list.Add(e2); |
|
|
|
} |
|
|
|
} |
|
|
|
foreach (var item in list) |
|
|
|
session.Insert(item); |
|
|
|
|
|
|
|
foreach (var item in tp) |
|
|
|
SetCarcassTakeOut(session, item); |
|
|
|
|
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
return arr.Count; |
|
|
|
} |
|
|
|
|
|
|
|
static void SetCarcassTakeOut(IDmoSession session, long id, DateTime time, long worker_ID) |
|
|
|
static void SetCarcassTakeOut(IDmoSession session, Tuple<long, DateTime, long> item) |
|
|
|
{ |
|
|
|
var update = new DQUpdateDom(typeof(CarcassFullInfo)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.Field("InStoreWeight"))); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickWorker_ID", worker_ID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickTime", time)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickWorker_ID", item.Item3)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickTime", item.Item2)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("PickType", 领用类型.条转段)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", item.Item1)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
|
|
|
|
|