This commit is contained in:
FanLian
2023-06-16 15:46:23 +08:00
parent b9dcd91460
commit 4229d60271
2 changed files with 38 additions and 16 deletions

View File

@@ -84,21 +84,33 @@ namespace Tnb.WarehouseMgr
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
}
/* //更新主载具明细表,增加新的数据
var row = await _db.Insertable<WmsCarryD>(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<WmsCarryH>().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/
await _db.Ado.CommitTranAsync();
else
{
if (carry == null)
{
throw new AppFriendlyException("没有可用的主载具", 500);
}
if (subCarry == null)
{
throw new AppFriendlyException("没有可用的子载具", 500);
}
}
/* //更新主载具明细表,增加新的数据
var row = await _db.Insertable<WmsCarryD>(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<WmsCarryH>().SetColumns(it=>it.carry_status == "1").Where(it=>it.id == input.data[nameof(WmsCarrybindH.carry_id)].ToString());*/
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
{

View File

@@ -75,7 +75,17 @@ namespace Tnb.WarehouseMgr
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
isOk = (row > 0);
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
}
else
{
if (carry == null)
{
throw new AppFriendlyException("没有可用的主载具", 500);
}
if (subCarry == null)
{
throw new AppFriendlyException("没有可用的子载具", 500);
}
}
await _db.Ado.CommitTranAsync();