优化
This commit is contained in:
@@ -27,25 +27,28 @@ namespace Tnb.WarehouseMgr
|
||||
/// PDA投料记录
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSFEEDINGRECORDPDA_ID)]
|
||||
public class WmsPDAFeedingService : BaseWareHouseService, IWmsCarryService, IPdaStroage
|
||||
public class WmsPDAFeedingService : BaseWareHouseService, IPdaStroage
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IWmsCarryService _carryService;
|
||||
public WmsPDAFeedingService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService)
|
||||
IVisualDevService visualDevService,
|
||||
IWmsCarryService carryService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_carryService = carryService;
|
||||
OverideFuncs.CreateAsync = WmsPDAFeedingRecord;
|
||||
}
|
||||
|
||||
@@ -97,7 +100,7 @@ namespace Tnb.WarehouseMgr
|
||||
it.modify_time
|
||||
}).ExecuteCommandAsync();
|
||||
//更新载具
|
||||
row = await UpdateNullCarry(carry);
|
||||
row = await _carryService.UpdateNullCarry(carry);
|
||||
isOk = (row > 0);
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
@@ -124,37 +127,5 @@ namespace Tnb.WarehouseMgr
|
||||
return isOk;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateNullCarry(WmsCarryH carryObj)
|
||||
{
|
||||
var row = -1;
|
||||
try
|
||||
{
|
||||
carryObj.status = 0;
|
||||
carryObj.carry_status = ((int)EnumCarryStatus.空闲).ToString();
|
||||
carryObj.location_id = null;
|
||||
carryObj.location_code = null;
|
||||
carryObj.out_status = "0";
|
||||
carryObj.is_check = 0;
|
||||
carryObj.status = 1;
|
||||
carryObj.bale_num = null;
|
||||
carryObj.collocation_scheme_id = null;
|
||||
carryObj.collocation_scheme_code = null;
|
||||
carryObj.source_id = null;
|
||||
carryObj.source_code = null;
|
||||
row = await _db.Updateable(carryObj).ExecuteCommandAsync();
|
||||
//删除对应明细表
|
||||
//删除载具明细
|
||||
await _db.Deleteable<WmsCarryD>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
//删除载具分拣物料明细
|
||||
await _db.Deleteable<WmsCarryMat>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
//删除载具条码
|
||||
await _db.Deleteable<WmsCarryCode>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
return row;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user