😎采购申请优化代码

This commit is contained in:
bairubing 2025-02-14 16:59:41 +08:00
parent ce1d126366
commit b2e89ddbd9
2 changed files with 1 additions and 2 deletions

View File

@ -37,7 +37,6 @@ public class PurchasingRequisitionToSap : IJob
var sapOutputs = await _purchasingRequisition.TimingSyncToSAPPurchasingRequisition(); var sapOutputs = await _purchasingRequisition.TimingSyncToSAPPurchasingRequisition();
var json = JsonConvert.SerializeObject(sapOutputs); var json = JsonConvert.SerializeObject(sapOutputs);
using var serviceScope = _scopeFactory.CreateScope(); using var serviceScope = _scopeFactory.CreateScope();
var sysEnumService = serviceScope.ServiceProvider.GetRequiredService<SysEnumService>();
var dbMain = serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>().AsTenant().GetConnectionScope("1300000000001").CopyNew(); var dbMain = serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>().AsTenant().GetConnectionScope("1300000000001").CopyNew();
string output = json; string output = json;
var elapsedMilliseconds = (DateTime.Now - startTime).TotalMilliseconds; var elapsedMilliseconds = (DateTime.Now - startTime).TotalMilliseconds;

View File

@ -120,7 +120,7 @@ public class PurchasingRequisitionService : IDynamicApiController, ITransient
//查询BOM //查询BOM
var bomData = await db.CopyNew().Queryable<ConfigurationData>().Where(x => x.ConfigId == configid && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == item.VersionIndex).ToListAsync(); var bomData = await db.CopyNew().Queryable<ConfigurationData>().Where(x => x.ConfigId == configid && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == item.VersionIndex).ToListAsync();
var project = await db.CopyNew().Queryable<Obj119>().Where(x => x.RecordGuid == item.fld004639_Rec && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync(); var project = await db.CopyNew().Queryable<Obj109>().Where(x => x.RecordGuid == item.fld004639_Rec && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync();
foreach (var bomItem in bomData) foreach (var bomItem in bomData)
{ {
var unit = await _dataValidationService.GetUnit(bomItem.ChildObjID, bomItem.ChildGuid); var unit = await _dataValidationService.GetUnit(bomItem.ChildObjID, bomItem.ChildGuid);