This commit is contained in:
2023-06-16 16:28:50 +08:00
3 changed files with 39 additions and 17 deletions

View File

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

View File

@@ -75,7 +75,17 @@ namespace Tnb.WarehouseMgr
row = await _db.Updateable(subCarry).ExecuteCommandAsync(); row = await _db.Updateable(subCarry).ExecuteCommandAsync();
isOk = (row > 0); isOk = (row > 0);
if (!isOk) throw Oops.Oh(ErrorCode.COM1001); 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(); await _db.Ado.CommitTranAsync();

View File

@@ -78,7 +78,7 @@ namespace Tnb.WarehouseMgr
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/ var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
//出库取起点,获取所有符合输入的载具规格的载具 //出库取起点,获取所有符合输入的载具规格的载具
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)]); var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id) var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
.Select((a,b) => new .Select((a,b) => new
{ {