diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/ItemDzModel.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/ItemDzModel.cs
new file mode 100644
index 00000000..cd3b6f5c
--- /dev/null
+++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/ItemDzModel.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Shentun.Peis.PlugIns.Extensions.ThirdPushs.Hty
+{
+ public class ItemDzModel
+ {
+ public string CodeValue { get; set; }
+
+ public string InterfaceCodeValue { get; set; }
+ }
+}
diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushHtyDataInputDto.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushHtyDataInputDto.cs
new file mode 100644
index 00000000..140d26d7
--- /dev/null
+++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushHtyDataInputDto.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Shentun.Peis.PlugIns.Extensions.ThirdPushs.Hty
+{
+ public class PushHtyDataInputDto
+ {
+ public PushHtyDataInputPatientDto info { get; set; }
+
+ public object content { get; set; }
+
+ //public string serious { get; set; }
+ }
+
+ public class PushHtyDataInputPatientDto
+ {
+ ///
+ ///
+ ///
+ public string USERID { get; set; }
+ ///
+ ///
+ ///
+ public string CERTNO { get; set; }
+ ///
+ ///
+ ///
+ public string BIRTHDATE { get; set; }
+ ///
+ ///
+ ///
+ public string USERTIMES { get; set; }
+ ///
+ /// 男、女
+ ///
+ public string GENDER { get; set; }
+ ///
+ ///
+ ///
+ public string NAME { get; set; }
+ ///
+ ///
+ ///
+ public string MEDICALDATE { get; set; }
+ ///
+ ///
+ ///
+ public string RORGNAME { get; set; }
+ ///
+ ///
+ ///
+ public string MEDICALCODE { get; set; }
+ }
+
+
+ public class pushHtyDataItemDto
+ {
+ ///
+ ///
+ ///
+ public string sysCode { get; set; }
+ ///
+ ///
+ ///
+ public string p_value { get; set; }
+ ///
+ ///
+ ///
+ public int ordinary { get; set; }
+ ///
+ ///
+ ///
+ public string unit { get; set; }
+ ///
+ /// 男:<85|女:<80
+ ///
+ public string dicValue { get; set; }
+ }
+
+ public class PushHtyDataResultDto
+ {
+ public string stateMessage { get; set; }
+ }
+}
diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushPeisResultPlugInsHty.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushPeisResultPlugInsHty.cs
new file mode 100644
index 00000000..c7e411c2
--- /dev/null
+++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ThirdPushs/Hty/PushPeisResultPlugInsHty.cs
@@ -0,0 +1,270 @@
+using Dapper;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Identity.Client;
+using Newtonsoft.Json;
+using Npgsql;
+using ServiceReferenceDianLisReport;
+using ServiceReferenceDianLisResult;
+using Shentun.Peis.Enums;
+using Shentun.Peis.ImportLisResults;
+using Shentun.Peis.PlugIns.ColumnReferences;
+using Shentun.Peis.PlugIns.Extensions.ImportLisResults.Dian;
+using Shentun.Peis.PlugIns.ImportLisResults;
+using Shentun.Peis.PlugIns.ThirdPushs.Hty;
+using Shentun.Peis.PlugIns.WebAppoints;
+using Shentun.Peis.PrintReports;
+using Shentun.Peis.RegisterCheckPictures;
+using Shentun.Peis.ThirdInterfaces;
+using Spire.Pdf.Exporting.XPS.Schema;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Common;
+using System.Linq;
+using System.ServiceModel;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using static OpenIddict.Abstractions.OpenIddictConstants;
+
+namespace Shentun.Peis.PlugIns.Extensions.ThirdPushs.Hty
+{
+ public class PushPeisResultPlugInsHty : PushPeisResultPlugInsBase
+ {
+
+ public PushPeisResultPlugInsHty(Guid thirdInterfaceId) : base(thirdInterfaceId)
+ {
+
+ }
+
+
+ public async Task DoWork()
+ {
+
+ List patientRegisters = await GetRequestPatientRegistersHtyAsync();
+
+ foreach (var patientRegisterId in patientRegisters)
+ {
+ await PushHtyPeisResultByPatientRegisterIdAsync(patientRegisterId);
+ }
+
+ }
+
+
+ ///
+ /// 根据id推送信息到海豚云
+ ///
+ ///
+ ///
+ ///
+ public async Task PushHtyPeisResultByPatientRegisterIdAsync(Guid patientRegisterId)
+ {
+ var pushBaseApi = InterfaceConfig.GetValue("Interface:PushBaseApi", "");
+ var columnReferenceId = InterfaceConfig.GetValue("Interface:ColumnReferenceId", "");
+
+
+ using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
+ {
+ var sql_patient = $@" select b.patient_no,b.id_no,b.birth_date,a.medical_times,b.sex_id,a.patient_name,
+ a.medical_start_date,a.patient_register_no,a.complete_flag from patient_register as a left join
+ patient as b on a.patient_id=b.id where a.id=@patient_register_id ";
+
+
+ var patientRegisterSqlEntity = (await conn.QueryFirstAsync(sql_patient,
+ new { patient_register_id = patientRegisterId }));
+
+ if (patientRegisterSqlEntity != null)
+ {
+ if (patientRegisterSqlEntity.complete_flag != "3")
+ {
+ throw new UserFriendlyException("人员为总检");
+ }
+
+ var pushRequest = new PushHtyDataInputDto();
+ pushRequest.info = new PushHtyDataInputPatientDto
+ {
+ USERID = patientRegisterSqlEntity.patient_no.ToString(),
+ CERTNO = patientRegisterSqlEntity.id_no.ToString(),
+ BIRTHDATE = !string.IsNullOrWhiteSpace(patientRegisterSqlEntity.birth_date.ToString()) ? Convert.ToDateTime(patientRegisterSqlEntity.birth_date).ToString("yyyy-MM-dd") : "",
+ USERTIMES = patientRegisterSqlEntity.medical_times.ToString(),
+ GENDER = ConertSex(patientRegisterSqlEntity.sex_id.ToString()),
+ NAME = patientRegisterSqlEntity.patient_name.ToString(),
+ MEDICALDATE = Convert.ToDateTime(patientRegisterSqlEntity.medical_start_date).ToString("yyyy-MM-dd HH:mm:ss"),
+ MEDICALCODE = patientRegisterSqlEntity.patient_register_no.ToString(),
+ RORGNAME = ""
+ };
+
+ //查看项目
+ var sql_item = $@" select c.display_name as item_name,b.* from register_check as a
+ left join register_check_item as b on a.id=b.register_check_id
+ left join item as c on b.item_id=c.id where a.patient_register_id=@patient_register_id ";
+
+ var registerItemSqlEntity = await conn.QueryAsync(sql_item,
+ new { patient_register_id = patientRegisterId });
+
+ if (registerItemSqlEntity.Count() > 0)
+ {
+
+ #region 获取对照数据
+
+ var sql_dz = $@" select a.code_value,b.interface_code_value from column_reference_code as a
+ left join column_reference_interface as b on a.id=b.column_reference_code_id
+ where a.column_reference_id=@column_reference_id ";
+
+ var itemDZSqlEntity = (await conn.QueryAsync(sql_dz,
+ new { column_reference_id = Guid.Parse(columnReferenceId) })).ToList();
+
+ #endregion
+
+
+ Dictionary contents = new Dictionary();
+
+ foreach (var itemRow in registerItemSqlEntity)
+ {
+ var itemCode = itemDZSqlEntity.FirstOrDefault(f => f.code_value == itemRow.item_id.ToString());
+ if (itemCode != null)
+ {
+ var constr = new pushHtyDataItemDto
+ {
+ dicValue = itemRow.reference_range_value.ToString(),
+ ordinary = 1,
+ p_value = itemRow.result.ToString(),
+ sysCode = itemCode.interface_code_value,
+ unit = itemRow.unit.ToString()
+ };
+ var dcIndex = contents.Count + 1;
+
+ contents.Add("con" + dcIndex, constr);
+ }
+ }
+
+
+ pushRequest.content = contents;
+ }
+
+ string pushRequestJsonString = JsonConvert.SerializeObject(pushRequest, Formatting.Indented);
+
+
+ //推送信息
+
+ var formContent = new MultipartFormDataContent();
+ formContent.Add(new StringContent(_thirdToken), "token");
+ formContent.Add(new StringContent("fbpc"), "urlFrom");
+ formContent.Add(new StringContent("-1"), "tmId");
+ formContent.Add(new StringContent(pushRequestJsonString, Encoding.UTF8, "application/json"), "pushData");
+
+ var result = await HtyHttpPostHelper.PostFormDataAsync($"{pushBaseApi}/api/manageFrame/healthCheck/medicalInterfaceDataFetch.action", formContent, "PostmanRuntime-ApipostRuntime/1.1.0");
+ var resultModel = JsonConvert.DeserializeObject(result);
+
+ if (resultModel.stateMessage == "suc")
+ {
+ #region 更新人员状态
+
+ #endregion
+ }
+
+ return $"{pushRequest.info.NAME}_{pushRequest.info.MEDICALCODE}_推送结果:{resultModel.stateMessage}";
+
+ }
+ else
+ {
+ throw new UserFriendlyException("人员不存在");
+ }
+ }
+
+
+ }
+
+
+ ///
+ /// 获取需要推送的人员id集合
+ ///
+ ///
+ public async Task> GetRequestPatientRegistersHtyAsync()
+ {
+ var patientRegisterIds = new List();
+
+ var queryDaysStr = InterfaceConfig.GetValue("Interface:Scheduler:QueryDays", "");
+ var isAuditWhere = InterfaceConfig.GetValue("Interface:Scheduler:IsAuditWhere", "");
+ var uploadDateType = InterfaceConfig.GetValue("Interface:Scheduler:UploadDateType", "");
+ var otherWhere = InterfaceConfig.GetValue("Interface:Scheduler:OtherWhere", "");
+ var uploadCountLimit = InterfaceConfig.GetValue("Interface:Scheduler:UploadCountLimit", "");
+ if (string.IsNullOrWhiteSpace(queryDaysStr))
+ {
+ queryDaysStr = "1";
+ }
+ if (!int.TryParse(queryDaysStr, out int days))
+ {
+ days = 1;
+ }
+
+
+ using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
+ {
+ string sql;
+ sql = @"
+ SELECT
+ id
+ from patient_register
+ where complete_flag = @CompleteFlag ";
+
+ if (uploadDateType == "1")
+ {
+ sql += " and summary_date>= @HandDate ";
+ }
+ else if (uploadDateType == "2")
+ {
+ sql += " and audit_date>= @HandDate ";
+ }
+ else
+ {
+ sql += " and last_modification_time>= @HandDate ";
+ }
+
+ if (isAuditWhere == "Y")
+ {
+ sql += " and is_audit='Y' ";
+ }
+
+ if (!string.IsNullOrWhiteSpace(otherWhere))
+ {
+ sql += otherWhere;
+ }
+
+ var parameters = new DynamicParameters();
+ parameters.Add("HandDate", DateTime.Now.Date.AddDays(-days));
+ parameters.Add("CompleteFlag", PatientRegisterCompleteFlag.SumCheck);
+
+
+ sql += $" limit {uploadCountLimit} ";
+
+
+ var patientRegisterSqlList = (await conn.QueryAsync(sql, parameters)).ToList();
+ patientRegisterIds = patientRegisterSqlList.Select(s => s.Id).ToList();
+ }
+
+ return patientRegisterIds;
+ }
+
+ private string ConertSex(string sexId)
+ {
+ string res = "";
+
+ if (sexId == "M")
+ {
+ res = "男";
+ }
+ else if (sexId == "F")
+ {
+ res = "女";
+ }
+ else
+ {
+ res = "未知";
+ }
+
+ return res;
+
+ }
+ }
+}
diff --git a/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/GetHtyTokenDto.cs b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/GetHtyTokenDto.cs
new file mode 100644
index 00000000..8d6a5774
--- /dev/null
+++ b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/GetHtyTokenDto.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Shentun.Peis.PlugIns.ThirdPushs.Hty
+{
+ public class GetHtyTokenDto
+ {
+ ///
+ /// 登录成功
+ ///
+ public string msg { get; set; }
+ ///
+ ///
+ ///
+ public string expireDays { get; set; }
+ ///
+ ///
+ ///
+ public int gender { get; set; }
+ ///
+ ///
+ ///
+ public string photomiddle { get; set; }
+ ///
+ ///
+ ///
+ public string isCusService { get; set; }
+ ///
+ ///
+ ///
+ public string userLoginTimeStr { get; set; }
+ ///
+ ///
+ ///
+ public string isShopUser { get; set; }
+ ///
+ ///
+ ///
+ public string isShowCoupon { get; set; }
+ ///
+ ///
+ ///
+ public string isAdmin { get; set; }
+ ///
+ ///
+ ///
+ public string userName { get; set; }
+ ///
+ ///
+ ///
+ public string userLoginIp { get; set; }
+ ///
+ ///
+ ///
+ public string userId { get; set; }
+ ///
+ ///
+ ///
+ public string userCode { get; set; }
+ ///
+ ///
+ ///
+ public string rfqId { get; set; }
+ ///
+ ///
+ ///
+ public string isDoctor { get; set; }
+ ///
+ /// 石家庄长城中西医接合体检中心
+ ///
+ public string name { get; set; }
+ ///
+ ///
+ ///
+ public string eaId { get; set; }
+ ///
+ ///
+ ///
+ public string token2 { get; set; }
+ ///
+ ///
+ ///
+ public string eaCode { get; set; }
+ ///
+ ///
+ ///
+ public string expireDate { get; set; }
+ ///
+ ///
+ ///
+ public string state { get; set; }
+ ///
+ ///
+ ///
+ public string msgCode { get; set; }
+ ///
+ ///
+ ///
+ public string isService { get; set; }
+ }
+}
diff --git a/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/HtyHttpPostHelper.cs b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/HtyHttpPostHelper.cs
new file mode 100644
index 00000000..ddab7b39
--- /dev/null
+++ b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/HtyHttpPostHelper.cs
@@ -0,0 +1,99 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Shentun.Peis.PlugIns.ThirdPushs.Hty
+{
+ public class HtyHttpPostHelper
+ {
+ private static readonly HttpClient _httpClient = new HttpClient();
+
+ ///
+ /// 发送普通表单POST请求
+ ///
+ public static async Task PostFormDataAsync(string url,
+ Dictionary formData,
+ Dictionary headers = null)
+ {
+ var content = new FormUrlEncodedContent(formData ?? new Dictionary());
+
+ return await SendRequestAsync(url, content, headers);
+ }
+
+ ///
+ /// 发送JSON格式POST请求
+ ///
+ public static async Task PostJsonAsync(string url,
+ object jsonData,
+ Dictionary headers = null)
+ {
+ var json = JsonConvert.SerializeObject(jsonData);
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ return await SendRequestAsync(url, content, headers);
+ }
+
+ ///
+ /// 发送原始字符串POST请求
+ ///
+ public static async Task PostRawStringAsync(string url,
+ string rawData,
+ string contentType,
+ Dictionary headers = null)
+ {
+ var content = new StringContent(rawData, Encoding.UTF8, contentType);
+ return await SendRequestAsync(url, content, headers);
+ }
+
+ private static async Task SendRequestAsync(string url,
+ HttpContent content,
+ Dictionary headers)
+ {
+ try
+ {
+
+ var request = new HttpRequestMessage(HttpMethod.Post, url);
+ request.Content = content;
+
+ if (headers != null)
+ {
+ foreach (var header in headers)
+ {
+ request.Headers.Add(header.Key, header.Value);
+ }
+ }
+
+ var response = await _httpClient.SendAsync(request);
+ response.EnsureSuccessStatusCode();
+ return await response.Content.ReadAsStringAsync();
+ }
+ catch (HttpRequestException ex)
+ {
+ throw new Exception($"HTTP请求失败: {ex.Message}");
+ }
+ }
+
+ ///
+ /// formdata提交post
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task PostFormDataAsync(string url, MultipartFormDataContent formContent, string userAgentName)
+ {
+ using (HttpClient client = new HttpClient())
+ {
+ if (!string.IsNullOrWhiteSpace(userAgentName))
+ client.DefaultRequestHeaders.UserAgent.ParseAdd(userAgentName);
+
+ var response = await client.PostAsync(url, formContent);
+ response.EnsureSuccessStatusCode();
+ var resStr = await response.Content.ReadAsStringAsync();
+ return resStr;
+ }
+ }
+ }
+}
diff --git a/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/PushPeisResultPlugInsBase.cs b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/PushPeisResultPlugInsBase.cs
new file mode 100644
index 00000000..a7330e0e
--- /dev/null
+++ b/src/Shentun.ColumnReferencePlugIns/ThirdPushs/Hty/PushPeisResultPlugInsBase.cs
@@ -0,0 +1,91 @@
+using Dapper;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Identity.Client;
+using Newtonsoft.Json;
+using Npgsql;
+using Shentun.Peis.ThirdInterfaces;
+using Shentun.Utilities;
+using System;
+using System.Collections.Generic;
+using System.Data.Common;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+
+namespace Shentun.Peis.PlugIns.ThirdPushs.Hty
+{
+ public class PushPeisResultPlugInsBase
+ {
+
+ protected IConfiguration? InterfaceConfig;
+ protected IConfiguration? AppConfig;
+ //当前系统数据库地址
+ protected string? AppConnctionStr;
+ protected ThirdInterfaceDto? _thirdInterfaceDto;
+ protected string? _thirdToken;
+
+ static PushPeisResultPlugInsBase()
+ {
+ Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true;
+ }
+
+ public PushPeisResultPlugInsBase(Guid thirdInterfaceId)
+ {
+
+ AppConfig = new ConfigurationBuilder()
+ .SetBasePath(DirectoryHelper.GetAppDirectory()) // 设置基础路径为当前目录
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .Build();
+ AppConnctionStr = AppConfig.GetSection("ConnectionStrings")
+ .GetSection("Default").Value;
+
+ using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
+ {
+ string sql;
+ sql = @"
+ SELECT *
+ from third_interface
+ where id =@ThirdInterfaceId
+ ";
+
+ _thirdInterfaceDto = (conn.Query(sql,
+ new { ThirdInterfaceId = thirdInterfaceId })).Single();
+
+
+ var configurationBuilder = new ConfigurationBuilder()
+ .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(_thirdInterfaceDto.ParmValue)));
+ InterfaceConfig = configurationBuilder.Build();
+ }
+
+ GetThirdToken();
+ }
+
+
+ private void GetThirdToken()
+ {
+ var pushBaseApi = InterfaceConfig.GetValue("Interface:PushBaseApi", "");
+ var thirdLoginUser = InterfaceConfig.GetValue("Interface:ThirdLoginUser", "");
+ var thirdLoginPassWord = InterfaceConfig.GetValue("Interface:ThirdLoginPassWord", "");
+
+ var formContent = new MultipartFormDataContent();
+ formContent.Add(new StringContent(thirdLoginUser), "username");
+ formContent.Add(new StringContent(thirdLoginPassWord), "password");
+ formContent.Add(new StringContent("Ea"), "type");
+
+ var result = (HtyHttpPostHelper.PostFormDataAsync($"{pushBaseApi}/api/loginEaV.action", formContent, "PostmanRuntime-ApipostRuntime/1.1.0")).GetAwaiter().GetResult();
+
+ var resModel = JsonConvert.DeserializeObject(result);
+ if (resModel != null && resModel.state == "suc")
+ {
+ _thirdToken = resModel.token2;
+ }
+ else
+ {
+ throw new UserFriendlyException("获取token失败,检查配置的账户");
+ }
+ }
+
+
+ }
+}
diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs
index e7d98629..a81b582d 100644
--- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs
@@ -204,5 +204,11 @@ namespace Shentun.Peis.PeisReports
///
public string ReportFormatTemplateId { get; set; }
+
+ ///
+ /// 是否推送第三方结果
+ ///
+ public char IsPushThirdResult { get; set; }
+
}
}
diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
index a6b0da5d..5d57f847 100644
--- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
@@ -73,6 +73,11 @@ namespace Shentun.Peis.PeisReports
///
public char? IsUpload { get; set; }
+ ///
+ /// 是否推送第三方结果
+ ///
+ public char? IsPushThirdResult { get; set; }
+
///
/// 身份证号
///
diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
index 2455f830..be2f3ca3 100644
--- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
+++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
@@ -152,7 +152,8 @@ namespace Shentun.Peis.PeisReports
a.IsReceiveReport,
a.ReportReceiveDate,
a.ReportReceiveName,
- a.Remark
+ a.Remark,
+ a.IsPushThirdResult
},
//RegisterCheckCompleteFlag = registerCheck.CompleteFlag,
//IsCheck = asbitem.IsCheck,
@@ -340,6 +341,11 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.a.IsUpload == input.IsUpload);
}
+ if (input.IsPushThirdResult != null)
+ {
+ sumquery = sumquery.Where(m => m.a.IsPushThirdResult == input.IsPushThirdResult);
+ }
+
if (!string.IsNullOrEmpty(input.IdNo))
{
sumquery = sumquery.Where(m => m.ab.IdNo == input.IdNo);
@@ -439,7 +445,8 @@ namespace Shentun.Peis.PeisReports
ReportReceiveDate = DataHelper.ConversionDateShortToString(s.a.ReportReceiveDate),
ReportReceiveName = s.a.ReportReceiveName,
Remark = s.a.Remark,
- ReportFormatTemplateId = reportFormatTemplateId
+ ReportFormatTemplateId = reportFormatTemplateId,
+ IsPushThirdResult = s.a.IsPushThirdResult
});
}
@@ -496,7 +503,8 @@ namespace Shentun.Peis.PeisReports
patientRegister.ReportReceiveDate,
patientRegister.ReportReceiveName,
patientRegister.Remark,
- patientRegister.MedicalPackageId
+ patientRegister.MedicalPackageId,
+ patientRegister.IsPushThirdResult
},
patient = new { patient.IdNo, patient.Address, patient.PatientNo, patient.MobileTelephone, patient.Telephone, patient.Email, patient.DisplayName }
};
@@ -623,7 +631,7 @@ namespace Shentun.Peis.PeisReports
{
sumquery = sumquery.Where(m => !string.IsNullOrWhiteSpace(input.PatientName) && m.patientRegister.PatientName.Contains(input.PatientName));
}
-
+
}
if (!string.IsNullOrEmpty(input.phone))
@@ -675,6 +683,11 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.patientRegister.IsUpload == input.IsUpload);
}
+ if (input.IsPushThirdResult != null)
+ {
+ sumquery = sumquery.Where(m => m.patientRegister.IsPushThirdResult == input.IsPushThirdResult);
+ }
+
if (!string.IsNullOrEmpty(input.IdNo))
{
sumquery = sumquery.Where(m => m.patient.IdNo == input.IdNo);
@@ -746,7 +759,8 @@ namespace Shentun.Peis.PeisReports
patientRegister.ReportReceiveDate,
patientRegister.ReportReceiveName,
patientRegister.Remark,
- patientRegister.MedicalPackageId
+ patientRegister.MedicalPackageId,
+ patientRegister.IsPushThirdResult
},
patient = new { patient.IdNo, patient.Address, patient.PatientNo, patient.MobileTelephone, patient.Telephone, patient.Email, patient.DisplayName },
registerCheckAsbitemHaveEmpty = registerCheckAsbitemHaveEmpty != null ? new
@@ -820,7 +834,8 @@ namespace Shentun.Peis.PeisReports
IsReceiveReport = group.Key.IsReceiveReport,
ReportReceiveDate = DataHelper.ConversionDateShortToString(group.Key.ReportReceiveDate),
ReportReceiveName = group.Key.ReportReceiveName,
- Remark = group.Key.Remark
+ Remark = group.Key.Remark,
+ IsPushThirdResult = group.Key.IsPushThirdResult
};
entDto.StandardAmount = 0;
diff --git a/src/Shentun.Peis.Application/ThirdResultPushs/ThirdResultPushAppService.cs b/src/Shentun.Peis.Application/ThirdResultPushs/ThirdResultPushAppService.cs
new file mode 100644
index 00000000..fa3fcc36
--- /dev/null
+++ b/src/Shentun.Peis.Application/ThirdResultPushs/ThirdResultPushAppService.cs
@@ -0,0 +1,154 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using Shentun.Peis.Enums;
+using Shentun.Peis.Models;
+using Shentun.Peis.PatientRegisters;
+using Shentun.Peis.PlugIns.ImportLisResults;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Repositories;
+
+namespace Shentun.Peis.ThirdResultPushs
+{
+ ///
+ /// 第三方结果推送
+ ///
+ [ApiExplorerSettings(GroupName = "Work")]
+ [Authorize]
+ public class ThirdResultPushAppService : ApplicationService
+ {
+ private readonly IRepository _patientRegisterRepository;
+ private readonly IRepository _thirdInterfaceRepository;
+ private readonly IRepository- _itemRepository;
+ private readonly IConfiguration _configuration;
+ private readonly IRepository _columnReferenceCodeRepository;
+ private readonly IRepository _columnReferenceInterfaceRepository;
+
+
+
+ public ThirdResultPushAppService(
+ IRepository patientRegisterRepository,
+ IRepository thirdInterfaceRepository,
+ IConfiguration configuration,
+ IRepository
- itemRepository,
+ IRepository columnReferenceCodeRepository,
+ IRepository columnReferenceInterfaceRepository)
+ {
+ _patientRegisterRepository = patientRegisterRepository;
+ _thirdInterfaceRepository = thirdInterfaceRepository;
+ _configuration = configuration;
+ _itemRepository = itemRepository;
+ _columnReferenceCodeRepository = columnReferenceCodeRepository;
+ _columnReferenceInterfaceRepository = columnReferenceInterfaceRepository;
+ }
+
+ ///
+ /// 推送体检信息到海豚云
+ ///
+ ///
+ ///
+ [HttpPost("api/app/ThirdResultPush/PushHtyResultByPatientRegisterId")]
+ public async Task PushHtyResultByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
+ {
+ var patientRegister = await _patientRegisterRepository.GetAsync(input.PatientRegisterId);
+ var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o =>
+ o.ThirdInterfaceType == ThirdInterfaceTypeFlag.CheckResultPush
+ && o.IsActive == 'Y');
+ foreach (var thirdInterface in thirdInterfaces)
+ {
+ var parmValue = thirdInterface.ParmValue;
+ var configurationBuilder = new ConfigurationBuilder()
+ .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
+ var config = configurationBuilder.Build();
+ var assemblyName = config.GetSection("Interface").GetSection("AssemblyName").Value;
+ var className = config.GetSection("Interface").GetSection("ClassName").Value;
+ object[] objects = new object[] { input.PatientRegisterId };
+
+ var pluginsOut = await Utilities.ReflectionHelper.InvokeAsync(assemblyName,
+ className, [thirdInterface.Id], "PushHtyPeisResultByPatientRegisterIdAsync", objects);
+
+
+ Logger.LogInformation(pluginsOut);
+ }
+ }
+
+
+
+ ///
+ /// 自动对照海豚云
+ ///
+ ///
+ ///
+ [HttpPost("api/app/ThirdResultPush/AutoColumnReferenceHtyAsync")]
+ public async Task AutoColumnReferenceHtyAsync(Guid columnReferenceId)
+ {
+ var itemList = await _itemRepository.GetListAsync();
+
+ SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = _configuration.GetValue("ConnectionStrings:Default", ""),
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
+ var dzList = await Db.Ado.SqlQueryAsync(" select * from third_dz_data ");
+
+ var columnReferenceCodeList = await _columnReferenceCodeRepository.GetListAsync(m => m.ColumnReferenceId == columnReferenceId);
+
+ foreach (var item in itemList)
+ {
+ var iCount = itemList.Count(c => c.DisplayName == item.DisplayName);
+ if (iCount == 1)
+ {
+ //体检系统不重名
+ var dqList = dzList.Where(m => m.third_name == item.DisplayName).ToList();
+ if (dqList.Count == 1)
+ {
+ var isColumnReferenceCode = columnReferenceCodeList.FirstOrDefault(f => f.CodeValue == item.Id.ToString());
+ if (isColumnReferenceCode == null)
+ {
+ Guid columnReferenceCodeId = GuidGenerator.Create();
+ //未对照
+ var columnReferenceCodeEntity = new ColumnReferenceCode(columnReferenceCodeId)
+ {
+ CodeValue = item.Id.ToString(),
+ ColumnReferenceId = columnReferenceId,
+ FilterCodeValue = ""
+ };
+
+ await _columnReferenceCodeRepository.InsertAsync(columnReferenceCodeEntity);
+
+
+ var columnReferenceInterfaceEntity = new ColumnReferenceInterface()
+ {
+ ColumnReferenceCodeId = columnReferenceCodeId,
+ InterfaceCodeValue = dqList.FirstOrDefault().third_code
+ };
+
+ await _columnReferenceInterfaceRepository.InsertAsync(columnReferenceInterfaceEntity);
+ }
+ }
+ }
+ }
+
+ }
+
+
+ }
+
+ public class TempThirdDzData
+ {
+ public string third_name { get; set; }
+ public string third_code { get; set; }
+ public string third_ks { get; set; }
+ public string third_asbitem_name { get; set; }
+ }
+}
diff --git a/src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs b/src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs
index b06f58f9..311e6918 100644
--- a/src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs
+++ b/src/Shentun.Peis.Domain.Shared/Enums/ThirdInterfaceTypeFlag.cs
@@ -53,5 +53,9 @@ namespace Shentun.Peis.Enums
[Description("自动签到")]
public const string AutoSign = "15";
+
+
+ [Description("检后结果推送")]
+ public const string CheckResultPush = "16";
}
}
diff --git a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
index 72e66a3b..d3925fae 100644
--- a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
+++ b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
@@ -366,6 +366,13 @@ namespace Shentun.Peis.Models
[Column("report_receive_date")]
public DateTime? ReportReceiveDate { get; set; }
+
+ ///
+ /// 是否推送第三方结果
+ ///
+ [Column("is_push_third_result")]
+ public char IsPushThirdResult { get; set; }
+
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }
diff --git a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs
index 50466096..97257668 100644
--- a/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs
+++ b/src/Shentun.Peis.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs
@@ -106,6 +106,8 @@ namespace Shentun.Peis.DbMapping
entity.Property(t => t.IsReceiveReport).HasComment("报告是否领取").HasDefaultValueSql("'N'");
entity.Property(t => t.ReportReceiveName).HasComment("报告领取人");
entity.Property(t => t.ReportReceiveDate).HasComment("报告领取时间");
+ entity.Property(t => t.IsPushThirdResult).HasComment("是否推送第三方结果").HasDefaultValueSql("'N'");
+
//entity.HasOne(d => d.CustomerOrgRegister)
// .WithMany(p => p.PatientRegisters)
diff --git a/src/Shentun.Peis.EntityFrameworkCore/Migrations/20260304082752_update_patient_register_add_is_push_third_result.Designer.cs b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20260304082752_update_patient_register_add_is_push_third_result.Designer.cs
new file mode 100644
index 00000000..424fe78d
--- /dev/null
+++ b/src/Shentun.Peis.EntityFrameworkCore/Migrations/20260304082752_update_patient_register_add_is_push_third_result.Designer.cs
@@ -0,0 +1,16623 @@
+//
+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.Peis.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace Shentun.Peis.Migrations
+{
+ [DbContext(typeof(PeisDbContext))]
+ [Migration("20260304082752_update_patient_register_add_is_push_third_result")]
+ partial class update_patient_register_add_is_push_third_result
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
+ .HasAnnotation("ProductVersion", "6.0.5")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Shentun.Peis.Books.HelloA", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("ADesc")
+ .HasColumnType("text")
+ .HasColumnName("a_desc");
+
+ b.Property("AName")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text")
+ .HasDefaultValue("默认值")
+ .HasColumnName("a_name");
+
+ b.Property("AddTime")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("add_time")
+ .HasDefaultValueSql("now()");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("HelloTypeId")
+ .HasColumnType("text")
+ .HasColumnName("hello_type_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("S2")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasDefaultValueSql("'A'::bpchar");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "AName" }, "ix_helloa")
+ .IsUnique();
+
+ b.ToTable("hello_a");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.HelloType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("TypeName")
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)")
+ .HasColumnName("type_name")
+ .HasComment("类型名称");
+
+ b.Property("s1")
+ .HasColumnType("uuid")
+ .HasColumnName("s1");
+
+ b.Property("s2")
+ .HasColumnType("uuid")
+ .HasColumnName("s2");
+
+ b.Property("s3")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("s3");
+
+ b.HasKey("Id");
+
+ b.ToTable("hello_type");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Ma", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.ToTable("ma");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Mb", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MaId")
+ .HasColumnType("text")
+ .HasColumnName("ma_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MaId");
+
+ b.ToTable("mb");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Mc", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text")
+ .HasColumnName("id");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MbId")
+ .HasColumnType("text")
+ .HasColumnName("mb_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MbId");
+
+ b.ToTable("mc");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.Student", b =>
+ {
+ b.Property("Sid")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("sid");
+
+ b.Property("Cid")
+ .HasColumnType("text");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uuid")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uuid")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("DeletionTime");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("boolean")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uuid")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Uid")
+ .HasColumnType("uuid");
+
+ b.HasKey("Sid");
+
+ b.ToTable("student");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestA", b =>
+ {
+ b.Property("AId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("AName")
+ .HasColumnType("text");
+
+ b.HasKey("AId");
+
+ b.ToTable("testa");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestB", b =>
+ {
+ b.Property("BId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AId")
+ .HasColumnType("uuid")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("AName")
+ .HasColumnType("text");
+
+ b.Property("TestAsAId")
+ .HasColumnType("uuid");
+
+ b.HasKey("BId");
+
+ b.HasIndex("TestAsAId");
+
+ b.ToTable("testb");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Books.TestCT", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .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("TName")
+ .HasColumnType("text")
+ .HasColumnName("t_name");
+
+ b.HasKey("Id");
+
+ b.ToTable("test_ct");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AbpUserDepartment", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.Property("OrganizationUnitId")
+ .HasColumnType("uuid")
+ .HasColumnName("organization_unit_id");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("UserId", "OrganizationUnitId")
+ .HasName("pk_user_organizationunitid");
+
+ b.ToTable("abp_user_department");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("BarcodeMode")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("barcode_mode")
+ .HasDefaultValueSql("'0'")
+ .HasComment("条码模式");
+
+ b.Property("ClinicalMeaning")
+ .HasMaxLength(500)
+ .HasColumnType("character varying(500)")
+ .HasColumnName("clinical_meaning")
+ .HasComment("临床意义");
+
+ b.Property("CollectItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("collect_item_type_id")
+ .IsFixedLength()
+ .HasComment("汇总项目类别");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("CriticalValueFunction")
+ .HasColumnType("text")
+ .HasColumnName("critical_value_function")
+ .HasComment("危急值函数");
+
+ 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("DiagnosisFunction")
+ .HasMaxLength(4000)
+ .HasColumnType("character varying(4000)")
+ .HasColumnName("diagnosis_function")
+ .HasComment("诊断函数");
+
+ b.Property("DiseaseScreeningTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("disease_screening_type_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("FollowUpFunction")
+ .HasColumnType("text")
+ .HasColumnName("follow_up_function")
+ .HasComment("随访函数");
+
+ b.Property("ForPregnantFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_pregnant_flag")
+ .HasDefaultValueSql("'A'")
+ .HasComment("备怀孕期间禁止检查");
+
+ b.Property("ForSexId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_sex_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用性别,M-男,F-女,A-全部");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_active")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是启用");
+
+ b.Property("IsBeforeEat")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_before_eat")
+ .HasDefaultValueSql("'N'")
+ .HasComment("餐前项目");
+
+ b.Property("IsCheck")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_check")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是检查项目");
+
+ b.Property("IsContinueProcess")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_continue_process")
+ .HasDefaultValueSql("'N'")
+ .HasComment("诊断函数处理完毕后继续处理");
+
+ b.Property("IsCriticalValueFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_critical_value_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否启用危急值函数");
+
+ b.Property("IsDiagnosisFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_diagnosis_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("启用诊断函数");
+
+ b.Property("IsDiscount")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasColumnName("is_discount")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是否折扣");
+
+ b.Property("IsFollowUpFunction")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_follow_up_function")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否启用随访函数");
+
+ b.Property("IsItemResultMerger")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_item_result_merger")
+ .HasDefaultValueSql("'N'")
+ .HasComment("项目结果合并");
+
+ b.Property("IsOutsend")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasColumnName("is_outsend")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否外检项目");
+
+ b.Property("IsPictureRotate")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_picture_rotate")
+ .HasDefaultValueSql("'N'")
+ .HasComment("体检报告图片旋转90°");
+
+ b.Property("IsPrivacy")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("character(1)")
+ .HasColumnName("is_privacy")
+ .HasDefaultValueSql("'N'")
+ .HasComment("是否隐私项目");
+
+ b.Property("IsWebAppoint")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_web_appoint")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是否支持网上预约");
+
+ b.Property("ItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_type_id")
+ .IsFixedLength()
+ .HasComment("项目类别");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MaritalStatusId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("marital_status_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用婚姻状况,0-未婚,1-已婚,A-全部");
+
+ b.Property("MedicalCenterId")
+ .HasColumnType("uuid")
+ .HasColumnName("medical_center_id")
+ .HasComment("体检中心id");
+
+ b.Property("Price")
+ .ValueGeneratedOnAdd()
+ .HasPrecision(8, 2)
+ .HasColumnType("numeric(8,2)")
+ .HasColumnName("price")
+ .HasDefaultValueSql("0")
+ .HasComment("价格");
+
+ b.Property("QueueTime")
+ .ValueGeneratedOnAdd()
+ .HasPrecision(3, 1)
+ .HasColumnType("numeric(3,1)")
+ .HasColumnName("queue_time")
+ .HasDefaultValueSql("0")
+ .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");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CollectItemTypeId");
+
+ b.HasIndex("ItemTypeId");
+
+ b.HasIndex(new[] { "DisplayName" }, "ix_asbitem")
+ .IsUnique();
+
+ b.ToTable("asbitem");
+
+ b.HasComment("组合项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemDetail", b =>
+ {
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength();
+
+ b.Property("ItemId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_id")
+ .IsFixedLength()
+ .HasComment("项目编码");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.HasKey("AsbitemId", "ItemId")
+ .HasName("pk_department_asbitem_detail");
+
+ b.HasIndex("ItemId");
+
+ b.ToTable("asbitem_detail");
+
+ b.HasComment("组合项目包含项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemGuide", b =>
+ {
+ b.Property("MedicalCenterId")
+ .HasColumnType("uuid")
+ .HasColumnName("medical_center_id")
+ .IsFixedLength()
+ .HasComment("单位科室ID");
+
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength()
+ .HasComment("组合项目ID");
+
+ b.Property("ForSexId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("for_sex_id")
+ .HasDefaultValueSql("'A'")
+ .HasComment("适用性别ID");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Guide")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("guide")
+ .HasComment("指引单内容");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("MedicalCenterId", "AsbitemId", "ForSexId")
+ .HasName("pk_department_asbitem_guide");
+
+ b.ToTable("asbitem_guide");
+
+ b.HasComment("体检中心组和项目指引内容");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemMutualExclusion", b =>
+ {
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength()
+ .HasComment("组合项目id");
+
+ b.Property("MutualExclusionAsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("mutual_exclusion_asbitem_id")
+ .IsFixedLength()
+ .HasComment("互斥的组合项目id");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.HasKey("AsbitemId", "MutualExclusionAsbitemId")
+ .HasName("pk_asbitem_mutual_exclusion_asbitem_id_mutual_exclusion_asbitem_id");
+
+ b.ToTable("asbitem_mutual_exclusion");
+
+ b.HasComment("组合项目对应的互斥项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.AsbitemPriceItem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("Amount")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasColumnType("smallint")
+ .HasColumnName("amount")
+ .HasDefaultValueSql("0")
+ .HasComment("数量");
+
+ b.Property("AsbitemId")
+ .HasColumnType("uuid")
+ .HasColumnName("asbitem_id")
+ .IsFixedLength()
+ .HasComment("组合项目编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("PriceItemId")
+ .HasColumnType("uuid")
+ .HasColumnName("price_item_id")
+ .IsFixedLength()
+ .HasComment("价表项目编码");
+
+ b.HasKey("Id");
+
+ b.ToTable("asbitem_price_item");
+
+ b.HasComment("组和项目包含价表项目");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultConclusion", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTemplateId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_template_id")
+ .IsFixedLength();
+
+ b.Property("Conclusion")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)")
+ .HasColumnName("conclusion")
+ .HasComment("结论");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("IsAbnormal")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_abnormal")
+ .HasDefaultValueSql("'Y'")
+ .HasComment("是否为异常结论");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTemplateId");
+
+ b.ToTable("bigtext_result_conclusion");
+
+ b.HasComment("大文本结果结论");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultDescription", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTemplateId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_template_id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Description")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)")
+ .HasColumnName("description")
+ .HasComment("描述");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTemplateId");
+
+ b.ToTable("bigtext_result_description");
+
+ b.HasComment("大文本结果描述");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultTemplate", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("BigtextResultTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("bigtext_result_type_id")
+ .IsFixedLength()
+ .HasComment("结果类别编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BigtextResultTypeId");
+
+ b.ToTable("bigtext_result_template");
+
+ b.HasComment("大文本结果模板");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BigtextResultType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer")
+ .HasColumnName("display_order");
+
+ b.Property("ItemTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("item_type_id")
+ .IsFixedLength()
+ .HasComment("项目类别");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("ParentId")
+ .HasColumnType("uuid")
+ .HasColumnName("parent_id")
+ .IsFixedLength()
+ .HasComment("父编号");
+
+ b.Property("PathCode")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("path_code")
+ .HasComment("路径编码");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ItemTypeId");
+
+ b.ToTable("bigtext_result_type");
+
+ b.HasComment("大文本结果类别");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.BirthPlace", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength();
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CountryCode")
+ .IsRequired()
+ .HasMaxLength(6)
+ .HasColumnType("character varying(6)")
+ .HasColumnName("country_code")
+ .HasComment("国家标准码");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("DisplayName")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("display_name");
+
+ b.Property("DisplayOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("display_order")
+ .HasDefaultValueSql("999999");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("SimpleCode")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)")
+ .HasColumnName("simple_code");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "DisplayName" }, "ix_birth_place")
+ .IsUnique();
+
+ b.ToTable("birth_place");
+
+ b.HasComment("出生地");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardBill", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("编号");
+
+ b.Property("BillFlag")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("bill_flag")
+ .HasDefaultValueSql("'0'::bpchar")
+ .HasComment("记账标志");
+
+ b.Property("BillMoney")
+ .HasPrecision(10, 2)
+ .HasColumnType("numeric(10,2)")
+ .HasColumnName("bill_money")
+ .HasComment("记账金额");
+
+ b.Property("CardRegisterId")
+ .HasColumnType("uuid")
+ .HasColumnName("card_register_id")
+ .HasComment("卡登记编号");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("PayModeId")
+ .IsRequired()
+ .HasMaxLength(4)
+ .HasColumnType("character varying(4)")
+ .HasColumnName("pay_mode_id")
+ .HasComment("支付方式");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CardRegisterId");
+
+ b.HasIndex("PayModeId");
+
+ b.ToTable("card_bill");
+
+ b.HasComment("卡记账记录");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardRegister", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .HasComment("编号");
+
+ b.Property("CardBalance")
+ .HasPrecision(10, 2)
+ .HasColumnType("numeric(10,2)")
+ .HasColumnName("card_balance");
+
+ b.Property("CardNo")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)")
+ .HasColumnName("card_no")
+ .HasComment("卡号");
+
+ b.Property("CardPassword")
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)")
+ .HasColumnName("card_password");
+
+ b.Property("CardTypeId")
+ .HasColumnType("uuid")
+ .HasColumnName("card_type_id")
+ .IsFixedLength()
+ .HasComment("卡类型");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("CustomerName")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("customer_name")
+ .HasComment("领用者");
+
+ b.Property("Discount")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("discount")
+ .HasDefaultValueSql("100")
+ .HasComment("折扣");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("expiry_date")
+ .HasComment("有效期");
+
+ b.Property("IdNo")
+ .HasMaxLength(18)
+ .HasColumnType("character varying(18)")
+ .HasColumnName("id_no");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("is_active")
+ .HasDefaultValueSql("0")
+ .HasComment("使用标志");
+
+ b.Property("LastModificationTime")
+ .IsRequired()
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("last_modification_time");
+
+ b.Property("LastModifierId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("last_modifier_id");
+
+ b.Property("MedicalCenterId")
+ .HasColumnType("uuid")
+ .HasColumnName("medical_center_id");
+
+ b.Property("MobileTelephone")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("mobile_telephone");
+
+ b.Property("Remark")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)")
+ .HasColumnName("remark")
+ .HasComment("备注");
+
+ b.Property("Telephone")
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("telephone")
+ .HasComment("电话");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CardTypeId");
+
+ b.HasIndex(new[] { "CardNo", "IsActive" }, "ix_card_register");
+
+ b.ToTable("card_register");
+
+ b.HasComment("会员卡登记");
+ });
+
+ modelBuilder.Entity("Shentun.Peis.Models.CardType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid")
+ .HasColumnName("id")
+ .IsFixedLength()
+ .HasComment("编号");
+
+ b.Property("CardModeId")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(1)
+ .HasColumnType("character(1)")
+ .HasColumnName("card_mode_id")
+ .HasDefaultValueSql("0")
+ .HasComment("卡模式");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)")
+ .HasColumnName("concurrency_stamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("timestamp without time zone")
+ .HasColumnName("creation_time");
+
+ b.Property("CreatorId")
+ .IsRequired()
+ .HasColumnType("uuid")
+ .HasColumnName("creator_id");
+
+ b.Property("Discount")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("discount")
+ .HasDefaultValueSql("100")
+ .HasComment("折扣");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)")
+ .HasColumnName("display_name")
+ .HasComment("名称");
+
+ b.Property