原材料/成品调拨出库接口、采购收货添加是否赠品、单价、是否自制字段
This commit is contained in:
@@ -77,8 +77,6 @@ namespace Tnb.WarehouseMgr
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.carry_code == input.carry_code).FirstAsync();
|
||||
if (wmsCarryH == null)
|
||||
{
|
||||
@@ -93,7 +91,7 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException($"【MaterialSign】载具{input.carry_code}未绑定物料", 500);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(wmsCarryH.location_id))
|
||||
if (string.IsNullOrEmpty(wmsCarryH.location_id))
|
||||
{
|
||||
throw new AppFriendlyException($"【MaterialSign】载具{input.carry_code}当前库位为空,无法签收", 500);
|
||||
}
|
||||
@@ -106,6 +104,7 @@ namespace Tnb.WarehouseMgr
|
||||
wmsMaterialSignH.carry_id = wmsCarryH.id;
|
||||
wmsMaterialSignH.carry_code = wmsCarryH.carry_code;
|
||||
List<WmsMaterialSignD> wmsMaterialSignDs = new List<WmsMaterialSignD>();
|
||||
await _db.Ado.BeginTranAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
if (item.sign_qty < 0)
|
||||
@@ -147,11 +146,9 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
CarryCodeUnbindCodeInput carryCodeUnbindCodeInput = new CarryCodeUnbindCodeInput();
|
||||
await _wmsCarryUnbindService.CarryCodeUnbindCode(carryCodeUnbindCodeInput, _db);
|
||||
wmsCarryCodes.Remove(wmsCarryCode);
|
||||
|
||||
await _db.Updateable<WmsTempCode>().SetColumns(r => r.codeqty == wmsCarryCode.codeqty - item.sign_qty)
|
||||
.Where(r => r.barcode == wmsCarryCode.barcode).ExecuteCommandAsync();
|
||||
}
|
||||
await _db.Updateable<WmsTempCode>().SetColumns(r => r.codeqty == wmsCarryCode.codeqty)
|
||||
.Where(r => r.barcode == wmsCarryCode.barcode).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
BasLocation carryLoc = await _db.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
|
||||
@@ -179,21 +176,19 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException("没有可以回库的库位", 500);
|
||||
}
|
||||
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput.startlocation_id = carryLoc.location_code;
|
||||
commonCreatePretaskInput.startlocation_id = carryLoc.id;
|
||||
commonCreatePretaskInput.endlocation_id = endLocations[0].id;
|
||||
commonCreatePretaskInput.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID;
|
||||
commonCreatePretaskInput.isExcuteMission = false;
|
||||
commonCreatePretaskInput.moduleConsts = ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID;
|
||||
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WmsMaterialSign_ID;
|
||||
|
||||
Logger.LogInformation($"【MaterialSign】 开始生成原材料仓回库任务 起点{carryLoc.location_code} 终点{endLocations[0].location_code} 托盘 {wmsCarryH.carry_code}");
|
||||
|
||||
Entities.Dto.Outputs.Result res = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput, _db);
|
||||
if (res.code == HttpStatusCode.OK)
|
||||
if (res.code != HttpStatusCode.OK)
|
||||
{
|
||||
|
||||
throw new AppFriendlyException(res.msg, 500);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -210,8 +205,8 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
|
||||
await _db.Updateable(wmsMaterialSignH).ExecuteCommandAsync();
|
||||
await _db.Updateable(wmsMaterialSignDs).ExecuteCommandAsync();
|
||||
await _db.Insertable(wmsMaterialSignH).ExecuteCommandAsync();
|
||||
await _db.Insertable(wmsMaterialSignDs).ExecuteCommandAsync();
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user