17 changed files with 424 additions and 14110 deletions
-
279src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
-
4src/Shentun.Peis.DbMigrator/appsettings.json
-
5src/Shentun.Peis.Domain/CustomerOrgGroups/CustomerOrgGroup.cs
-
2src/Shentun.Peis.Domain/Patients/Patient.cs
-
13768src/Shentun.Peis.EntityFrameworkCore/Migrations/20240420050902_init20240420002.Designer.cs
-
136src/Shentun.Peis.EntityFrameworkCore/Migrations/20240420050902_init20240420002.cs
-
158src/Shentun.Peis.EntityFrameworkCore/Migrations/20240420092428_init20240420003.cs
-
8src/Shentun.Peis.EntityFrameworkCore/Migrations/20240421094110_init20240421001.Designer.cs
-
39src/Shentun.Peis.EntityFrameworkCore/Migrations/20240421094110_init20240421001.cs
-
37src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
-
18test/Shentun.Peis.Application.Tests/ApiWorkTest.cs
-
58test/Shentun.Peis.Application.Tests/BaseDataHandleTest.cs
-
6test/Shentun.Peis.Application.Tests/GuideTypeAppServiceTest.cs
-
2test/Shentun.Peis.Application.Tests/SysParmAppServiceTest.cs
-
4test/Shentun.Peis.Domain.Tests/CacheServiceTest.cs
-
6test/Shentun.Peis.Domain.Tests/GuideTypeManagerTest.cs
-
4test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs
13768
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240420050902_init20240420002.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,136 +0,0 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240420002 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "column_reference_plug_ins", |
|||
columns: table => new |
|||
{ |
|||
id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false, comment: "编号"), |
|||
display_name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false, comment: "名称"), |
|||
dll_name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "Dll名称"), |
|||
parm_value = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true, comment: "配置参数"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true), |
|||
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_column_reference_plug_ins", x => x.id); |
|||
}, |
|||
comment: "字段对照插件表"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "column_reference", |
|||
columns: table => new |
|||
{ |
|||
id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false, comment: "编号"), |
|||
display_name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false, comment: "名称"), |
|||
column_reference_plug_ins_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "插件ID"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true), |
|||
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_column_reference", x => x.id); |
|||
table.ForeignKey( |
|||
name: "fk_columnreference_columnreferenceplugins", |
|||
column: x => x.column_reference_plug_ins_id, |
|||
principalTable: "column_reference_plug_ins", |
|||
principalColumn: "id"); |
|||
}, |
|||
comment: "字段对照主表"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "column_reference_code", |
|||
columns: table => new |
|||
{ |
|||
id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false, comment: "编号"), |
|||
column_reference_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "字段对照主表ID"), |
|||
code_value = table.Column<string>(type: "text", nullable: false, comment: "本系统编码值"), |
|||
filter_code_value = table.Column<string>(type: "text", nullable: true, comment: "过滤编码值"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true), |
|||
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_column_reference_code", x => x.id); |
|||
table.ForeignKey( |
|||
name: "fk_columnreferencecode_columnreference", |
|||
column: x => x.column_reference_id, |
|||
principalTable: "column_reference", |
|||
principalColumn: "id"); |
|||
}, |
|||
comment: "字段对照本系统编码表"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "column_reference_interface", |
|||
columns: table => new |
|||
{ |
|||
id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false, comment: "编号"), |
|||
column_reference_code_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "字段对照本系统编码表ID"), |
|||
interface_code_value = table.Column<string>(type: "text", nullable: false, comment: "第三方系统编码值"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true), |
|||
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_column_reference_interface", x => x.id); |
|||
table.ForeignKey( |
|||
name: "fk_columnreferenceinterface_columnreferencecode", |
|||
column: x => x.column_reference_code_id, |
|||
principalTable: "column_reference_code", |
|||
principalColumn: "id"); |
|||
}, |
|||
comment: "字段对照第三方系统编码表"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_column_reference_column_reference_plug_ins_id", |
|||
table: "column_reference", |
|||
column: "column_reference_plug_ins_id"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_column_reference_code_column_reference_id", |
|||
table: "column_reference_code", |
|||
column: "column_reference_id"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_column_reference_interface_column_reference_code_id", |
|||
table: "column_reference_interface", |
|||
column: "column_reference_code_id"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "column_reference_interface"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "column_reference_code"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "column_reference"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "column_reference_plug_ins"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,158 +0,0 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240420003 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropForeignKey( |
|||
name: "fk_lis_request_sample_group", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropForeignKey( |
|||
name: "fk_sample_", |
|||
table: "sample_group"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_lis_request_sample_group_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "sample_group_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "sampler", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "sample_container_id", |
|||
table: "lis_request", |
|||
type: "uuid", |
|||
nullable: false, |
|||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), |
|||
comment: "标本容器编号"); |
|||
|
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "sample_type_id", |
|||
table: "lis_request", |
|||
type: "uuid", |
|||
nullable: false, |
|||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), |
|||
comment: "标本类型"); |
|||
|
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "sampler_id", |
|||
table: "lis_request", |
|||
type: "uuid", |
|||
nullable: true, |
|||
comment: "采样人ID"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_lis_request_sample_container_id", |
|||
table: "lis_request", |
|||
column: "sample_container_id"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_lis_request_sample_type_id", |
|||
table: "lis_request", |
|||
column: "sample_type_id"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "fk_lis_request_sample_container", |
|||
table: "lis_request", |
|||
column: "sample_container_id", |
|||
principalTable: "sample_container", |
|||
principalColumn: "id"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "fk_lis_request_sample_type", |
|||
table: "lis_request", |
|||
column: "sample_type_id", |
|||
principalTable: "sample_type", |
|||
principalColumn: "id"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "fk_sample_group_sample_container", |
|||
table: "sample_group", |
|||
column: "sample_container_id", |
|||
principalTable: "sample_container", |
|||
principalColumn: "id"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropForeignKey( |
|||
name: "fk_lis_request_sample_container", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropForeignKey( |
|||
name: "fk_lis_request_sample_type", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropForeignKey( |
|||
name: "fk_sample_group_sample_container", |
|||
table: "sample_group"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_lis_request_sample_container_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_lis_request_sample_type_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "sample_container_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "sample_type_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "sampler_id", |
|||
table: "lis_request"); |
|||
|
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "sample_group_id", |
|||
table: "lis_request", |
|||
type: "uuid", |
|||
fixedLength: true, |
|||
nullable: false, |
|||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), |
|||
comment: "条码分组ID"); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "sampler", |
|||
table: "lis_request", |
|||
type: "character varying(16)", |
|||
maxLength: 16, |
|||
nullable: true, |
|||
comment: "采样人姓名"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_lis_request_sample_group_id", |
|||
table: "lis_request", |
|||
column: "sample_group_id"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "fk_lis_request_sample_group", |
|||
table: "lis_request", |
|||
column: "sample_group_id", |
|||
principalTable: "sample_group", |
|||
principalColumn: "id"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "fk_sample_", |
|||
table: "sample_group", |
|||
column: "sample_container_id", |
|||
principalTable: "sample_container", |
|||
principalColumn: "id"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240421001 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "display_name", |
|||
table: "customer_org_group", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: false, |
|||
comment: "分组名称", |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(20)", |
|||
oldMaxLength: 20, |
|||
oldComment: "分组名称"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "display_name", |
|||
table: "customer_org_group", |
|||
type: "character varying(20)", |
|||
maxLength: 20, |
|||
nullable: false, |
|||
comment: "分组名称", |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(50)", |
|||
oldMaxLength: 50, |
|||
oldComment: "分组名称"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using Shentun.Peis.CustomerOrgs; |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Uow; |
|||
using Xunit.Abstractions; |
|||
using Xunit; |
|||
using Shentun.Peis.DataMigrations; |
|||
|
|||
namespace Shentun.Peis |
|||
{ |
|||
|
|||
|
|||
public class BaseDataHandleTest : PeisApplicationTestBase |
|||
{ |
|||
|
|||
private readonly ITestOutputHelper _output; |
|||
private readonly IUnitOfWorkManager _unitOfWorkManager; |
|||
private readonly BaseDataHandleAppService _appService; |
|||
public BaseDataHandleTest(ITestOutputHelper testOutputHelper) |
|||
{ |
|||
_output = testOutputHelper; |
|||
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
|||
_appService = GetRequiredService<BaseDataHandleAppService>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task TransferPatientData() |
|||
{ |
|||
|
|||
for (int i = 0; i < 1000; i++) |
|||
{ |
|||
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
|||
{ |
|||
var IsHand = await _appService.TransferPatientData(); |
|||
|
|||
await unitOfWork.CompleteAsync(); |
|||
|
|||
_output.WriteLine($"处理{(i + 1) * 1000}"); |
|||
|
|||
if (!IsHand) |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue