立即调用erp接口 任务单批次生成修改

This commit is contained in:
2024-09-23 15:07:00 +08:00
parent 1c04f0449f
commit 1dc51107f5
16 changed files with 452 additions and 346 deletions

View File

@@ -44,6 +44,7 @@ using Tnb.BasicData;
using Tnb.ProductionMgr.Entities.Entity;
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
using System.Threading;
using Tnb.BasicData.Interfaces;
namespace Tnb.WarehouseMgr
{
@@ -65,6 +66,7 @@ namespace Tnb.WarehouseMgr
private readonly IWmsCarryUnbindService _wmsCarryUnbindService;
private readonly IOrganizeService _organizeService;
private readonly IWmsCarryQueryService _wmsCarryQueryService;
private readonly IThirdApiRecordService _thirdApiRecordService;
public static SemaphoreSlim s_taskDistributeToZCC = new(1);
public static SemaphoreSlim s_taskDistributeYCL2ZCC = new(1);
@@ -82,6 +84,7 @@ namespace Tnb.WarehouseMgr
IWmsCarryUnbindService wmsCarryUnbindService,
IOrganizeService organizeService,
IWmsCarryQueryService wmsCarryQueryService,
IThirdApiRecordService thirdApiRecordService,
IWmsCarryBindService wmsCarryBindService)
{
_db = repository.AsSugarClient();
@@ -94,6 +97,7 @@ namespace Tnb.WarehouseMgr
_wmsCarryUnbindService = wmsCarryUnbindService;
_organizeService = organizeService;
_wmsCarryQueryService = wmsCarryQueryService;
_thirdApiRecordService = thirdApiRecordService;
OverideFuncs.GetListAsync = GetList;
}
@@ -1165,6 +1169,11 @@ namespace Tnb.WarehouseMgr
thirdWebapiRecord2.remark = $"原材料转库单wms_material_transfer:{wmsMaterialTransfer.bill_code}";
await _db.Insertable(thirdWebapiRecord2).ExecuteCommandAsync();
BasFactoryConfig callErp = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.CALLERP);
if(callErp.value=="1"){
await _thirdApiRecordService.Send(new List<ThirdWebapiRecord> { thirdWebapiRecord2 }, "自动", _db);
}
}
// 其它出库
else
@@ -1268,6 +1277,11 @@ namespace Tnb.WarehouseMgr
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
Logger.LogInformation("【WmsMaterialTransferService ModifyAsync】同步其它出库单到erp成功");
BasFactoryConfig callErp = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.CALLERP);
if(callErp.value=="1"){
await _thirdApiRecordService.Send(new List<ThirdWebapiRecord> { thirdWebapiRecord }, "自动", _db);
}
}
}
}