Browse Source

数据导入

bjmzak
wxd 2 years ago
parent
commit
2f38a09bec
  1. 849
      src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
  2. 102
      test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs

849
src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
File diff suppressed because it is too large
View File

102
test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs

@ -28,79 +28,79 @@ namespace Shentun.Peis
_appService = GetRequiredService<BaseDataHandleAppService>();
}
[Fact]
public async Task TransferPatientData()
{
//[Fact]
//public async Task TransferPatientData()
//{
for (int i = 0; i < 500; i++)
{
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{
var IsHand = await _appService.TransferPatientData();
// for (int i = 0; i < 500; i++)
// {
// using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
// {
// var IsHand = await _appService.TransferPatientData();
await unitOfWork.CompleteAsync();
// await unitOfWork.CompleteAsync();
_output.WriteLine($"处理{(i + 1) * 1000}");
// _output.WriteLine($"处理{(i + 1) * 1000}");
if (!IsHand)
{
break;
}
}
}
// if (!IsHand)
// {
// break;
// }
// }
// }
}
//}
[Fact]
public async Task TransferPatientRegisterData()
{
//[Fact]
//public async Task TransferPatientRegisterData()
//{
for (int i = 0; i < 3000; i++)
{
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{
var IsHand = await _appService.TransferPatientRegisterData();
// for (int i = 0; i < 3000; i++)
// {
// using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
// {
// var IsHand = await _appService.TransferPatientRegisterData();
await unitOfWork.CompleteAsync();
// await unitOfWork.CompleteAsync();
_output.WriteLine($"处理{(i + 1) * 1000}");
// _output.WriteLine($"处理{(i + 1) * 1000}");
if (!IsHand)
{
break;
}
}
}
// if (!IsHand)
// {
// break;
// }
// }
// }
}
//}
[Fact]
public async Task HandPatientRegisterDoctor()
{
//[Fact]
//public async Task HandPatientRegisterDoctor()
//{
for (int i = 0; i < 3000; i++)
{
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{
var IsHand = await _appService.HandPatientRegisterDoctor();
// for (int i = 0; i < 3000; i++)
// {
// using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
// {
// var IsHand = await _appService.HandPatientRegisterDoctor();
await unitOfWork.CompleteAsync();
// await unitOfWork.CompleteAsync();
_output.WriteLine($"处理{(i + 1) * 1000}");
// _output.WriteLine($"处理{(i + 1) * 1000}");
if (!IsHand)
{
break;
}
}
}
// if (!IsHand)
// {
// break;
// }
// }
// }
}
//}
}
}
Loading…
Cancel
Save