From 409bf69cfe6d919670cb4e60c090ac0d83f929f5 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 16 Jun 2023 17:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsCarryBindService.cs | 16 +--------------- .../Tnb.WarehouseMgr/WmsCarryUnbindService.cs | 4 ++-- 2 files changed, 3 insertions(+), 17 deletions(-) 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";