调整Mes->Wms生产出库返回值
This commit is contained in:
@@ -321,6 +321,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//[NonUnify]
|
//[NonUnify]
|
||||||
public async Task<dynamic> MESCreateOutstock(MESCreateOutstockInput input)
|
public async Task<dynamic> MESCreateOutstock(MESCreateOutstockInput input)
|
||||||
{
|
{
|
||||||
|
var isSuccessful = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
await _db.Ado.BeginTranAsync();
|
||||||
@@ -346,7 +347,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
outstock.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;// 新增
|
outstock.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;// 新增
|
||||||
outstock.create_id = _userManager.UserId;
|
outstock.create_id = _userManager.UserId;
|
||||||
outstock.create_time = DateTime.Now;
|
outstock.create_time = DateTime.Now;
|
||||||
|
|
||||||
//明细表
|
//明细表
|
||||||
foreach (var outstockD in outstockDs!)
|
foreach (var outstockD in outstockDs!)
|
||||||
{
|
{
|
||||||
@@ -357,7 +358,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
outstock.create_time = outstock.create_time;
|
outstock.create_time = outstock.create_time;
|
||||||
outstock.create_id = outstock.create_id;
|
outstock.create_id = outstock.create_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == outstock.location_id.ToString());
|
//var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == outstock.location_id.ToString());
|
||||||
var carryIds = new List<string>();
|
var carryIds = new List<string>();
|
||||||
//tablefield120 出库物料明细
|
//tablefield120 出库物料明细
|
||||||
@@ -445,10 +446,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
carryIds = allOutIds.Concat(sortingOutIds).ToList();
|
carryIds = allOutIds.Concat(sortingOutIds).ToList();
|
||||||
if(carryIds?.Count> 0)
|
if (carryIds?.Count > 0)
|
||||||
{
|
{
|
||||||
var carryId = carryIds[^carryIds.Count];
|
var carryId = carryIds[^carryIds.Count];
|
||||||
var curCurry =await _db.Queryable<WmsCarryH>().SingleAsync(it=>it.id == carryId);
|
var curCurry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||||
var isMatch = await IsCarryAndLocationMatchByCarryStd(curCurry, location);
|
var isMatch = await IsCarryAndLocationMatchByCarryStd(curCurry, location);
|
||||||
if (!isMatch) throw new AppFriendlyException("该载具无法放置到目标库位", 500);
|
if (!isMatch) throw new AppFriendlyException("该载具无法放置到目标库位", 500);
|
||||||
}
|
}
|
||||||
@@ -549,11 +550,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
isSuccessful = false;
|
||||||
JNPF.Logging.Log.Error(ex.Message);
|
JNPF.Logging.Log.Error(ex.Message);
|
||||||
await _db.Ado.RollbackTranAsync();
|
await _db.Ado.RollbackTranAsync();
|
||||||
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
|
|
||||||
}
|
}
|
||||||
return await ToApiResult();
|
return isSuccessful;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||||
|
|||||||
Reference in New Issue
Block a user