fix #2483
This commit is contained in:
parent
3b70246e9d
commit
1b7759c9e2
16 changed files with 98 additions and 41 deletions
13
.idea/.idea.BMA.EHR.Recruit.Service/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.BMA.EHR.Recruit.Service/.idea/.gitignore
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/contentModel.xml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/modules.xml
|
||||||
|
/.idea.BMA.EHR.Recruit.Service.iml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
1
.idea/.idea.BMA.EHR.Recruit.Service/.idea/.name
generated
Normal file
1
.idea/.idea.BMA.EHR.Recruit.Service/.idea/.name
generated
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
BMA.EHR.Recruit.Service
|
||||||
|
After Width: | Height: | Size: 23 B |
4
.idea/.idea.BMA.EHR.Recruit.Service/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.BMA.EHR.Recruit.Service/.idea/encodings.xml
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/.idea.BMA.EHR.Recruit.Service/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.BMA.EHR.Recruit.Service/.idea/indexLayout.xml
generated
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.BMA.EHR.Recruit.Service/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.BMA.EHR.Recruit.Service/.idea/vcs.xml
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -752,6 +752,8 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
||||||
var cols = workSheet.GetHeaderColumns();
|
var cols = workSheet.GetHeaderColumns();
|
||||||
|
|
||||||
int row = 2;
|
int row = 2;
|
||||||
|
int batchCount = 0;
|
||||||
|
const int batchSize = 500;
|
||||||
|
|
||||||
while (row <= totalRows)
|
while (row <= totalRows)
|
||||||
{
|
{
|
||||||
|
|
@ -860,13 +862,23 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
||||||
|
|
||||||
//imported.Recruits.Add(r);
|
//imported.Recruits.Add(r);
|
||||||
row++;
|
row++;
|
||||||
|
batchCount++;
|
||||||
|
|
||||||
|
// Batch save to prevent OutOfMemoryException on large imports
|
||||||
|
if (batchCount >= batchSize)
|
||||||
|
{
|
||||||
|
_context.SaveChanges();
|
||||||
|
_context.ChangeTracker.Clear();
|
||||||
|
// Re-attach the import entity after clearing the tracker
|
||||||
|
_context.RecruitImports.Attach(imported);
|
||||||
|
batchCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally save to database
|
// Save remaining records in the last batch
|
||||||
|
|
||||||
_context.SaveChanges();
|
_context.SaveChanges();
|
||||||
|
|
||||||
return Success();
|
return Success();
|
||||||
|
|
@ -1371,6 +1383,8 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
||||||
var cols = workSheet.GetHeaderColumns();
|
var cols = workSheet.GetHeaderColumns();
|
||||||
|
|
||||||
int row = 8;
|
int row = 8;
|
||||||
|
int batchCount = 0;
|
||||||
|
const int batchSize = 500;
|
||||||
var endRow = workSheet.Dimension.End.Row; // แถวสุดท้ายที่มีข้อมูล
|
var endRow = workSheet.Dimension.End.Row; // แถวสุดท้ายที่มีข้อมูล
|
||||||
while (row <= endRow)
|
while (row <= endRow)
|
||||||
{
|
{
|
||||||
|
|
@ -1461,14 +1475,31 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
batchCount++;
|
||||||
|
|
||||||
|
// Batch save to prevent OutOfMemoryException on large imports
|
||||||
|
if (batchCount >= batchSize)
|
||||||
|
{
|
||||||
|
rec_import.ScoreImport = imported;
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
_context.ChangeTracker.Clear();
|
||||||
|
// Re-attach entities after clearing the tracker
|
||||||
|
_context.Attach(rec_import);
|
||||||
|
_context.Attach(imported);
|
||||||
|
imported.Scores.Clear();
|
||||||
|
batchCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
} // end of sheet loop
|
} // end of sheet loop
|
||||||
} // end of all file loop
|
} // end of all file loop
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally save to database
|
// Save remaining records in the last batch
|
||||||
|
if (imported.Scores.Count > 0)
|
||||||
|
{
|
||||||
rec_import.ScoreImport = imported;
|
rec_import.ScoreImport = imported;
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
return Success();
|
return Success();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
"auditLevel": "low",
|
"auditLevel": "low",
|
||||||
"auditMode": "direct"
|
"auditMode": "direct"
|
||||||
},
|
},
|
||||||
"SdkAnalysisLevel": "9.0.300"
|
"SdkAnalysisLevel": "10.0.200"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net7.0": {
|
"net7.0": {
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
"privateAssets": "all"
|
"privateAssets": "all"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/9.0.305/RuntimeIdentifierGraph.json"
|
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.203/RuntimeIdentifierGraph.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/suphonchaip/.nuget/packages/</NuGetPackageRoot>
|
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/suphonchaip/.nuget/packages/</NuGetPackageRoot>
|
||||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/suphonchaip/.nuget/packages/</NuGetPackageFolders>
|
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/suphonchaip/.nuget/packages/</NuGetPackageFolders>
|
||||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.0</NuGetToolVersion>
|
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
<SourceRoot Include="/Users/suphonchaip/.nuget/packages/" />
|
<SourceRoot Include="/Users/suphonchaip/.nuget/packages/" />
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@ using System.Reflection;
|
||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("BMA.EHR.Recruit.Service")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("BMA.EHR.Recruit.Service")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
<<<<<<< HEAD
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3b70246e9d6b2564a4d9b34daf5f4837c4116a91")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+82e6bcc95bc1a1582fcc9513f288ef318f5adb72")]
|
|
||||||
=======
|
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d245236a144a9ba61661418db9ef1a8a2225d063")]
|
|
||||||
>>>>>>> develop
|
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("BMA.EHR.Recruit.Service")]
|
[assembly: System.Reflection.AssemblyProductAttribute("BMA.EHR.Recruit.Service")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("BMA.EHR.Recruit.Service")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("BMA.EHR.Recruit.Service")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1 @@
|
||||||
<<<<<<< HEAD
|
41b5cec2055d8189cb57cbe339bf4738c10bcf621221538d3a3cce6fb5666e55
|
||||||
e6710ad194b71c423e48e4496ccfad9f61fd14ce3d380484fc72866c29b8ac89
|
|
||||||
=======
|
|
||||||
157a45ee45981ce605f03881ba3934018f157203e24d6fc6a8c2d7a6fcd5987d
|
|
||||||
>>>>>>> develop
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
is_global = true
|
is_global = true
|
||||||
build_property.TargetFramework = net7.0
|
build_property.TargetFramework = net7.0
|
||||||
|
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||||
|
build_property.TargetFrameworkVersion = v7.0
|
||||||
build_property.TargetPlatformMinVersion =
|
build_property.TargetPlatformMinVersion =
|
||||||
build_property.UsingMicrosoftNETSdkWeb = true
|
build_property.UsingMicrosoftNETSdkWeb = true
|
||||||
build_property.ProjectTypeGuids =
|
build_property.ProjectTypeGuids =
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
// <auto-generated/>
|
// <auto-generated/>
|
||||||
global using global::Microsoft.AspNetCore.Builder;
|
global using Microsoft.AspNetCore.Builder;
|
||||||
global using global::Microsoft.AspNetCore.Hosting;
|
global using Microsoft.AspNetCore.Hosting;
|
||||||
global using global::Microsoft.AspNetCore.Http;
|
global using Microsoft.AspNetCore.Http;
|
||||||
global using global::Microsoft.AspNetCore.Routing;
|
global using Microsoft.AspNetCore.Routing;
|
||||||
global using global::Microsoft.Extensions.Configuration;
|
global using Microsoft.Extensions.Configuration;
|
||||||
global using global::Microsoft.Extensions.DependencyInjection;
|
global using Microsoft.Extensions.DependencyInjection;
|
||||||
global using global::Microsoft.Extensions.Hosting;
|
global using Microsoft.Extensions.Hosting;
|
||||||
global using global::Microsoft.Extensions.Logging;
|
global using Microsoft.Extensions.Logging;
|
||||||
global using global::System;
|
global using System;
|
||||||
global using global::System.Collections.Generic;
|
global using System.Collections.Generic;
|
||||||
global using global::System.IO;
|
global using System.IO;
|
||||||
global using global::System.Linq;
|
global using System.Linq;
|
||||||
global using global::System.Net.Http;
|
global using System.Net.Http;
|
||||||
global using global::System.Net.Http.Json;
|
global using System.Net.Http.Json;
|
||||||
global using global::System.Threading;
|
global using System.Threading;
|
||||||
global using global::System.Threading.Tasks;
|
global using System.Threading.Tasks;
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -13782,7 +13782,7 @@
|
||||||
"auditLevel": "low",
|
"auditLevel": "low",
|
||||||
"auditMode": "direct"
|
"auditMode": "direct"
|
||||||
},
|
},
|
||||||
"SdkAnalysisLevel": "9.0.300"
|
"SdkAnalysisLevel": "10.0.200"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net7.0": {
|
"net7.0": {
|
||||||
|
|
@ -13946,7 +13946,7 @@
|
||||||
"privateAssets": "all"
|
"privateAssets": "all"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/9.0.305/RuntimeIdentifierGraph.json"
|
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.203/RuntimeIdentifierGraph.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"dgSpecHash": "z4TN+iW9Ey8=",
|
"dgSpecHash": "6/jNsBvJ3SY=",
|
||||||
"success": true,
|
"success": true,
|
||||||
"projectFilePath": "/Users/suphonchaip/Develop/hrms/hrms-api-recruit/BMA.EHR.Recruit.Service.csproj",
|
"projectFilePath": "/Users/suphonchaip/Develop/hrms/hrms-api-recruit/BMA.EHR.Recruit.Service.csproj",
|
||||||
"expectedPackageFiles": [
|
"expectedPackageFiles": [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue