|
|
|
@ -146,7 +146,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
{ |
|
|
|
foreach (var item in list) |
|
|
|
{ |
|
|
|
var id = GetID(item.BarCode, session); |
|
|
|
var id = GetID(item.BarCode, item.ID, session); |
|
|
|
if (id.HasValue) |
|
|
|
Update(id.Value, item, session); |
|
|
|
else |
|
|
|
@ -162,13 +162,13 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
static long? GetID(string code, IDmoSession session) |
|
|
|
static long? GetID(string code, long id, IDmoSession session) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(code)) |
|
|
|
return null; |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(CarcassFullInfo))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("BarCode", code)); |
|
|
|
query.Where.Conditions.Add(DQCondition.Or(DQCondition.EQ("InStoreClientID", id), DQCondition.EQ("BarCode", code))); |
|
|
|
return query.EExecuteScalar<long?>(session); |
|
|
|
} |
|
|
|
|
|
|
|
@ -181,6 +181,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
update.Columns.Add(new DQUpdateColumn("InStoreGoods_ID", obj.InStoreGoods_ID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("InStoreWeight", obj.InStoreWeight)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("InStoreTime", obj.InStoreTime)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("InStoreClientID", obj.ID)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
@ -195,6 +196,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
entity.InStoreGoods_ID = obj.InStoreGoods_ID; |
|
|
|
entity.InStoreWeight = obj.InStoreWeight; |
|
|
|
entity.InStoreTime = obj.InStoreTime; |
|
|
|
entity.InStoreClientID = obj.ID; |
|
|
|
session.Insert(entity); |
|
|
|
} |
|
|
|
|
|
|
|
@ -219,6 +221,7 @@ namespace BWP.B3ClientService.Rpcs |
|
|
|
|
|
|
|
class CarcassInStoreObj |
|
|
|
{ |
|
|
|
public long ID { get; set; } |
|
|
|
public string BarCode { get; set; } |
|
|
|
public long? InStoreWorker_ID { get; set; } |
|
|
|
public long? WorkUnit_ID { get; set; } |
|
|
|
|