diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs index 0cebc9d1..61b7b24d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs @@ -65,7 +65,7 @@ namespace Tnb.WarehouseMgr var carry = await _db.Queryable().FirstAsync(it => it.id == carryId); var subCarry = await _db.Queryable().FirstAsync(it => it.id == subCarryId); WmsCarrybindH wmsCarrybindH = carry.Adapt(); - if (carryId != null && subCarryId != null) + if (carry != null && subCarry != null) { wmsCarrybindH.id = SnowflakeIdHelper.NextId(); wmsCarrybindH.org_id = carry.org_id; @@ -96,20 +96,6 @@ namespace Tnb.WarehouseMgr } } - /* //更新主载具明细表,增加新的数据 - var row = await _db.Insertable(new WmsCarryD { - id = SnowflakeIdHelper.NextId(), - org_id = carry.org_id, - carry_id = carry.id, - membercarry_id = subCarry.id, - membercarry_code = subCarry.carry_code, - loc = input.data[nameof(WmsCarrybindH.loc)].ToString(), - create_id = _userManager.UserId, - create_time = DateTime.Now - }) - .ExecuteCommandAsync(); - if (row <= 0) throw Oops.Oh(ErrorCode.COM1000); - _db.Updateable().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/ await _db.Ado.CommitTranAsync(); } catch (Exception ex) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs index 0ff573bc..24ed3812 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs @@ -66,9 +66,9 @@ namespace Tnb.WarehouseMgr var carry = await _db.Queryable().FirstAsync(it => it.id == carryId); var subCarry = await _db.Queryable().FirstAsync(it => it.id == subCarryId); //WmsCarryunbindH wmsCarryUnbindH = carry.Adapt(); - if (carryId != null && subCarryId != null) + if (carry != null && subCarry != null) { - var row = await _db.Deleteable().Where(it=>it.carry_id == subCarry.id).ExecuteCommandAsync(); + var row = await _db.Deleteable().Where(it => it.carry_id == subCarry.id).ExecuteCommandAsync(); carry.carry_status = "0"; row = await _db.Updateable(carry).ExecuteCommandAsync(); subCarry.carry_status = "0";