其他出库记录、原材料到中储仓入库接口变更

This commit is contained in:
2024-09-20 08:59:07 +08:00
parent 4ea75cc677
commit 28742d05d0
11 changed files with 448 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ namespace Tnb.WarehouseMgr
private readonly IWmsPDAScanInStockService _wmsPDAScanInStock;
private readonly IWmsCarryUnbindService _wmsCarryUnbindService;
private readonly IWareHouseService _wareHouseService;
private readonly IOtherOutstockHService _otherOutstockHService;
public WmsMaterialSignHService(
ISqlSugarRepository<WmsCarryH> repository,
IUserManager userManager,
@@ -54,7 +55,8 @@ namespace Tnb.WarehouseMgr
IVisualDevService visualDevService,
IWmsPDAScanInStockService wmsPDAScanInStock,
IWmsCarryUnbindService wmsCarryUnbindService,
IWareHouseService wareHouseService)
IWareHouseService wareHouseService,
IOtherOutstockHService otherOutstockHService)
{
_db = repository.AsSugarClient();
_userManager = userManager;
@@ -64,6 +66,7 @@ namespace Tnb.WarehouseMgr
_wmsPDAScanInStock = wmsPDAScanInStock;
_wmsCarryUnbindService = wmsCarryUnbindService;
_wareHouseService = wareHouseService;
_otherOutstockHService = otherOutstockHService;
}
/// <summary>
@@ -125,7 +128,29 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($"【MaterialSign】载具{input.carry_code}任务{wmsDistaskH.bill_code}的业务类型异常", 500);
}
wmsMaterialSignH.biz_type = wmsDistaskH.biz_type;
// wms其它出库记录主表
OtherOutstockAddDetailInput otherOutstockAddDetailInput = new OtherOutstockAddDetailInput();
switch (wmsDistaskH.biz_type)
{
case WmsWareHouseConst.BIZTYPE_WMSMATERIALTRANSFER_ID:
{
WmsMaterialTransferD wmsMaterialTransferD = await _db.Queryable<WmsMaterialTransferD>().Where(r => r.id == wmsDistaskH.source_id).FirstAsync();
WmsMaterialTransfer wmsMaterialTransfer = await _db.Queryable<WmsMaterialTransfer>().Where(r => r.id == wmsMaterialTransferD.bill_id).FirstAsync();
otherOutstockAddDetailInput.source_detail_id = wmsMaterialTransferD.id;
otherOutstockAddDetailInput.source_id = wmsMaterialTransfer.id;
otherOutstockAddDetailInput.source_bill_code = wmsMaterialTransfer.bill_code;
otherOutstockAddDetailInput.department = "";
otherOutstockAddDetailInput.salesman = "";
otherOutstockAddDetailInput.warehouse_code = wmsMaterialTransfer.warehouse_outstock;
break;
}
}
List<WmsMaterialSignD> wmsMaterialSignDs = new List<WmsMaterialSignD>();
List<OtherOutstockAddDetailDetail> details = new List<OtherOutstockAddDetailDetail>();
await _db.Ado.BeginTranAsync();
foreach (var item in input.details)
{
@@ -173,6 +198,26 @@ namespace Tnb.WarehouseMgr
}
await _db.Updateable<WmsTempCode>().SetColumns(r => r.codeqty == wmsCarryCode.codeqty)
.Where(r => r.barcode == wmsCarryCode.barcode).ExecuteCommandAsync();
// wms其他出库记录明细
OtherOutstockAddDetailDetail otherOutstockAddDetailDetail = new OtherOutstockAddDetailDetail();
otherOutstockAddDetailDetail.actual_outstock_qty = item.sign_qty;
otherOutstockAddDetailDetail.auxprop_xph = wmsCarryCode.auxprop_xph;
otherOutstockAddDetailDetail.auxprop_gys = wmsCarryCode.auxprop_gys;
otherOutstockAddDetailDetail.qty = item.sign_qty;
otherOutstockAddDetailDetail.unit = wmsCarryCode.unit_id;
otherOutstockAddDetailDetail.batchno = wmsCarryCode.code_batch;
otherOutstockAddDetailDetail.material_code = basMaterial.code;
otherOutstockAddDetailDetail.material_id = basMaterial.id;
otherOutstockAddDetailDetail.material_name = basMaterial.name;
details.Add(otherOutstockAddDetailDetail);
}
if (!string.IsNullOrEmpty(otherOutstockAddDetailInput.warehouse_code))
{
otherOutstockAddDetailInput.details = details;
await _otherOutstockHService.AddDetail(otherOutstockAddDetailInput, _db);
}
// 如果没有条码 设置载具状态为空闲