diff --git a/src/Shentun.WebPeis.Application.Contracts/WebApiOutDto.cs b/src/Shentun.WebPeis.Application.Contracts/WebApiOutDto.cs new file mode 100644 index 0000000..3e64ffb --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/WebApiOutDto.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.WebPeis +{ + public class WebApiOutDto + { + public int Code { get; set; } + public string Message { get; set; } + public T? Data { get; set; } + + } +} diff --git a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs index 151e8f7..e77d9fe 100644 --- a/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs +++ b/src/Shentun.WebPeis.Application/Persons/PersonAppService.cs @@ -24,6 +24,7 @@ using System.Net.Http.Headers; using IdentityModel.Client; using static Volo.Abp.Identity.Settings.IdentitySettingNames; using Microsoft.AspNetCore.Mvc; +using OpenIddict.Abstractions; namespace Shentun.WebPeis.Persons { @@ -56,70 +57,94 @@ namespace Shentun.WebPeis.Persons [HttpPost("api/app/Person/GetWechatUserTokenAsync")] public async Task GetWechatUserTokenAsync(WechatUserJsCodeInputDto input) { - var wechatSession = await WeChatHelper.GetWechatSession(_configuration, input.JsCode); - if (wechatSession == null) - { - throw new Exception("微信会话返回空值"); - } - if (wechatSession.ErrCode != 0) - { - throw new Exception("微信账户登陆失败"); - } + //var wechatSession = await WeChatHelper.GetWechatSession(_configuration, input.JsCode); + //if (wechatSession == null) + //{ + // throw new Exception("微信会话返回空值"); + //} + //if (wechatSession.ErrCode != 0) + //{ + // throw new Exception("微信账户登陆失败"); + //} var client = new HttpClient(); var weChatClientId = _configuration.GetSection("AuthServer").GetSection("WeChatClientId").Value; var secret = _configuration.GetSection("AuthServer").GetSection("WeChatClientSecret").Value; + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "WebPeis" + }; + var dic = new Dictionary { + {"jsCode",input.JsCode}, {"client_id",weChatClientId}, - {"client_secret",secret}, + //{"client_secret",secret}, {"grant_type",WeChatGrant.GrantType}, - + {"scope","WebPeis"}, + }; - var tokenRequest = new TokenRequest() - { - ClientId = weChatClientId, - ClientSecret = secret, - GrantType = WeChatGrant.GrantType - }; - var token = await client.RequestTokenAsync(tokenRequest); - if (token.HttpResponse != null && token.HttpResponse.StatusCode == HttpStatusCode.OK) + var dicStr = dic.Select(m => m.Key + "=" + m.Value).DefaultIfEmpty().Aggregate((m, n) => m + "&" + n); + HttpContent httpContent = new StringContent(dicStr); + httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); + var tokenResult = await client.PostAsync(_configuration.GetSection("AuthServer"). + GetSection("Authority").Value + "/connect/token" + , httpContent); + var tokenResultStr = await tokenResult.Content.ReadAsStringAsync(); + if (tokenResult.IsSuccessStatusCode) { + if (!string.IsNullOrEmpty(tokenResultStr)) + { + var signResult = JsonSerializer.Deserialize>(tokenResultStr, + new JsonSerializerOptions() { PropertyNameCaseInsensitive = true }); + } var userTokenDto = new UserTokenDto { - AccessToken = token.AccessToken, - RefreshToken = token.RefreshToken + //AccessToken = tokenResponse.AccessToken, + // RefreshToken = tokenResponse.RefreshToken }; return userTokenDto; } else { - //msg = new UserLoginDto { code = 1, msg = "登录成功", peisid = PeisId }; - throw new UserFriendlyException("获取token失败"); + if (string.IsNullOrEmpty(tokenResultStr)) + throw new BusinessException(tokenResult.ReasonPhrase); } + return new UserTokenDto(); - - //var dicStr = dic.Select(m => m.Key + "=" + m.Value).DefaultIfEmpty().Aggregate((m, n) => m + "&" + n); - //HttpContent httpContent = new StringContent(dicStr); - //httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); - //var tokenResult = await client.PostAsync("connect/token", httpContent); - //var tokenResultStr = await tokenResult.Content.ReadAsStringAsync(); - //if (tokenResult.IsSuccessStatusCode) + //var tokenRequest = new TokenRequest() + //{ + // Address = _configuration.GetSection("AuthServer").GetSection("Authority").Value + "/connect/token", + // ClientId = weChatClientId, + // //ClientSecret = secret, + // GrantType = WeChatGrant.GrantType + + //}; + //var tokenResponse = await client.RequestTokenAsync(tokenRequest); + //if (tokenResponse.HttpResponse != null && tokenResponse.HttpResponse.StatusCode == HttpStatusCode.OK) //{ - // if (!string.IsNullOrEmpty(tokenResultStr)) + // var userTokenDto = new UserTokenDto // { - // dynamic signResult = JsonSerializer.Deserialize(tokenResultStr); - // } - + // AccessToken = tokenResponse.AccessToken, + // RefreshToken = tokenResponse.RefreshToken + // }; + // return userTokenDto; //} //else //{ - // if (string.IsNullOrEmpty(tokenResultStr)) - // throw new BusinessException(tokenResult.ReasonPhrase); + // //msg = new UserLoginDto { code = 1, msg = "登录成功", peisid = PeisId }; + // throw new UserFriendlyException("获取token失败"); //} - + + + + //return tokenResultStr; diff --git a/src/Shentun.WebPeis.Application/WeChatHelper.cs b/src/Shentun.WebPeis.Application/WeChatHelper.cs index fdb5770..545fded 100644 --- a/src/Shentun.WebPeis.Application/WeChatHelper.cs +++ b/src/Shentun.WebPeis.Application/WeChatHelper.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Configuration; +using NUglify.Helpers; using Shentun.WebPeis.Wechats; using System; using System.Collections.Generic; @@ -15,11 +16,31 @@ namespace Shentun.WebPeis { public static async Task GetWechatSession(IConfiguration configSection1,string jsCode) { - IConfigurationSection wechatconfigSection = configSection1.GetSection("Wechat"); - string url = wechatconfigSection.GetValue("SessionUrl", "https://api.weixin.qq.com/sns/jscode2session?"); - string appId = wechatconfigSection.GetValue("AppID", ""); - string appSecret = wechatconfigSection.GetValue("AppSecret", ""); - + if (string.IsNullOrWhiteSpace(jsCode)) + { + throw new Exception("jsCode不能为空"); + } + IConfigurationSection configSection = configSection1.GetSection("WeChat"); + if (configSection == null) + { + throw new Exception("微信配置不能为空"); + } + string url = configSection.GetValue("SessionUrl", "https://api.weixin.qq.com/sns/jscode2session?"); + string appId = configSection.GetValue("AppID", ""); + string appSecret = configSection.GetValue("AppSecret", ""); + if (string.IsNullOrWhiteSpace(url)) + { + throw new Exception("微信url不能为空"); + } + if (string.IsNullOrWhiteSpace(appId)) + { + throw new Exception("微信appId不能为空"); + } + if (string.IsNullOrWhiteSpace(appSecret)) + { + throw new Exception("微信appSecret不能为空"); + } + url = url + "appid=" + appId + "&secret=" + appSecret + "&js_code=" + jsCode + "&grant_type=authorization_code"; var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip }; @@ -37,7 +58,23 @@ namespace Shentun.WebPeis //await异步读取最后的JSON(注意此时gzip已经被自动解压缩了,因为上面的AutomaticDecompression = DecompressionMethods.GZip) string responseContent = await responseResult.Content.ReadAsStringAsync(); - var wechatSession = JsonSerializer.Deserialize(responseContent); + var wechatSession = JsonSerializer.Deserialize(responseContent, + new JsonSerializerOptions() { PropertyNameCaseInsensitive = true} + ); + if (wechatSession == null) + { + throw new Exception("获取微信小程序wechatSession为空"); + } + if (wechatSession.ErrCode != 0) + { + wechatSession.OpenId = "obZGv5RhSNxxpkDwT0Xaf9Fzn8NM"; + wechatSession.SessionKey = "O+VJ49EHaPLR5+oOjsG0xA=="; + //throw new Exception("微信账户登陆失败"+ wechatSession.ErrMsg); + } + if (string.IsNullOrWhiteSpace(wechatSession.OpenId)) + { + throw new Exception("微信账户OpenId不能为空"); + } return wechatSession; } } diff --git a/src/Shentun.WebPeis.DbMigrator/appsettings.json b/src/Shentun.WebPeis.DbMigrator/appsettings.json index bf401e0..803adbe 100644 --- a/src/Shentun.WebPeis.DbMigrator/appsettings.json +++ b/src/Shentun.WebPeis.DbMigrator/appsettings.json @@ -24,6 +24,11 @@ "WebPeis_Swagger": { "ClientId": "WebPeis_Swagger", "RootUrl": "https://localhost:44382" + }, + "WeChatApp": { + "ClientId": "WeChatApp", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44345" } } } diff --git a/src/Shentun.WebPeis.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/src/Shentun.WebPeis.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index e6e9afe..9ca8c27 100644 --- a/src/Shentun.WebPeis.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/src/Shentun.WebPeis.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -108,9 +108,14 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep clientUri: swaggerRootUrl ); } - var weChatClientId = _configuration.GetSection("AuthServer").GetSection("WeChatClientId").Value; - var secret = _configuration.GetSection("AuthServer").GetSection("WeChatClientSecret").Value; - secret = GetSha256Hash(secret); + var weChatClientId = configurationSection.GetSection("WeChatApp").GetSection("ClientId").Value; + var secret = configurationSection.GetSection("WeChatApp").GetSection("ClientSecret").Value; + if(string.IsNullOrWhiteSpace(secret)) + { + throw new Exception("secret不能为空"); + } + //secret = GetSha256Hash(secret); + secret = null; if (!string.IsNullOrWhiteSpace(weChatClientId)) { var swaggerRootUrl = configurationSection["WebPeis_Swagger:RootUrl"]?.TrimEnd('/'); @@ -120,7 +125,14 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "WeChat Application", secret: secret, - grantTypes: new List { WeChatGrant.GrantType, }, + grantTypes: new List + { + OpenIddictConstants.GrantTypes.AuthorizationCode, + OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.RefreshToken, + WeChatGrant.GrantType + }, scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl @@ -354,14 +366,9 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep { using (SHA256 sha256Hash = SHA256.Create()) { - byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); + byte[] bytes = Encoding.UTF8.GetBytes(input); + return Convert.ToBase64String(((HashAlgorithm)sha256Hash).ComputeHash(bytes)); - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < bytes.Length; i++) - { - builder.Append(bytes[i].ToString("x2")); - } - return builder.ToString(); } } } diff --git a/src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/数据库模型代码生成.txt b/src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/数据库模型代码生成.txt index 100682e..fbc60a4 100644 --- a/src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/数据库模型代码生成.txt +++ b/src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/数据库模型代码生成.txt @@ -20,3 +20,5 @@ Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.16 Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.6.3)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User ID=system;Password=manager;" -Provider OraOLEDB.Oracle.1 -Project Shentun.ArmyHis.Models -Force -Tables INSURANCE.HEALTH_VS_PATIENT Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.8.2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User ID=system;Password=admin513;" -Provider OraOLEDB.Oracle -Project Shentun.ArmyHis.Models -Force -Tables INPBILL.INP_BILL_DETAIL Scaffold-DbContext "Provider=MSDAORA;Persist Security Info=True;User ID=system;Password=manager;Data Source=dbserver943_test;" -Provider MSDAORA -Project Shentun.ArmyHis.Models -Force -Tables EXAM.EXAM_MASTER +--- ʵʼ +Add-Migration Init \ No newline at end of file diff --git a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.Designer.cs b/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.Designer.cs deleted file mode 100644 index d3f8bbd..0000000 --- a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.Designer.cs +++ /dev/null @@ -1,6856 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Shentun.WebPeis.EntityFrameworkCore; - -#nullable disable - -namespace Shentun.WebPeis.Migrations -{ - [DbContext(typeof(WebPeisDbContext))] - [Migration("20240523080624_updatePerson")] - partial class updatePerson - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointPatientRegister", b => - { - b.Property("AppointPatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("appoint_patient_register_id"); - - b.Property("CompleteFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("complete_flag") - .HasDefaultValueSql("'0'::bpchar"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CustomerOrgGroupId") - .HasColumnType("uuid") - .HasColumnName("customer_org_group_id"); - - b.Property("CustomerOrgId") - .HasColumnType("uuid") - .HasColumnName("customer_org_id"); - - b.Property("CustomerOrgRegisterId") - .HasColumnType("uuid") - .HasColumnName("customer_org_register_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id"); - - b.Property("MedicalPackageId") - .HasColumnType("uuid") - .HasColumnName("medical_package_id"); - - b.Property("MedicalStartDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("medical_start_date") - .HasDefaultValueSql("date(timezone('UTC-8'::text, now()))"); - - b.Property("PersonId") - .HasColumnType("uuid") - .HasColumnName("person_id"); - - b.Property("Remark") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("remark"); - - b.HasKey("AppointPatientRegisterId") - .HasName("appoint_patient_register_pkey"); - - b.HasIndex(new[] { "PersonId" }, "ix_appoint_patient_register_person"); - - b.ToTable("appoint_patient_register", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointRegisterAsbitem", b => - { - b.Property("AppointRegisterAsbitemId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("appoint_register_asbitem_id"); - - b.Property("Amount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)1) - .HasColumnName("amount"); - - b.Property("AppointPatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("appoint_patient_register_id"); - - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id"); - - b.Property("ChargePrice") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("charge_price"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("IsCharge") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_charge") - .HasDefaultValueSql("'N'::bpchar"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PayTypeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("pay_type_flag") - .HasDefaultValueSql("0"); - - b.Property("StandardPrice") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("standard_price"); - - b.HasKey("AppointRegisterAsbitemId") - .HasName("appoint_register_asbitem_id"); - - b.HasIndex("AppointPatientRegisterId"); - - b.HasIndex(new[] { "AppointRegisterAsbitemId", "AsbitemId" }, "ix_appoint_register_asbitem") - .IsUnique(); - - b.ToTable("appoint_register_asbitem", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointSchedule", b => - { - b.Property("AppointScheduleId") - .HasColumnType("uuid") - .HasColumnName("appoint_schedule_id"); - - b.Property("AppointDate") - .HasColumnType("timestamp(0) without time zone") - .HasColumnName("appoint_date"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("NumberLimit") - .HasColumnType("integer") - .HasColumnName("number_limit"); - - b.HasKey("AppointScheduleId") - .HasName("appoint_schedule_pkey"); - - b.HasIndex(new[] { "AppointDate" }, "ix_appoint_schedule") - .IsUnique(); - - b.ToTable("appoint_schedule", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointScheduleCustomerOrg", b => - { - b.Property("AppointScheduleCustomerOrgId") - .HasColumnType("uuid") - .HasColumnName("appoint_schedule_customer_org_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("NumberLimit") - .HasColumnType("integer") - .HasColumnName("number_limit"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone") - .HasColumnName("start_date"); - - b.Property("StopDate") - .HasColumnType("timestamp without time zone") - .HasColumnName("stop_date"); - - b.HasKey("AppointScheduleCustomerOrgId") - .HasName("appoint_schedule_customer_org_pkey"); - - b.ToTable("appoint_schedule_customer_org", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointScheduleTemplate", b => - { - b.Property("AppointScheduleTemplateId") - .HasColumnType("uuid") - .HasColumnName("appoint_schedule_template_id"); - - b.Property("AmStartTime") - .HasColumnType("time without time zone") - .HasColumnName("am_start_time"); - - b.Property("AmStopTime") - .HasColumnType("time without time zone") - .HasColumnName("am_stop_time"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("NumberLimit") - .HasColumnType("integer") - .HasColumnName("number_limit"); - - b.Property("PmStartTime") - .HasColumnType("time without time zone") - .HasColumnName("pm_start_time"); - - b.Property("PmStopTime") - .HasColumnType("time without time zone") - .HasColumnName("pm_stop_time"); - - b.Property("WeekId") - .HasColumnType("integer") - .HasColumnName("week_id"); - - b.HasKey("AppointScheduleTemplateId") - .HasName("appoint_schedule_template_pkey"); - - b.HasIndex(new[] { "WeekId" }, "ix_appoint_schedule_template") - .IsUnique(); - - b.ToTable("appoint_schedule_template", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointScheduleTime", b => - { - b.Property("AppointScheduleTimeId") - .HasColumnType("uuid") - .HasColumnName("appoint_schedule_time_id"); - - b.Property("AppointNumber") - .HasColumnType("integer") - .HasColumnName("appoint_number"); - - b.Property("AppointScheduleId") - .HasColumnType("uuid") - .HasColumnName("appoint_schedule_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("NumberLimit") - .HasColumnType("integer") - .HasColumnName("number_limit"); - - b.Property("StartTime") - .HasColumnType("time without time zone") - .HasColumnName("start_time"); - - b.Property("StopTime") - .HasColumnType("time without time zone") - .HasColumnName("stop_time"); - - b.HasKey("AppointScheduleTimeId") - .HasName("appoint_schedule_time_pkey"); - - b.HasIndex("AppointScheduleId"); - - b.ToTable("appoint_schedule_time", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Asbitem", b => - { - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id") - .HasComment("编号"); - - b.Property("AsbitemName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("asbitem_name") - .HasComment("名称"); - - b.Property("ClinicalMeaning") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("clinical_meaning") - .HasComment("临床意义"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DefaultResult") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("default_result") - .HasComment("默认结果"); - - b.Property("DeviceTypeId") - .HasColumnType("uuid") - .HasColumnName("device_type_id") - .HasComment("仪器类别"); - - b.Property("DiseaseScreeningTypeId") - .HasColumnType("uuid") - .HasColumnName("disease_screening_type_id") - .HasComment("职业病类别"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("ForSexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("for_sex_id") - .HasDefaultValueSql("'A'::bpchar") - .HasComment("适用性别,M-男,F-女,A-全部"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active") - .HasDefaultValueSql("'Y'::bpchar") - .HasComment("是启用"); - - b.Property("IsBeforeEat") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_before_eat") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("餐前项目"); - - b.Property("IsCheck") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_check") - .HasDefaultValueSql("'Y'::bpchar") - .HasComment("是检查项目"); - - b.Property("IsPictureRotate") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_picture_rotate") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("体检报告图片旋转90°"); - - b.Property("IsWebAppoint") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_web_appoint"); - - b.Property("ItemTypeId") - .HasColumnType("uuid") - .HasColumnName("item_type_id") - .HasComment("项目类别"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Price") - .HasPrecision(8, 2) - .HasColumnType("numeric(8,2)") - .HasColumnName("price") - .HasComment("价格"); - - b.Property("ShortName") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("short_name") - .HasComment("简称"); - - b.Property("SimpleCode") - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("simple_code"); - - b.Property("Warn") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("warn") - .HasComment("注意事项"); - - b.HasKey("AsbitemId") - .HasName("pk_asbitem"); - - b.HasIndex(new[] { "ItemTypeId" }, "IX_asbitem_item_type_id"); - - b.HasIndex(new[] { "AsbitemName" }, "ix_asbitem") - .IsUnique(); - - b.ToTable("asbitem", null, t => - { - t.HasComment("组合项目"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AsbitemDetail", b => - { - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id"); - - b.Property("ItemId") - .HasColumnType("uuid") - .HasColumnName("item_id") - .HasComment("项目编码"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.HasKey("AsbitemId", "ItemId") - .HasName("pk_department_asbitem_detail"); - - b.HasIndex(new[] { "ItemId" }, "IX_asbitem_detail_item_id"); - - b.ToTable("asbitem_detail", null, t => - { - t.HasComment("组合项目包含项目"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Charge", b => - { - b.Property("ChargeId") - .HasColumnType("uuid") - .HasColumnName("charge_id") - .HasComment("收据号"); - - b.Property("AppointPatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("appoint_patient_register_id") - .HasComment("登记流水号"); - - b.Property("ChargeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("charge_flag") - .HasDefaultValueSql("0"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("InvoiceNo") - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("invoice_no"); - - b.Property("InvoiceOrgName") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("invoice_org_name"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SettleAccountId") - .HasColumnType("uuid") - .HasColumnName("settle_account_id"); - - b.Property("SettleTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("settle_time"); - - b.HasKey("ChargeId") - .HasName("charge_pkey"); - - b.HasIndex("AppointPatientRegisterId"); - - b.ToTable("charge", null, t => - { - t.HasComment("收费主档"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeAsbitem", b => - { - b.Property("ChargeAsbitemId") - .HasColumnType("uuid") - .HasColumnName("charge_asbitem_id"); - - b.Property("Amount") - .HasColumnType("smallint") - .HasColumnName("amount"); - - b.Property("AppointRegisterAsbitemId") - .HasColumnType("uuid") - .HasColumnName("appoint_register_asbitem_id"); - - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id") - .HasComment("组合项目"); - - b.Property("ChargeId") - .HasColumnType("uuid") - .HasColumnName("charge_id") - .HasComment("收据号"); - - b.Property("ChargePrice") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("charge_price") - .HasComment("价格"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.HasKey("ChargeAsbitemId") - .HasName("charge_asbitem_pkey"); - - b.HasIndex("AsbitemId"); - - b.HasIndex(new[] { "ChargeId", "AsbitemId" }, "ix_charge_asbitem") - .IsUnique(); - - b.ToTable("charge_asbitem", null, t => - { - t.HasComment("收费包含组合项目"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBack", b => - { - b.Property("ChargeBackId") - .HasColumnType("uuid") - .HasColumnName("charge_back_id"); - - b.Property("ChargeId") - .HasColumnType("uuid") - .HasColumnName("charge_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SettleAccountId") - .HasColumnType("uuid") - .HasColumnName("settle_account_id"); - - b.Property("SettleTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("settle_time"); - - b.HasKey("ChargeBackId") - .HasName("charge_back_pkey"); - - b.HasIndex("ChargeId"); - - b.ToTable("charge_back", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBackPay", b => - { - b.Property("ChargeBackPayId") - .HasColumnType("uuid") - .HasColumnName("charge_back_pay_id"); - - b.Property("BackMoeny") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("back_moeny") - .HasComment("退费金额"); - - b.Property("CardBillId") - .HasColumnType("uuid") - .HasColumnName("card_bill_id") - .HasComment("会员卡ID"); - - b.Property("ChargeBackId") - .HasColumnType("uuid") - .HasColumnName("charge_back_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("PayModeId") - .IsRequired() - .HasMaxLength(4) - .HasColumnType("character varying(4)") - .HasColumnName("pay_mode_id") - .HasComment("支付方式ID"); - - b.HasKey("ChargeBackPayId") - .HasName("charge_back_pay_pkey"); - - b.HasIndex(new[] { "ChargeBackId", "PayModeId" }, "ix_charge_back_pay"); - - b.ToTable("charge_back_pay", null, t => - { - t.HasComment("退费支付方式"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBakAsbitem", b => - { - b.Property("ChargeBakAsbitemId") - .HasColumnType("uuid") - .HasColumnName("charge_bak_asbitem_id"); - - b.Property("Amount") - .HasColumnType("smallint") - .HasColumnName("amount"); - - b.Property("ChargeAsbitemId") - .HasColumnType("uuid") - .HasColumnName("charge_asbitem_id"); - - b.Property("ChargeBakId") - .HasColumnType("uuid") - .HasColumnName("charge_bak_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.HasKey("ChargeBakAsbitemId") - .HasName("pk_charge_bak_asbitem"); - - b.HasIndex("ChargeAsbitemId"); - - b.HasIndex(new[] { "ChargeBakId", "ChargeAsbitemId" }, "IX_charge_bak_asbitem_asbitem_id") - .IsUnique(); - - b.ToTable("charge_bak_asbitem", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargePay", b => - { - b.Property("CardBillId") - .HasColumnType("uuid") - .HasColumnName("card_bill_id") - .HasComment("会员卡ID"); - - b.Property("ChargeId") - .HasColumnType("uuid") - .HasColumnName("charge_id") - .HasComment("收据号"); - - b.Property("ChargeMoney") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("charge_money") - .HasComment("金额"); - - b.Property("ChargePayId") - .HasColumnType("uuid") - .HasColumnName("charge_pay_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("PayModeId") - .IsRequired() - .HasMaxLength(4) - .HasColumnType("character varying(4)") - .HasColumnName("pay_mode_id") - .HasComment("支付方式"); - - b.HasIndex(new[] { "ChargeId", "PayModeId" }, "ix_charge_pay") - .IsUnique(); - - b.ToTable("charge_pay", null, t => - { - t.HasComment("收费支付方式"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrg", b => - { - b.Property("CustomerOrgId") - .HasColumnType("uuid") - .HasColumnName("customer_org_id") - .HasComment("单位ID"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CountryOrgCode") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("country_org_code"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CustomerOrgName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("customer_org_name") - .HasComment("单位名称"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active") - .HasDefaultValueSql("'Y'::bpchar") - .HasComment("状态"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id") - .HasComment("体检中心ID"); - - b.Property("ParentId") - .HasColumnType("uuid") - .HasColumnName("parent_id") - .HasComment("父编号"); - - b.Property("PathCode") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("character varying(60)") - .HasColumnName("path_code") - .HasComment("路径编码"); - - b.Property("Remark") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("remark") - .HasComment("备注"); - - b.Property("ShortName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("short_name") - .HasComment("简称"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("simple_code") - .HasComment("拼音简码"); - - b.HasKey("CustomerOrgId") - .HasName("pk_customer_org"); - - b.HasIndex(new[] { "MedicalCenterId" }, "fki_fk_customer_org_organization_units"); - - b.HasIndex(new[] { "ParentId", "CustomerOrgName" }, "ix_org") - .IsUnique(); - - b.ToTable("customer_org", null, t => - { - t.HasComment("团检单位设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgGroup", b => - { - b.Property("CustomerOrgGroupId") - .HasColumnType("uuid") - .HasColumnName("customer_org_group_id"); - - b.Property("AgeLowerLimit") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)0) - .HasColumnName("age_lower_limit") - .HasComment("适用年龄下限"); - - b.Property("AgeUpperLimit") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)200) - .HasColumnName("age_upper_limit") - .HasComment("适用年龄上限"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CustomerOrgRegisterId") - .HasColumnType("uuid") - .HasColumnName("customer_org_register_id"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("display_name") - .HasComment("分组名称"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("ForSexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("for_sex_id") - .HasDefaultValueSql("'A'::bpchar") - .HasComment("适用性别"); - - b.Property("JobPost") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("job_post") - .HasComment("适用职务"); - - b.Property("JobTitle") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("job_title") - .HasComment("适用职称"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MaritalStatusId") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("marital_status_id") - .HasComment("适用婚姻状况"); - - b.Property("Price") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("price") - .HasComment("价格"); - - b.Property("Remark") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("remark") - .HasComment("备注"); - - b.HasKey("CustomerOrgGroupId") - .HasName("pk_customer_org_group"); - - b.HasIndex(new[] { "CustomerOrgRegisterId" }, "fki_fk_customer_org_group_register"); - - b.ToTable("customer_org_group", null, t => - { - t.HasComment("团体分组主档"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgGroupDetail", b => - { - b.Property("CustomerOrgGroupId") - .HasColumnType("uuid") - .HasColumnName("customer_org_group_id") - .HasComment("分组编号"); - - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id") - .HasComment("组合项目编号"); - - b.Property("Amount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)1) - .HasColumnName("amount") - .HasComment("数量"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Price") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("price") - .HasComment("价格"); - - b.HasKey("CustomerOrgGroupId", "AsbitemId") - .HasName("pk_org_group_detail"); - - b.HasIndex(new[] { "AsbitemId" }, "IX_customer_org_group_detail_asbitem_id"); - - b.ToTable("customer_org_group_detail", null, t => - { - t.HasComment("团检分组包含组合项目"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgRegister", b => - { - b.Property("CustomerOrgRegisterId") - .HasColumnType("uuid") - .HasColumnName("customer_org_register_id"); - - b.Property("BeginTime") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("begin_time") - .HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)") - .HasComment("开始日期"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CustomerOrgId") - .HasColumnType("uuid") - .HasColumnName("customer_org_id") - .HasComment("单位编号"); - - b.Property("EndTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("end_time") - .HasComment("结束日期"); - - b.Property("IsComplete") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_complete") - .HasComment("完成标志"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MedicalTimes") - .HasColumnType("smallint") - .HasColumnName("medical_times") - .HasComment("单位体检次数"); - - b.Property("RegisterName") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("register_name") - .HasComment("计划名称"); - - b.Property("RegisterNo") - .HasMaxLength(12) - .HasColumnType("character varying(12)") - .HasColumnName("register_no") - .HasComment("计划号"); - - b.HasKey("CustomerOrgRegisterId") - .HasName("pk_customer_org_register"); - - b.HasIndex(new[] { "CustomerOrgId" }, "IX_customer_org_register_customer_org_id"); - - b.ToTable("customer_org_register", null, t => - { - t.HasComment("团检体检登记"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Diagnosis", b => - { - b.Property("DiagnosisId") - .HasColumnType("uuid") - .HasColumnName("diagnosis_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DiagnosisLevelId") - .HasColumnType("smallint") - .HasColumnName("diagnosis_level_id"); - - b.Property("DiagnosisName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("diagnosis_name") - .HasComment("名称"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("ForSexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("for_sex_id") - .HasDefaultValueSql("'A'::bpchar"); - - b.Property("IsIll") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_ill") - .HasComment("是疾病"); - - b.Property("ItemTypeId") - .HasColumnType("uuid") - .HasColumnName("item_type_id") - .HasComment("项目类别"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SimpleCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("simple_code"); - - b.Property("SuggestionName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("suggestion_name") - .HasComment("建议名称"); - - b.HasKey("DiagnosisId") - .HasName("pk_diagnosis"); - - b.HasIndex("ItemTypeId"); - - b.ToTable("diagnosis", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.DiagnosisLevel", b => - { - b.Property("DiagnosisLevelId") - .HasColumnType("smallint") - .HasColumnName("diagnosis_level_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayName") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("display_name"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.HasKey("DiagnosisLevelId") - .HasName("pk_diagnosis_level"); - - b.ToTable("diagnosis_level", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.DiseaseScreeningType", b => - { - b.Property("DiseaseScreeningTypeId") - .HasColumnType("uuid") - .HasColumnName("question_type_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DiseaseScreeningTypeName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("disease_screening_type_name"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("DiseaseScreeningTypeId") - .HasName("pk_disease_screening_type"); - - b.HasIndex(new[] { "DiseaseScreeningTypeName" }, "ix_disease_screening_type") - .IsUnique(); - - b.ToTable("disease_screening_type", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ForSex", b => - { - b.Property("ForSexId") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("for_sex_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("ForSexName") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("for_sex_name"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SimpleCode") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("simple_code"); - - b.HasKey("ForSexId") - .HasName("pk_for_sex"); - - b.ToTable("for_sex", null, t => - { - t.HasComment("适用性别设置,固定编码"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Item", b => - { - b.Property("ItemId") - .HasColumnType("uuid") - .HasColumnName("item_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DefaultResult") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("default_result") - .HasComment("默认结果"); - - b.Property("DeviceTypeId") - .HasColumnType("uuid") - .HasColumnName("device_type_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("EnglishShortName") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("english_short_name") - .HasComment("英文缩写"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active") - .HasDefaultValueSql("'Y'::bpchar") - .HasComment("启用"); - - b.Property("IsCalculationItem") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_calculation_item") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("是计算项目"); - - b.Property("ItemName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("item_name") - .HasComment("名称"); - - b.Property("ItemTypeId") - .HasColumnType("uuid") - .HasColumnName("item_type_id") - .HasComment("项目类别"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("LineModeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("line_mode_flag") - .HasDefaultValueSql("'2'::bpchar") - .HasComment("项目结果行模式"); - - b.Property("Price") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("price") - .HasComment("价格"); - - b.Property("ReferenceRangeTypeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("reference_range_type_flag") - .HasDefaultValueSql("'0'::bpchar") - .HasComment("参考范围类别0-无参考范围,1-数字型,2-字符型,3-性激素"); - - b.Property("SimpleCode") - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("simple_code"); - - b.Property("UnitId") - .HasColumnType("uuid") - .HasColumnName("unit_id") - .HasComment("单位"); - - b.HasKey("ItemId") - .HasName("pk_item"); - - b.HasIndex(new[] { "ItemTypeId" }, "IX_item_item_type_id"); - - b.HasIndex(new[] { "ItemName", "ItemTypeId" }, "ix_item") - .IsUnique(); - - b.ToTable("item", null, t => - { - t.HasComment("项目设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ItemType", b => - { - b.Property("ItemTypeId") - .HasColumnType("uuid") - .HasColumnName("item_type_id"); - - b.Property("CheckTypeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("check_type_flag") - .HasDefaultValueSql("'G'::bpchar") - .HasComment("检查类别,0-普通检查,1-检验,2-影像检查"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("IsWrap") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_wrap") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("项目结果是否可以换行"); - - b.Property("ItemTypeName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("item_type_name") - .HasComment("名称"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ParentId") - .HasColumnType("uuid") - .HasColumnName("parent_id") - .HasComment("父id"); - - b.Property("PathCode") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("path_code") - .HasComment("路径编码"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code") - .HasComment("自定义简码"); - - b.HasKey("ItemTypeId") - .HasName("pk_item_type"); - - b.HasIndex(new[] { "ItemTypeName", "ParentId" }, "ix_item_type") - .IsUnique(); - - b.ToTable("item_type", null, t => - { - t.HasComment("项目类别设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Kinship", b => - { - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("KinshipCode") - .HasMaxLength(2) - .HasColumnType("character varying(2)") - .HasColumnName("kinship_code"); - - b.Property("KinshipId") - .HasMaxLength(2) - .HasColumnType("character(2)") - .HasColumnName("kinship_id") - .IsFixedLength(); - - b.Property("KinshipName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("kinship_name"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("simple_code"); - - b.ToTable("kinship", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MaritalStatus", b => - { - b.Property("MaritalStatusId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("marital_status_id") - .HasDefaultValueSql("'0'::bpchar") - .HasComment("婚姻状况编号"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MaritalStatusName") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("marital_status_name") - .HasComment("婚姻状况名称"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("simple_code") - .HasComment("自定义简码"); - - b.HasKey("MaritalStatusId") - .HasName("pk_marital_status"); - - b.HasIndex(new[] { "MaritalStatusName" }, "ix_marital_status") - .IsUnique(); - - b.ToTable("marital_status", null, t => - { - t.HasComment("婚姻状况设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MedicalCenter", b => - { - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MedicalCenterName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("medical_center_name"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("MedicalCenterId") - .HasName("pk_medical_center"); - - b.HasIndex(new[] { "MedicalCenterName" }, "ix_medical_center") - .IsUnique(); - - b.ToTable("medical_center", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MedicalPackage", b => - { - b.Property("MedicalPackageId") - .HasColumnType("uuid") - .HasColumnName("medical_package_id") - .HasComment("套餐主档编号"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("ForSexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("for_sex_id") - .HasDefaultValueSql("'A'::bpchar") - .HasComment("适用性别"); - - b.Property("IsActive") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active") - .HasComment("启用标志"); - - b.Property("IsWebAppoint") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_web_appoint"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MedicalPackageName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("medical_package_name") - .HasComment("名称"); - - b.Property("Price") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("price") - .HasComment("价格"); - - b.Property("Remark") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("remark") - .HasComment("备注"); - - b.Property("SimpleCode") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("MedicalPackageId") - .HasName("pk_medical_package"); - - b.HasIndex(new[] { "MedicalPackageName" }, "ix_medical_package") - .IsUnique(); - - b.ToTable("medical_package", null, t => - { - t.HasComment("体检套餐主档设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MedicalPackageDetail", b => - { - b.Property("MedicalPackageId") - .HasColumnType("uuid") - .HasColumnName("medical_package_id") - .HasComment("套餐编号"); - - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id") - .HasComment("组合项目编号"); - - b.Property("Amount") - .HasColumnType("smallint") - .HasColumnName("amount"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("Price") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("price"); - - b.HasKey("MedicalPackageId", "AsbitemId") - .HasName("pk_medical_package_detail"); - - b.HasIndex(new[] { "AsbitemId" }, "IX_medical_package_detail_asbitem_id"); - - b.ToTable("medical_package_detail", null, t => - { - t.HasComment("体检套餐包含的组合项目设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Nation", b => - { - b.Property("NationId") - .HasMaxLength(3) - .HasColumnType("character(3)") - .HasColumnName("nation_id") - .IsFixedLength() - .HasComment("编号"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CountryCode") - .HasMaxLength(2) - .HasColumnType("character varying(2)") - .HasColumnName("country_code"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("NationName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("nation_name") - .HasComment("名称"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code") - .HasComment("拼音简码"); - - b.HasKey("NationId") - .HasName("pk_nation"); - - b.HasIndex(new[] { "NationName" }, "ix_nation") - .IsUnique(); - - b.ToTable("nation", null, t => - { - t.HasComment("民族设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Patient", b => - { - b.Property("Address") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("address") - .HasComment("地址"); - - b.Property("BirthDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("birth_date") - .HasComment("出生日期"); - - b.Property("BirthPlaceId") - .HasColumnType("uuid") - .HasColumnName("birth_place_id") - .HasComment("出生地"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("Email") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("email") - .HasComment("email"); - - b.Property("IdNo") - .HasMaxLength(18) - .HasColumnType("character varying(18)") - .HasColumnName("id_no") - .HasComment("身份证号"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MaritalStatusId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("marital_status_id") - .HasDefaultValueSql("'9'::bpchar") - .HasComment("婚姻状况"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id") - .HasComment("组织单位ID"); - - b.Property("MobileTelephone") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("mobile_telephone") - .HasComment("手机号"); - - b.Property("NationId") - .HasColumnType("text") - .HasColumnName("nation_id") - .HasComment("民族编号"); - - b.Property("PatientId") - .HasColumnType("uuid") - .HasColumnName("patient_id"); - - b.Property("PatientName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("patient_name") - .HasComment("姓名"); - - b.Property("PatientNo") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("patient_no") - .HasComment("档案号"); - - b.Property("PostalCode") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("postal_code") - .HasComment("邮政编码"); - - b.Property("SexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("sex_id") - .HasDefaultValueSql("'U'::bpchar") - .HasComment("性别"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("simple_code") - .HasComment("简码"); - - b.Property("Telephone") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("telephone") - .HasComment("电话"); - - b.HasIndex(new[] { "PatientNo" }, "IX_patient_patient_no") - .IsUnique(); - - b.HasIndex(new[] { "IdNo" }, "ix_patient"); - - b.HasIndex(new[] { "PatientName" }, "ix_patient_1"); - - b.ToTable("patient", null, t => - { - t.HasComment("体检人员档案"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.PatientRegister", b => - { - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id") - .HasComment("登记流水号"); - - b.Property("Age") - .HasColumnType("smallint") - .HasColumnName("age") - .HasComment("年龄"); - - b.Property("AuditDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("audit_date") - .HasComment("审核日期"); - - b.Property("AuditDoctorId") - .HasColumnType("uuid") - .HasColumnName("audit_doctor_id") - .HasComment("审核医生"); - - b.Property("BirthDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("birth_date") - .HasComment("出生日期"); - - b.Property("CompleteFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("complete_flag") - .HasDefaultValueSql("'0'::bpchar") - .HasComment("完成标志"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CustomerOrgGroupId") - .HasColumnType("uuid") - .HasColumnName("customer_org_group_id") - .HasComment("分组"); - - b.Property("CustomerOrgId") - .HasColumnType("uuid") - .HasColumnName("customer_org_id") - .HasComment("单位编号"); - - b.Property("CustomerOrgRegisterId") - .HasColumnType("uuid") - .HasColumnName("customer_org_register_id") - .HasComment("客户单位登记ID"); - - b.Property("HisPatientId") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("his_patient_id"); - - b.Property("InterposeMeasure") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("interpose_measure") - .HasComment("干预措施"); - - b.Property("IsAudit") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_audit") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("审核"); - - b.Property("IsMedicalStart") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_medical_start") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("体检开始标志"); - - b.Property("IsVip") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_vip") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("vip客户"); - - b.Property("JobCardNo") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("job_card_no") - .HasComment("工卡号"); - - b.Property("JobPost") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("job_post") - .HasComment("职务"); - - b.Property("JobTitle") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("job_title") - .HasComment("职称"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MaritalStatusId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("marital_status_id") - .HasDefaultValueSql("'9'::bpchar") - .HasComment("婚姻状况"); - - b.Property("MedicalCardNo") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("medical_card_no") - .HasComment("体检卡号"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id") - .HasComment("体检中心ID"); - - b.Property("MedicalConclusionId") - .HasColumnType("uuid") - .HasColumnName("medical_conclusion_id") - .HasComment("体检结论"); - - b.Property("MedicalPackageId") - .HasColumnType("uuid") - .HasColumnName("medical_package_id") - .HasComment("套餐"); - - b.Property("MedicalStartDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("medical_start_date") - .HasDefaultValueSql("date(timezone('UTC-8'::text, now()))") - .HasComment("体检开始日期"); - - b.Property("MedicalTimes") - .HasColumnType("smallint") - .HasColumnName("medical_times") - .HasComment("体检次数"); - - b.Property("MedicalTypeId") - .HasColumnType("uuid") - .HasColumnName("medical_type_id") - .HasComment("体检类别"); - - b.Property("PatientId") - .HasColumnType("uuid") - .HasColumnName("patient_id") - .HasComment("档案号"); - - b.Property("PatientName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("patient_name") - .HasComment("姓名"); - - b.Property("PatientRegisterNo") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("patient_register_no") - .HasComment("条码号"); - - b.Property("PersonnelTypeId") - .HasColumnType("uuid") - .HasColumnName("personnel_type_id") - .HasComment("人员类别"); - - b.Property("Photo") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("photo") - .HasComment("照片"); - - b.Property("Remark") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("remark") - .HasComment("备注"); - - b.Property("SexHormoneTermId") - .HasColumnType("uuid") - .HasColumnName("sex_hormone_term_id") - .HasComment("性激素期限"); - - b.Property("SexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("sex_id") - .HasDefaultValueSql("'U'::bpchar") - .HasComment("性别"); - - b.Property("SummaryDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("summary_date") - .HasComment("总检日期"); - - b.Property("SummaryDoctorId") - .HasColumnType("uuid") - .HasColumnName("summary_doctor_id") - .HasComment("总检医生"); - - b.Property("ThirdInfo") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("third_info") - .HasComment("附加第三方信息"); - - b.HasKey("PatientRegisterId") - .HasName("pk_patient_register"); - - b.HasIndex(new[] { "MaritalStatusId" }, "IX_patient_register_marital_status_id"); - - b.HasIndex(new[] { "MedicalCenterId" }, "fki_fk_patient_register_ororganization_unit"); - - b.HasIndex(new[] { "PatientRegisterNo" }, "ix_patient_register") - .IsUnique(); - - b.HasIndex(new[] { "PatientId", "MedicalTimes" }, "ix_patient_register_1") - .IsUnique(); - - b.HasIndex(new[] { "PatientName" }, "ix_patient_register_2"); - - b.ToTable("patient_register", null, t => - { - t.HasComment("体检登记主档"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.PayMode", b => - { - b.Property("PayModeId") - .HasMaxLength(4) - .HasColumnType("character varying(4)") - .HasColumnName("pay_mode_id") - .HasComment("编号,固定编码"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("IsActive") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active") - .HasDefaultValueSql("'Y'::bpchar"); - - b.Property("PayModeName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("pay_mode_name") - .HasComment("名称"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code") - .HasComment("简码"); - - b.HasKey("PayModeId") - .HasName("pk_pay_mode"); - - b.HasIndex(new[] { "PayModeName" }, "ix_payment_mode") - .IsUnique(); - - b.ToTable("pay_mode", null, t => - { - t.HasComment("支付方式设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Person", b => - { - b.Property("PersonId") - .HasColumnType("uuid") - .HasColumnName("person_id"); - - b.Property("Address") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("address") - .HasComment("地址"); - - b.Property("BirthDate") - .IsRequired() - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("birth_date") - .HasComment("出生日期"); - - b.Property("BirthPlaceId") - .HasColumnType("uuid") - .HasColumnName("birth_place_id") - .HasComment("出生地"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CountryCode") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("character varying(3)") - .HasColumnName("country_code"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("IdNo") - .IsRequired() - .HasMaxLength(18) - .HasColumnType("character varying(18)") - .HasColumnName("id_no") - .HasComment("身份证号"); - - b.Property("IdTypeId") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character(2)") - .HasColumnName("id_type_id") - .IsFixedLength(); - - b.Property("IsAllowBind") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_allow_bind"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("MaritalStatusId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("marital_status_id") - .HasDefaultValueSql("'9'::bpchar") - .HasComment("婚姻状况"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id") - .HasComment("组织单位ID"); - - b.Property("NationId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("nation_id") - .HasComment("民族编号"); - - b.Property("PersonNo") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("person_no") - .HasComment("档案号"); - - b.Property("PostalCode") - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("postal_code") - .HasComment("邮政编码"); - - b.Property("SexId") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("sex_id") - .HasDefaultValueSql("'U'::bpchar") - .HasComment("性别"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("character varying(30)") - .HasColumnName("simple_code") - .HasComment("简码"); - - b.Property("WechatOpenId") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("wechat_open_id"); - - b.HasKey("PersonId") - .HasName("pk_patient"); - - b.HasIndex(new[] { "PersonNo" }, "IX_person_person_no") - .IsUnique(); - - b.HasIndex(new[] { "IdNo" }, "ix_person_id_no") - .IsUnique(); - - b.ToTable("person", null, t => - { - t.HasComment("体检人员档案"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.PersonKinship", b => - { - b.Property("PersonId") - .HasColumnType("uuid") - .HasColumnName("person_id"); - - b.Property("ParentPersonId") - .HasColumnType("uuid") - .HasColumnName("parent_person_id"); - - b.Property("KinshipId") - .HasMaxLength(2) - .HasColumnType("character(2)") - .HasColumnName("kinship_id") - .IsFixedLength(); - - b.HasKey("PersonId", "ParentPersonId", "KinshipId") - .HasName("person_kinship_pkey"); - - b.ToTable("person_kinship", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Question", b => - { - b.Property("QuestionId") - .HasColumnType("uuid") - .HasColumnName("question_id"); - - b.Property("AnswerType") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("answer_type"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("IsActive") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_active"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("QuestionName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("question_name"); - - b.Property("QuestionTypeId") - .HasColumnType("uuid") - .HasColumnName("question_type_id"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("QuestionId") - .HasName("pk_question"); - - b.HasIndex(new[] { "QuestionName" }, "ix_question") - .IsUnique(); - - b.ToTable("question", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionAnswer", b => - { - b.Property("QuestionAnswerId") - .HasColumnType("uuid") - .HasColumnName("question_answer_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("QuestionAnswerName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("question_answer_name"); - - b.Property("QuestionId") - .HasColumnType("uuid") - .HasColumnName("question_id"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("QuestionAnswerId") - .HasName("pk_question_answer"); - - b.ToTable("question_answer", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegister", b => - { - b.Property("QuestionRegisterId") - .HasColumnType("uuid") - .HasColumnName("question_register_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PersonId") - .HasColumnType("uuid") - .HasColumnName("person_id"); - - b.HasKey("QuestionRegisterId") - .HasName("pk_question_register"); - - b.HasIndex("PersonId"); - - b.ToTable("question_register", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegisterAnswer", b => - { - b.Property("QuestionRegisterAnswerId") - .HasColumnType("uuid") - .HasColumnName("question_register_answer_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("QuestionAnswerId") - .HasColumnType("uuid") - .HasColumnName("question_answer_id"); - - b.Property("QuestionRegisterItemId") - .HasColumnType("uuid") - .HasColumnName("question_register_item_id"); - - b.HasKey("QuestionRegisterAnswerId") - .HasName("question_register_answer_pkey"); - - b.HasIndex("QuestionAnswerId"); - - b.HasIndex("QuestionRegisterItemId"); - - b.ToTable("question_register_answer", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegisterItem", b => - { - b.Property("QuestionRegisterItemId") - .HasColumnType("uuid") - .HasColumnName("question_register_item_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("QuestionId") - .HasColumnType("uuid") - .HasColumnName("question_id"); - - b.Property("QuestionRegisterId") - .HasColumnType("uuid") - .HasColumnName("question_register_id"); - - b.HasKey("QuestionRegisterItemId") - .HasName("pk_question_register_item"); - - b.HasIndex("QuestionId"); - - b.HasIndex("QuestionRegisterId"); - - b.ToTable("question_register_item", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionType", b => - { - b.Property("QuestionTypeId") - .HasColumnType("uuid") - .HasColumnName("question_type_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("QuestionTypeName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("question_type_name"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("simple_code"); - - b.HasKey("QuestionTypeId") - .HasName("pk_question_type"); - - b.HasIndex(new[] { "QuestionTypeName" }, "ix_question_type") - .IsUnique(); - - b.ToTable("question_type", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheck", b => - { - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id"); - - b.Property("AuditTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("audit_time") - .HasComment("审核时间"); - - b.Property("AuditorUserId") - .HasColumnType("uuid") - .HasColumnName("auditor_user_id") - .HasComment("审核医生ID"); - - b.Property("CheckDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("check_date") - .HasComment("检查日期"); - - b.Property("CheckDoctorId") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("check_doctor_id") - .HasComment("检查医生ID"); - - b.Property("CheckRequestNo") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("check_request_no") - .HasComment("检查单号"); - - b.Property("CompleteFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("complete_flag") - .HasDefaultValueSql("0") - .HasComment("完成标志"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CriticalValue") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("critical_value") - .HasComment("危急值"); - - b.Property("CriticalValueCreateDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("critical_value_create_date") - .HasComment("危急值创建日期"); - - b.Property("CriticalValueFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("critical_value_flag") - .HasDefaultValueSql("0") - .HasComment("危急值标志"); - - b.Property("CriticalValueProcessContent") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("critical_value_process_content") - .HasComment("危急值处理内容"); - - b.Property("CriticalValueProcessDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("critical_value_process_date") - .HasComment("危急值处理日期"); - - b.Property("CriticalValueProcessDoctor") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("critical_value_process_doctor") - .HasComment("危急值处理医生"); - - b.Property("CriticalValueProcessFlag") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("critical_value_process_flag") - .HasComment("危急值处理标志"); - - b.Property("ExecOrganizationUnitId") - .HasColumnType("uuid") - .HasColumnName("exec_organization_unit_id"); - - b.Property("IsAudit") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_audit") - .HasComment("是审核"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id"); - - b.Property("ThirdInfo") - .HasMaxLength(80) - .HasColumnType("character varying(80)") - .HasColumnName("third_info") - .HasComment("第三方信息"); - - b.HasKey("RegisterCheckId") - .HasName("pk_register_check"); - - b.ToTable("register_check", null, t => - { - t.HasComment("登记检查单"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckAsbitem", b => - { - b.Property("RegisterCheckAsbitemId") - .HasColumnType("uuid") - .HasColumnName("register_check_asbitem_id") - .HasComment("主键"); - - b.Property("Amount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)1) - .HasColumnName("amount") - .HasComment("数量"); - - b.Property("AsbitemId") - .HasColumnType("uuid") - .HasColumnName("asbitem_id") - .HasComment("组合项目"); - - b.Property("ChargePrice") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("charge_price") - .HasComment("实收价格"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("IsCharge") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_charge") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("是否已收费"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id") - .HasComment("登记流水号"); - - b.Property("PayTypeFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("pay_type_flag") - .HasDefaultValueSql("0") - .HasComment("支付方式,比如是自费、免费、单位支付"); - - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id"); - - b.Property("StandardPrice") - .HasPrecision(10, 2) - .HasColumnType("numeric(10,2)") - .HasColumnName("standard_price") - .HasComment("标准价格"); - - b.HasKey("RegisterCheckAsbitemId") - .HasName("pk_register_check_asbitem"); - - b.HasIndex(new[] { "AsbitemId" }, "IX_register_check_asbitem_asbitem_id"); - - b.HasIndex(new[] { "RegisterCheckId" }, "IX_register_check_asbitem_register_check_id"); - - b.HasIndex(new[] { "PatientRegisterId", "AsbitemId" }, "ix_register_asbitem") - .IsUnique(); - - b.ToTable("register_check_asbitem", null, t => - { - t.HasComment("检查组合项目记录"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckItem", b => - { - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id"); - - b.Property("ItemId") - .HasColumnType("uuid") - .HasColumnName("item_id") - .HasComment("项目编号"); - - b.Property("CheckDate") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("check_date") - .HasComment("检查日期"); - - b.Property("CheckDoctorName") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("check_doctor_name") - .HasComment("检查医生"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("CriticalRangeValue") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("critical_range_value") - .HasComment("危急值范围"); - - b.Property("CriticalValue") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("critical_value") - .HasComment("危急值"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ReferenceRangeValue") - .ValueGeneratedOnAdd() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("reference_range_value") - .HasDefaultValueSql("''::character varying") - .HasComment("参考范围"); - - b.Property("Result") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("result") - .HasComment("结果"); - - b.Property("ResultStatusId") - .HasMaxLength(2) - .HasColumnType("character varying(2)") - .HasColumnName("result_status_id") - .HasComment("报告单提示"); - - b.Property("Unit") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("unit") - .HasComment("单位"); - - b.HasKey("RegisterCheckId", "ItemId") - .HasName("pk_register_item_1"); - - b.HasIndex(new[] { "ItemId" }, "IX_register_check_item_item_id"); - - b.HasIndex(new[] { "ResultStatusId" }, "IX_register_check_item_result_status_id"); - - b.ToTable("register_check_item", null, t => - { - t.HasComment("检查明细项目记录"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckPicture", b => - { - b.Property("RegisterCheckPictureId") - .HasColumnType("uuid") - .HasColumnName("register_check_picture_id") - .HasComment("检查图片编号"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("IsPrint") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_print") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("打印标志"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PictureFileType") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("picture_file_type"); - - b.Property("PictureFilename") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("picture_filename") - .HasComment("图片名"); - - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id") - .HasComment("登记流水号"); - - b.HasKey("RegisterCheckPictureId") - .HasName("pk_register_check_picture"); - - b.HasIndex(new[] { "RegisterCheckId", "PictureFilename" }, "ix_check_picture") - .IsUnique(); - - b.ToTable("register_check_picture", null, t => - { - t.HasComment("体检登记组合项目图片"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckSuggestion", b => - { - b.Property("RegisterCheckSuggestionId") - .HasColumnType("uuid") - .HasColumnName("register_check_suggestion_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id") - .HasComment("登记检查ID"); - - b.Property("Suggestion") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("suggestion") - .HasComment("建议"); - - b.HasKey("RegisterCheckSuggestionId") - .HasName("pk_register_check_suggestion"); - - b.HasIndex(new[] { "RegisterCheckId" }, "IX_register_check_suggestion_register_check_id"); - - b.ToTable("register_check_suggestion", null, t => - { - t.HasComment("登记检查建议"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckSummary", b => - { - b.Property("RegisterCheckSummaryId") - .HasColumnType("uuid") - .HasColumnName("register_check_summary_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("RegisterCheckId") - .HasColumnType("uuid") - .HasColumnName("register_check_id") - .HasComment("登记检查ID"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("summary") - .HasComment("综述"); - - b.Property("SummaryFlag") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("summary_flag") - .HasComment("综述标志"); - - b.HasKey("RegisterCheckSummaryId") - .HasName("pk_register_check_summary"); - - b.HasIndex(new[] { "RegisterCheckId" }, "IX_register_check_summary_register_check_id"); - - b.ToTable("register_check_summary", null, t => - { - t.HasComment("登记检查综述"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ResultStatus", b => - { - b.Property("ResultStatusId") - .HasMaxLength(2) - .HasColumnType("character varying(2)") - .HasColumnName("result_status_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DataInputBackgroundColor") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(16777215) - .HasColumnName("data_input_background_color") - .HasComment("数据录入报告单颜色"); - - b.Property("DataInputFontColor") - .HasColumnType("integer") - .HasColumnName("data_input_font_color") - .HasComment("数据录入字体颜色"); - - b.Property("DataInputPrompt") - .HasMaxLength(8) - .HasColumnType("character varying(8)") - .HasColumnName("data_input_prompt") - .HasComment("数据录入提示"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ReportBackgroundColor") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(16777215) - .HasColumnName("report_background_color") - .HasComment("报告单背景颜色"); - - b.Property("ReportFontColor") - .HasColumnType("integer") - .HasColumnName("report_font_color") - .HasComment("报告单字体颜色"); - - b.Property("ReportPrompt") - .HasMaxLength(8) - .HasColumnType("character varying(8)") - .HasColumnName("report_prompt") - .HasComment("报告单提示"); - - b.Property("ResultStatusName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("result_status_name") - .HasComment("名称"); - - b.HasKey("ResultStatusId") - .HasName("pk_result_status"); - - b.HasIndex(new[] { "ResultStatusName" }, "ix_result_status") - .IsUnique(); - - b.ToTable("result_status", null, t => - { - t.HasComment("结果状态设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SettleAccount", b => - { - b.Property("SettleAccountId") - .HasColumnType("uuid") - .HasColumnName("settle_account_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("IsComplete") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_complete") - .HasComment("是完成"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.HasKey("SettleAccountId") - .HasName("pk_settle_account"); - - b.ToTable("settle_account", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Sex", b => - { - b.Property("SexId") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("sex_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SexName") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("sex_name") - .HasComment("名称"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("character varying(10)") - .HasColumnName("simple_code") - .HasComment("简码"); - - b.HasKey("SexId") - .HasName("pk_sex"); - - b.ToTable("sex", null, t => - { - t.HasComment("性别设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumDiagnosis", b => - { - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id") - .HasComment("病人登记ID"); - - b.Property("DiagnosisId") - .HasColumnType("uuid") - .HasColumnName("diagnosis_id") - .HasComment("诊断ID"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("SumSuggestionHeaderId") - .HasColumnType("uuid") - .HasColumnName("sum_suggestion_header_id") - .HasComment("建议头ID"); - - b.HasKey("PatientRegisterId", "DiagnosisId") - .HasName("pk_summary_diagnosis"); - - b.HasIndex(new[] { "DiagnosisId" }, "IX_sum_diagnosis_diagnosis_id"); - - b.ToTable("sum_diagnosis", null, t => - { - t.HasComment("总检诊断"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSuggestionContent", b => - { - b.Property("SumSuggestionContentId") - .HasColumnType("uuid") - .HasColumnName("sum_suggestion_content_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SuggestionContent") - .IsRequired() - .HasMaxLength(10000) - .HasColumnType("character varying(10000)") - .HasColumnName("suggestion_content") - .HasComment("建议内容"); - - b.Property("SuggestionType") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("character varying(1)") - .HasColumnName("suggestion_type") - .HasComment("建议类型"); - - b.Property("SumSuggestionHeaderId") - .HasColumnType("uuid") - .HasColumnName("sum_suggestion_header_id") - .HasComment("建议头ID"); - - b.HasKey("SumSuggestionContentId") - .HasName("pk_sum_suggestion_content"); - - b.HasIndex(new[] { "SumSuggestionHeaderId" }, "IX_sum_suggestion_content_sum_suggestion_header_id"); - - b.ToTable("sum_suggestion_content", null, t => - { - t.HasComment("总检建议内容"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSuggestionHeader", b => - { - b.Property("SumSuggestionHeaderId") - .HasColumnType("uuid") - .HasColumnName("sum_suggestion_header_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id") - .HasComment("病人登记ID"); - - b.Property("SuggestionFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("suggestion_flag") - .HasDefaultValueSql("'0'::bpchar") - .HasComment("建议标志"); - - b.Property("SuggestionTitle") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("suggestion_title") - .HasComment("建议标题"); - - b.HasKey("SumSuggestionHeaderId") - .HasName("pk_sum_suggestion_header"); - - b.HasIndex(new[] { "PatientRegisterId", "SuggestionTitle" }, "ix_sum_suggestion_title") - .IsUnique(); - - b.ToTable("sum_suggestion_header", null, t => - { - t.HasComment("总检建议头"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSummaryContent", b => - { - b.Property("SumSummaryContentId") - .HasColumnType("uuid") - .HasColumnName("sum_summary_content_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("SumSummaryHeaderId") - .HasColumnType("uuid") - .HasColumnName("sum_summary_header_id") - .HasComment("建议头ID"); - - b.Property("SummaryContent") - .IsRequired() - .HasMaxLength(3000) - .HasColumnType("character varying(3000)") - .HasColumnName("summary_content") - .HasComment("建议内容"); - - b.HasKey("SumSummaryContentId") - .HasName("pk_sum_summary_content"); - - b.HasIndex(new[] { "SumSummaryHeaderId" }, "IX_sum_summary_content_sum_summary_header_id"); - - b.ToTable("sum_summary_content", null, t => - { - t.HasComment("总检综述内容"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSummaryHeader", b => - { - b.Property("SumSummaryHeaderId") - .HasColumnType("uuid") - .HasColumnName("sum_summary_header_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .HasColumnType("integer") - .HasColumnName("display_order"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("PatientRegisterId") - .HasColumnType("uuid") - .HasColumnName("patient_register_id") - .HasComment("病人登记ID"); - - b.Property("SummaryFlag") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("summary_flag") - .HasDefaultValueSql("'0'::bpchar") - .HasComment("综述标志"); - - b.Property("SummaryTitle") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("summary_title") - .HasComment("综述标题"); - - b.HasKey("SumSummaryHeaderId") - .HasName("pk_sum_summary_header"); - - b.HasIndex(new[] { "PatientRegisterId" }, "IX_sum_summary_header_patient_register_id"); - - b.ToTable("sum_summary_header", null, t => - { - t.HasComment("总检综述头"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParm", b => - { - b.Property("SysParmId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("IsPublic") - .ValueGeneratedOnAdd() - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("is_public") - .HasDefaultValueSql("'N'::bpchar") - .HasComment("是否支持设置按体检中心设置参数值(Y 直接取公共参数,无法设置 N.可以设置多个参数)"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Remark") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("remark") - .HasComment("备注"); - - b.Property("SimpleCode") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("simple_code"); - - b.Property("SysParmName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_name") - .HasComment("参数名"); - - b.Property("SysParmTypeId") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_type_id") - .HasComment("参数类别ID"); - - b.Property("ValueType") - .HasMaxLength(1) - .HasColumnType("character(1)") - .HasColumnName("value_type") - .HasComment("结果类别"); - - b.HasKey("SysParmId") - .HasName("pk_sys_parm"); - - b.HasIndex(new[] { "SysParmTypeId" }, "IX_sys_parm_sys_parm_type_id"); - - b.ToTable("sys_parm", null, t => - { - t.HasComment("系统参数设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmType", b => - { - b.Property("SysParmTypeId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_type_id"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(999999) - .HasColumnName("display_order") - .HasComment("显示顺序"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ParentId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("parent_id") - .HasComment("父ID"); - - b.Property("SimpleCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("simple_code") - .HasComment("简码"); - - b.Property("SysParmTypeName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_type_name") - .HasComment("名称"); - - b.HasKey("SysParmTypeId") - .HasName("pk_sys_parm_type"); - - b.ToTable("sys_parm_type", null, t => - { - t.HasComment("系统参数类别设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmValue", b => - { - b.Property("SysParmId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sys_parm_id") - .HasComment("参数ID"); - - b.Property("MedicalCenterId") - .HasColumnType("uuid") - .HasColumnName("medical_center_id") - .HasComment("体检中心ID"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp(6) without time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ParmValue") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("parm_value") - .HasComment("参数值"); - - b.Property("Remark") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("remark") - .HasComment("备注"); - - b.HasKey("SysParmId", "MedicalCenterId") - .HasName("pk_sys_parm_value"); - - b.ToTable("sys_parm_value", null, t => - { - t.HasComment("系统参数值设置"); - }); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmValueOption", b => - { - b.Property("SysParmId") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("sys_parm_id"); - - b.Property("ValueOption") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("value_option") - .HasComment("可选项"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("DisplayOrder") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(1) - .HasColumnName("display_order"); - - b.Property("ValueOptionName") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("value_option_name") - .HasComment("可选项名"); - - b.HasKey("SysParmId", "ValueOption") - .HasName("pk_sys_parm_value_option"); - - b.ToTable("sys_parm_value_option", null, t => - { - t.HasComment("系统参数可选值设置"); - }); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ApplicationName") - .HasMaxLength(96) - .HasColumnType("character varying(96)") - .HasColumnName("application_name"); - - b.Property("BrowserInfo") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("browser_info"); - - b.Property("ClientId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("client_id"); - - b.Property("ClientIpAddress") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("client_ip_address"); - - b.Property("ClientName") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("client_name"); - - b.Property("Comments") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("comments"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CorrelationId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("correlation_id"); - - b.Property("Exceptions") - .HasColumnType("text") - .HasColumnName("exceptions"); - - b.Property("ExecutionDuration") - .HasColumnType("integer") - .HasColumnName("execution_duration"); - - b.Property("ExecutionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("execution_time"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("HttpMethod") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("http_method"); - - b.Property("HttpStatusCode") - .HasColumnType("integer") - .HasColumnName("http_status_code"); - - b.Property("ImpersonatorTenantId") - .HasColumnType("uuid") - .HasColumnName("impersonator_tenant_id"); - - b.Property("ImpersonatorTenantName") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("impersonator_tenant_name"); - - b.Property("ImpersonatorUserId") - .HasColumnType("uuid") - .HasColumnName("impersonator_user_id"); - - b.Property("ImpersonatorUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("impersonator_user_name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("TenantName") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("tenant_name"); - - b.Property("Url") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("url"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("pk_abp_audit_logs"); - - b.HasIndex("TenantId", "ExecutionTime"); - - b.HasIndex("TenantId", "UserId", "ExecutionTime"); - - b.ToTable("abp_audit_logs", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AuditLogId") - .HasColumnType("uuid") - .HasColumnName("audit_log_id"); - - b.Property("ExecutionDuration") - .HasColumnType("integer") - .HasColumnName("execution_duration"); - - b.Property("ExecutionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("execution_time"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("MethodName") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("method_name"); - - b.Property("Parameters") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("parameters"); - - b.Property("ServiceName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("service_name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_audit_log_actions"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); - - b.ToTable("abp_audit_log_actions", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AuditLogId") - .HasColumnType("uuid") - .HasColumnName("audit_log_id"); - - b.Property("ChangeTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("change_time"); - - b.Property("ChangeType") - .HasColumnType("smallint") - .HasColumnName("change_type"); - - b.Property("EntityId") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("entity_id"); - - b.Property("EntityTenantId") - .HasColumnType("uuid") - .HasColumnName("entity_tenant_id"); - - b.Property("EntityTypeFullName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("entity_type_full_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_entity_changes"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); - - b.ToTable("abp_entity_changes", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("EntityChangeId") - .HasColumnType("uuid") - .HasColumnName("entity_change_id"); - - b.Property("NewValue") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("new_value"); - - b.Property("OriginalValue") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("original_value"); - - b.Property("PropertyName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("property_name"); - - b.Property("PropertyTypeFullName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("property_type_full_name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_entity_property_changes"); - - b.HasIndex("EntityChangeId"); - - b.ToTable("abp_entity_property_changes", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsAbandoned") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_abandoned"); - - b.Property("JobArgs") - .IsRequired() - .HasMaxLength(1048576) - .HasColumnType("character varying(1048576)") - .HasColumnName("job_args"); - - b.Property("JobName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("job_name"); - - b.Property("LastTryTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_try_time"); - - b.Property("NextTryTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("next_try_time"); - - b.Property("Priority") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((byte)15) - .HasColumnName("priority"); - - b.Property("TryCount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)0) - .HasColumnName("try_count"); - - b.HasKey("Id") - .HasName("pk_abp_background_jobs"); - - b.HasIndex("IsAbandoned", "NextTryTime"); - - b.ToTable("abp_background_jobs", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AllowedProviders") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("allowed_providers"); - - b.Property("DefaultValue") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("default_value"); - - b.Property("Description") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("description"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("display_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("GroupName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("group_name"); - - b.Property("IsAvailableToHost") - .HasColumnType("boolean") - .HasColumnName("is_available_to_host"); - - b.Property("IsVisibleToClients") - .HasColumnType("boolean") - .HasColumnName("is_visible_to_clients"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("ParentName") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("parent_name"); - - b.Property("ValueType") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("value_type"); - - b.HasKey("Id") - .HasName("pk_abp_features"); - - b.HasIndex("GroupName"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("abp_features", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("display_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_abp_feature_groups"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("abp_feature_groups", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("ProviderKey") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_key"); - - b.Property("ProviderName") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_name"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_abp_feature_values"); - - b.HasIndex("Name", "ProviderName", "ProviderKey") - .IsUnique(); - - b.ToTable("abp_feature_values", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("Description") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("description"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsStatic") - .HasColumnType("boolean") - .HasColumnName("is_static"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Regex") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("regex"); - - b.Property("RegexDescription") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("regex_description"); - - b.Property("Required") - .HasColumnType("boolean") - .HasColumnName("required"); - - b.Property("ValueType") - .HasColumnType("integer") - .HasColumnName("value_type"); - - b.HasKey("Id") - .HasName("pk_abp_claim_types"); - - b.ToTable("abp_claim_types", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("SourceTenantId") - .HasColumnType("uuid") - .HasColumnName("source_tenant_id"); - - b.Property("SourceUserId") - .HasColumnType("uuid") - .HasColumnName("source_user_id"); - - b.Property("TargetTenantId") - .HasColumnType("uuid") - .HasColumnName("target_tenant_id"); - - b.Property("TargetUserId") - .HasColumnType("uuid") - .HasColumnName("target_user_id"); - - b.HasKey("Id") - .HasName("pk_abp_link_users"); - - b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") - .IsUnique(); - - b.ToTable("abp_link_users", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("EntityVersion") - .HasColumnType("integer") - .HasColumnName("entity_version"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDefault") - .HasColumnType("boolean") - .HasColumnName("is_default"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("IsStatic") - .HasColumnType("boolean") - .HasColumnName("is_static"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("normalized_name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_roles"); - - b.HasIndex("NormalizedName"); - - b.ToTable("abp_roles", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("claim_type"); - - b.Property("ClaimValue") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("claim_value"); - - b.Property("RoleId") - .HasColumnType("uuid") - .HasColumnName("role_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_role_claims"); - - b.HasIndex("RoleId"); - - b.ToTable("abp_role_claims", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Action") - .HasMaxLength(96) - .HasColumnType("character varying(96)") - .HasColumnName("action"); - - b.Property("ApplicationName") - .HasMaxLength(96) - .HasColumnType("character varying(96)") - .HasColumnName("application_name"); - - b.Property("BrowserInfo") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("browser_info"); - - b.Property("ClientId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("client_id"); - - b.Property("ClientIpAddress") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("client_ip_address"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CorrelationId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("correlation_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("Identity") - .HasMaxLength(96) - .HasColumnType("character varying(96)") - .HasColumnName("identity"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("TenantName") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("tenant_name"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("pk_abp_security_logs"); - - b.HasIndex("TenantId", "Action"); - - b.HasIndex("TenantId", "ApplicationName"); - - b.HasIndex("TenantId", "Identity"); - - b.HasIndex("TenantId", "UserId"); - - b.ToTable("abp_security_logs", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("access_failed_count"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("email"); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("email_confirmed"); - - b.Property("EntityVersion") - .HasColumnType("integer") - .HasColumnName("entity_version"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsActive") - .HasColumnType("boolean") - .HasColumnName("is_active"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("IsExternal") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_external"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("LastPasswordChangeTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_password_change_time"); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("lockout_enabled"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone") - .HasColumnName("lockout_end"); - - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("name"); - - b.Property("NormalizedEmail") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("normalized_email"); - - b.Property("NormalizedUserName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("normalized_user_name"); - - b.Property("PasswordHash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("password_hash"); - - b.Property("PhoneNumber") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("phone_number"); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("phone_number_confirmed"); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("security_stamp"); - - b.Property("ShouldChangePasswordOnNextLogin") - .HasColumnType("boolean") - .HasColumnName("should_change_password_on_next_login"); - - b.Property("Surname") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("surname"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("two_factor_enabled"); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("pk_abp_users"); - - b.HasIndex("Email"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.HasIndex("UserName"); - - b.ToTable("abp_users", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("claim_type"); - - b.Property("ClaimValue") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("claim_value"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("pk_abp_user_claims"); - - b.HasIndex("UserId"); - - b.ToTable("abp_user_claims", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("EndTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("end_time"); - - b.Property("SourceUserId") - .HasColumnType("uuid") - .HasColumnName("source_user_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("TargetUserId") - .HasColumnType("uuid") - .HasColumnName("target_user_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_user_delegations"); - - b.ToTable("abp_user_delegations", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("LoginProvider") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("login_provider"); - - b.Property("ProviderDisplayName") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("provider_display_name"); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196) - .HasColumnType("character varying(196)") - .HasColumnName("provider_key"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("UserId", "LoginProvider") - .HasName("pk_abp_user_logins"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("abp_user_logins", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => - { - b.Property("OrganizationUnitId") - .HasColumnType("uuid") - .HasColumnName("organization_unit_id"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("OrganizationUnitId", "UserId") - .HasName("pk_abp_user_organization_units"); - - b.HasIndex("UserId", "OrganizationUnitId"); - - b.ToTable("abp_user_organization_units", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("RoleId") - .HasColumnType("uuid") - .HasColumnName("role_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("UserId", "RoleId") - .HasName("pk_abp_user_roles"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("abp_user_roles", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("LoginProvider") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("login_provider"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("Value") - .HasColumnType("text") - .HasColumnName("value"); - - b.HasKey("UserId", "LoginProvider", "Name") - .HasName("pk_abp_user_tokens"); - - b.ToTable("abp_user_tokens", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Code") - .IsRequired() - .HasMaxLength(95) - .HasColumnType("character varying(95)") - .HasColumnName("code"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("display_name"); - - b.Property("EntityVersion") - .HasColumnType("integer") - .HasColumnName("entity_version"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("ParentId") - .HasColumnType("uuid") - .HasColumnName("parent_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_organization_units"); - - b.HasIndex("Code"); - - b.HasIndex("ParentId"); - - b.ToTable("abp_organization_units", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => - { - b.Property("OrganizationUnitId") - .HasColumnType("uuid") - .HasColumnName("organization_unit_id"); - - b.Property("RoleId") - .HasColumnType("uuid") - .HasColumnName("role_id"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("OrganizationUnitId", "RoleId") - .HasName("pk_abp_organization_unit_roles"); - - b.HasIndex("RoleId", "OrganizationUnitId"); - - b.ToTable("abp_organization_unit_roles", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ApplicationType") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("application_type"); - - b.Property("ClientId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("client_id"); - - b.Property("ClientSecret") - .HasColumnType("text") - .HasColumnName("client_secret"); - - b.Property("ClientType") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("client_type"); - - b.Property("ClientUri") - .HasColumnType("text") - .HasColumnName("client_uri"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("ConsentType") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("consent_type"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("DisplayName") - .HasColumnType("text") - .HasColumnName("display_name"); - - b.Property("DisplayNames") - .HasColumnType("text") - .HasColumnName("display_names"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("JsonWebKeySet") - .HasColumnType("text") - .HasColumnName("json_web_key_set"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("LogoUri") - .HasColumnType("text") - .HasColumnName("logo_uri"); - - b.Property("Permissions") - .HasColumnType("text") - .HasColumnName("permissions"); - - b.Property("PostLogoutRedirectUris") - .HasColumnType("text") - .HasColumnName("post_logout_redirect_uris"); - - b.Property("Properties") - .HasColumnType("text") - .HasColumnName("properties"); - - b.Property("RedirectUris") - .HasColumnType("text") - .HasColumnName("redirect_uris"); - - b.Property("Requirements") - .HasColumnType("text") - .HasColumnName("requirements"); - - b.Property("Settings") - .HasColumnType("text") - .HasColumnName("settings"); - - b.HasKey("Id") - .HasName("pk_open_iddict_applications"); - - b.HasIndex("ClientId"); - - b.ToTable("open_iddict_applications", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ApplicationId") - .HasColumnType("uuid") - .HasColumnName("application_id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_date"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Properties") - .HasColumnType("text") - .HasColumnName("properties"); - - b.Property("Scopes") - .HasColumnType("text") - .HasColumnName("scopes"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("status"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("subject"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_open_iddict_authorizations"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("open_iddict_authorizations", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("Descriptions") - .HasColumnType("text") - .HasColumnName("descriptions"); - - b.Property("DisplayName") - .HasColumnType("text") - .HasColumnName("display_name"); - - b.Property("DisplayNames") - .HasColumnType("text") - .HasColumnName("display_names"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("name"); - - b.Property("Properties") - .HasColumnType("text") - .HasColumnName("properties"); - - b.Property("Resources") - .HasColumnType("text") - .HasColumnName("resources"); - - b.HasKey("Id") - .HasName("pk_open_iddict_scopes"); - - b.HasIndex("Name"); - - b.ToTable("open_iddict_scopes", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ApplicationId") - .HasColumnType("uuid") - .HasColumnName("application_id"); - - b.Property("AuthorizationId") - .HasColumnType("uuid") - .HasColumnName("authorization_id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_date"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("ExpirationDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_date"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Payload") - .HasColumnType("text") - .HasColumnName("payload"); - - b.Property("Properties") - .HasColumnType("text") - .HasColumnName("properties"); - - b.Property("RedemptionDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("redemption_date"); - - b.Property("ReferenceId") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("reference_id"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("status"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("subject"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_open_iddict_tokens"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("open_iddict_tokens", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("display_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("GroupName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("group_name"); - - b.Property("IsEnabled") - .HasColumnType("boolean") - .HasColumnName("is_enabled"); - - b.Property("MultiTenancySide") - .HasColumnType("smallint") - .HasColumnName("multi_tenancy_side"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("ParentName") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("parent_name"); - - b.Property("Providers") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("providers"); - - b.Property("StateCheckers") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("state_checkers"); - - b.HasKey("Id") - .HasName("pk_abp_permissions"); - - b.HasIndex("GroupName"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("abp_permissions", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_key"); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_name"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.HasKey("Id") - .HasName("pk_abp_permission_grants"); - - b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") - .IsUnique(); - - b.ToTable("abp_permission_grants", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("display_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_abp_permission_groups"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("abp_permission_groups", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("ProviderKey") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_key"); - - b.Property("ProviderName") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("provider_name"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_abp_settings"); - - b.HasIndex("Name", "ProviderName", "ProviderKey") - .IsUnique(); - - b.ToTable("abp_settings", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("DefaultValue") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("default_value"); - - b.Property("Description") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("description"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("display_name"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsEncrypted") - .HasColumnType("boolean") - .HasColumnName("is_encrypted"); - - b.Property("IsInherited") - .HasColumnType("boolean") - .HasColumnName("is_inherited"); - - b.Property("IsVisibleToClients") - .HasColumnType("boolean") - .HasColumnName("is_visible_to_clients"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("name"); - - b.Property("Providers") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("providers"); - - b.HasKey("Id") - .HasName("pk_abp_setting_definitions"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("abp_setting_definitions", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("concurrency_stamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_time"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("creator_id"); - - b.Property("DeleterId") - .HasColumnType("uuid") - .HasColumnName("deleter_id"); - - b.Property("DeletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("deletion_time"); - - b.Property("EntityVersion") - .HasColumnType("integer") - .HasColumnName("entity_version"); - - b.Property("ExtraProperties") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra_properties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_deleted"); - - b.Property("LastModificationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modification_time"); - - b.Property("LastModifierId") - .HasColumnType("uuid") - .HasColumnName("last_modifier_id"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("name"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("normalized_name"); - - b.HasKey("Id") - .HasName("pk_abp_tenants"); - - b.HasIndex("Name"); - - b.HasIndex("NormalizedName"); - - b.ToTable("abp_tenants", (string)null); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("tenant_id"); - - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("name"); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("value"); - - b.HasKey("TenantId", "Name") - .HasName("pk_abp_tenant_connection_strings"); - - b.ToTable("abp_tenant_connection_strings", (string)null); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointRegisterAsbitem", b => - { - b.HasOne("Shentun.WebPeis.Models.AppointPatientRegister", "AppointPatientRegister") - .WithMany() - .HasForeignKey("AppointPatientRegisterId") - .IsRequired() - .HasConstraintName("fk_appoint_register_asbitem"); - - b.Navigation("AppointPatientRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointScheduleTime", b => - { - b.HasOne("Shentun.WebPeis.Models.AppointSchedule", "AppointSchedule") - .WithMany("AppointScheduleTimes") - .HasForeignKey("AppointScheduleId") - .HasConstraintName("fk_appoint_schedule_time"); - - b.Navigation("AppointSchedule"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Asbitem", b => - { - b.HasOne("Shentun.WebPeis.Models.ItemType", "ItemType") - .WithMany("Asbitems") - .HasForeignKey("ItemTypeId") - .IsRequired() - .HasConstraintName("fk_asbitem_item_type"); - - b.Navigation("ItemType"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AsbitemDetail", b => - { - b.HasOne("Shentun.WebPeis.Models.Asbitem", "Asbitem") - .WithMany("AsbitemDetails") - .HasForeignKey("AsbitemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_asbitem_detail_asbitem"); - - b.HasOne("Shentun.WebPeis.Models.Item", "Item") - .WithMany("AsbitemDetails") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_asbitem_detail_item"); - - b.Navigation("Asbitem"); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Charge", b => - { - b.HasOne("Shentun.WebPeis.Models.AppointPatientRegister", "AppointPatientRegister") - .WithMany("Charges") - .HasForeignKey("AppointPatientRegisterId") - .IsRequired() - .HasConstraintName("fk_charge"); - - b.Navigation("AppointPatientRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeAsbitem", b => - { - b.HasOne("Shentun.WebPeis.Models.Asbitem", "Asbitem") - .WithMany("ChargeAsbitems") - .HasForeignKey("AsbitemId") - .IsRequired() - .HasConstraintName("fk_charge_asbitem_asbitem"); - - b.HasOne("Shentun.WebPeis.Models.Charge", "Charge") - .WithMany("ChargeAsbitems") - .HasForeignKey("ChargeId") - .IsRequired() - .HasConstraintName("fk_charge_asbitem"); - - b.Navigation("Asbitem"); - - b.Navigation("Charge"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBack", b => - { - b.HasOne("Shentun.WebPeis.Models.Charge", "Charge") - .WithMany("ChargeBacks") - .HasForeignKey("ChargeId") - .IsRequired() - .HasConstraintName("fk_charge_back"); - - b.Navigation("Charge"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBackPay", b => - { - b.HasOne("Shentun.WebPeis.Models.ChargeBack", "ChargeBack") - .WithMany("ChargeBackPays") - .HasForeignKey("ChargeBackId") - .IsRequired() - .HasConstraintName("fk_charge_back_pay"); - - b.Navigation("ChargeBack"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBakAsbitem", b => - { - b.HasOne("Shentun.WebPeis.Models.ChargeAsbitem", "ChargeAsbitem") - .WithMany("ChargeBakAsbitems") - .HasForeignKey("ChargeAsbitemId") - .IsRequired() - .HasConstraintName("fk_charge_bak_asbitem_asbitem"); - - b.HasOne("Shentun.WebPeis.Models.ChargeBack", "ChargeBak") - .WithMany("ChargeBakAsbitems") - .HasForeignKey("ChargeBakId") - .IsRequired() - .HasConstraintName("fk_charge_bak_asbitem"); - - b.Navigation("ChargeAsbitem"); - - b.Navigation("ChargeBak"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargePay", b => - { - b.HasOne("Shentun.WebPeis.Models.Charge", "Charge") - .WithMany() - .HasForeignKey("ChargeId") - .IsRequired() - .HasConstraintName("fk_charge_pay"); - - b.Navigation("Charge"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgGroup", b => - { - b.HasOne("Shentun.WebPeis.Models.CustomerOrgRegister", "CustomerOrgRegister") - .WithMany("CustomerOrgGroups") - .HasForeignKey("CustomerOrgRegisterId") - .IsRequired() - .HasConstraintName("fk_customer_org_group_register"); - - b.Navigation("CustomerOrgRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgGroupDetail", b => - { - b.HasOne("Shentun.WebPeis.Models.Asbitem", "Asbitem") - .WithMany("CustomerOrgGroupDetails") - .HasForeignKey("AsbitemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_org_group_detail_asbitem"); - - b.HasOne("Shentun.WebPeis.Models.CustomerOrgGroup", "CustomerOrgGroup") - .WithMany("CustomerOrgGroupDetails") - .HasForeignKey("CustomerOrgGroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_org_group_detail_org_group"); - - b.Navigation("Asbitem"); - - b.Navigation("CustomerOrgGroup"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgRegister", b => - { - b.HasOne("Shentun.WebPeis.Models.CustomerOrg", "CustomerOrg") - .WithMany("CustomerOrgRegisters") - .HasForeignKey("CustomerOrgId") - .IsRequired() - .HasConstraintName("fk_customer_org_register"); - - b.Navigation("CustomerOrg"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Diagnosis", b => - { - b.HasOne("Shentun.WebPeis.Models.ItemType", "ItemType") - .WithMany("Diagnoses") - .HasForeignKey("ItemTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_diagnosis_item_type"); - - b.Navigation("ItemType"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Item", b => - { - b.HasOne("Shentun.WebPeis.Models.ItemType", "ItemType") - .WithMany("Items") - .HasForeignKey("ItemTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_item_item_type"); - - b.Navigation("ItemType"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MedicalPackageDetail", b => - { - b.HasOne("Shentun.WebPeis.Models.Asbitem", "Asbitem") - .WithMany("MedicalPackageDetails") - .HasForeignKey("AsbitemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_medical"); - - b.HasOne("Shentun.WebPeis.Models.MedicalPackage", "MedicalPackage") - .WithMany("MedicalPackageDetails") - .HasForeignKey("MedicalPackageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_medica2"); - - b.Navigation("Asbitem"); - - b.Navigation("MedicalPackage"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.PatientRegister", b => - { - b.HasOne("Shentun.WebPeis.Models.MaritalStatus", "MaritalStatus") - .WithMany("PatientRegisters") - .HasForeignKey("MaritalStatusId") - .IsRequired() - .HasConstraintName("fk_patient_register_marital_status_id"); - - b.Navigation("MaritalStatus"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegister", b => - { - b.HasOne("Shentun.WebPeis.Models.Person", "Person") - .WithMany("QuestionRegisters") - .HasForeignKey("PersonId") - .IsRequired() - .HasConstraintName("fk_question_register"); - - b.Navigation("Person"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegisterAnswer", b => - { - b.HasOne("Shentun.WebPeis.Models.QuestionAnswer", "QuestionAnswer") - .WithMany("QuestionRegisterAnswers") - .HasForeignKey("QuestionAnswerId") - .IsRequired() - .HasConstraintName("fk_question_register_answer_a"); - - b.HasOne("Shentun.WebPeis.Models.QuestionRegisterItem", "QuestionRegisterItem") - .WithMany("QuestionRegisterAnswers") - .HasForeignKey("QuestionRegisterItemId") - .IsRequired() - .HasConstraintName("fk_question_register_answer"); - - b.Navigation("QuestionAnswer"); - - b.Navigation("QuestionRegisterItem"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegisterItem", b => - { - b.HasOne("Shentun.WebPeis.Models.Question", "Question") - .WithMany("QuestionRegisterItems") - .HasForeignKey("QuestionId") - .IsRequired() - .HasConstraintName("fk_question_register_item_q"); - - b.HasOne("Shentun.WebPeis.Models.QuestionRegister", "QuestionRegister") - .WithMany("QuestionRegisterItems") - .HasForeignKey("QuestionRegisterId") - .IsRequired() - .HasConstraintName("fk_question_register_item"); - - b.Navigation("Question"); - - b.Navigation("QuestionRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckItem", b => - { - b.HasOne("Shentun.WebPeis.Models.RegisterCheck", "RegisterCheck") - .WithMany("RegisterCheckItems") - .HasForeignKey("RegisterCheckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_register_item_register_check"); - - b.Navigation("RegisterCheck"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckPicture", b => - { - b.HasOne("Shentun.WebPeis.Models.RegisterCheck", "RegisterCheck") - .WithMany("RegisterCheckPictures") - .HasForeignKey("RegisterCheckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_check_picture_register_check"); - - b.Navigation("RegisterCheck"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckSuggestion", b => - { - b.HasOne("Shentun.WebPeis.Models.RegisterCheck", "RegisterCheck") - .WithMany("RegisterCheckSuggestions") - .HasForeignKey("RegisterCheckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_registe"); - - b.Navigation("RegisterCheck"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheckSummary", b => - { - b.HasOne("Shentun.WebPeis.Models.RegisterCheck", "RegisterCheck") - .WithMany("RegisterCheckSummaries") - .HasForeignKey("RegisterCheckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_registe"); - - b.Navigation("RegisterCheck"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumDiagnosis", b => - { - b.HasOne("Shentun.WebPeis.Models.PatientRegister", "PatientRegister") - .WithMany("SumDiagnoses") - .HasForeignKey("PatientRegisterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sum_dia"); - - b.Navigation("PatientRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSuggestionContent", b => - { - b.HasOne("Shentun.WebPeis.Models.SumSuggestionHeader", "SumSuggestionHeader") - .WithMany("SumSuggestionContents") - .HasForeignKey("SumSuggestionHeaderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sum_sug"); - - b.Navigation("SumSuggestionHeader"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSuggestionHeader", b => - { - b.HasOne("Shentun.WebPeis.Models.PatientRegister", "PatientRegister") - .WithMany("SumSuggestionHeaders") - .HasForeignKey("PatientRegisterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sum_sug"); - - b.Navigation("PatientRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSummaryContent", b => - { - b.HasOne("Shentun.WebPeis.Models.SumSummaryHeader", "SumSummaryHeader") - .WithMany("SumSummaryContents") - .HasForeignKey("SumSummaryHeaderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sum_sum"); - - b.Navigation("SumSummaryHeader"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSummaryHeader", b => - { - b.HasOne("Shentun.WebPeis.Models.PatientRegister", "PatientRegister") - .WithMany("SumSummaryHeaders") - .HasForeignKey("PatientRegisterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sum_sum"); - - b.Navigation("PatientRegister"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParm", b => - { - b.HasOne("Shentun.WebPeis.Models.SysParmType", "SysParmType") - .WithMany("SysParms") - .HasForeignKey("SysParmTypeId") - .IsRequired() - .HasConstraintName("fk_sys_parm_sys_parm_type"); - - b.Navigation("SysParmType"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmValue", b => - { - b.HasOne("Shentun.WebPeis.Models.SysParm", "SysParm") - .WithMany("SysParmValues") - .HasForeignKey("SysParmId") - .IsRequired() - .HasConstraintName("fk_sys_parm_value_sys_parm"); - - b.Navigation("SysParm"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmValueOption", b => - { - b.HasOne("Shentun.WebPeis.Models.SysParm", "SysParm") - .WithMany("SysParmValueOptions") - .HasForeignKey("SysParmId") - .IsRequired() - .HasConstraintName("fk_sys_par"); - - b.Navigation("SysParm"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("Actions") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_audit_log_actions_abp_audit_logs_audit_log_id"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_entity_changes_abp_audit_logs_audit_log_id"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) - .WithMany("PropertyChanges") - .HasForeignKey("EntityChangeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_entity_property_changes_abp_entity_changes_entity_chang~"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_role_claims_abp_roles_role_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_claims_abp_users_user_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_logins_abp_users_user_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany() - .HasForeignKey("OrganizationUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_organization_units_abp_organization_units_organizati~"); - - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("OrganizationUnits") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_organization_units_abp_users_user_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_roles_abp_roles_role_id"); - - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_roles_abp_users_user_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_user_tokens_abp_users_user_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany() - .HasForeignKey("ParentId") - .HasConstraintName("fk_abp_organization_units_abp_organization_units_parent_id"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => - { - b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) - .WithMany("Roles") - .HasForeignKey("OrganizationUnitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_organization_unit_roles_abp_organization_units_organiza~"); - - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_organization_unit_roles_abp_roles_role_id"); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => - { - b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) - .WithMany() - .HasForeignKey("ApplicationId") - .HasConstraintName("fk_open_iddict_authorizations_open_iddict_applications_applica~"); - }); - - modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => - { - b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) - .WithMany() - .HasForeignKey("ApplicationId") - .HasConstraintName("fk_open_iddict_tokens_open_iddict_applications_application_id"); - - b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) - .WithMany() - .HasForeignKey("AuthorizationId") - .HasConstraintName("fk_open_iddict_tokens_open_iddict_authorizations_authorization~"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.TenantManagement.Tenant", null) - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_abp_tenant_connection_strings_abp_tenants_tenant_id"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointPatientRegister", b => - { - b.Navigation("Charges"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.AppointSchedule", b => - { - b.Navigation("AppointScheduleTimes"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Asbitem", b => - { - b.Navigation("AsbitemDetails"); - - b.Navigation("ChargeAsbitems"); - - b.Navigation("CustomerOrgGroupDetails"); - - b.Navigation("MedicalPackageDetails"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Charge", b => - { - b.Navigation("ChargeAsbitems"); - - b.Navigation("ChargeBacks"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeAsbitem", b => - { - b.Navigation("ChargeBakAsbitems"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ChargeBack", b => - { - b.Navigation("ChargeBackPays"); - - b.Navigation("ChargeBakAsbitems"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrg", b => - { - b.Navigation("CustomerOrgRegisters"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgGroup", b => - { - b.Navigation("CustomerOrgGroupDetails"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrgRegister", b => - { - b.Navigation("CustomerOrgGroups"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Item", b => - { - b.Navigation("AsbitemDetails"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.ItemType", b => - { - b.Navigation("Asbitems"); - - b.Navigation("Diagnoses"); - - b.Navigation("Items"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MaritalStatus", b => - { - b.Navigation("PatientRegisters"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.MedicalPackage", b => - { - b.Navigation("MedicalPackageDetails"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.PatientRegister", b => - { - b.Navigation("SumDiagnoses"); - - b.Navigation("SumSuggestionHeaders"); - - b.Navigation("SumSummaryHeaders"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Person", b => - { - b.Navigation("QuestionRegisters"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.Question", b => - { - b.Navigation("QuestionRegisterItems"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionAnswer", b => - { - b.Navigation("QuestionRegisterAnswers"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegister", b => - { - b.Navigation("QuestionRegisterItems"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.QuestionRegisterItem", b => - { - b.Navigation("QuestionRegisterAnswers"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.RegisterCheck", b => - { - b.Navigation("RegisterCheckItems"); - - b.Navigation("RegisterCheckPictures"); - - b.Navigation("RegisterCheckSuggestions"); - - b.Navigation("RegisterCheckSummaries"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSuggestionHeader", b => - { - b.Navigation("SumSuggestionContents"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SumSummaryHeader", b => - { - b.Navigation("SumSummaryContents"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParm", b => - { - b.Navigation("SysParmValueOptions"); - - b.Navigation("SysParmValues"); - }); - - modelBuilder.Entity("Shentun.WebPeis.Models.SysParmType", b => - { - b.Navigation("SysParms"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => - { - b.Navigation("Actions"); - - b.Navigation("EntityChanges"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.Navigation("PropertyChanges"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Navigation("Claims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Navigation("Claims"); - - b.Navigation("Logins"); - - b.Navigation("OrganizationUnits"); - - b.Navigation("Roles"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => - { - b.Navigation("Roles"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Navigation("ConnectionStrings"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.cs b/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.cs deleted file mode 100644 index 26faceb..0000000 --- a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20240523080624_updatePerson.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Shentun.WebPeis.Migrations -{ - /// - public partial class updatePerson : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "ix_person_name", - table: "person"); - - migrationBuilder.DropColumn( - name: "email", - table: "person"); - - migrationBuilder.DropColumn( - name: "is_active", - table: "person"); - - migrationBuilder.DropColumn( - name: "mobile_telephone", - table: "person"); - - migrationBuilder.DropColumn( - name: "password_hash", - table: "person"); - - migrationBuilder.DropColumn( - name: "person_name", - table: "person"); - - migrationBuilder.AlterColumn( - name: "nation_id", - table: "person", - type: "text", - nullable: false, - defaultValue: "", - comment: "民族编号", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true, - oldComment: "民族编号"); - - migrationBuilder.AlterColumn( - name: "is_allow_bind", - table: "person", - type: "character(1)", - maxLength: 1, - nullable: false, - defaultValue: '\0', - oldClrType: typeof(char), - oldType: "character(1)", - oldMaxLength: 1, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "id_type_id", - table: "person", - type: "character(2)", - fixedLength: true, - maxLength: 2, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character(2)", - oldFixedLength: true, - oldMaxLength: 2, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "id_no", - table: "person", - type: "character varying(18)", - maxLength: 18, - nullable: false, - defaultValue: "", - comment: "身份证号", - oldClrType: typeof(string), - oldType: "character varying(18)", - oldMaxLength: 18, - oldNullable: true, - oldComment: "身份证号"); - - migrationBuilder.AlterColumn( - name: "country_code", - table: "person", - type: "character varying(3)", - maxLength: 3, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(3)", - oldMaxLength: 3, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "birth_date", - table: "person", - type: "timestamp(6) without time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - comment: "出生日期", - oldClrType: typeof(DateTime), - oldType: "timestamp(6) without time zone", - oldNullable: true, - oldComment: "出生日期"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "nation_id", - table: "person", - type: "text", - nullable: true, - comment: "民族编号", - oldClrType: typeof(string), - oldType: "text", - oldComment: "民族编号"); - - migrationBuilder.AlterColumn( - name: "is_allow_bind", - table: "person", - type: "character(1)", - maxLength: 1, - nullable: true, - oldClrType: typeof(char), - oldType: "character(1)", - oldMaxLength: 1); - - migrationBuilder.AlterColumn( - name: "id_type_id", - table: "person", - type: "character(2)", - fixedLength: true, - maxLength: 2, - nullable: true, - oldClrType: typeof(string), - oldType: "character(2)", - oldFixedLength: true, - oldMaxLength: 2); - - migrationBuilder.AlterColumn( - name: "id_no", - table: "person", - type: "character varying(18)", - maxLength: 18, - nullable: true, - comment: "身份证号", - oldClrType: typeof(string), - oldType: "character varying(18)", - oldMaxLength: 18, - oldComment: "身份证号"); - - migrationBuilder.AlterColumn( - name: "country_code", - table: "person", - type: "character varying(3)", - maxLength: 3, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(3)", - oldMaxLength: 3); - - migrationBuilder.AlterColumn( - name: "birth_date", - table: "person", - type: "timestamp(6) without time zone", - nullable: true, - comment: "出生日期", - oldClrType: typeof(DateTime), - oldType: "timestamp(6) without time zone", - oldComment: "出生日期"); - - migrationBuilder.AddColumn( - name: "email", - table: "person", - type: "character varying(50)", - maxLength: 50, - nullable: true, - comment: "email"); - - migrationBuilder.AddColumn( - name: "is_active", - table: "person", - type: "character(1)", - maxLength: 1, - nullable: true); - - migrationBuilder.AddColumn( - name: "mobile_telephone", - table: "person", - type: "character varying(50)", - maxLength: 50, - nullable: true, - comment: "手机号"); - - migrationBuilder.AddColumn( - name: "password_hash", - table: "person", - type: "character varying(10)", - maxLength: 10, - nullable: true, - comment: "登录密码"); - - migrationBuilder.AddColumn( - name: "person_name", - table: "person", - type: "character varying(30)", - maxLength: 30, - nullable: false, - defaultValue: "", - comment: "姓名"); - - migrationBuilder.CreateIndex( - name: "ix_person_name", - table: "person", - column: "person_name"); - } - } -} diff --git a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs b/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs index eef1776..e1e9f09 100644 --- a/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs +++ b/src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs @@ -2194,7 +2194,7 @@ namespace Shentun.WebPeis.Migrations .HasColumnType("timestamp(6) without time zone") .HasColumnName("creation_time"); - b.Property("CreatorId") + b.Property("CreatorId") .HasColumnType("uuid") .HasColumnName("creator_id"); @@ -2266,11 +2266,11 @@ namespace Shentun.WebPeis.Migrations .HasColumnName("job_title") .HasComment("职称"); - b.Property("LastModificationTime") + b.Property("LastModificationTime") .HasColumnType("timestamp(6) without time zone") .HasColumnName("last_modification_time"); - b.Property("LastModifierId") + b.Property("LastModifierId") .HasColumnType("uuid") .HasColumnName("last_modifier_id"); @@ -2356,6 +2356,12 @@ namespace Shentun.WebPeis.Migrations .HasColumnName("remark") .HasComment("备注"); + b.Property("ReportFile") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("report_file") + .HasComment("体检报告文件"); + b.Property("SexHormoneTermId") .HasColumnType("uuid") .HasColumnName("sex_hormone_term_id") @@ -2385,6 +2391,12 @@ namespace Shentun.WebPeis.Migrations .HasColumnName("third_info") .HasComment("附加第三方信息"); + b.Property("ThirdRegisterId") + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("third_register_id") + .HasComment("第三方ID"); + b.HasKey("PatientRegisterId") .HasName("pk_patient_register"); @@ -2458,9 +2470,9 @@ namespace Shentun.WebPeis.Migrations modelBuilder.Entity("Shentun.WebPeis.Models.Person", b => { - b.Property("PersonId") + b.Property("UserId") .HasColumnType("uuid") - .HasColumnName("person_id"); + .HasColumnName("user_id"); b.Property("Address") .HasMaxLength(100) @@ -2578,7 +2590,7 @@ namespace Shentun.WebPeis.Migrations .HasColumnType("character varying(50)") .HasColumnName("wechat_open_id"); - b.HasKey("PersonId") + b.HasKey("UserId") .HasName("pk_patient"); b.HasIndex(new[] { "PersonNo" }, "IX_person_person_no") @@ -2595,13 +2607,13 @@ namespace Shentun.WebPeis.Migrations modelBuilder.Entity("Shentun.WebPeis.Models.PersonKinship", b => { - b.Property("PersonId") + b.Property("UserId") .HasColumnType("uuid") - .HasColumnName("person_id"); + .HasColumnName("user_id"); - b.Property("ParentPersonId") + b.Property("ParentUserId") .HasColumnType("uuid") - .HasColumnName("parent_person_id"); + .HasColumnName("parent_user_id"); b.Property("KinshipId") .HasMaxLength(2) @@ -2609,7 +2621,7 @@ namespace Shentun.WebPeis.Migrations .HasColumnName("kinship_id") .IsFixedLength(); - b.HasKey("PersonId", "ParentPersonId", "KinshipId") + b.HasKey("UserId", "ParentUserId", "KinshipId") .HasName("person_kinship_pkey"); b.ToTable("person_kinship", (string)null); diff --git a/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs b/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs index 668deec..4faaa3b 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs +++ b/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs @@ -20,25 +20,33 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; using System.Collections.Generic; using IdentityModel; +using Shentun.WebPeis.Enums; +using Microsoft.AspNetCore.Authentication.Cookies; +using Volo.Abp.Security.Claims; namespace Shentun.WebPeis.Controllers { - - //[IgnoreAntiforgeryToken] - //[ApiExplorerSettings(IgnoreApi = true)] - public class WeChatController : AbpOpenIdDictControllerBase, ITokenExtensionGrant + + public interface IWeChatController + { + + } + [IgnoreAntiforgeryToken] + [ApiExplorerSettings(IgnoreApi = true)] + public class WeChatController : AbpOpenIdDictControllerBase, ITokenExtensionGrant, IWeChatController { private readonly IConfiguration _configuration; private readonly IRepository _personRepository; private readonly IRepository _identityUserRepository; private readonly IdentityUserManager _userManager; - public string Name => throw new System.NotImplementedException(); + public string Name => WeChatGrant.GrantType; public WeChatController(IConfiguration configuration, IRepository identityUserRepository, IdentityUserManager userManager, IRepository personRepository) { + _configuration = configuration; _identityUserRepository = identityUserRepository; _userManager = userManager; @@ -47,76 +55,138 @@ namespace Shentun.WebPeis.Controllers public async Task HandleAsync(ExtensionGrantContext context) { - LazyServiceProvider = context.HttpContext.RequestServices.GetRequiredService(); + + //LazyServiceProvider = context.HttpContext.RequestServices.GetRequiredService(); //var request = await GetOpenIddictServerRequestAsync(HttpContext); - string jsCode = context.Request.GetParameter("jsCode").ToString(); - var wechatSession = await GetWechatSession(jsCode); - if (wechatSession == null) + if(_configuration == null) { - throw new Exception("微信会话返回空值"); + throw new Exception("_configuration不能为空"); } - if (wechatSession.ErrCode != 0) + + if (context.Request.GetParameter("jsCode") == null) { - throw new Exception("微信账户登陆失败"); + throw new Exception("jsCode不能为空"); } + + string jsCode = context.Request.GetParameter("jsCode").ToString(); + + var wechatSession = await WeChatHelper.GetWechatSession(_configuration, jsCode); + + //var wechatSession = await GetWechatSession(jsCode); + //if (wechatSession == null) + //{ + // throw new Exception("微信会话返回空值"); + //} + //if (wechatSession.ErrCode != 0) + //{ + // throw new Exception("微信账户登陆失败"); + //} + if (_personRepository == null) + { + throw new Exception("_personRepository不能为空"); + } + var person = (await _personRepository.GetQueryableAsync()).Where(o => o.WechatOpenId == wechatSession.OpenId).FirstOrDefault(); + var wechatUser = new WechatUserDto(); var principal = new ClaimsPrincipal(); - var claimsIdentity = new ClaimsIdentity(); - if (person == null) - { - claimsIdentity.AddClaim(new Claim("IsNewUser", "N")); - claimsIdentity.AddClaim(new Claim("OpenId", wechatSession.OpenId)); - wechatUser.IsNewUser = true; - principal.AddIdentity(claimsIdentity); - return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - var user = (await _identityUserRepository.GetQueryableAsync()).Where(o => o.Id == person.UserId).Single(); + var claimsIdentity = new ClaimsIdentity(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); + var scopes = context.Request.GetScopes(); + var resources = await GetResourcesAsync(scopes); + //if (person == null) + //{ + + // claimsIdentity.AddClaim(new Claim(ClaimTypes.Sid, "无效")); + // claimsIdentity.AddClaim(new Claim(ClaimTypes.Name, "无效")); + // claimsIdentity.AddClaim(new Claim(ClaimTypes.Role, "无效")); + // claimsIdentity.AddClaim(new Claim(ClaimTypes.Email, "无效")); + // claimsIdentity.AddClaim(new Claim("IsNewUser", "N")); + // claimsIdentity.AddClaim(new Claim("OpenId", wechatSession.OpenId)); + // wechatUser.IsNewUser = true; + // principal.AddIdentity(claimsIdentity); + // principal.SetScopes(scopes); + // principal.SetResources(resources); + // return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); + //} + var user = (await _identityUserRepository.GetQueryableAsync()).Where(o => o.UserName == "admin").FirstOrDefault(); + //var user = (await _identityUserRepository.GetQueryableAsync()).Where(o => o.Id == person.UserId).Single(); if (user == null) { throw new Exception("用户不存在"); } principal = await SignInManager.CreateUserPrincipalAsync(user); - var claim = new Claim("IsNewUser","N"); - claimsIdentity.AddClaim(claim); - principal.AddIdentity(claimsIdentity); - var scopes = context.Request.GetScopes(); + + //var claim = new Claim("IsNewUser","N"); + //claimsIdentity.AddClaim(claim); + //principal.AddIdentity(claimsIdentity); + principal.SetScopes(scopes); - var resources = await GetResourcesAsync(scopes); - principal.SetResources(resources); + principal.SetResources(resources); + if (principal == null) + { + throw new Exception("principal不能为空"); + } + return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); } - private async Task GetWechatSession(string jsCode) - { - IConfigurationSection configSection = _configuration.GetSection("Wechat"); - string url = configSection.GetValue("SessionUrl", "https://api.weixin.qq.com/sns/jscode2session?"); - string appId = configSection.GetValue("AppID", ""); - string appSecret = configSection.GetValue("AppSecret", ""); + //private async Task GetWechatSession(string jsCode) + //{ + // if (string.IsNullOrWhiteSpace(jsCode)) + // { + // throw new Exception("jsCode不能为空"); + // } + // IConfigurationSection configSection = _configuration.GetSection("WeChat"); + // if (configSection == null) + // { + // throw new Exception("微信配置不能为空"); + // } + // string url = configSection.GetValue("SessionUrl", "https://api.weixin.qq.com/sns/jscode2session?"); + // string appId = configSection.GetValue("AppID", ""); + // string appSecret = configSection.GetValue("AppSecret", ""); + // if (string.IsNullOrWhiteSpace(url)) + // { + // throw new Exception("微信url不能为空"); + // } + // if (string.IsNullOrWhiteSpace(appId)) + // { + // throw new Exception("微信appId不能为空"); + // } + // if (string.IsNullOrWhiteSpace(appSecret)) + // { + // throw new Exception("微信appSecret不能为空"); + // } + // url = url + "appid=" + appId + "&secret=" + appSecret + "&js_code=" + jsCode + "&grant_type=authorization_code"; + + // var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip }; - url = url + "appid=" + appId + "&secret=" + appSecret + "&js_code=" + jsCode + "&grant_type=authorization_code"; + // using (var httpClient = new HttpClient(handler)) + // { + // //await异步等待回应 - var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip }; + // var responseResult = await httpClient.GetAsync(url); + // //确保HTTP成功状态值 + // if (!responseResult.IsSuccessStatusCode) + // { + // throw new Exception("获取微信小程序数据失败," + responseResult.StatusCode); + // } - using (var httpClient = new HttpClient(handler)) - { - //await异步等待回应 - - var responseResult = await httpClient.GetAsync(url); - //确保HTTP成功状态值 - if (!responseResult.IsSuccessStatusCode) - { - throw new Exception("获取微信小程序数据失败," + responseResult.StatusCode); - } - - //await异步读取最后的JSON(注意此时gzip已经被自动解压缩了,因为上面的AutomaticDecompression = DecompressionMethods.GZip) - string responseContent = await responseResult.Content.ReadAsStringAsync(); - var wechatSession = JsonSerializer.Deserialize(responseContent); - return wechatSession; - } - } + // //await异步读取最后的JSON(注意此时gzip已经被自动解压缩了,因为上面的AutomaticDecompression = DecompressionMethods.GZip) + // string responseContent = await responseResult.Content.ReadAsStringAsync(); + // var wechatSession = JsonSerializer.Deserialize(responseContent); + // if(wechatSession == null) + // { + // throw new Exception("获取微信小程序wechatSession为空"); + // } + // if (wechatSession.ErrCode != 0) + // { + // throw new Exception("微信账户登陆失败"); + // } + // return wechatSession; + // } + //} } } diff --git a/src/Shentun.WebPeis.HttpApi.Host/Filters/CustomerActionFilterAttribute.cs b/src/Shentun.WebPeis.HttpApi.Host/Filters/CustomerActionFilterAttribute.cs index acaa20c..522620b 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/Filters/CustomerActionFilterAttribute.cs +++ b/src/Shentun.WebPeis.HttpApi.Host/Filters/CustomerActionFilterAttribute.cs @@ -53,18 +53,13 @@ namespace Shentun.WebPeis else { - List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems" }; + List filterApiUrl = new List { "/connect/token" }; if (filterApiUrl.Contains(context.HttpContext.Request.Path.ToString().ToLower())) { - ThirdReturn msg = new ThirdReturn - { - code = "200", - message = "处理成功", - data = result.Value - }; + - context.Result = new OkObjectResult(msg); + context.Result = result; } else { diff --git a/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs b/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs index 31016de..263f690 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs +++ b/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs @@ -41,6 +41,9 @@ using Volo.Abp.OpenIddict.ExtensionGrantTypes; using OpenIddict.Server; using Shentun.WebPeis.Controllers; using Autofac.Core; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.EntityFrameworkCore.Internal; +using Volo.Abp.OpenIddict; namespace Shentun.WebPeis; @@ -76,6 +79,11 @@ public class WebPeisHttpApiHostModule : AbpModule openIddictServerOptions.GrantTypes.Add(WeChatGrant.GrantType); }); }); + + //context.Services.PreConfigure(options => + //{ + // options.UpdateAbpClaimTypes = false; + //}); } public override void ConfigureServices(ServiceConfigurationContext context) @@ -112,14 +120,41 @@ public class WebPeisHttpApiHostModule : AbpModule //}); Configure(x => { - x.InputDateTimeFormats.Add( "yyyy-MM-dd HH:mm:ss"); + x.InputDateTimeFormats.Add("yyyy-MM-dd HH:mm:ss"); x.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss"; }); - context.Services.AddSingleton(); - Configure(options => + Configure(x => { - options.Grants.Add(WeChatGrant.GrantType, (IExtensionGrant)context.Services.GetServiceLazy()); + x.JsonSerializerOptions.PropertyNameCaseInsensitive = true; }); + // context.Services.AddTransient(); + //Configure(options => + //{ + // //options.Grants.Add(WeChatGrant.GrantType, (IExtensionGrant)context.Services.GetServiceLazy()); + // options.Grants.Add(WeChatGrant.GrantType, serviceProvider.GetRequiredService()); + //}); + context.Services.AddOptions() + .Configure((options, serviceProvider) => + { + options.Grants.Add(WeChatGrant.GrantType, serviceProvider.GetRequiredService()); + }); + + + + // context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + //.AddJwtBearer(options => + //{ + // options.Authority = configuration["AuthServer:Authority"]; + // options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); + // options.Audience = "BookStore2"; + // options.MapInboundClaims = false; + //}); + //context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + // .AddJwtBearer( + // options => + // { + // options.MapInboundClaims = false; + // }); //context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:PhysicsPath"], configuration["VirtualPath:Alias"])); } diff --git a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json index bc85fc7..991ae14 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json +++ b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json @@ -28,10 +28,10 @@ "StringEncryption": { "DefaultPassPhrase": "rBfozS7zkeTYat2k" }, - "Wechat": { + "WeChat": { "SessionUrl": "https://api.weixin.qq.com/sns/jscode2session?", //微信小程序访问用户信息URL - "AppID": "wx7532a29e2c51f70b", //微信小程序要求的AppID - "AppSecret": "6a26f526c5436086cd93787d7435acb9" //微信小程序要求的AppSecret + "AppID": "wx6a8a4440a42c9466", //微信小程序要求的AppID + "AppSecret": "aae34bfef498906290a92318d0f7183d" //微信小程序要求的AppSecret }, "VirtualPaths": [ { diff --git a/test/Shentun.WebPeis.Application.Tests/PersonAppServiceTest.cs b/test/Shentun.WebPeis.Application.Tests/PersonAppServiceTest.cs index 5c89e8a..e439a2b 100644 --- a/test/Shentun.WebPeis.Application.Tests/PersonAppServiceTest.cs +++ b/test/Shentun.WebPeis.Application.Tests/PersonAppServiceTest.cs @@ -1,12 +1,49 @@ -using System; +using Shentun.WebPeis.Models; +using Shentun.WebPeis.Persons; +using Shentun.WebPeis.Wechats; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Xunit; +using Xunit.Abstractions; namespace Shentun.WebPeis { - internal class PersonAppServiceTest + public abstract class PersonAppServiceTest : WebPeisApplicationTestBase + where TStartupModule : IAbpModule { + private readonly IRepository _repository; + private readonly PersonAppService _appService; + //private readonly ITestOutputHelper _output; + private readonly IUnitOfWorkManager _unitOfWorkManager; + public PersonAppServiceTest() + { + //ITestOutputHelper testOutputHelper + //_output = testOutputHelper; + _unitOfWorkManager = GetRequiredService(); + _repository = GetRequiredService>(); + _appService = GetRequiredService(); + //_output = GetRequiredService(); + } + [Fact] + public async Task GetWechatUserTokenAsync() + { + using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) + { + + var entity = new WechatUserJsCodeInputDto() + { + JsCode = "0c1yTa0w3mErQ23eot3w3ocsxw4yTa0P" + }; + + var newEntity = await _appService.GetWechatUserTokenAsync(entity); + await unitOfWork.CompleteAsync(); + } + } } } diff --git a/test/Shentun.WebPeis.Application.Tests/Shentun.WebPeis.Application.Tests.csproj b/test/Shentun.WebPeis.Application.Tests/Shentun.WebPeis.Application.Tests.csproj index 1ebdac9..643dd3d 100644 --- a/test/Shentun.WebPeis.Application.Tests/Shentun.WebPeis.Application.Tests.csproj +++ b/test/Shentun.WebPeis.Application.Tests/Shentun.WebPeis.Application.Tests.csproj @@ -8,6 +8,30 @@ Shentun.WebPeis + + + + + + + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + diff --git a/test/Shentun.WebPeis.Application.Tests/WebPeisApplicationTestBase.cs b/test/Shentun.WebPeis.Application.Tests/WebPeisApplicationTestBase.cs index 108c537..1cb0deb 100644 --- a/test/Shentun.WebPeis.Application.Tests/WebPeisApplicationTestBase.cs +++ b/test/Shentun.WebPeis.Application.Tests/WebPeisApplicationTestBase.cs @@ -7,3 +7,8 @@ public abstract class WebPeisApplicationTestBase : WebPeisTestBa { } + +//public abstract class WebPeisApplicationTestBase : WebPeisTestBase +//{ + +//} diff --git a/test/Shentun.WebPeis.Application.Tests/appsettings.Development.json b/test/Shentun.WebPeis.Application.Tests/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/test/Shentun.WebPeis.Application.Tests/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/test/Shentun.WebPeis.Application.Tests/appsettings.json b/test/Shentun.WebPeis.Application.Tests/appsettings.json new file mode 100644 index 0000000..991ae14 --- /dev/null +++ b/test/Shentun.WebPeis.Application.Tests/appsettings.json @@ -0,0 +1,43 @@ +{ + //"Kestrel": { + // "Endpoints": { + // "Http": { + // "Url": "http://localhost:44382" + // }, + // "Https": { + // "Url": "https://localhost:44382" + // } + // } + //}, + "App": { + "SelfUrl": "https://localhost:44382", + "CorsOrigins": "https://*.WebPeis.com", + "RedirectAllowedUrls": "" + }, + + "ConnectionStrings": { + "Default": "Host=10.1.12.140;Port=5432;Database=WebPeis0520;User ID=postgres;Password=st123;" + }, + "AuthServer": { + "Authority": "https://localhost:44382", + "RequireHttpsMetadata": false, + "SwaggerClientId": "WebPeis_Swagger", + "WeChatClientId": "WeChatApp", + "WeChatClientSecret": "1234*^@" + }, + "StringEncryption": { + "DefaultPassPhrase": "rBfozS7zkeTYat2k" + }, + "WeChat": { + "SessionUrl": "https://api.weixin.qq.com/sns/jscode2session?", //微信小程序访问用户信息URL + "AppID": "wx6a8a4440a42c9466", //微信小程序要求的AppID + "AppSecret": "aae34bfef498906290a92318d0f7183d" //微信小程序要求的AppSecret + }, + "VirtualPaths": [ + { + "PhysicsPath": "F:\\testimg", //体检报告物理路径 + "RequestPath": "/Report", //体检报告请求路径 + "Alias": "Report" //体检报告别名 + } + ] +} diff --git a/test/Shentun.WebPeis.Application.Tests/appsettings.secrets.json b/test/Shentun.WebPeis.Application.Tests/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/test/Shentun.WebPeis.Application.Tests/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCorePersonAppServiceTest.cs b/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCorePersonAppServiceTest.cs new file mode 100644 index 0000000..379f13e --- /dev/null +++ b/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCorePersonAppServiceTest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.WebPeis.EntityFrameworkCore.Applications +{ + public class EfCorePersonAppServiceTest:PersonAppServiceTest + { + } +} diff --git a/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/WebPeisEntityFrameworkCoreTestModule.cs b/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/WebPeisEntityFrameworkCoreTestModule.cs index e057797..a8c6bd5 100644 --- a/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/WebPeisEntityFrameworkCoreTestModule.cs +++ b/test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/WebPeisEntityFrameworkCoreTestModule.cs @@ -24,6 +24,7 @@ public class WebPeisEntityFrameworkCoreTestModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => { options.SaveStaticFeaturesToDatabase = false; @@ -35,10 +36,23 @@ public class WebPeisEntityFrameworkCoreTestModule : AbpModule options.IsDynamicPermissionStoreEnabled = false; }); context.Services.AddAlwaysDisableUnitOfWorkTransaction(); - - ConfigureInMemorySqlite(context.Services); + ConfigurePostGress(context.Services); + //ConfigureInMemorySqlite(context.Services); } + private void ConfigurePostGress(IServiceCollection services) + { + //string connectStr = "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123"; + string connectStr = "Host=10.1.12.140;Port=5432;Database=WebPeis0520;User ID=postgres;Password=st123;"; + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseNpgsql(connectStr); + }); + }); + } private void ConfigureInMemorySqlite(IServiceCollection services) { _sqliteConnection = CreateDatabaseAndGetConnection(); diff --git a/test/Shentun.WebPeis.TestBase/WebPeisTestBaseModule.cs b/test/Shentun.WebPeis.TestBase/WebPeisTestBaseModule.cs index c6af57f..5894e3a 100644 --- a/test/Shentun.WebPeis.TestBase/WebPeisTestBaseModule.cs +++ b/test/Shentun.WebPeis.TestBase/WebPeisTestBaseModule.cs @@ -29,7 +29,7 @@ public class WebPeisTestBaseModule : AbpModule public override void OnApplicationInitialization(ApplicationInitializationContext context) { - SeedTestData(context); + //SeedTestData(context); } private static void SeedTestData(ApplicationInitializationContext context)