bug处理 料箱出7号线逻辑
This commit is contained in:
@@ -184,43 +184,49 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<dynamic> CarryBindFloor2UpDownMachine(CarryBindFloor2UpDownMachineInput input)
|
||||
{
|
||||
bool isOk = false;
|
||||
try
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
WmsCarryH? carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carry_id);
|
||||
WmsCarryH? subCarry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.membercarry_id);
|
||||
if (carry != null && subCarry != null)
|
||||
{
|
||||
WmsCarryD wmsCarryD = new()
|
||||
{
|
||||
carry_id = input.carry_id,
|
||||
membercarry_id = input.membercarry_id,
|
||||
membercarry_code = input.membercarry_code,
|
||||
loc = 1,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
int row = await _db.Insertable(wmsCarryD).ExecuteCommandAsync();
|
||||
isOk = row > 0;
|
||||
if (!isOk)
|
||||
{
|
||||
throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (carry == null || subCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的主载具", 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
using (var db = _db.CopyNew())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
WmsCarryH? carry = await db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carry_id);
|
||||
WmsCarryH? subCarry = await db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.membercarry_id);
|
||||
if (carry != null && subCarry != null)
|
||||
{
|
||||
WmsCarryD wmsCarryD = new()
|
||||
{
|
||||
carry_id = input.carry_id,
|
||||
membercarry_id = input.membercarry_id,
|
||||
membercarry_code = input.membercarry_code,
|
||||
loc = 1,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
int row = await db.Insertable(wmsCarryD).ExecuteCommandAsync();
|
||||
isOk = row > 0;
|
||||
if (!isOk)
|
||||
{
|
||||
throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (carry == null || subCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的主载具", 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user