载具绑定物料

This commit is contained in:
2024-05-30 11:32:45 +08:00
parent 260dd5d195
commit 892d758dbf
4 changed files with 27 additions and 19 deletions

View File

@@ -35,7 +35,10 @@ namespace Tnb.WarehouseMgr
private readonly IBillRullService _billRullService;
private readonly IWareHouseService _wareHouseService;
private readonly IWmsCarryBindService _wmsCarryBindService;
private readonly IWmsCarryService _wmsCarryService;
public WmsPDACarryBindService(
ISqlSugarRepository<WmsCarryH> repository,
IRunService runService,
@@ -43,7 +46,8 @@ namespace Tnb.WarehouseMgr
IUserManager userManager,
IWareHouseService wareHouseService,
IBillRullService billRullService,
IWmsCarryBindService wmsCarryBindService)
IWmsCarryBindService wmsCarryBindService,
IWmsCarryService wmsCarryService)
{
_db = repository.AsSugarClient();
_runService = runService;
@@ -52,6 +56,7 @@ namespace Tnb.WarehouseMgr
_billRullService = billRullService;
_wareHouseService = wareHouseService;
_wmsCarryBindService = wmsCarryBindService;
_wmsCarryService = wmsCarryService;
OverideFuncs.CreateAsync = PDACarryBind;
}
@@ -307,18 +312,20 @@ namespace Tnb.WarehouseMgr
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
WmsCarryCode wmsCarryCode = new WmsCarryCode();
wmsCarryCode.create_time = DateTime.Now;
wmsCarryCode.carry_id = wmsCarryH.id;
wmsCarryCode.barcode = wmsCarryH.carry_code;
wmsCarryCode.codeqty = input.qty;
wmsCarryCode.material_id = input.material_id;
wmsCarryCode.material_code = basMaterial.code;
wmsCarryCode.material_name = basMaterial.name;
wmsCarryCode.location_id = endLocations[0].id;
wmsCarryCode.location_code = endLocations[0].location_code;
wmsCarryCode.code_batch = wmsTransferInstockD.pi_code;
_ = await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput();
bindCarryCodeInput.carry_id = wmsCarryH.id;
bindCarryCodeInput.barcode = wmsCarryH.carry_code;
bindCarryCodeInput.codeqty = input.qty;
bindCarryCodeInput.material_id = input.material_id;
bindCarryCodeInput.material_code = basMaterial.code;
bindCarryCodeInput.material_name = basMaterial.name;
bindCarryCodeInput.location_id = endLocations[0].id;
bindCarryCodeInput.location_code = endLocations[0].location_code;
bindCarryCodeInput.code_batch = wmsTransferInstockD.pi_code;
await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput);
}
}
}